Class: Gemma::RakeTasks
- Inherits:
-
Object
- Object
- Gemma::RakeTasks
- Defined in:
- lib/gemma/rake_tasks.rb,
lib/gemma/rake_tasks/plugin.rb,
lib/gemma/rake_tasks/gem_tasks.rb,
lib/gemma/rake_tasks/rdoc_tasks.rb,
lib/gemma/rake_tasks/yard_tasks.rb,
lib/gemma/rake_tasks/minitest_tasks.rb
Overview
Generate standard gem development tasks; the tasks are configured using the settings in the given gemspec file.
Defined Under Namespace
Classes: GemTasks, MinitestTasks, Plugin, RDocTasks, YardTasks
Instance Attribute Summary collapse
-
#gemspec ⇒ Gem::Specification
readonly
The specification used to configure the rake tasks.
-
#gemspec_file_name ⇒ String
readonly
File from which the #gemspec was loaded.
- #plugins ⇒ Hash<Symbol, Plugin> readonly
Instance Method Summary collapse
- #gem ⇒ GemTasks
-
#initialize(gemspec) {|tasks| ... } ⇒ RakeTasks
constructor
Constructor mainly for internal use; you should usually use the
with_gemspec_filealias (see examples in RakeTasks). - #rdoc ⇒ RDocTasks
- #test ⇒ MinitestTasks
- #yard ⇒ YardTasks
Constructor Details
#initialize(gemspec) {|tasks| ... } ⇒ RakeTasks
Constructor mainly for internal use; you should usually use the
with_gemspec_file alias (see examples in Gemma::RakeTasks).
file or a gemspec object; the latter is intended mainly for testing
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/gemma/rake_tasks.rb', line 39 def initialize(gemspec) # Load gemspec. if gemspec.is_a?(String) @gemspec_file_name = gemspec @gemspec = Gem::Specification.load(gemspec_file_name) elsif gemspec.is_a?(Gem::Specification) @gemspec_file_name = nil @gemspec = gemspec else raise ArgumentError, 'bad gemspec argument' end @plugins = {} create_default_plugins # Let the user add more plugins and alter settings. yield(self) if block_given? @plugins.each_value do |plugin| plugin.create_rake_tasks rescue StandardError warn "plugin #{plugin.class} failed: #{$ERROR_INFO}" end end |
Instance Attribute Details
#gemspec ⇒ Gem::Specification (readonly)
The specification used to configure the rake tasks.
(make the changes in the gemspec file instead).
78 79 80 |
# File 'lib/gemma/rake_tasks.rb', line 78 def gemspec @gemspec end |
#gemspec_file_name ⇒ String (readonly)
File from which the #gemspec was loaded.
constructor; otherwise, nil
70 71 72 |
# File 'lib/gemma/rake_tasks.rb', line 70 def gemspec_file_name @gemspec_file_name end |
#plugins ⇒ Hash<Symbol, Plugin> (readonly)
83 84 85 |
# File 'lib/gemma/rake_tasks.rb', line 83 def plugins @plugins end |
Instance Method Details
#test ⇒ MinitestTasks
95 96 97 |
# File 'lib/gemma/rake_tasks.rb', line 95 def test @plugins[:test] end |
#yard ⇒ YardTasks
102 103 104 |
# File 'lib/gemma/rake_tasks.rb', line 102 def yard @plugins[:yard] end |