class Lolcommits::Runner

Attributes

capture_delay[RW]
capture_device[RW]
config[RW]
font[RW]
main_image[RW]
message[RW]
repo[RW]
repo_internal_path[RW]
sha[RW]
snapshot_loc[RW]

Public Class Methods

new(attributes={}) click to toggle source

Executed First

# File lib/lolcommits/runner.rb, line 21
def initialize(attributes={})
  attributes.each do |attr, val|
    self.send("#{attr}=", val)
  end

  if self.sha.nil? || self.message.nil?
    git_info = GitInfo.new
    self.sha = git_info.sha if self.sha.nil?
    self.message = git_info.message if self.message.nil?
    self.repo_internal_path = git_info.repo_internal_path
    self.repo = git_info.repo
  end
end

Public Instance Methods

run() click to toggle source
# File lib/lolcommits/runner.rb, line 35
def run
  die_if_rebasing!

  run_callbacks :run do
    puts "*** Preserving this moment in history."
    self.snapshot_loc = self.config.raw_image
    self.main_image   = self.config.main_image(self.sha)
    capturer = "Lolcommits::Capture#{Configuration.platform}".constantize.new(
      :capture_device    => self.capture_device,
      :capture_delay     => self.capture_delay,
      :snapshot_location => self.snapshot_loc,
      :font              => self.font
    )
    capturer.capture
    resize_snapshot!
  end
end