class TorqueBox::Server
Attributes
server[R]
Public Class Methods
new()
click to toggle source
# File lib/torquebox/server.rb, line 23 def initialize @server = server_gem_path end
Public Instance Methods
display()
click to toggle source
# File lib/torquebox/server.rb, line 27 def display print_server_gem print_installed_apps rescue Exception => e puts "Exception caught: #{e}" end
home()
click to toggle source
# File lib/torquebox/server.rb, line 59 def home server || ENV['TORQUEBOX_HOME'] end
print_installed_apps()
click to toggle source
# File lib/torquebox/server.rb, line 43 def print_installed_apps if home puts "TorqueBox applications installed in #{home}:" deploy_dir = File.join( home, "jboss", "standalone", "deployments" ) if File.exists? deploy_dir Dir.glob File.join(deploy_dir, "*.yml") do |f| puts " " + File.basename( f ).gsub( /\.yml/, '' ) end else puts " Cannot find TorqueBox deployment directory #{deploy_dir}" end else puts " Can't find TorqueBox!" end end
print_server_gem()
click to toggle source
# File lib/torquebox/server.rb, line 34 def print_server_gem puts "torquebox-server gem:" if server puts " Installed in #{server}" else puts " Not installed" end end
Private Instance Methods
server_gem_path()
click to toggle source
# File lib/torquebox/server.rb, line 64 def server_gem_path if ((::Gem::Version.new(::Gem::VERSION) <=> ::Gem::Version.new('1.8.9')) < 0) puts "[WARNING] Found rubygems version #{::Gem::VERSION}. This probably means you are on JRuby 1.6.4. While JRuby 1.6.4 should work, TorqueBox is tested on and ships with JRuby 1.6.5." home = ::Gem.searcher.find( 'torquebox-server' ) else begin home = ::Gem::Specification.find_by_name( 'torquebox-server' ) rescue ::Gem::LoadError end end home.full_gem_path if home end