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
-
#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.
7 8 9 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 7 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
22 23 24 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 22 def gemspec_helper @gemspec_helper ||= GemSpecHelper.new(gemspec, base_dir) 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
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 26 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
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 11 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 |