Class: Jeweler::Commands::Version::Base
- Inherits:
-
Object
- Object
- Jeweler::Commands::Version::Base
- Defined in:
- lib/jeweler/commands/version/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#commit ⇒ Object
Returns the value of attribute commit.
-
#gemspec ⇒ Object
Returns the value of attribute gemspec.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#version_helper ⇒ Object
Returns the value of attribute version_helper.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#commit ⇒ Object
Returns the value of attribute commit.
6 7 8 |
# File 'lib/jeweler/commands/version/base.rb', line 6 def commit @commit end |
#gemspec ⇒ Object
Returns the value of attribute gemspec.
6 7 8 |
# File 'lib/jeweler/commands/version/base.rb', line 6 def gemspec @gemspec end |
#repo ⇒ Object
Returns the value of attribute repo.
6 7 8 |
# File 'lib/jeweler/commands/version/base.rb', line 6 def repo @repo end |
#version_helper ⇒ Object
Returns the value of attribute version_helper.
6 7 8 |
# File 'lib/jeweler/commands/version/base.rb', line 6 def version_helper @version_helper end |
Class Method Details
.build_for(jeweler) ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/jeweler/commands/version/base.rb', line 29 def self.build_for(jeweler) command = new command.repo = jeweler.repo command.version_helper = jeweler.version_helper command.gemspec = jeweler.gemspec command.commit = jeweler.commit command end |
Instance Method Details
#commit_version ⇒ Object
21 22 23 24 25 26 |
# File 'lib/jeweler/commands/version/base.rb', line 21 def commit_version if self.repo self.repo.add(version_helper.path) self.repo.commit("Version bump to #{self.version_helper.to_s}") end end |
#run ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/jeweler/commands/version/base.rb', line 8 def run update_version self.version_helper.write self.gemspec.version = self.version_helper.to_s commit_version if self.repo && self.commit end |
#update_version ⇒ Object
17 18 19 |
# File 'lib/jeweler/commands/version/base.rb', line 17 def update_version raise "Subclasses should implement this" end |