Class: Autoversion::CLI
- Inherits:
-
Thor
- Object
- Thor
- Autoversion::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/autoversion/cli.rb
Class Attribute Summary collapse
-
.pwd ⇒ Object
Returns the value of attribute pwd.
-
.version_file_contents ⇒ Object
Returns the value of attribute version_file_contents.
Instance Method Summary collapse
-
#initialize(*args) ⇒ CLI
constructor
A new instance of CLI.
- #major ⇒ Object
- #minor ⇒ Object
- #patch ⇒ Object
- #read_version ⇒ Object
- #special ⇒ Object
Constructor Details
#initialize(*args) ⇒ CLI
Returns a new instance of CLI.
12 13 14 15 16 |
# File 'lib/autoversion/cli.rb', line 12 def initialize(*args) super *args version_file_contents = CLI::version_file_contents || File.read(File.join(Dir.pwd, "Versionfile")) @versioner = Autoversion::Versioner.new version_file_contents, CLI::pwd end |
Class Attribute Details
.pwd ⇒ Object
Returns the value of attribute pwd.
9 10 11 |
# File 'lib/autoversion/cli.rb', line 9 def pwd @pwd end |
.version_file_contents ⇒ Object
Returns the value of attribute version_file_contents.
8 9 10 |
# File 'lib/autoversion/cli.rb', line 8 def version_file_contents @version_file_contents end |
Instance Method Details
#major ⇒ Object
40 41 42 |
# File 'lib/autoversion/cli.rb', line 40 def major increment_version :major, [:simulate], [:force] end |
#minor ⇒ Object
33 34 35 |
# File 'lib/autoversion/cli.rb', line 33 def minor increment_version :minor, [:simulate], [:force] end |
#patch ⇒ Object
26 27 28 |
# File 'lib/autoversion/cli.rb', line 26 def patch increment_version :patch, [:simulate], [:force] end |
#read_version ⇒ Object
19 20 21 |
# File 'lib/autoversion/cli.rb', line 19 def read_version say @versioner.current_version.to_s, :cyan end |
#special ⇒ Object
46 47 48 |
# File 'lib/autoversion/cli.rb', line 46 def special create_build_version end |