This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "YaST web service".
The branch, master has been updated
via 59fe8c5ab930c4e9f49890ac8c633342c6528d75 (commit)
from 5fdbe178631e6a32e54f6bb32d14baee8ca1891e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 59fe8c5ab930c4e9f49890ac8c633342c6528d75
Author: Klaus Kämpf
Date: Thu Jun 25 15:01:52 2009 +0200
Move RAILS_PARENT detection to lib and reuse it in Rakefile
-----------------------------------------------------------------------
Summary of changes and diff:
plugins/language/.gitignore | 1 +
plugins/language/Rakefile | 4 ++++
plugins/language/config/rails_parent.rb | 15 +++++++++++++++
plugins/language/test/test_helper.rb | 14 +++-----------
4 files changed, 23 insertions(+), 11 deletions(-)
create mode 100644 plugins/language/config/rails_parent.rb
diff --git a/plugins/language/.gitignore b/plugins/language/.gitignore
index b3a00e1..ef971c1 100644
--- a/plugins/language/.gitignore
+++ b/plugins/language/.gitignore
@@ -1,2 +1,3 @@
package/www/
package/www.tar.bz2
+coverage
\ No newline at end of file
diff --git a/plugins/language/Rakefile b/plugins/language/Rakefile
index c5f022e..fc62167 100644
--- a/plugins/language/Rakefile
+++ b/plugins/language/Rakefile
@@ -2,6 +2,9 @@ require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'rake/packagetask'
+require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
+require File.join(RailsParent.parent, 'config', 'boot')
+require 'tasks/rails'
desc 'Default: run unit tests.'
task :default => :test
@@ -10,6 +13,7 @@ desc 'Test the language plugin.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
+ t.libs << RailsParent.parent
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
diff --git a/plugins/language/config/rails_parent.rb b/plugins/language/config/rails_parent.rb
new file mode 100644
index 0000000..b869908
--- /dev/null
+++ b/plugins/language/config/rails_parent.rb
@@ -0,0 +1,15 @@
+class RailsParent
+
+ def RailsParent.parent
+ parent = ENV["RAILS_PARENT"]
+ unless parent
+ parent = File.expand_path(File.join('..','..','..', 'webservice'), File.dirname(__FILE__))
+ unless File.directory?( parent || "" )
+ $stderr.puts "Nope: #{parent}\nPlease set RAILS_PARENT environment"
+ exit 1
+ end
+ end
+ parent
+ end
+
+end
diff --git a/plugins/language/test/test_helper.rb b/plugins/language/test/test_helper.rb
index e989867..7d67910 100644
--- a/plugins/language/test/test_helper.rb
+++ b/plugins/language/test/test_helper.rb
@@ -1,15 +1,7 @@
-rails_parent = ENV["RAILS_PARENT"]
-unless rails_parent
- if File.directory?("../../webservice/")
- $stderr.puts "Taking ../../webservice/ for RAILS_PARENT"
- rails_parent="../../webservice/"
- else
- $stderr.puts "Please set RAILS_PARENT environment"
- exit
- end
-end
+# find the rails parent
+require File.join(File.dirname(__FILE__), '..', 'config', 'rails_parent')
# first config rails
-require File.expand_path(rails_parent + "/config/environment")
+require File.expand_path( File.join("config","environment"), RailsParent.parent )
# then enable testing, this will get the routing right
ENV["RAILS_ENV"] = "test"
require 'test_help'
hooks/post-receive
--
YaST web service
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org