Parent

Bones::GemPackageTask

Attributes

gem_spec[RW]

Ruby GEM spec containing the metadata for this package. The name, version and package_files are automatically determined from the GEM spec and don’t need to be explicitly provided.

Public Class Methods

new(gem_spec) click to toggle source

Create a GEM Package task library. Automatically define the gem if a block is given. If no block is supplied, then define needs to be called to define the task.

    # File lib/bones/gem_package_task.rb, line 19
19:   def initialize(gem_spec)
20:     init(gem_spec)
21:     yield self if block_given?
22:     define if block_given?
23:   end

Public Instance Methods

define() click to toggle source

Create the Rake tasks and actions specified by this GemPackageTask. (define is automatically called if a block is given to new).

    # File lib/bones/gem_package_task.rb, line 38
38:   def define
39:     super
40:     task :prereqs
41:     task :package => ['gem:prereqs', "#{package_dir_path}/#{gem_file}"]
42: 
43:     file "#{package_dir_path}/#{gem_file}" => [package_dir_path] + package_files do
44:       when_writing("Creating GEM") {
45:         chdir(package_dir_path) do
46:           Gem::Builder.new(gem_spec).build
47:           verbose(true) {
48:             mv gem_file, "../#{gem_file}"
49:           }
50:         end
51:       }
52:     end
53: 
54:     file package_dir_path do
55:       mkdir_p package_dir rescue nil
56:     end
57:   end
gem_file() click to toggle source
    # File lib/bones/gem_package_task.rb, line 61
61:   def gem_file
62:     if @gem_spec.platform == Gem::Platform::RUBY
63:       "#{package_name}.gem"
64:     else
65:       "#{package_name}-#{@gem_spec.platform}.gem"
66:     end
67:   end
init(gem) click to toggle source

Initialization tasks without the “yield self” or define operations.

    # File lib/bones/gem_package_task.rb, line 28
28:   def init(gem)
29:     super(gem.name, gem.version)
30:     @gem_spec = gem
31:     @package_files += gem_spec.files if gem_spec.files
32:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.