Class: OmgPullRequest::Lolcommits

Inherits:
Object
  • Object
show all
Defined in:
lib/omg_pull_request/lolcommits.rb

Constant Summary collapse

LOLCOMMITS_PATH =
'/animated_gifs'
LOLCOMMITS_URL =
"http://www.lolcommits.com"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = Hash.new) ⇒ Lolcommits

Returns a new instance of Lolcommits.



7
8
9
10
11
# File 'lib/omg_pull_request/lolcommits.rb', line 7

def initialize(attributes=Hash.new)
  attributes.each do |attr, value|
    self.send("#{attr}=", value)
  end
end

Instance Attribute Details

#configurationObject

Returns the value of attribute configuration.



5
6
7
# File 'lib/omg_pull_request/lolcommits.rb', line 5

def configuration
  @configuration
end

#contextObject

Returns the value of attribute context.



5
6
7
# File 'lib/omg_pull_request/lolcommits.rb', line 5

def context
  @context
end

#github_wrapperObject

Returns the value of attribute github_wrapper.



5
6
7
# File 'lib/omg_pull_request/lolcommits.rb', line 5

def github_wrapper
  @github_wrapper
end

#runnerObject

Returns the value of attribute runner.



5
6
7
# File 'lib/omg_pull_request/lolcommits.rb', line 5

def runner
  @runner
end

Instance Method Details

#animation_urlObject



13
14
15
16
17
18
19
20
# File 'lib/omg_pull_request/lolcommits.rb', line 13

def animation_url
  return @animation_url if @animation_url
  commits = github_wrapper.commit_shas(runner.pull_request) - 
    context.get_animated_shas(runner.pull_request.number)
  context.add_animated_shas(runner.pull_request.number, commits)

  @animation_url ||= get_animation_url(commits)
end