lib/puck/jar.rb
# Create a new instance with the specified configuration.
#
# Puck tries to use sane defaults like assuming that the application name
# is the same as the name of the directory containing the "lib" directory.
#
# @param [Hash] configuration
# @option configuration [String] :extra_files a list of files to include in
#   the Jar. The paths must be below the `:app_dir`.
# @option configuration [String] :gem_groups ([:default]) a list of gem
#   groups to include in the Jar. Remember to include the default group if
#   you override this option.
# @option configuration [String] :jruby_complete a path to the
#   `jruby-complete.jar` that you want to use. If you don't specify this
#   option you need to have `jruby-jars` in your `Gemfile` (it contains
#   the equivalent of `jruby-complete.jar`. This option is mostly useful
#   when you have a customized JRuby runtime that you want to use.
# @option configuration [String] :app_dir (Dir.pwd)
#   the application's base directory (i.e. the directory that contains the
#   "lib" directory)
# @option configuration [String] :app_name (File.basename(configuration[:app_dir]))
#   the name of the application, primarily used to name the Jar
# @option configuration [String] :build_dir ("build") the directory where
#   the Jar file will be created
#
Create a new instance with the specified configuration.
Puck tries to use sane defaults like assuming that the application name
is the same as the name of the directory containing the "lib" directory.
Create a new instance with the specified configuration . Puck tries to use sane defaults like assuming that the application name is the same as the name of the directory containing the " lib " directory .
def create_jar_bootstrap!(tmp_dir, gem_dependencies)
      File.open(File.join(tmp_dir, 'jar-bootstrap.rb'), 'w') do |io|
        io.puts(%(PUCK_BIN_PATH = ['/#{JAR_APP_HOME}/bin', '/#{JAR_JRUBY_HOME}/bin']))
        gem_dependencies.each do |spec|
          io.puts("PUCK_BIN_PATH << '/#{spec[:bin_path]}'")
        end
        io.puts
        gem_dependencies.each do |spec|
          spec[:load_paths].each do |load_path|
            io.puts(%($LOAD_PATH << 'classpath:#{load_path}'))
          end
        end
        io.puts
        io.puts(File.read(File.expand_path('../bootstrap.rb', __FILE__)))
      end
    end
def create_jar_bootstrap! ( tmp_dir , gem_dependencies ) File . open ( File . join ( tmp_dir , 'jar-bootstrap.rb' ) , 'w' ) do | io | io . puts ( %(PUCK_BIN_PATH = ['/#{JAR_APP_HOME}/bin', '/#{JAR_JRUBY_HOME}/bin']) ) gem_dependencies . each do | spec | io . puts ( "PUCK_BIN_PATH << '/#{spec[:bin_path]}'" ) end io . puts gem_dependencies . each do | spec | spec [ :load_paths ] . each do | load_path | io . puts ( %($LOAD_PATH << 'classpath:#{load_path}') ) end end io . puts io . puts ( File . read ( File . expand_path ( '../bootstrap.rb' , __FILE__ ) ) ) end end
Create a new instance with the specified configuration.
Create a new instance with the specified configuration .
tmp_dir
<not_specific>
gem_dependencies
<not_specific>
<not_specific>
None
configuration
<not_specific>
:build_dir ("build") the directory where the Jar file will be created
: build_dir ( " build " ) the directory where the Jar file will be created