diff options
Diffstat (limited to 'lib/rubygems/commands/contents_command.rb')
-rw-r--r-- | lib/rubygems/commands/contents_command.rb | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index e0f2eedb5d..6da89a136e 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -73,7 +73,7 @@ prefix or only the files that are requireable. names.each do |name| found = - if options[:show_install_dir] then + if options[:show_install_dir] gem_install_dir name else gem_contents name @@ -83,15 +83,15 @@ prefix or only the files that are requireable. end end - def files_in spec - if spec.default_gem? then + def files_in(spec) + if spec.default_gem? files_in_default_gem spec else files_in_gem spec end end - def files_in_gem spec + def files_in_gem(spec) gem_path = spec.full_gem_path extra = "/{#{spec.require_paths.join ','}}" if options[:lib_only] glob = "#{gem_path}#{extra}/**/*" @@ -102,7 +102,7 @@ prefix or only the files that are requireable. end end - def files_in_default_gem spec + def files_in_default_gem(spec) spec.files.map do |file| case file when /\A#{spec.bindir}\// @@ -115,7 +115,7 @@ prefix or only the files that are requireable. end end - def gem_contents name + def gem_contents(name) spec = spec_for name return false unless spec @@ -127,7 +127,7 @@ prefix or only the files that are requireable. true end - def gem_install_dir name + def gem_install_dir(name) spec = spec_for name return false unless spec @@ -138,27 +138,27 @@ prefix or only the files that are requireable. end def gem_names # :nodoc: - if options[:all] then + if options[:all] Gem::Specification.map(&:name) else get_all_gem_names end end - def path_description spec_dirs # :nodoc: - if spec_dirs.empty? then + def path_description(spec_dirs) # :nodoc: + if spec_dirs.empty? "default gem paths" else "specified path" end end - def show_files files + def show_files(files) files.sort.each do |prefix, basename| absolute_path = File.join(prefix, basename) next if File.directory? absolute_path - if options[:prefix] then + if options[:prefix] say absolute_path else say basename @@ -166,14 +166,14 @@ prefix or only the files that are requireable. end end - def spec_for name + def spec_for(name) spec = Gem::Specification.find_all_by_name(name, @version).last return spec if spec say "Unable to find gem '#{name}' in #{@path_kind}" - if Gem.configuration.verbose then + if Gem.configuration.verbose say "\nDirectories searched:" @spec_dirs.sort.each { |dir| say dir } end @@ -188,4 +188,3 @@ prefix or only the files that are requireable. end end - |