Class: Afterlife::Release::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/afterlife/release/helper.rb

Direct Known Subclasses

CreateHelper, PreHelper

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cli, args) ⇒ Helper

Returns a new instance of Helper.



16
17
18
19
# File 'lib/afterlife/release/helper.rb', line 16

def initialize(cli, args)
  args.compact!
  @cli = cli
end

Instance Attribute Details

#cliObject (readonly)

Returns the value of attribute cli.



14
15
16
# File 'lib/afterlife/release/helper.rb', line 14

def cli
  @cli
end

Class Method Details

.call(cli, args) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/afterlife/release/helper.rb', line 6

def self.call(cli, args)
  new(cli, args).call
rescue Git::GitExecuteError => e
  cli.fatal! e.message.chomp.split(':').last.strip
rescue Interrupt
  cli.log_interrupted
end

Instance Method Details

#gitObject



21
22
23
# File 'lib/afterlife/release/helper.rb', line 21

def git
  @git ||= Git.open('.')
end