diff --git a/Gemfile b/Gemfile index 1393f1b..b005c64 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,11 @@ source :rubygems gem 'rack' -gem 'rjb' +gem 'rjb', :platforms => :ruby # to prevent some errors with precompiled versions while using ruby 1.9 and rvm gem 'locator', :path => '~/Development/projects/locator' group :test do gem 'mocha' - gem 'ruby-debug' + #gem 'ruby-debug' <-- because of diff versions for ruby 1.8 and 1.9 recommend to take out of repo file gem 'test_declarative' end diff --git a/README.textile b/README.textile index 1d4e979..86c5800 100644 --- a/README.textile +++ b/README.textile @@ -32,7 +32,6 @@ Since some Mac OS X 10.6 update removed the Java header files that are necessary Also, if you are on Mac OS X, use `sudo` and get an error saying that "JAVA_HOME is not set" then you need to export the JAVA_HOME variable for RJB. See here for two solutions: "Installing RJB on Mac OS X":http://www.elctech.com/articles/sudo-java_home-and-mac-os-x. The visudo way worked for us. Don't forget to add yourself to the sudoers file, though. - h2. Configuration @@ -41,7 +40,7 @@ You should not need to configure anything. If you do need though have a look at E.g. in order to tweak the Java load params you can -pre. Steam.config[:java_load_params] = "-Xmx2048M" +pre. Steam.config[:java_load_params] = ["-Xmx2048M"] If you want to test your application through Cucumber features then you need to setup your Cucumber environment and steps accordingly. You can find an example for a Cucumber setup here: "env.rb":http://github.com/svenfuchs/steam/blob/master/example/cucumber/env.rb. diff --git a/lib/steam.rb b/lib/steam.rb index 8f6ef7d..8ec5b18 100644 --- a/lib/steam.rb +++ b/lib/steam.rb @@ -23,7 +23,7 @@ def config :server_port => '3000', :url_scheme => 'http', :charset => 'utf-8', - :java_load_params => '-Xmx1024M', + :java_load_params => ['-Xmx1024M'], :drb_uri => 'druby://127.0.0.1:9000', :html_unit => { :java_path => File.expand_path("../../vendor/htmlunit-2.6/", __FILE__), diff --git a/lib/steam/configuration.rb b/lib/steam/configuration.rb new file mode 100644 index 0000000..d10ed8b --- /dev/null +++ b/lib/steam/configuration.rb @@ -0,0 +1,27 @@ +module Steam + + def self.config + @@config ||= Configuration.new + end + + def self.configure(&block) + raise "#configure must be sent a block" unless block_given? + yield config + end + + class Configuration + + attr_accessor :java_load_params + attr_accessor :server_name + attr_accessor :server_port + attr_accessor :rack_url_scheme + attr_accessor :charset + attr_accessor :drb_uri + attr_accessor :request_env_for + + def initialize + end + + end + +end diff --git a/lib/steam/java.rb b/lib/steam/java.rb index 26c1816..b3a1e36 100644 --- a/lib/steam/java.rb +++ b/lib/steam/java.rb @@ -60,7 +60,7 @@ def load_from(path) end def load(paths) - Rjb::load(paths, Steam.config[:java_load_params].to_a) + Rjb::load(paths, Steam.config[:java_load_params]) end def logger(classifier)