Namespace

Warbler::Trait

Each trait class includes this module to receive shared functionality.

Attributes

config[R]

Public Class Methods

included(base) click to toggle source
# File lib/warbler/traits.rb, line 61
def self.included(base)
  base.extend ClassMethods
end
new(config) click to toggle source
# File lib/warbler/traits.rb, line 66
def initialize(config)
  @config = config
end

Public Instance Methods

add_init_load_path(path) click to toggle source
# File lib/warbler/traits.rb, line 79
def add_init_load_path(path)
  config.init_contents << StringIO.new("$LOAD_PATH.unshift __FILE__.sub(/!.*/, '!/#{path}')\n")
end
add_main_rb(jar, bin_path, params = nil) click to toggle source
# File lib/warbler/traits.rb, line 83
def add_main_rb(jar, bin_path, params = nil)
  binary = ""
  binary << "ARGV.unshift('#{params}')\n" if params
  binary << "load '#{bin_path}'"
  jar.files['META-INF/main.rb'] = StringIO.new(binary)
end
after_configure() click to toggle source
# File lib/warbler/traits.rb, line 73
def after_configure
end
before_configure() click to toggle source
# File lib/warbler/traits.rb, line 70
def before_configure
end
jruby_jars() click to toggle source
# File lib/warbler/traits.rb, line 101
def jruby_jars
  require 'jruby-jars'
  FileList[JRubyJars.core_jar_path, JRubyJars.stdlib_jar_path]
end
update_archive(jar) click to toggle source
# File lib/warbler/traits.rb, line 76
def update_archive(jar)
end
update_gem_path(default_gem_path) click to toggle source
# File lib/warbler/traits.rb, line 90
def update_gem_path(default_gem_path)
  if config.gem_path != default_gem_path
    config.gem_path = "/#{config.gem_path}" unless config.gem_path =~ %{^/}
    sub_gem_path = config.gem_path[1..-1]
    config.pathmaps.marshal_dump.keys.each do |pm|
      config.pathmaps.send(pm).each {|p| p.sub!(default_gem_path[1..-1], sub_gem_path)}
    end
    config.webxml["gem"]["path"] = config.gem_path if config.webxml
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.