| Module | Gem::InstallUpdateOptions |
| In: |
lib/rubygems/install_update_options.rb
|
Mixin methods for install and update options for Gem::Commands
Add the install/update options to the option parser.
# File lib/rubygems/install_update_options.rb, line 24
24: def add_install_update_options
25: OptionParser.accept Gem::Security::Policy do |value|
26: require 'rubygems/security'
27:
28: value = Gem::Security::Policies[value]
29: valid = Gem::Security::Policies.keys.sort
30: message = "#{value} (#{valid.join ', '} are valid)"
31: raise OptionParser::InvalidArgument, message if value.nil?
32: value
33: end
34:
35: add_option("Install/Update""Install/Update", '-i', '--install-dir DIR',
36: 'Gem repository directory to get installed',
37: 'gems') do |value, options|
38: options[:install_dir] = File.expand_path(value)
39: end
40:
41: add_option("Install/Update""Install/Update", '-n', '--bindir DIR',
42: 'Directory where binary files are',
43: 'located') do |value, options|
44: options[:bin_dir] = File.expand_path(value)
45: end
46:
47: add_option("Install/Update""Install/Update", '-d', '--[no-]rdoc',
48: 'Generate RDoc documentation for the gem on',
49: 'install') do |value, options|
50: options[:generate_rdoc] = value
51: end
52:
53: add_option("Install/Update""Install/Update", '--[no-]ri',
54: 'Generate RI documentation for the gem on',
55: 'install') do |value, options|
56: options[:generate_ri] = value
57: end
58:
59: add_option("Install/Update""Install/Update", '-E', '--[no-]env-shebang',
60: "Rewrite the shebang line on installed",
61: "scripts to use /usr/bin/env") do |value, options|
62: options[:env_shebang] = value
63: end
64:
65: add_option("Install/Update""Install/Update", '-f', '--[no-]force',
66: 'Force gem to install, bypassing dependency',
67: 'checks') do |value, options|
68: options[:force] = value
69: end
70:
71: add_option("Install/Update""Install/Update", '-w', '--[no-]wrappers',
72: 'Use bin wrappers for executables',
73: 'Not available on dosish platforms') do |value, options|
74: options[:wrappers] = value
75: end
76:
77: add_option("Install/Update""Install/Update", '-P', '--trust-policy POLICY',
78: Gem::Security::Policy,
79: 'Specify gem trust policy') do |value, options|
80: options[:security_policy] = value
81: end
82:
83: add_option("Install/Update""Install/Update", '--ignore-dependencies',
84: 'Do not install any required dependent gems') do |value, options|
85: options[:ignore_dependencies] = value
86: end
87:
88: add_option("Install/Update""Install/Update", '-y', '--include-dependencies',
89: 'Unconditionally install the required',
90: 'dependent gems') do |value, options|
91: options[:include_dependencies] = value
92: end
93:
94: add_option("Install/Update""Install/Update", '--[no-]format-executable',
95: 'Make installed executable names match ruby.',
96: 'If ruby is ruby18, foo_exec will be',
97: 'foo_exec18') do |value, options|
98: options[:format_executable] = value
99: end
100:
101: add_option("Install/Update""Install/Update", '--[no-]user-install',
102: 'Install in user\'s home directory instead',
103: 'of GEM_HOME.') do |value, options|
104: options[:user_install] = value
105: end
106:
107: add_option("Install/Update""Install/Update", "--development",
108: "Install any additional development",
109: "dependencies") do |value, options|
110: options[:development] = true
111: end
112:
113: add_option("Install/Update""Install/Update", "--conservative",
114: "Don't attempt to upgrade gems already",
115: "meeting version requirement") do |value, options|
116: options[:conservative] = true
117: end
118: end