diff options
Diffstat (limited to 'test/rubygems/simple_gem.rb')
-rw-r--r-- | test/rubygems/simple_gem.rb | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/test/rubygems/simple_gem.rb b/test/rubygems/simple_gem.rb index 4b6112300e..a6f14bc3c7 100644 --- a/test/rubygems/simple_gem.rb +++ b/test/rubygems/simple_gem.rb @@ -5,63 +5,59 @@ #++ SIMPLE_GEM = <<-GEMDATA - MD5SUM = "954df67d9475aa2f4fbba20aa33649c8" + MD5SUM = "e3701f9db765a2358aef94c40ded71c8" if $0 == __FILE__ require 'optparse' - + options = {} ARGV.options do |opts| opts.on_tail("--help", "show this message") {puts opts; exit} - opts.on('--dir=DIRNAME', "Installation directory for the Gem") {|x| - options[:directory] = x - } - opts.on('--force', "Force Gem to intall, bypassing dependency checks") {|x| - options[:force] = x - } - opts.on('--gen-rdoc', "Generate RDoc documentation for the Gem") {|x| - options[:gen_rdoc] = x - } + opts.on('--dir=DIRNAME', "Installation directory for the Gem") {|options[:directory]|} + opts.on('--force', "Force Gem to intall, bypassing dependency checks") {|options[:force]|} + opts.on('--gen-rdoc', "Generate RDoc documentation for the Gem") {|options[:gen_rdoc]|} opts.parse! end - require 'rubygems/installer' - - gem = Gem::Installer.new(__FILE__, options).install + require 'rubygems' + @directory = options[:directory] || Gem.dir + @force = options[:force] + + gem = Gem::Installer.new(__FILE__).install(@force, @directory) if options[:gen_rdoc] Gem::DocManager.new(gem).generate_rdoc end - end +end __END__ ---- !ruby/object:Gem::Specification +--- !ruby/object:Gem::Specification rubygems_version: "1.0" name: testing -version: !ruby/object:Gem::Version +version: !ruby/object:Gem::Version version: 1.2.3 date: 2004-03-18 22:01:52.859121 -05:00 -platform: +platform: summary: This exercise the gem testing stuff. -require_paths: +require_paths: - lib -files: +files: - lib/foo.rb - lib/test - lib/test.rb - lib/test/wow.rb autorequire: test test_suite_file: foo -requirements: +requirements: - a computer processor ---- -- +--- +- size: 109 mode: 420 path: lib/foo.rb -- +- size: 0 mode: 420 path: lib/test.rb -- +- size: 15 mode: 420 path: lib/test/wow.rb |