diff options
Diffstat (limited to 'lib/rubygems/commands/sources_command.rb')
-rw-r--r-- | lib/rubygems/commands/sources_command.rb | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/rubygems/commands/sources_command.rb b/lib/rubygems/commands/sources_command.rb index 884d9445c9..a5f2d022c6 100644 --- a/lib/rubygems/commands/sources_command.rb +++ b/lib/rubygems/commands/sources_command.rb @@ -1,40 +1,40 @@ # frozen_string_literal: true -require_relative '../command' -require_relative '../remote_fetcher' -require_relative '../spec_fetcher' -require_relative '../local_remote_options' +require_relative "../command" +require_relative "../remote_fetcher" +require_relative "../spec_fetcher" +require_relative "../local_remote_options" class Gem::Commands::SourcesCommand < Gem::Command include Gem::LocalRemoteOptions def initialize - require 'fileutils' + require "fileutils" - super 'sources', - 'Manage the sources and cache file RubyGems uses to search for gems' + super "sources", + "Manage the sources and cache file RubyGems uses to search for gems" - add_option '-a', '--add SOURCE_URI', 'Add source' do |value, options| + add_option "-a", "--add SOURCE_URI", "Add source" do |value, options| options[:add] = value end - add_option '-l', '--list', 'List sources' do |value, options| + add_option "-l", "--list", "List sources" do |value, options| options[:list] = value end - add_option '-r', '--remove SOURCE_URI', 'Remove source' do |value, options| + add_option "-r", "--remove SOURCE_URI", "Remove source" do |value, options| options[:remove] = value end - add_option '-c', '--clear-all', - 'Remove all sources (clear the cache)' do |value, options| + add_option "-c", "--clear-all", + "Remove all sources (clear the cache)" do |value, options| options[:clear_all] = value end - add_option '-u', '--update', 'Update source cache' do |value, options| + add_option "-u", "--update", "Update source cache" do |value, options| options[:update] = value end - add_option '-f', '--[no-]force', "Do not show any confirmation prompts and behave as if 'yes' was always answered" do |value, options| + add_option "-f", "--[no-]force", "Do not show any confirmation prompts and behave as if 'yes' was always answered" do |value, options| options[:force] = value end @@ -82,8 +82,8 @@ Do you want to add this source? def check_rubygems_https(source_uri) # :nodoc: uri = URI source_uri - if uri.scheme and uri.scheme.downcase == 'http' and - uri.host.downcase == 'rubygems.org' + if uri.scheme and uri.scheme.downcase == "http" and + uri.host.downcase == "rubygems.org" question = <<-QUESTION.chomp https://rubygems.org is recommended for security over #{uri} @@ -112,7 +112,7 @@ Do you want to add this insecure source? end def defaults_str # :nodoc: - '--list' + "--list" end def description # :nodoc: |