class PhusionPassenger::Config::BuildNativeSupportCommand

Private Class Methods

create_option_parser(options) click to toggle source
# File lib/phusion_passenger/config/build_native_support_command.rb, line 38
def self.create_option_parser(options)
        PhusionPassenger.require_passenger_lib 'platform_info/ruby'
        OptionParser.new do |opts|
                nl = "\n" + ' ' * 37
                opts.banner = "Usage: passenger-config build-native-support [OPTIONS]\n"
                opts.separator ""
                opts.separator "  #{PROGRAM_NAME} utilizes a Ruby native extension, called native_support,"
                opts.separator "  for improving Ruby performance. The extension depends on the"
                opts.separator "  #{PROGRAM_NAME} version and the Ruby version. Normally, every time you run"
                opts.separator "  a #{PROGRAM_NAME} version with a Ruby version that it hasn't encountered"
                opts.separator "  before, it will rebuild the native_support library for that Ruby version."
                opts.separator "  By running this command, you can force the native_support to be built for"
                opts.separator "  the current Ruby interpreter."
                opts.separator ""
                opts.separator "  The current Ruby interpreter is:"
                opts.separator "    Path: #{PlatformInfo.ruby_command}"
                opts.separator "    Version: #{RUBY_VERSION}"
                opts.separator ""

                opts.separator "Options:"
                opts.on("-h", "--help", "Show this help") do
                        options[:help] = true
                end
        end
end

Public Instance Methods

run() click to toggle source
# File lib/phusion_passenger/config/build_native_support_command.rb, line 32
def run
        parse_options
        PhusionPassenger.require_passenger_lib 'native_support'
end

Private Instance Methods

help() click to toggle source
# File lib/phusion_passenger/config/build_native_support_command.rb, line 64
def help
        puts @parser
end
parse_options() click to toggle source
Calls superclass method
# File lib/phusion_passenger/config/build_native_support_command.rb, line 68
def parse_options
        super
        if @argv.size > 0
                help
                abort
        end
end