Class: Mj::Git::Commands::DeleteStaleBranchesCommand
- Inherits:
-
Object
- Object
- Mj::Git::Commands::DeleteStaleBranchesCommand
- Defined in:
- lib/mj/git/commands/delete_stale_branches_command.rb
Instance Method Summary collapse
- #after_date ⇒ Object
- #before_date ⇒ Object
- #dry_run? ⇒ Boolean
- #from_commiters ⇒ Object
- #from_pull_requestors ⇒ Object
-
#initialize(options: {}) ⇒ DeleteStaleBranchesCommand
constructor
A new instance of DeleteStaleBranchesCommand.
- #only_with_closed_prs ⇒ Object
- #only_with_prs ⇒ Object
Constructor Details
#initialize(options: {}) ⇒ DeleteStaleBranchesCommand
Returns a new instance of DeleteStaleBranchesCommand.
7 8 9 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 7 def initialize(options: {}) @options = end |
Instance Method Details
#after_date ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 15 def after_date if @after_date return @after_date end if @options[:after_date] @after_date ||= DateTime.parse(@options[:after_date]) end # Default to 100+ years ago - sure there are no commits that old @after_date ||= DateTime.new(1900, 1, 1, 0, 0, 0) end |
#before_date ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 28 def before_date if @before_date return @before_date end if @options[:before_date] @before_date ||= DateTime.parse(@options[:before_date]) end # Default to now, because all things happened before now. @before_date ||= DateTime.now end |
#dry_run? ⇒ Boolean
11 12 13 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 11 def dry_run? @options[:dry_run] end |
#from_commiters ⇒ Object
53 54 55 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 53 def from_commiters @options[:from_commiters].to_s.split(",") end |
#from_pull_requestors ⇒ Object
49 50 51 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 49 def from_pull_requestors @options[:from_pull_requestors].to_s.split(",") end |
#only_with_closed_prs ⇒ Object
45 46 47 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 45 def only_with_closed_prs @options[:only_with_closed_prs] end |
#only_with_prs ⇒ Object
41 42 43 |
# File 'lib/mj/git/commands/delete_stale_branches_command.rb', line 41 def only_with_prs @options[:only_with_prs] end |