Class: FlashFlow::Lock::Github

Inherits:
Object
  • Object
show all
Defined in:
lib/flash_flow/lock/github.rb

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Github

Returns a new instance of Github.



10
11
12
13
14
15
# File 'lib/flash_flow/lock/github.rb', line 10

def initialize(config)
  @config = config

  verify_params!
  initialize_connection!
end

Instance Method Details

#with_lock(&block) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/flash_flow/lock/github.rb', line 17

def with_lock(&block)
  if issue_locked?
    raise Lock::Error.new(error_message)
  else
    lock_issue

    begin
      block.call
    ensure
      unlock_issue
    end
  end
end