rubygems-update 2.1.0.rc.1 → 2.1.0.rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rubygems-update might be problematic. Click here for more details.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/History.txt +11 -3
- data/Manifest.txt +1 -0
- data/Rakefile +22 -18
- data/lib/rubygems.rb +8 -10
- data/lib/rubygems/basic_specification.rb +112 -108
- data/lib/rubygems/commands/build_command.rb +19 -0
- data/lib/rubygems/commands/check_command.rb +7 -0
- data/lib/rubygems/commands/cleanup_command.rb +5 -5
- data/lib/rubygems/commands/contents_command.rb +8 -0
- data/lib/rubygems/commands/dependency_command.rb +11 -0
- data/lib/rubygems/commands/environment_command.rb +3 -0
- data/lib/rubygems/commands/fetch_command.rb +10 -0
- data/lib/rubygems/commands/list_command.rb +12 -1
- data/lib/rubygems/commands/mirror_command.rb +6 -0
- data/lib/rubygems/commands/outdated_command.rb +9 -0
- data/lib/rubygems/commands/owner_command.rb +9 -2
- data/lib/rubygems/commands/pristine_command.rb +12 -11
- data/lib/rubygems/commands/push_command.rb +8 -2
- data/lib/rubygems/commands/query_command.rb +9 -0
- data/lib/rubygems/commands/rdoc_command.rb +6 -2
- data/lib/rubygems/commands/search_command.rb +14 -1
- data/lib/rubygems/commands/sources_command.rb +47 -0
- data/lib/rubygems/commands/specification_command.rb +16 -0
- data/lib/rubygems/commands/stale_command.rb +10 -0
- data/lib/rubygems/commands/uninstall_command.rb +19 -6
- data/lib/rubygems/commands/unpack_command.rb +18 -0
- data/lib/rubygems/commands/update_command.rb +9 -0
- data/lib/rubygems/commands/which_command.rb +11 -0
- data/lib/rubygems/commands/yank_command.rb +16 -2
- data/lib/rubygems/core_ext/kernel_require.rb +4 -4
- data/lib/rubygems/defaults.rb +7 -0
- data/lib/rubygems/dependency_installer.rb +1 -4
- data/lib/rubygems/ext/builder.rb +118 -0
- data/lib/rubygems/installer.rb +7 -60
- data/lib/rubygems/package_task.rb +5 -2
- data/lib/rubygems/remote_fetcher.rb +1 -1
- data/lib/rubygems/security/policy.rb +5 -0
- data/lib/rubygems/security/signer.rb +19 -1
- data/lib/rubygems/source.rb +7 -3
- data/lib/rubygems/source/local.rb +5 -4
- data/lib/rubygems/source/specific_file.rb +28 -0
- data/lib/rubygems/specification.rb +55 -44
- data/lib/rubygems/stub_specification.rb +93 -92
- data/lib/rubygems/test_case.rb +10 -9
- data/test/rubygems/test_gem.rb +27 -0
- data/test/rubygems/test_gem_commands_install_command.rb +1 -0
- data/test/rubygems/test_gem_commands_uninstall_command.rb +17 -8
- data/test/rubygems/test_gem_ext_builder.rb +97 -2
- data/test/rubygems/test_gem_installer.rb +0 -89
- data/test/rubygems/test_gem_package.rb +6 -8
- data/test/rubygems/test_gem_package_task.rb +23 -2
- data/test/rubygems/test_gem_security_policy.rb +11 -0
- data/test/rubygems/test_gem_security_signer.rb +6 -0
- data/test/rubygems/test_gem_source.rb +23 -0
- data/test/rubygems/test_gem_source_installed.rb +28 -0
- data/test/rubygems/test_gem_source_local.rb +29 -6
- data/test/rubygems/test_gem_source_specific_file.rb +38 -0
- data/test/rubygems/test_gem_specification.rb +10 -2
- metadata +7 -5
- metadata.gz.sig +0 -0
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 7da132d518c17a925f7ab5d00e1017bd8cce49d4
         | 
| 4 | 
            +
              data.tar.gz: ee8eb91dc1ea06f0784dc4924a2563d109ce0138
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 66a6e4769192f4c73ea72e465228dfee2e3145c0bcb836398a093deb621bf7be0650ca6ca9ac4d1146887997b179aac891a007017dea8749276ae8bafc5b19b8
         | 
| 7 | 
            +
              data.tar.gz: ae9cc7d9106c3d141b2ea1100d279f1f94b05cdd4e817dc8e22795415df9b67a8a504b0d410232b9c4ad8bc0928e3cbed8afdc41cbf0e6c76e9479ea27a1ff0c
         | 
    
        checksums.yaml.gz.sig
    CHANGED
    
    | Binary file | 
    
        data.tar.gz.sig
    CHANGED
    
    | Binary file | 
    
        data/History.txt
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # coding: UTF-8
         | 
| 2 2 |  | 
| 3 | 
            -
            === 2.1.0.rc. | 
| 3 | 
            +
            === 2.1.0.rc.2
         | 
| 4 4 |  | 
| 5 5 | 
             
            Major enhancements:
         | 
| 6 6 |  | 
| @@ -83,8 +83,16 @@ Minor enhancements: | |
| 83 83 | 
             
            Bug fixes:
         | 
| 84 84 |  | 
| 85 85 | 
             
            * rubygems_plugin.rb files are now only loaded from the latest installed gem.
         | 
| 86 | 
            -
             | 
| 87 | 
            -
             | 
| 86 | 
            +
             | 
| 87 | 
            +
            === 2.0.7 / 2013-08-15
         | 
| 88 | 
            +
             | 
| 89 | 
            +
            * Extensions may now be built in parallel (therefore gems may be installed in
         | 
| 90 | 
            +
              parallel).  Bug #607 by Hemant Kumar.
         | 
| 91 | 
            +
            * Changed broken link to RubyGems Bookshelf to point to RubyGems guides.  Ruby
         | 
| 92 | 
            +
              pull request #369 by 謝致邦.
         | 
| 93 | 
            +
            * Fixed various test failures due to platform differences or poor tests.
         | 
| 94 | 
            +
              Patches by Yui Naruse and Koichi Sasada.
         | 
| 95 | 
            +
            * Fixed documentation for Kernel#require.
         | 
| 88 96 |  | 
| 89 97 | 
             
            === 2.0.6 / 2013-07-24
         | 
| 90 98 |  | 
    
        data/Manifest.txt
    CHANGED
    
    | @@ -266,6 +266,7 @@ test/rubygems/test_gem_security_trust_dir.rb | |
| 266 266 | 
             
            test/rubygems/test_gem_server.rb
         | 
| 267 267 | 
             
            test/rubygems/test_gem_silent_ui.rb
         | 
| 268 268 | 
             
            test/rubygems/test_gem_source.rb
         | 
| 269 | 
            +
            test/rubygems/test_gem_source_installed.rb
         | 
| 269 270 | 
             
            test/rubygems/test_gem_source_list.rb
         | 
| 270 271 | 
             
            test/rubygems/test_gem_source_local.rb
         | 
| 271 272 | 
             
            test/rubygems/test_gem_source_specific_file.rb
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -25,7 +25,6 @@ Hoe.plugin :git | |
| 25 25 | 
             
            Hoe.plugin :travis
         | 
| 26 26 |  | 
| 27 27 | 
             
            hoe = Hoe.spec 'rubygems-update' do
         | 
| 28 | 
            -
              self.rubyforge_name = 'rubygems'
         | 
| 29 28 | 
             
              self.author         = ['Jim Weirich', 'Chad Fowler', 'Eric Hodel']
         | 
| 30 29 | 
             
              self.email          = %w[rubygems-developers@rubyforge.org]
         | 
| 31 30 | 
             
              self.readme_file    = 'README.rdoc'
         | 
| @@ -60,31 +59,36 @@ hoe = Hoe.spec 'rubygems-update' do | |
| 60 59 | 
             
              self.extra_rdoc_files = Dir["*.rdoc"]
         | 
| 61 60 |  | 
| 62 61 | 
             
              spec_extras['rdoc_options'] = proc do |rdoc_options|
         | 
| 63 | 
            -
                rdoc_options << "--title=RubyGems  | 
| 62 | 
            +
                rdoc_options << "--title=RubyGems Update Documentation"
         | 
| 64 63 | 
             
              end
         | 
| 65 64 |  | 
| 66 65 | 
             
              self.rsync_args += " --no-p -O"
         | 
| 67 66 |  | 
| 68 | 
            -
               | 
| 69 | 
            -
              # doesn't uninstall it. It should uninstall or better, not install
         | 
| 70 | 
            -
              # in the first place.
         | 
| 71 | 
            -
              spec_extras['require_paths'] = %w[hide_lib_for_update] unless
         | 
| 72 | 
            -
                ENV['RAKE_SUCKS']
         | 
| 67 | 
            +
              spec_extras['require_paths'] = %w[hide_lib_for_update]
         | 
| 73 68 | 
             
            end
         | 
| 74 69 |  | 
| 75 70 | 
             
            hoe.test_prelude = 'gem "minitest", "~> 4.0"'
         | 
| 76 71 |  | 
| 77 | 
            -
             | 
| 78 | 
            -
             | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
               | 
| 82 | 
            -
             | 
| 83 | 
            -
               | 
| 84 | 
            -
             | 
| 85 | 
            -
                 | 
| 86 | 
            -
             | 
| 87 | 
            -
                 | 
| 72 | 
            +
            Rake::Task['docs'].clear
         | 
| 73 | 
            +
            Rake::Task['clobber_docs'].clear
         | 
| 74 | 
            +
             | 
| 75 | 
            +
            begin
         | 
| 76 | 
            +
              require 'rdoc/task'
         | 
| 77 | 
            +
             | 
| 78 | 
            +
              RDoc::Task.new :rdoc => 'docs', :clobber_rdoc => 'clobber_docs' do |doc|
         | 
| 79 | 
            +
                doc.main   = hoe.readme_file
         | 
| 80 | 
            +
                doc.title  = "RubyGems #{hoe.version} API Documentation"
         | 
| 81 | 
            +
             | 
| 82 | 
            +
                rdoc_files = Rake::FileList.new %w[lib History.txt LICENSE.txt MIT.txt]
         | 
| 83 | 
            +
                rdoc_files.add hoe.extra_rdoc_files
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                doc.rdoc_files = rdoc_files
         | 
| 86 | 
            +
             | 
| 87 | 
            +
                doc.rdoc_dir = 'doc'
         | 
| 88 | 
            +
              end
         | 
| 89 | 
            +
            rescue LoadError, RuntimeError # rake 10.1 on rdoc from ruby 1.9.2 and earlier
         | 
| 90 | 
            +
              task 'docs' do
         | 
| 91 | 
            +
                abort 'You must install rdoc to build documentation, try `rake newb` again'
         | 
| 88 92 | 
             
              end
         | 
| 89 93 | 
             
            end
         | 
| 90 94 |  | 
    
        data/lib/rubygems.rb
    CHANGED
    
    | @@ -8,7 +8,7 @@ | |
| 8 8 | 
             
            require 'rbconfig'
         | 
| 9 9 |  | 
| 10 10 | 
             
            module Gem
         | 
| 11 | 
            -
              VERSION = '2.1.0.rc. | 
| 11 | 
            +
              VERSION = '2.1.0.rc.2'
         | 
| 12 12 | 
             
            end
         | 
| 13 13 |  | 
| 14 14 | 
             
            # Must be first since it unloads the prelude from 1.9.2
         | 
| @@ -36,9 +36,9 @@ require 'rubygems/errors' | |
| 36 36 | 
             
            #
         | 
| 37 37 | 
             
            # Further RubyGems documentation can be found at:
         | 
| 38 38 | 
             
            #
         | 
| 39 | 
            +
            # * {RubyGems Guides}[http://guides.rubygems.org]
         | 
| 39 40 | 
             
            # * {RubyGems API}[http://rubygems.rubyforge.org/rdoc] (also available from
         | 
| 40 41 | 
             
            #   <tt>gem server</tt>)
         | 
| 41 | 
            -
            # * {RubyGems Bookshelf}[http://rubygem.org]
         | 
| 42 42 | 
             
            #
         | 
| 43 43 | 
             
            # == RubyGems Plugins
         | 
| 44 44 | 
             
            #
         | 
| @@ -1048,16 +1048,14 @@ module Gem | |
| 1048 1048 | 
             
                #
         | 
| 1049 1049 |  | 
| 1050 1050 | 
             
                def register_default_spec(spec)
         | 
| 1051 | 
            -
                  new_format | 
| 1051 | 
            +
                  new_format = Gem.default_gems_use_full_paths? || spec.require_paths.any? {|path| spec.files.any? {|f| f.start_with? path } }
         | 
| 1052 1052 |  | 
| 1053 | 
            -
                   | 
| 1054 | 
            -
                     | 
| 1055 | 
            -
             | 
| 1056 | 
            -
             | 
| 1057 | 
            -
                      prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
         | 
| 1058 | 
            -
                      prefix_pattern = /^(#{prefix_group})/
         | 
| 1059 | 
            -
                    end
         | 
| 1053 | 
            +
                  if new_format
         | 
| 1054 | 
            +
                    prefix_group = spec.require_paths.map {|f| f + "/"}.join("|")
         | 
| 1055 | 
            +
                    prefix_pattern = /^(#{prefix_group})/
         | 
| 1056 | 
            +
                  end
         | 
| 1060 1057 |  | 
| 1058 | 
            +
                  spec.files.each do |file|
         | 
| 1061 1059 | 
             
                    if new_format
         | 
| 1062 1060 | 
             
                      file = file.sub(prefix_pattern, "")
         | 
| 1063 1061 | 
             
                      next unless $~
         | 
| @@ -1,139 +1,143 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
             | 
| 4 | 
            -
              class BasicSpecification
         | 
| 5 | 
            -
                def self.default_specifications_dir
         | 
| 6 | 
            -
                  File.join(Gem.default_dir, "specifications", "default")
         | 
| 7 | 
            -
                end
         | 
| 1 | 
            +
            ##
         | 
| 2 | 
            +
            # BasicSpecification is an abstract class which implements some common code
         | 
| 3 | 
            +
            # used by both Specification and StubSpecification.
         | 
| 8 4 |  | 
| 9 | 
            -
             | 
| 10 | 
            -
                # Name of the gem
         | 
| 5 | 
            +
            class Gem::BasicSpecification
         | 
| 11 6 |  | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
                end
         | 
| 7 | 
            +
              ##
         | 
| 8 | 
            +
              # The path this gemspec was loaded from.  This attribute is not persisted.
         | 
| 15 9 |  | 
| 16 | 
            -
             | 
| 17 | 
            -
                # Version of the gem
         | 
| 10 | 
            +
              attr_reader :loaded_from
         | 
| 18 11 |  | 
| 19 | 
            -
             | 
| 20 | 
            -
             | 
| 21 | 
            -
             | 
| 12 | 
            +
              def self.default_specifications_dir
         | 
| 13 | 
            +
                File.join(Gem.default_dir, "specifications", "default")
         | 
| 14 | 
            +
              end
         | 
| 22 15 |  | 
| 23 | 
            -
             | 
| 24 | 
            -
             | 
| 16 | 
            +
              ##
         | 
| 17 | 
            +
              # True when the gem has been activated
         | 
| 25 18 |  | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 19 | 
            +
              def activated?
         | 
| 20 | 
            +
                raise NotImplementedError
         | 
| 21 | 
            +
              end
         | 
| 29 22 |  | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 23 | 
            +
              ##
         | 
| 24 | 
            +
              # Returns the full path to the base gem directory.
         | 
| 25 | 
            +
              #
         | 
| 26 | 
            +
              # eg: /usr/local/lib/ruby/gems/1.8
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              def base_dir
         | 
| 29 | 
            +
                return Gem.dir unless loaded_from
         | 
| 30 | 
            +
                @base_dir ||= if default_gem? then
         | 
| 31 | 
            +
                                File.dirname File.dirname File.dirname loaded_from
         | 
| 32 | 
            +
                              else
         | 
| 33 | 
            +
                                File.dirname File.dirname loaded_from
         | 
| 34 | 
            +
                              end
         | 
| 35 | 
            +
              end
         | 
| 32 36 |  | 
| 33 | 
            -
             | 
| 34 | 
            -
             | 
| 35 | 
            -
                end
         | 
| 37 | 
            +
              ##
         | 
| 38 | 
            +
              # Return true if this spec can require +file+.
         | 
| 36 39 |  | 
| 37 | 
            -
             | 
| 38 | 
            -
                 | 
| 40 | 
            +
              def contains_requirable_file? file
         | 
| 41 | 
            +
                root     = full_gem_path
         | 
| 42 | 
            +
                suffixes = Gem.suffixes
         | 
| 39 43 |  | 
| 40 | 
            -
                 | 
| 41 | 
            -
                   | 
| 44 | 
            +
                require_paths.any? do |lib|
         | 
| 45 | 
            +
                  base = "#{root}/#{lib}/#{file}"
         | 
| 46 | 
            +
                  suffixes.any? { |suf| File.file? "#{base}#{suf}" }
         | 
| 42 47 | 
             
                end
         | 
| 48 | 
            +
              end
         | 
| 43 49 |  | 
| 44 | 
            -
             | 
| 45 | 
            -
                 | 
| 50 | 
            +
              def default_gem?
         | 
| 51 | 
            +
                loaded_from &&
         | 
| 52 | 
            +
                  File.dirname(loaded_from) == self.class.default_specifications_dir
         | 
| 53 | 
            +
              end
         | 
| 46 54 |  | 
| 47 | 
            -
             | 
| 48 | 
            -
             | 
| 49 | 
            -
                 | 
| 55 | 
            +
              def find_full_gem_path # :nodoc:
         | 
| 56 | 
            +
                # TODO: also, shouldn't it default to full_name if it hasn't been written?
         | 
| 57 | 
            +
                path = File.expand_path File.join(gems_dir, full_name)
         | 
| 58 | 
            +
                path.untaint
         | 
| 59 | 
            +
                path if File.directory? path
         | 
| 60 | 
            +
              end
         | 
| 61 | 
            +
             | 
| 62 | 
            +
              private :find_full_gem_path
         | 
| 50 63 |  | 
| 51 | 
            -
             | 
| 52 | 
            -
             | 
| 53 | 
            -
                attr_reader :filename
         | 
| 64 | 
            +
              ##
         | 
| 65 | 
            +
              # The full path to the gem (install path + full name).
         | 
| 54 66 |  | 
| 55 | 
            -
             | 
| 56 | 
            -
                #  | 
| 57 | 
            -
                # to  | 
| 67 | 
            +
              def full_gem_path
         | 
| 68 | 
            +
                # TODO: This is a heavily used method by gems, so we'll need
         | 
| 69 | 
            +
                # to aleast just alias it to #gem_dir rather than remove it.
         | 
| 70 | 
            +
                @full_gem_path ||= find_full_gem_path
         | 
| 71 | 
            +
              end
         | 
| 58 72 |  | 
| 59 | 
            -
             | 
| 60 | 
            -
             | 
| 73 | 
            +
              ##
         | 
| 74 | 
            +
              # Returns the full name (name-version) of this Gem.  Platform information
         | 
| 75 | 
            +
              # is included (name-version-platform) if it is specified and not the
         | 
| 76 | 
            +
              # default Ruby platform.
         | 
| 61 77 |  | 
| 62 | 
            -
             | 
| 63 | 
            -
             | 
| 64 | 
            -
                   | 
| 78 | 
            +
              def full_name
         | 
| 79 | 
            +
                if platform == Gem::Platform::RUBY or platform.nil? then
         | 
| 80 | 
            +
                  "#{name}-#{version}".untaint
         | 
| 81 | 
            +
                else
         | 
| 82 | 
            +
                  "#{name}-#{version}-#{platform}".untaint
         | 
| 65 83 | 
             
                end
         | 
| 84 | 
            +
              end
         | 
| 66 85 |  | 
| 67 | 
            -
             | 
| 68 | 
            -
             | 
| 86 | 
            +
              ##
         | 
| 87 | 
            +
              # Returns the full path to the gems directory containing this spec's
         | 
| 88 | 
            +
              # gem directory. eg: /usr/local/lib/ruby/1.8/gems
         | 
| 69 89 |  | 
| 70 | 
            -
             | 
| 71 | 
            -
             | 
| 72 | 
            -
             | 
| 90 | 
            +
              def gems_dir
         | 
| 91 | 
            +
                # TODO: this logic seems terribly broken, but tests fail if just base_dir
         | 
| 92 | 
            +
                @gems_dir ||= File.join(loaded_from && base_dir || Gem.dir, "gems")
         | 
| 93 | 
            +
              end
         | 
| 73 94 |  | 
| 74 | 
            -
             | 
| 75 | 
            -
             | 
| 76 | 
            -
             | 
| 77 | 
            -
                  end
         | 
| 78 | 
            -
                end
         | 
| 95 | 
            +
              ##
         | 
| 96 | 
            +
              # Set the path the Specification was loaded from. +path+ is converted to a
         | 
| 97 | 
            +
              # String.
         | 
| 79 98 |  | 
| 80 | 
            -
             | 
| 81 | 
            -
                 | 
| 99 | 
            +
              def loaded_from= path
         | 
| 100 | 
            +
                @loaded_from   = path && path.to_s
         | 
| 82 101 |  | 
| 83 | 
            -
                 | 
| 84 | 
            -
                   | 
| 85 | 
            -
                   | 
| 86 | 
            -
             | 
| 87 | 
            -
                end
         | 
| 102 | 
            +
                @full_gem_path = nil
         | 
| 103 | 
            +
                @gems_dir      = nil
         | 
| 104 | 
            +
                @base_dir      = nil
         | 
| 105 | 
            +
              end
         | 
| 88 106 |  | 
| 89 | 
            -
             | 
| 90 | 
            -
             | 
| 91 | 
            -
                  # TODO: also, shouldn't it default to full_name if it hasn't been written?
         | 
| 92 | 
            -
                  path = File.expand_path File.join(gems_dir, full_name)
         | 
| 93 | 
            -
                  path.untaint
         | 
| 94 | 
            -
                  path if File.directory? path
         | 
| 95 | 
            -
                end
         | 
| 96 | 
            -
                private :find_full_gem_path
         | 
| 107 | 
            +
              ##
         | 
| 108 | 
            +
              # Name of the gem
         | 
| 97 109 |  | 
| 98 | 
            -
             | 
| 99 | 
            -
                 | 
| 100 | 
            -
             | 
| 110 | 
            +
              def name
         | 
| 111 | 
            +
                raise NotImplementedError
         | 
| 112 | 
            +
              end
         | 
| 101 113 |  | 
| 102 | 
            -
             | 
| 103 | 
            -
             | 
| 104 | 
            -
                  @gems_dir ||= File.join(filename && base_dir || Gem.dir, "gems")
         | 
| 105 | 
            -
                end
         | 
| 114 | 
            +
              ##
         | 
| 115 | 
            +
              # Platform of the gem
         | 
| 106 116 |  | 
| 107 | 
            -
             | 
| 108 | 
            -
                 | 
| 109 | 
            -
             | 
| 110 | 
            -
                # eg: /usr/local/lib/ruby/gems/1.8
         | 
| 111 | 
            -
             | 
| 112 | 
            -
                def base_dir
         | 
| 113 | 
            -
                  return Gem.dir unless filename
         | 
| 114 | 
            -
                  @base_dir ||= if default_gem? then
         | 
| 115 | 
            -
                                  File.dirname File.dirname File.dirname filename
         | 
| 116 | 
            -
                                else
         | 
| 117 | 
            -
                                  File.dirname File.dirname filename
         | 
| 118 | 
            -
                                end
         | 
| 119 | 
            -
                end
         | 
| 117 | 
            +
              def platform
         | 
| 118 | 
            +
                raise NotImplementedError
         | 
| 119 | 
            +
              end
         | 
| 120 120 |  | 
| 121 | 
            -
             | 
| 122 | 
            -
             | 
| 123 | 
            -
                    File.dirname(filename) == self.class.default_specifications_dir
         | 
| 124 | 
            -
                end
         | 
| 121 | 
            +
              ##
         | 
| 122 | 
            +
              # Require paths of the gem
         | 
| 125 123 |  | 
| 126 | 
            -
             | 
| 127 | 
            -
                 | 
| 128 | 
            -
                # is included (name-version-platform) if it is specified and not the
         | 
| 129 | 
            -
                # default Ruby platform.
         | 
| 130 | 
            -
             | 
| 131 | 
            -
                def full_name
         | 
| 132 | 
            -
                  if platform == Gem::Platform::RUBY or platform.nil? then
         | 
| 133 | 
            -
                    "#{name}-#{version}".untaint
         | 
| 134 | 
            -
                  else
         | 
| 135 | 
            -
                    "#{name}-#{version}-#{platform}".untaint
         | 
| 136 | 
            -
                  end
         | 
| 137 | 
            -
                end
         | 
| 124 | 
            +
              def require_paths
         | 
| 125 | 
            +
                raise NotImplementedError
         | 
| 138 126 | 
             
              end
         | 
| 127 | 
            +
             | 
| 128 | 
            +
              ##
         | 
| 129 | 
            +
              # Return a Gem::Specification from this gem
         | 
| 130 | 
            +
             | 
| 131 | 
            +
              def to_spec
         | 
| 132 | 
            +
                raise NotImplementedError
         | 
| 133 | 
            +
              end
         | 
| 134 | 
            +
             | 
| 135 | 
            +
              ##
         | 
| 136 | 
            +
              # Version of the gem
         | 
| 137 | 
            +
             | 
| 138 | 
            +
              def version
         | 
| 139 | 
            +
                raise NotImplementedError
         | 
| 140 | 
            +
              end
         | 
| 141 | 
            +
             | 
| 139 142 | 
             
            end
         | 
| 143 | 
            +
             | 
| @@ -15,6 +15,25 @@ class Gem::Commands::BuildCommand < Gem::Command | |
| 15 15 | 
             
                "GEMSPEC_FILE  gemspec file name to build a gem for"
         | 
| 16 16 | 
             
              end
         | 
| 17 17 |  | 
| 18 | 
            +
              def description # :nodoc:
         | 
| 19 | 
            +
                <<-EOF
         | 
| 20 | 
            +
            The build command allows you to create a gem from a ruby gemspec.
         | 
| 21 | 
            +
             | 
| 22 | 
            +
            The best way to build a gem is to use a Rakefile and the Gem::PackageTask
         | 
| 23 | 
            +
            which ships with RubyGems.
         | 
| 24 | 
            +
             | 
| 25 | 
            +
            The gemspec can either be created by hand or extracted from an existing gem
         | 
| 26 | 
            +
            with gem spec:
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              $ gem unpack my_gem-1.0.gem
         | 
| 29 | 
            +
              Unpacked gem: '.../my_gem-1.0'
         | 
| 30 | 
            +
              $ gem spec my_gem-1.0.gem --ruby > my_gem-1.0/my_gem-1.0.gemspec
         | 
| 31 | 
            +
              $ cd my_gem-1.0
         | 
| 32 | 
            +
              [edit gem contents]
         | 
| 33 | 
            +
              $ gem build my_gem-1.0.gemspec
         | 
| 34 | 
            +
                EOF
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
             | 
| 18 37 | 
             
              def usage # :nodoc:
         | 
| 19 38 | 
             
                "#{program_name} GEMSPEC_FILE"
         | 
| 20 39 | 
             
              end
         | 
| @@ -79,6 +79,13 @@ class Gem::Commands::CheckCommand < Gem::Command | |
| 79 79 | 
             
                '--gems --alien'
         | 
| 80 80 | 
             
              end
         | 
| 81 81 |  | 
| 82 | 
            +
              def description # :nodoc:
         | 
| 83 | 
            +
                <<-EOF
         | 
| 84 | 
            +
            The check command can list and repair problems with installed gems and
         | 
| 85 | 
            +
            specifications and will clean up gems that have been partially uninstalled.
         | 
| 86 | 
            +
                EOF
         | 
| 87 | 
            +
              end
         | 
| 88 | 
            +
             | 
| 82 89 | 
             
              def usage # :nodoc:
         | 
| 83 90 | 
             
                "#{program_name} [OPTIONS] [GEMNAME ...]"
         | 
| 84 91 | 
             
              end
         |