Class: Jeweler::Commands::WriteGemspec
- Inherits:
-
Object
- Object
- Jeweler::Commands::WriteGemspec
- Defined in:
- lib/jeweler/commands/write_gemspec.rb
Instance Attribute Summary (collapse)
-
- (Object) base_dir
Returns the value of attribute base_dir.
-
- (Object) gemspec
Returns the value of attribute gemspec.
-
- (Object) gemspec_helper
Returns the value of attribute gemspec_helper.
-
- (Object) output
Returns the value of attribute output.
-
- (Object) version
Returns the value of attribute version.
-
- (Object) version_helper
Returns the value of attribute version_helper.
Class Method Summary (collapse)
Instance Method Summary (collapse)
-
- (WriteGemspec) initialize
constructor
A new instance of WriteGemspec.
- - (Object) run
Constructor Details
- (WriteGemspec) initialize
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
- (Object) base_dir
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 |
- (Object) gemspec
Returns the value of attribute gemspec
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def gemspec @gemspec end |
- (Object) gemspec_helper
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 |
- (Object) output
Returns the value of attribute output
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def output @output end |
- (Object) version
Returns the value of attribute version
4 5 6 |
# File 'lib/jeweler/commands/write_gemspec.rb', line 4 def version @version end |
- (Object) version_helper
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
+ (Object) build_for(jeweler)
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
- (Object) run
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 |