Class: Gemma::RakeTasks::GemTasks

Inherits:
Plugin
  • Object
show all
Defined in:
lib/gemma/rake_tasks/gem_tasks.rb

Overview

Create tasks for building and releasing gems.

Note that the release task is git-specific, but the other tasks are not specific to any particular version control system.

This plugin just calls Bundler::GemHelper with the given gemspec.

Instance Attribute Summary

Attributes inherited from Plugin

#gemspec

Instance Method Summary collapse

Constructor Details

#initialize(gemspec, gemspec_file_name) ⇒ GemTasks

Returns a new instance of GemTasks.

Parameters:

  • gemspec (Gem::Specification)
  • gemspec_file_name (String, nil)


16
17
18
19
# File 'lib/gemma/rake_tasks/gem_tasks.rb', line 16

def initialize gemspec, gemspec_file_name
  super(gemspec)
  @gemspec_file_name = gemspec_file_name
end

Instance Method Details

#create_rake_tasksnil

Internal method; see Plugin#create_rake_tasks.

Returns:

  • (nil)


28
29
30
31
32
33
34
# File 'lib/gemma/rake_tasks/gem_tasks.rb', line 28

def create_rake_tasks
  require 'bundler/gem_helper'
  dir = File.dirname(@gemspec_file_name) if @gemspec_file_name
  Bundler::GemHelper.install_tasks(:dir => dir,
                                   :name => gemspec.name)
  nil
end