diff options
author | Takuya Noguchi <[email protected]> | 2022-07-17 08:08:51 +0000 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2022-07-22 12:07:23 +0900 |
commit | d7ffd3fea402239b16833cc434404a7af82d44f3 () | |
tree | 9794942135111c36e6b6bce69e070ca556b89028 /lib/rubygems/commands/sources_command.rb | |
parent | 388c4e1076ac5a58d5008abc8e0a8d017698875a (diff) |
RubyGems: Enable Style/StringLiterals cop
Signed-off-by: Takuya Noguchi <[email protected]>
-rw-r--r-- | lib/rubygems/commands/sources_command.rb | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -1,40 +1,40 @@ # frozen_string_literal: true -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' - 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| options[:add] = value end - add_option '-l', '--list', 'List sources' do |value, options| options[:list] = value end - 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| options[:clear_all] = value end - 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| 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' 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' end def description # :nodoc: |