Class: Jeweler::Commands::WriteGemspec
- Inherits:
-
Object
- Object
- Jeweler::Commands::WriteGemspec
- Defined in:
- lib/jeweler/commands/write_gemspec.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
Returns the value of attribute base_dir.
-
#gemspec ⇒ Object
Returns the value of attribute gemspec.
-
#gemspec_helper ⇒ Object
Returns the value of attribute gemspec_helper.
-
#output ⇒ Object
Returns the value of attribute output.
-
#version ⇒ Object
Returns the value of attribute version.
-
#version_helper ⇒ Object
Returns the value of attribute version_helper.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ WriteGemspec
constructor
A new instance of WriteGemspec.
- #run ⇒ Object
Constructor Details
#initialize ⇒ WriteGemspec
Returns a new instance of WriteGemspec.
6 7 8 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 6 def initialize self.output = $stdout end |
Instance Attribute Details
#base_dir ⇒ Object
Returns the value of attribute base_dir.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def base_dir @base_dir end |
#gemspec ⇒ Object
Returns the value of attribute gemspec.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def gemspec @gemspec end |
#gemspec_helper ⇒ Object
Returns the value of attribute gemspec_helper.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def gemspec_helper @gemspec_helper end |
#output ⇒ Object
Returns the value of attribute output.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def output @output end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def version @version end |
#version_helper ⇒ Object
Returns the value of attribute version_helper.
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def version_helper @version_helper end |
Class Method Details
.build_for(jeweler) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 25 def self.build_for(jeweler) command = new command.base_dir = jeweler.base_dir command.gemspec = jeweler.gemspec command.version = jeweler.version command.output = jeweler.output command.gemspec_helper = jeweler.gemspec_helper command.version_helper = jeweler.version_helper command end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 10 def run gemspec_helper.spec.version ||= begin version_helper.refresh version_helper.to_s end gemspec_helper.write output.puts "Generated: #{gemspec_helper.path}" end |