Class: Juwelier::Tasks

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/juwelier/tasks.rb

Overview

Rake tasks for managing your gem.

Here’s a basic usage example:

Juwelier::Tasks.new do |gem|
  gem.name = "juwelier"
  gem.summary = "Simple and opinionated helper for creating RubyGem projects on GitHub"
  gem.email = "[email protected]"
  gem.homepage = "http://github.com/flajann2/juwelier"
  gem.description = "Simple and opinionated helper for creating RubyGem projects on GitHub"
  gem.authors = ["Josh Nichols"]
end

The block variable gem is actually a Gem::Specification, so you can do anything you would normally do with a Gem::Specification. For more details, see the official gemspec reference: guides.rubygems.org/specification-reference

In addition, it provides reasonable defaults for several values. See Juwelier::Specification for more details.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gemspec = nil, &gemspec_building_block) ⇒ Tasks

Returns a new instance of Tasks.



42
43
44
45
46
47
48
# File 'lib/juwelier/tasks.rb', line 42

def initialize(gemspec = nil, &gemspec_building_block)
  @gemspec = gemspec || Gem::Specification.new
  self.gemspec_building_block = gemspec_building_block

  Rake.application.juwelier_tasks = self
  define
end

Instance Attribute Details

#gemspecObject

Returns the value of attribute gemspec.



40
41
42
# File 'lib/juwelier/tasks.rb', line 40

def gemspec
  @gemspec
end

#gemspec_building_blockObject

Returns the value of attribute gemspec_building_block.



40
41
42
# File 'lib/juwelier/tasks.rb', line 40

def gemspec_building_block
  @gemspec_building_block
end

#juwelierObject

Returns the value of attribute juwelier.



40
41
42
# File 'lib/juwelier/tasks.rb', line 40

def juwelier
  @juwelier
end