Class: GitCamera::CaptureSession
- Inherits:
-
Object
- Object
- GitCamera::CaptureSession
- Defined in:
- lib/git_camera/capture_session.rb
Instance Attribute Summary collapse
-
#after_all_block ⇒ Object
Returns the value of attribute after_all_block.
-
#after_all_command ⇒ Object
Returns the value of attribute after_all_command.
-
#after_each_block ⇒ Object
Returns the value of attribute after_each_block.
-
#after_each_command ⇒ Object
Returns the value of attribute after_each_command.
-
#before_all_block ⇒ Object
Returns the value of attribute before_all_block.
-
#before_all_command ⇒ Object
Returns the value of attribute before_all_command.
-
#before_each_block ⇒ Object
Returns the value of attribute before_each_block.
-
#before_each_command ⇒ Object
Returns the value of attribute before_each_command.
-
#delay ⇒ Object
Returns the value of attribute delay.
-
#fps ⇒ Object
Returns the value of attribute fps.
-
#page_url ⇒ Object
Returns the value of attribute page_url.
-
#repo_path ⇒ Object
Returns the value of attribute repo_path.
-
#resolution ⇒ Object
Returns the value of attribute resolution.
Instance Method Summary collapse
Instance Attribute Details
#after_all_block ⇒ Object
Returns the value of attribute after_all_block.
7 8 9 |
# File 'lib/git_camera/capture_session.rb', line 7 def after_all_block @after_all_block end |
#after_all_command ⇒ Object
Returns the value of attribute after_all_command.
7 8 9 |
# File 'lib/git_camera/capture_session.rb', line 7 def after_all_command @after_all_command end |
#after_each_block ⇒ Object
Returns the value of attribute after_each_block.
7 8 9 |
# File 'lib/git_camera/capture_session.rb', line 7 def after_each_block @after_each_block end |
#after_each_command ⇒ Object
Returns the value of attribute after_each_command.
7 8 9 |
# File 'lib/git_camera/capture_session.rb', line 7 def after_each_command @after_each_command end |
#before_all_block ⇒ Object
Returns the value of attribute before_all_block.
6 7 8 |
# File 'lib/git_camera/capture_session.rb', line 6 def before_all_block @before_all_block end |
#before_all_command ⇒ Object
Returns the value of attribute before_all_command.
6 7 8 |
# File 'lib/git_camera/capture_session.rb', line 6 def before_all_command @before_all_command end |
#before_each_block ⇒ Object
Returns the value of attribute before_each_block.
6 7 8 |
# File 'lib/git_camera/capture_session.rb', line 6 def before_each_block @before_each_block end |
#before_each_command ⇒ Object
Returns the value of attribute before_each_command.
6 7 8 |
# File 'lib/git_camera/capture_session.rb', line 6 def before_each_command @before_each_command end |
#delay ⇒ Object
Returns the value of attribute delay.
9 10 11 |
# File 'lib/git_camera/capture_session.rb', line 9 def delay @delay end |
#fps ⇒ Object
Returns the value of attribute fps.
9 10 11 |
# File 'lib/git_camera/capture_session.rb', line 9 def fps @fps end |
#page_url ⇒ Object
Returns the value of attribute page_url.
9 10 11 |
# File 'lib/git_camera/capture_session.rb', line 9 def page_url @page_url end |
#repo_path ⇒ Object
Returns the value of attribute repo_path.
9 10 11 |
# File 'lib/git_camera/capture_session.rb', line 9 def repo_path @repo_path end |
#resolution ⇒ Object
Returns the value of attribute resolution.
9 10 11 |
# File 'lib/git_camera/capture_session.rb', line 9 def resolution @resolution end |
Instance Method Details
#start_capture ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/git_camera/capture_session.rb', line 11 def start_capture FileUtils.mkdir('git_camera/frames') unless Dir.exist?('git_camera/frames') repo = Grit::Repo.new(repo_path || Dir.getwd) before_all_block.call if before_all_block repo.commits('master', 99999).reverse.each_with_index do |commit, i| before_each_block.call if before_each_block repo.git.native :checkout, {:raise=>true}, commit.sha destination = "git_camera/frames/frame_#{"%05d" % i}.png" before_each_block.call if before_each_block take_screenshot(destination) puts '- '+commit. after_each_block.call if after_each_block end compile_to_video delete_images after_all_block.call if after_all_block repo.git.native :checkout, {}, 'master' end |