Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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.


<a name="configuration"></a>

h2. Configuration
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion lib/steam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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__),
Expand Down
27 changes: 27 additions & 0 deletions lib/steam/configuration.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/steam/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down