Class: Octopolo::Scripts::CompareRelease
- Inherits:
-
Object
- Object
- Octopolo::Scripts::CompareRelease
- Includes:
- CLIWrapper, ConfigWrapper, GitWrapper, Base
- Defined in:
- lib/octopolo/scripts/compare_release.rb
Instance Attribute Summary collapse
-
#start ⇒ Object
Returns the value of attribute start.
-
#stop ⇒ Object
Returns the value of attribute stop.
Attributes included from CLIWrapper
Attributes included from ConfigWrapper
Attributes included from GitWrapper
Class Method Summary collapse
Instance Method Summary collapse
-
#ask_starting_tag ⇒ Object
Public: Ask, if not already set, which tag to start with.
-
#ask_stopping_tag ⇒ Object
Public: Ask, if not already set, which tag to end with.
-
#compare_url ⇒ Object
Public: The GitHub compare URL for the selected tags.
- #execute ⇒ Object
-
#initialize(start = nil, stop = nil) ⇒ CompareRelease
constructor
A new instance of CompareRelease.
-
#open_compare_page ⇒ Object
Public: Open the GitHub compare URL for the starting and ending branches.
Methods included from Base
Constructor Details
#initialize(start = nil, stop = nil) ⇒ CompareRelease
Returns a new instance of CompareRelease.
18 19 20 21 |
# File 'lib/octopolo/scripts/compare_release.rb', line 18 def initialize(start=nil, stop=nil) @start = start @stop = stop end |
Instance Attribute Details
#start ⇒ Object
Returns the value of attribute start.
11 12 13 |
# File 'lib/octopolo/scripts/compare_release.rb', line 11 def start @start end |
#stop ⇒ Object
Returns the value of attribute stop.
12 13 14 |
# File 'lib/octopolo/scripts/compare_release.rb', line 12 def stop @stop end |
Class Method Details
.execute(start, stop) ⇒ Object
14 15 16 |
# File 'lib/octopolo/scripts/compare_release.rb', line 14 def self.execute(start, stop) new(start, stop).execute end |
Instance Method Details
#ask_starting_tag ⇒ Object
Public: Ask, if not already set, which tag to start with
30 31 32 |
# File 'lib/octopolo/scripts/compare_release.rb', line 30 def ask_starting_tag self.start ||= cli.ask("Start with which tag?", git.) end |
#ask_stopping_tag ⇒ Object
Public: Ask, if not already set, which tag to end with
35 36 37 |
# File 'lib/octopolo/scripts/compare_release.rb', line 35 def ask_stopping_tag self.stop ||= cli.ask("Compare from #{start} to which tag?", git.) end |
#compare_url ⇒ Object
Public: The GitHub compare URL for the selected tags
46 47 48 |
# File 'lib/octopolo/scripts/compare_release.rb', line 46 def compare_url "https://github.com/#{config.github_repo}/compare/#{start}...#{stop}?w=1" end |
#execute ⇒ Object
23 24 25 26 27 |
# File 'lib/octopolo/scripts/compare_release.rb', line 23 def execute ask_starting_tag ask_stopping_tag open_compare_page end |
#open_compare_page ⇒ Object
Public: Open the GitHub compare URL for the starting and ending branches
40 41 42 43 |
# File 'lib/octopolo/scripts/compare_release.rb', line 40 def open_compare_page cli.copy_to_clipboard compare_url cli.open compare_url end |