| 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 18
18: def add_install_update_options
19: OptionParser.accept Gem::Security::Policy do |value|
20: value = Gem::Security::Policies[value]
21: raise OptionParser::InvalidArgument, value if value.nil?
22: value
23: end
24:
25: add_option("Install/Update""Install/Update", '-i', '--install-dir DIR',
26: 'Gem repository directory to get installed',
27: 'gems') do |value, options|
28: options[:install_dir] = File.expand_path(value)
29: end
30:
31: add_option("Install/Update""Install/Update", '-n', '--bindir DIR',
32: 'Directory where binary files are',
33: 'located') do |value, options|
34: options[:bin_dir] = File.expand_path(value)
35: end
36:
37: add_option("Install/Update""Install/Update", '-d', '--[no-]rdoc',
38: 'Generate RDoc documentation for the gem on',
39: 'install') do |value, options|
40: options[:generate_rdoc] = value
41: end
42:
43: add_option("Install/Update""Install/Update", '--[no-]ri',
44: 'Generate RI documentation for the gem on',
45: 'install') do |value, options|
46: options[:generate_ri] = value
47: end
48:
49: add_option("Install/Update""Install/Update", '-E', '--[no-]env-shebang',
50: "Rewrite the shebang line on installed",
51: "scripts to use /usr/bin/env") do |value, options|
52: options[:env_shebang] = value
53: end
54:
55: add_option("Install/Update""Install/Update", '-f', '--[no-]force',
56: 'Force gem to install, bypassing dependency',
57: 'checks') do |value, options|
58: options[:force] = value
59: end
60:
61: add_option("Install/Update""Install/Update", '-t', '--[no-]test',
62: 'Run unit tests prior to installation') do |value, options|
63: options[:test] = value
64: end
65:
66: add_option("Install/Update""Install/Update", '-w', '--[no-]wrappers',
67: 'Use bin wrappers for executables',
68: 'Not available on dosish platforms') do |value, options|
69: options[:wrappers] = value
70: end
71:
72: add_option("Install/Update""Install/Update", '-P', '--trust-policy POLICY',
73: Gem::Security::Policy,
74: 'Specify gem trust policy') do |value, options|
75: options[:security_policy] = value
76: end
77:
78: add_option("Install/Update""Install/Update", '--ignore-dependencies',
79: 'Do not install any required dependent gems') do |value, options|
80: options[:ignore_dependencies] = value
81: end
82:
83: add_option("Install/Update""Install/Update", '-y', '--include-dependencies',
84: 'Unconditionally install the required',
85: 'dependent gems') do |value, options|
86: options[:include_dependencies] = value
87: end
88:
89: add_option("Install/Update""Install/Update", '--[no-]format-executable',
90: 'Make installed executable names match ruby.',
91: 'If ruby is ruby18, foo_exec will be',
92: 'foo_exec18') do |value, options|
93: options[:format_executable] = value
94: end
95:
96: add_option("Install/Update""Install/Update", '--[no-]user-install',
97: 'Install in user\'s home directory instead',
98: 'of GEM_HOME. Defaults to using home',
99: 'only if GEM_HOME is not writable.') do |value, options|
100: options[:user_install] = value
101: end
102:
103: add_option("Install/Update""Install/Update", "--development",
104: "Install any additional development",
105: "dependencies") do |value, options|
106: options[:development] = true
107: end
108:
109: add_option("Install/Update""Install/Update", "--prerelease",
110: "Install prerelease versions of a gem if",
111: "available. Defaults to skipping",
112: "prereleases.") do |value, options|
113: options[:prerelease] = true
114: end
115: end