Parent

GemInstaller::GemArgProcessor

Constants

GEM_COMMON_OPTIONS_WITHOUT_ARG

Common Options:

      --source URL                 Use URL as the remote source for gems
  -p, --[no-]http-proxy [URL]      Use HTTP proxy for remote operations
  -h, --help                       Get help on this command
  -v, --verbose                    Set the verbose level of output
      --config-file FILE           Use this config file instead of default
      --backtrace                  Show stack backtrace on errors
      --debug                      Turn on Ruby debugging
GEM_COMMON_OPTIONS_WITH_ARG

Public Instance Methods

strip_non_common_gem_args(args) click to toggle source

take an array of args, and strip all args that are not common gem command args

    # File lib/geminstaller/gem_arg_processor.rb, line 15
15:     def strip_non_common_gem_args(args)
16:       # I can't figure out a way to elegantly do this, so I hardcoded the options.  Here's how you print them
17:       # Gem::Command.common_options.each do |option|
18:       #  p option[0]
19:       # end
20: 
21:       common_args = [] 
22:       i = 0
23:       loop do
24:         break if i == args.size
25:         arg = args[i]
26:         if GEM_COMMON_OPTIONS_WITHOUT_ARG.include?(arg)
27:           common_args << arg
28:         else
29:           GEM_COMMON_OPTIONS_WITH_ARG.each do |option|
30:             if arg.include?(option)
31:               common_args << arg
32:               unless arg.include?('=')
33:                 i += 1
34:                 common_args << args[i]
35:               end
36:             end
37:           end
38:         end
39:         i += 1
40:       end
41:       common_args
42:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.