Module: Gem::LocalRemoteOptions
- Included in:
- InstallCommand, QueryCommand, SpecificationCommand
- Defined in:
- lib/rubygems/gem_commands.rb
Overview
Mixin methods for handling the local/remote command line options.
Instance Method Summary collapse
-
#add_local_remote_options ⇒ Object
Add the local/remote options to the command line parser.
-
#local? ⇒ Boolean
Is local fetching enabled?.
-
#remote? ⇒ Boolean
Is remote fetching enabled?.
Instance Method Details
#add_local_remote_options ⇒ Object
Add the local/remote options to the command line parser.
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/rubygems/gem_commands.rb', line 67 def add_option('-l', '--local', 'Restrict operations to the LOCAL domain' ) do |value, | [:domain] = :local end add_option('-r', '--remote', 'Restrict operations to the REMOTE domain') do |value, | [:domain] = :remote end add_option('-b', '--both', 'Allow LOCAL and REMOTE operations') do |value, | [:domain] = :both end end |
#local? ⇒ Boolean
Is local fetching enabled?
88 89 90 |
# File 'lib/rubygems/gem_commands.rb', line 88 def local? [:domain] == :local || [:domain] == :both end |
#remote? ⇒ Boolean
Is remote fetching enabled?
93 94 95 |
# File 'lib/rubygems/gem_commands.rb', line 93 def remote? [:domain] == :remote || [:domain] == :both end |