Class: TorqueBox::Server
- Inherits:
-
Object
- Object
- TorqueBox::Server
- Defined in:
- lib/torquebox/server.rb
Class Method Summary collapse
- .gem_version ⇒ Object
- .jboss_home ⇒ Object
- .jruby_home ⇒ Object
- .setup_environment ⇒ Object
- .torquebox_home ⇒ Object
Class Method Details
.gem_version ⇒ Object
43 44 45 |
# File 'lib/torquebox/server.rb', line 43 def self.gem_version Gem::Version.new( Gem::VERSION ) end |
.jboss_home ⇒ Object
35 36 37 |
# File 'lib/torquebox/server.rb', line 35 def self.jboss_home File.join(torquebox_home, 'jboss') if torquebox_home end |
.jruby_home ⇒ Object
39 40 41 |
# File 'lib/torquebox/server.rb', line 39 def self.jruby_home File.(java.lang.System.getProperty('jruby.home')) end |
.setup_environment ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/torquebox/server.rb', line 47 def self.setup_environment ENV['TORQUEBOX_HOME'] ||= torquebox_home ENV['JBOSS_HOME'] ||= "#{ENV['TORQUEBOX_HOME']}/jboss" ENV['JRUBY_HOME'] ||= jruby_home ENV['JBOSS_OPTS'] ||= "-Djruby.home=#{jruby_home}" %w(JBOSS_HOME JRUBY_HOME).each { |key| puts "[ERROR] #{key} is not set. Install torquebox-server gem or manually set #{key}" unless ENV[key] } end |
.torquebox_home ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/torquebox/server.rb', line 24 def self.torquebox_home if ((gem_version <=> Gem::Version.new('1.8.9')) < 0) home = Gem.searcher.find( 'torquebox-server' ) else home = Gem::Specification.find_by_name( 'torquebox-server' ) end home.full_gem_path if home rescue Exception => e nil end |