Class: Afterlife::Release::CreateHelper
- Defined in:
- lib/afterlife/release/create_helper.rb
Constant Summary collapse
- DEFAULT_BASE_BRANCH =
'develop'
- PARTS =
%i[major minor patch].freeze
Instance Attribute Summary collapse
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#part ⇒ Object
readonly
Returns the value of attribute part.
Attributes inherited from Helper
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(cli, args) ⇒ CreateHelper
constructor
A new instance of CreateHelper.
Methods inherited from Helper
Constructor Details
#initialize(cli, args) ⇒ CreateHelper
Returns a new instance of CreateHelper.
11 12 13 14 15 16 17 18 19 |
# File 'lib/afterlife/release/create_helper.rb', line 11 def initialize(cli, args) super @part = args[:part] @branch_name = [ args.fetch(:prefix, 'release'), args.fetch(:name, "v#{new_version}"), ].join('/') @from = args.fetch(:from, DEFAULT_BASE_BRANCH) end |
Instance Attribute Details
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
9 10 11 |
# File 'lib/afterlife/release/create_helper.rb', line 9 def branch_name @branch_name end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
9 10 11 |
# File 'lib/afterlife/release/create_helper.rb', line 9 def from @from end |
#part ⇒ Object (readonly)
Returns the value of attribute part.
9 10 11 |
# File 'lib/afterlife/release/create_helper.rb', line 9 def part @part end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/afterlife/release/create_helper.rb', line 21 def call confirm_creation unless cli.[:yes] make_assertions unless cli.[:force] create_branch ChangeVersion.call(new_version) commit end |