Class: Bueller::Commands::Version::Base
- Inherits:
-
Object
- Object
- Bueller::Commands::Version::Base
show all
- Defined in:
- lib/bueller/commands/version/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(bueller) ⇒ Base
Returns a new instance of Base.
16
17
18
|
# File 'lib/bueller/commands/version/base.rb', line 16
def initialize(bueller)
@bueller = bueller
end
|
Instance Attribute Details
#bueller ⇒ Object
Returns the value of attribute bueller.
14
15
16
|
# File 'lib/bueller/commands/version/base.rb', line 14
def bueller
@bueller
end
|
#gemspec ⇒ Object
Returns the value of attribute gemspec.
13
14
15
|
# File 'lib/bueller/commands/version/base.rb', line 13
def gemspec
@gemspec
end
|
#version_helper ⇒ Object
Returns the value of attribute version_helper.
13
14
15
|
# File 'lib/bueller/commands/version/base.rb', line 13
def version_helper
@version_helper
end
|
Class Method Details
.run_for(bueller) ⇒ Object
7
8
9
10
11
|
# File 'lib/bueller/commands/version/base.rb', line 7
def self.run_for(bueller)
command = new bueller
command.run
command
end
|
Instance Method Details
#commit ⇒ Object
23
|
# File 'lib/bueller/commands/version/base.rb', line 23
def commit; bueller.commit; end
|
#commit_version ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/bueller/commands/version/base.rb', line 39
def commit_version
if repo and commit
repo.add gemspec_helper.path
repo.add version_helper.path
repo.commit "Version bump to #{version_helper.to_s}"
end
end
|
#gemspec_helper ⇒ Object
21
|
# File 'lib/bueller/commands/version/base.rb', line 21
def gemspec_helper; bueller.gemspec_helper; end
|
#repo ⇒ Object
22
|
# File 'lib/bueller/commands/version/base.rb', line 22
def repo; bueller.repo; end
|
#run ⇒ Object
25
26
27
28
29
30
31
32
33
|
# File 'lib/bueller/commands/version/base.rb', line 25
def run
update_version
gemspec_helper.set_date
gemspec_helper.write
version_helper.write_version
commit_version
end
|
#update_version ⇒ Object
35
36
37
|
# File 'lib/bueller/commands/version/base.rb', line 35
def update_version
raise "Subclasses should implement this"
end
|