Skip to content
This repository
Browse code

Merge pull request #317 from tute/master

Documenting Gem::Package class.
  • Loading branch information...
commit 024e06bd0f2a0851ae7039a7a2749469acf3a9a3 2 parents cdfbb51 + 38fe168
Evan Phoenix evanphx authored

Showing 2 changed files with 36 additions and 3 deletions. Show diff stats Hide diff stats

  1. +36 0 lib/rubygems/package.rb
  2. +0 3  lib/rubygems/package_task.rb
36 lib/rubygems/package.rb
@@ -3,6 +3,42 @@
3 3 # Copyright (C) 2004 Mauricio Julio Fernández Pradier
4 4 # See LICENSE.txt for additional licensing information.
5 5 #++
  6 +#
  7 +# Example using a Gem::Package
  8 +#
  9 +# Builds a .gem file given a Gem::Specification. A .gem file is a tarball
  10 +# which contains a data.tar.gz and metadata.gz, and possibly signatures.
  11 +#
  12 +# require 'rubygems'
  13 +# require 'rubygems/package'
  14 +#
  15 +# spec = Gem::Specification.new do |s|
  16 +# s.summary = "Ruby based make-like utility."
  17 +# s.name = 'rake'
  18 +# s.version = PKG_VERSION
  19 +# s.requirements << 'none'
  20 +# s.files = PKG_FILES
  21 +# s.description = <<-EOF
  22 +# Rake is a Make-like program implemented in Ruby. Tasks
  23 +# and dependencies are specified in standard Ruby syntax.
  24 +# EOF
  25 +# end
  26 +#
  27 +# Gem::Package.build spec
  28 +#
  29 +# Reads a .gem file.
  30 +#
  31 +# require 'rubygems'
  32 +# require 'rubygems/package'
  33 +#
  34 +# the_gem = Gem::Package.new(path_to_dot_gem)
  35 +# the_gem.contents # get the files in the gem
  36 +# the_gem.extract_files destination_directory # extract the gem into a directory
  37 +# the_gem.spec # get the spec out of the gem
  38 +# the_gem.verify # check the gem is OK (contains valid gem specification, contains a not corrupt contents archive)
  39 +#
  40 +# #files are the files in the .gem tar file, not the ruby files in the gem
  41 +# #extract_files and #contents automatically call #verify
6 42
7 43 require 'rubygems/security'
8 44 require 'rubygems/specification'
3  lib/rubygems/package_task.rb
@@ -44,13 +44,10 @@
44 44 # require 'rubygems/package_task'
45 45 #
46 46 # spec = Gem::Specification.new do |s|
47   -# s.platform = Gem::Platform::RUBY
48 47 # s.summary = "Ruby based make-like utility."
49 48 # s.name = 'rake'
50 49 # s.version = PKG_VERSION
51 50 # s.requirements << 'none'
52   -# s.require_path = 'lib'
53   -# s.autorequire = 'rake'
54 51 # s.files = PKG_FILES
55 52 # s.description = <<-EOF
56 53 # Rake is a Make-like program implemented in Ruby. Tasks

0 comments on commit 024e06b

Please sign in to comment.
Something went wrong with that request. Please try again.