Class: JRuby::Rack::GrizzlyHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/jruby/rack/grizzly_helper.rb

Direct Known Subclasses

RailsGrizzlyHelper

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(glassfish_config = nil) ⇒ GrizzlyHelper

Returns a new instance of GrizzlyHelper.



150
151
152
153
154
155
# File 'lib/jruby/rack/grizzly_helper.rb', line 150

def initialize(glassfish_config = nil)
  @glassfish_config = glassfish_config || $glassfish_config
  @public_root = File.join(@glassfish_config.app_root, "public")
  @gem_path = @glassfish_config.gem_path
  setup_gems
end

Instance Attribute Details

#gem_pathObject (readonly)

Returns the value of attribute gem_path.



148
149
150
# File 'lib/jruby/rack/grizzly_helper.rb', line 148

def gem_path
  @gem_path
end

#public_rootObject (readonly)

Returns the value of attribute public_root.



148
149
150
# File 'lib/jruby/rack/grizzly_helper.rb', line 148

def public_root
  @public_root
end

Class Method Details

.instanceObject



169
170
171
# File 'lib/jruby/rack/grizzly_helper.rb', line 169

def self.instance
  @instance ||= self.new
end

Instance Method Details

#logdevObject



157
158
159
# File 'lib/jruby/rack/grizzly_helper.rb', line 157

def logdev
  @logdev ||= GrizzlyLog.new
end

#loggerObject



161
162
163
# File 'lib/jruby/rack/grizzly_helper.rb', line 161

def logger
  @logger ||= begin; require 'logger'; Logger.new(logdev); end
end

#setup_gemsObject



165
166
167
# File 'lib/jruby/rack/grizzly_helper.rb', line 165

def setup_gems
  ENV['GEM_PATH'] = @gem_path
end