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_file` alias (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
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/gemma/rake_tasks.rb', line 38 def initialize gemspec, &block # 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. block.call(self) if block_given? @plugins.values.each do |plugin| begin plugin.create_rake_tasks rescue warn "plugin #{plugin.class} failed: #{$!}" end 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).
79 80 81 |
# File 'lib/gemma/rake_tasks.rb', line 79 def gemspec @gemspec end |
#gemspec_file_name ⇒ String (readonly)
File from which the #gemspec was loaded.
constructor; otherwise, nil
71 72 73 |
# File 'lib/gemma/rake_tasks.rb', line 71 def gemspec_file_name @gemspec_file_name end |
#plugins ⇒ Hash<Symbol, Plugin> (readonly)
84 85 86 |
# File 'lib/gemma/rake_tasks.rb', line 84 def plugins @plugins end |