Class: Lolcommits::Runner
- Inherits:
-
Object
- Object
- Lolcommits::Runner
- Includes:
- ActiveSupport::Callbacks, Methadone::CLILogging
- Defined in:
- lib/lolcommits/runner.rb
Instance Attribute Summary collapse
-
#capture_delay ⇒ Object
Returns the value of attribute capture_delay.
-
#capture_device ⇒ Object
Returns the value of attribute capture_device.
-
#config ⇒ Object
Returns the value of attribute config.
-
#font ⇒ Object
Returns the value of attribute font.
-
#main_image ⇒ Object
Returns the value of attribute main_image.
-
#message ⇒ Object
Returns the value of attribute message.
-
#repo ⇒ Object
Returns the value of attribute repo.
-
#repo_internal_path ⇒ Object
Returns the value of attribute repo_internal_path.
-
#sha ⇒ Object
Returns the value of attribute sha.
-
#snapshot_loc ⇒ Object
Returns the value of attribute snapshot_loc.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Runner
constructor
Executed First.
- #run ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Runner
Executed First
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# 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..nil? git_info = GitInfo.new self.sha = git_info.sha if self.sha.nil? self. = git_info. if self..nil? self.repo_internal_path = git_info.repo_internal_path self.repo = git_info.repo end end |
Instance Attribute Details
#capture_delay ⇒ Object
Returns the value of attribute capture_delay.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def capture_delay @capture_delay end |
#capture_device ⇒ Object
Returns the value of attribute capture_device.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def capture_device @capture_device end |
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def config @config end |
#font ⇒ Object
Returns the value of attribute font.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def font @font end |
#main_image ⇒ Object
Returns the value of attribute main_image.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def main_image @main_image end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def end |
#repo ⇒ Object
Returns the value of attribute repo.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def repo @repo end |
#repo_internal_path ⇒ Object
Returns the value of attribute repo_internal_path.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def repo_internal_path @repo_internal_path end |
#sha ⇒ Object
Returns the value of attribute sha.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def sha @sha end |
#snapshot_loc ⇒ Object
Returns the value of attribute snapshot_loc.
5 6 7 |
# File 'lib/lolcommits/runner.rb', line 5 def snapshot_loc @snapshot_loc end |
Instance Method Details
#run ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# 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 |