diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-06 03:56:38 +0000 |
commit | 287a34ae0dfc23e4158f67cb7783d239f202c368 (patch) | |
tree | 5e35d5b41aae961b37cf6632f60c42f51c7aa775 /lib/rubygems | |
parent | 9b52ae2e6491bb5d6c59e1799449f6268baf6f89 (diff) | |
download | ruby-287a34ae0dfc23e4158f67cb7783d239f202c368.tar.gz |
* {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/builder.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/command_manager.rb | 18 | ||||
-rw-r--r-- | lib/rubygems/commands/check_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/commands/rdoc_command.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/commands/search_command.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/config_file.rb | 4 | ||||
-rwxr-xr-x | lib/rubygems/digest/digest_adapter.rb | 8 | ||||
-rw-r--r-- | lib/rubygems/ext/builder.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/format.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/gem_runner.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/old_format.rb | 14 | ||||
-rw-r--r-- | lib/rubygems/package/tar_header.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/package/tar_writer.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/security.rb | 6 | ||||
-rw-r--r-- | lib/rubygems/source_index.rb | 2 | ||||
-rw-r--r-- | lib/rubygems/source_info_cache.rb | 4 | ||||
-rw-r--r-- | lib/rubygems/specification.rb | 34 | ||||
-rw-r--r-- | lib/rubygems/test_utilities.rb | 4 |
18 files changed, 60 insertions, 60 deletions
diff --git a/lib/rubygems/builder.rb b/lib/rubygems/builder.rb index 6fd8528f56..1c18c38d48 100644 --- a/lib/rubygems/builder.rb +++ b/lib/rubygems/builder.rb @@ -11,7 +11,7 @@ module Gem # to produce a .gem file. # class Builder - + include UserInteraction ## # Constructs a builder instance for the provided specification @@ -38,7 +38,7 @@ module Gem say success @spec.file_name end - + def success <<-EOM Successfully built RubyGem diff --git a/lib/rubygems/command_manager.rb b/lib/rubygems/command_manager.rb index dd9a1aee15..5a8dec451e 100644 --- a/lib/rubygems/command_manager.rb +++ b/lib/rubygems/command_manager.rb @@ -15,12 +15,12 @@ module Gem # sub-commands supported by the gem command. class CommandManager include UserInteraction - + # Return the authoritative instance of the command manager. def self.instance @command_manager ||= CommandManager.new end - + # Register all the subcommands supported by the gem command. def initialize @commands = {} @@ -52,24 +52,24 @@ module Gem register_command :update register_command :which end - + # Register the command object. def register_command(command_obj) @commands[command_obj] = false end - + # Return the registered command from the command name. def [](command_name) command_name = command_name.intern return nil if @commands[command_name].nil? @commands[command_name] ||= load_and_instantiate(command_name) end - + # Return a list of all command names (as strings). def command_names @commands.keys.collect {|key| key.to_s}.sort end - + # Run the config specified by +args+. def run(args) process_args(args) @@ -88,7 +88,7 @@ module Gem if args.size == 0 say Gem::Command::HELP terminate_interaction(1) - end + end case args[0] when '-h', '--help' say Gem::Command::HELP @@ -122,7 +122,7 @@ module Gem len = cmd_name.length self.command_names.select { |n| cmd_name == n[0,len] } end - + private def load_and_instantiate(command_name) @@ -143,4 +143,4 @@ module Gem end end end -end +end diff --git a/lib/rubygems/commands/check_command.rb b/lib/rubygems/commands/check_command.rb index 17c2c8f9c7..4eefca4232 100644 --- a/lib/rubygems/commands/check_command.rb +++ b/lib/rubygems/commands/check_command.rb @@ -46,7 +46,7 @@ class Gem::Commands::CheckCommand < Gem::Command say "\t#{error_entry.problem}" say end - else + else say "#{key} is error-free" end say diff --git a/lib/rubygems/commands/rdoc_command.rb b/lib/rubygems/commands/rdoc_command.rb index 82180d485c..2790ae7e3e 100644 --- a/lib/rubygems/commands/rdoc_command.rb +++ b/lib/rubygems/commands/rdoc_command.rb @@ -20,12 +20,12 @@ module Gem 'installed gems') do |value, options| options[:all] = value end - add_option('--[no-]rdoc', + add_option('--[no-]rdoc', 'Include RDoc generated documents') do |value, options| options[:include_rdoc] = value end - add_option('--[no-]ri', + add_option('--[no-]ri', 'Include RI generated documents' ) do |value, options| options[:include_ri] = value diff --git a/lib/rubygems/commands/search_command.rb b/lib/rubygems/commands/search_command.rb index 96da19c0f7..96f2e2c94d 100644 --- a/lib/rubygems/commands/search_command.rb +++ b/lib/rubygems/commands/search_command.rb @@ -32,6 +32,6 @@ module Gem super end end - + end end diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 934516ed91..545ef1a55a 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -30,7 +30,7 @@ class Gem::ConfigFile PLATFORM_DEFAULTS = {} - system_config_path = + system_config_path = begin require 'Win32API' @@ -45,7 +45,7 @@ class Gem::ConfigFile end SYSTEM_WIDE_CONFIG_FILE = File.join system_config_path, 'gemrc' - + # List of arguments supplied to the config file object. attr_reader :args diff --git a/lib/rubygems/digest/digest_adapter.rb b/lib/rubygems/digest/digest_adapter.rb index d5a00b059d..370446b205 100755 --- a/lib/rubygems/digest/digest_adapter.rb +++ b/lib/rubygems/digest/digest_adapter.rb @@ -6,12 +6,12 @@ #++ module Gem - - # There is an incompatibility between the way Ruby 1.8.5 and 1.8.6 - # handles digests. This DigestAdapter will take a pre-1.8.6 digest + + # There is an incompatibility between the way Ruby 1.8.5 and 1.8.6 + # handles digests. This DigestAdapter will take a pre-1.8.6 digest # and adapt it to the 1.8.6 API. # - # Note that only the digest and hexdigest methods are adapted, + # Note that only the digest and hexdigest methods are adapted, # since these are the only functions used by Gems. # class DigestAdapter diff --git a/lib/rubygems/ext/builder.rb b/lib/rubygems/ext/builder.rb index 36e9ec18f6..a521c7b572 100644 --- a/lib/rubygems/ext/builder.rb +++ b/lib/rubygems/ext/builder.rb @@ -15,7 +15,7 @@ class Gem::Ext::Builder def self.make(dest_path, results) unless File.exist? 'Makefile' then - raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" + raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}" end mf = File.read('Makefile') diff --git a/lib/rubygems/format.rb b/lib/rubygems/format.rb index 7dc127d5f4..49a3951e26 100644 --- a/lib/rubygems/format.rb +++ b/lib/rubygems/format.rb @@ -17,7 +17,7 @@ module Gem class Format attr_accessor :spec, :file_entries, :gem_path extend Gem::UserInteraction - + ## # Constructs an instance of a Format object, representing the gem's # data structure. @@ -27,9 +27,9 @@ module Gem def initialize(gem_path) @gem_path = gem_path end - + ## - # Reads the named gem file and returns a Format object, representing + # Reads the named gem file and returns a Format object, representing # the data from the gem file # # file_path:: [String] Path to the gem file diff --git a/lib/rubygems/gem_runner.rb b/lib/rubygems/gem_runner.rb index 5f91398b5b..7edc93d68f 100644 --- a/lib/rubygems/gem_runner.rb +++ b/lib/rubygems/gem_runner.rb @@ -38,7 +38,7 @@ module Gem end cmd.run(Gem.configuration.args) end_time = Time.now - if Gem.configuration.benchmark + if Gem.configuration.benchmark printf "\nExecution time: %0.2f seconds.\n", end_time-start_time puts "Press Enter to finish" STDIN.gets diff --git a/lib/rubygems/old_format.rb b/lib/rubygems/old_format.rb index ef5d621f52..4b8db70bc6 100644 --- a/lib/rubygems/old_format.rb +++ b/lib/rubygems/old_format.rb @@ -16,7 +16,7 @@ module Gem # class OldFormat attr_accessor :spec, :file_entries, :gem_path - + ## # Constructs an instance of a Format object, representing the gem's # data structure. @@ -26,9 +26,9 @@ module Gem def initialize(gem_path) @gem_path = gem_path end - + ## - # Reads the named gem file and returns a Format object, representing + # Reads the named gem file and returns a Format object, representing # the data from the gem file # # file_path:: [String] Path to the gem file @@ -58,8 +58,8 @@ module Gem end format end - - private + + private ## # Skips the Ruby self-install header. After calling this method, the # IO index will be set after the Ruby code. @@ -79,7 +79,7 @@ module Gem raise Gem::Exception.new("Failed to find end of ruby script while reading gem") end end - + ## # Reads the specification YAML from the supplied IO and constructs # a Gem::Specification from it. After calling this method, the @@ -100,7 +100,7 @@ module Gem raise Gem::Exception.new("Failed to parse gem specification out of gem file") end end - + ## # Reads lines from the supplied IO until a end-of-yaml (---) is # reached diff --git a/lib/rubygems/package/tar_header.rb b/lib/rubygems/package/tar_header.rb index c194cc0530..fa78126a0d 100644 --- a/lib/rubygems/package/tar_header.rb +++ b/lib/rubygems/package/tar_header.rb @@ -233,7 +233,7 @@ class Gem::Package::TarHeader ] header = header.pack PACK_FORMAT - + header << ("\0" * ((512 - header.size) % 512)) end diff --git a/lib/rubygems/package/tar_writer.rb b/lib/rubygems/package/tar_writer.rb index 6e11440e22..04a15c7779 100644 --- a/lib/rubygems/package/tar_writer.rb +++ b/lib/rubygems/package/tar_writer.rb @@ -169,7 +169,7 @@ class Gem::Package::TarWriter name = newname if name.size > 100 or prefix.size > 155 then - raise Gem::Package::TooLongFileName + raise Gem::Package::TooLongFileName end end diff --git a/lib/rubygems/security.rb b/lib/rubygems/security.rb index abf3cf4a6a..5cd3fb756f 100644 --- a/lib/rubygems/security.rb +++ b/lib/rubygems/security.rb @@ -218,7 +218,7 @@ require 'rubygems/gem_openssl' # # # signing key (still kept in an undisclosed location!) # s.signing_key = '/mnt/floppy/alf-private_key.pem' -# +# # # certificate chain (includes the issuer certificate now too) # s.cert_chain = ['/home/alf/doc/seattlerb-public_cert.pem', # '/home/alf/doc/alf_at_seattle-public_cert.pem'] @@ -274,7 +274,7 @@ require 'rubygems/gem_openssl' # # convert a PEM format X509 certificate into DER format: # # (note: Windows .cer files are X509 certificates in DER format) # $ openssl x509 -in input.pem -outform der -out output.der -# +# # # print out the certificate in a human-readable format: # $ openssl x509 -in input.pem -noout -text # @@ -282,7 +282,7 @@ require 'rubygems/gem_openssl' # # # convert a PEM format RSA key into DER format: # $ openssl rsa -in input_key.pem -outform der -out output_key.der -# +# # # print out the key in a human readable format: # $ openssl rsa -in input_key.pem -noout -text # diff --git a/lib/rubygems/source_index.rb b/lib/rubygems/source_index.rb index 8a8db2ef0d..57f6c30ae6 100644 --- a/lib/rubygems/source_index.rb +++ b/lib/rubygems/source_index.rb @@ -376,7 +376,7 @@ class Gem::SourceIndex end def ==(other) # :nodoc: - self.class === other and @gems == other.gems + self.class === other and @gems == other.gems end def dump diff --git a/lib/rubygems/source_info_cache.rb b/lib/rubygems/source_info_cache.rb index fdb30ad8d3..4289cdb52a 100644 --- a/lib/rubygems/source_info_cache.rb +++ b/lib/rubygems/source_info_cache.rb @@ -286,7 +286,7 @@ class Gem::SourceInfoCache next unless Gem.sources.include? source_uri # TODO - Remove this gunk after 2008/11 unless pattern.kind_of?(Gem::Dependency) - pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) + pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) end sic_entry.source_index.search pattern, platform_only end.flatten.compact @@ -306,7 +306,7 @@ class Gem::SourceInfoCache # TODO - Remove this gunk after 2008/11 unless pattern.kind_of?(Gem::Dependency) - pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) + pattern = Gem::Dependency.new(pattern, Gem::Requirement.default) end sic_entry.source_index.search(pattern, only_platform).each do |spec| diff --git a/lib/rubygems/specification.rb b/lib/rubygems/specification.rb index b3a42cf902..634b88f1f0 100644 --- a/lib/rubygems/specification.rb +++ b/lib/rubygems/specification.rb @@ -256,7 +256,7 @@ module Gem # Defines a _singular_ version of an existing _plural_ attribute (i.e. one # whose value is expected to be an array). This means just creating a # helper method that takes a single value and appends it to the array. - # These are created for convenience, so that in a spec, one can write + # These are created for convenience, so that in a spec, one can write # # s.require_path = 'mylib' # @@ -266,13 +266,13 @@ module Gem # # That above convenience is available courtesy of: # - # attribute_alias_singular :require_path, :require_paths + # attribute_alias_singular :require_path, :require_paths def self.attribute_alias_singular(singular, plural) define_method("#{singular}=") { |val| send("#{plural}=", [val]) } - define_method("#{singular}") { + define_method("#{singular}") { val = send("#{plural}") val.nil? ? nil : val.first } @@ -427,7 +427,7 @@ module Gem end alias has_test_suite? has_unit_tests? # :nodoc: deprecated - + ## # Specification constructor. Assigns the default values to the # attributes, adds this spec to the list of loaded specs (see @@ -476,7 +476,7 @@ module Gem # routine (#initialize). This method makes up for that and deals with # gems of different ages. # - # 'input' can be anything that YAML.load() accepts: String or IO. + # 'input' can be anything that YAML.load() accepts: String or IO. def self.from_yaml(input) input = normalize_yaml_input input @@ -493,12 +493,12 @@ module Gem unless (spec.instance_variables.include? '@specification_version' or spec.instance_variables.include? :@specification_version) and spec.instance_variable_get :@specification_version - spec.instance_variable_set :@specification_version, + spec.instance_variable_set :@specification_version, NONEXISTENT_SPECIFICATION_VERSION end spec - end + end ## # Loads ruby format gemspec from +filename+ @@ -522,7 +522,7 @@ module Gem result = "--- " + result unless result =~ /^--- / result end - + ## # Sets the rubygems_version to the current RubyGems version @@ -624,7 +624,7 @@ module Gem # Checks if this specification meets the requirement of +dependency+. def satisfies_requirement?(dependency) - return @name == dependency.name && + return @name == dependency.name && dependency.version_requirements.satisfied_by?(@version) end @@ -804,7 +804,7 @@ module Gem raise Gem::InvalidSpecificationException, "missing value for attribute #{symbol}" end - end + end if require_paths.empty? then raise Gem::InvalidSpecificationException, @@ -850,9 +850,9 @@ module Gem # Normalize the list of files so that: # * All file lists have redundancies removed. # * Files referenced in the extra_rdoc_files are included in the package - # file list. + # file list. # - # Also, the summary and description are converted to a normal format. + # Also, the summary and description are converted to a normal format. def normalize if defined?(@extra_rdoc_files) and @extra_rdoc_files then @@ -935,11 +935,11 @@ module Gem else raise Exception, "ruby_code case not handled: #{obj.class}" end end - + private :ruby_code # :section: Required gemspec attributes - + ## # The version of RubyGems used to create this gem @@ -979,7 +979,7 @@ module Gem ## # A contact email for this gem - + attribute :email ## @@ -990,7 +990,7 @@ module Gem ## # The rubyforge project this gem lives under. i.e. RubyGems' # rubyforge_project is "rubygems". - + attribute :rubyforge_project ## @@ -1108,7 +1108,7 @@ module Gem ## # Singular accessor for executables - + attribute_alias_singular :executable, :executables ## diff --git a/lib/rubygems/test_utilities.rb b/lib/rubygems/test_utilities.rb index 8b23d3236e..85541c9fc3 100644 --- a/lib/rubygems/test_utilities.rb +++ b/lib/rubygems/test_utilities.rb @@ -11,9 +11,9 @@ require 'rubygems/remote_fetcher' # @fetcher = Gem::FakeFetcher.new # @fetcher.data['http://gems.example.com/yaml'] = source_index.to_yaml # Gem::RemoteFetcher.fetcher = @fetcher -# +# # # invoke RubyGems code -# +# # paths = @fetcher.paths # assert_equal 'http://gems.example.com/yaml', paths.shift # assert paths.empty?, paths.join(', ') |