git_camera 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/git_camera +1 -1
- data/lib/default_config.rb +7 -13
- data/lib/git_camera/capture_session.rb +1 -3
- data/lib/git_camera/config.rb +2 -2
- data/lib/git_camera/version.rb +1 -1
- data/readme.md +36 -0
- metadata +2 -2
- data/git_camera/default_config.rb +0 -32
data/bin/git_camera
CHANGED
@@ -21,5 +21,5 @@ if config.exists?
|
|
21
21
|
capture_session.start_capture
|
22
22
|
else
|
23
23
|
config.init_project
|
24
|
-
puts "It looks like this is the first time you've used git-camera on this project. Default config has been initialised to
|
24
|
+
puts "It looks like this is the first time you've used git-camera on this project. Default config has been initialised to git_camera/config.rb. Make sure the settings are correct, then run this again to start capturing"
|
25
25
|
end
|
data/lib/default_config.rb
CHANGED
@@ -1,29 +1,23 @@
|
|
1
1
|
# The page to capture
|
2
|
-
page_url "http://
|
2
|
+
page_url "http://localhost:3000"
|
3
3
|
|
4
4
|
# Screen resolution to render at
|
5
5
|
resolution "800x600"
|
6
6
|
|
7
|
-
#
|
8
|
-
|
7
|
+
# Delay (in milliseconds) to wait for the server to load before taking a screenshot
|
8
|
+
delay 0
|
9
9
|
|
10
|
-
# Optional hooks for before/after each
|
10
|
+
# Optional hooks for before/after each screenshot, and before/after the capture session as a whole
|
11
11
|
# Each hook can either be a string to be executed on the command line or a block of Ruby code
|
12
12
|
|
13
|
-
before_each "forever start server.js"
|
14
|
-
after_each "forever stop server.js"
|
15
|
-
|
13
|
+
# before_each "forever start server.js"
|
14
|
+
# after_each "forever stop server.js"
|
16
15
|
before_all do
|
17
16
|
puts "Starting capture session"
|
18
17
|
end
|
19
|
-
|
20
18
|
after_all do
|
21
19
|
puts "Finished capture session"
|
22
20
|
end
|
23
21
|
|
24
22
|
# I'd hope this one's obvious enough
|
25
|
-
frames_per_second
|
26
|
-
|
27
|
-
# Uncomment if you don't want to delete the source frames when finished (doesn't work yet)
|
28
|
-
# keep_images
|
29
|
-
|
23
|
+
frames_per_second 2
|
@@ -14,7 +14,6 @@ module GitCamera
|
|
14
14
|
repo = Grit::Repo.new(repo_path || Dir.getwd)
|
15
15
|
|
16
16
|
before_all_block.call if before_all_block
|
17
|
-
puts 'Snapping:'
|
18
17
|
|
19
18
|
repo.commits('master', 99999).reverse.each_with_index do |commit, i|
|
20
19
|
before_each_block.call if before_each_block
|
@@ -22,7 +21,6 @@ module GitCamera
|
|
22
21
|
repo.git.native :checkout, {:raise=>true}, commit.sha
|
23
22
|
destination = "git_camera/frames/frame_#{"%05d" % i}.png"
|
24
23
|
before_each_block.call if before_each_block
|
25
|
-
# get unique destination path
|
26
24
|
|
27
25
|
take_screenshot(destination)
|
28
26
|
puts '- '+commit.message
|
@@ -57,7 +55,7 @@ module GitCamera
|
|
57
55
|
end
|
58
56
|
|
59
57
|
def compile_to_video
|
60
|
-
`ffmpeg -f image2 -r #{fps} -i git_camera/frames/frame_%05d.png -y git_camera_video.mp4`
|
58
|
+
`ffmpeg -f image2 -r #{fps} -i git_camera/frames/frame_%05d.png -y git_camera/git_camera_video.mp4`
|
61
59
|
end
|
62
60
|
|
63
61
|
def delete_images
|
data/lib/git_camera/config.rb
CHANGED
@@ -10,14 +10,14 @@ module GitCamera
|
|
10
10
|
|
11
11
|
def load_to_session(capture_session)
|
12
12
|
@c = capture_session
|
13
|
-
instance_eval(File.read('git_camera/
|
13
|
+
instance_eval(File.read('git_camera/config.rb'))
|
14
14
|
end
|
15
15
|
|
16
16
|
def init_project
|
17
17
|
FileUtils.mkdir('git_camera')
|
18
18
|
|
19
19
|
default_conf_location = File.expand_path("../../default_config.rb", __FILE__)
|
20
|
-
FileUtils.cp(default_conf_location, 'git_camera/
|
20
|
+
FileUtils.cp(default_conf_location, 'git_camera/config.rb')
|
21
21
|
end
|
22
22
|
|
23
23
|
private
|
data/lib/git_camera/version.rb
CHANGED
data/readme.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
git_camera
|
2
|
+
===
|
3
|
+
|
4
|
+
Have you ever finished a website and thought about how the design/build has evolved to get where it is now? Well git_camera is for you!
|
5
|
+
|
6
|
+
git_camera goes through your (web) project's git commits, and records a video of how the interface has changed over time. It's a little window into your build process - Use it for your own curiosity, show it to your client, your boss, investors, your cat, or your therapist.
|
7
|
+
|
8
|
+
|
9
|
+
Installation
|
10
|
+
---
|
11
|
+
|
12
|
+
If needs PhantomJS, FFmpeg, and Ruby. You probably already have Ruby, and if you're on a Mac you can get the others with:
|
13
|
+
|
14
|
+
$ brew install phantomjs ffmpeg
|
15
|
+
|
16
|
+
If that gave you an error, you probably need to install homebrew first:
|
17
|
+
|
18
|
+
$ ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
|
19
|
+
|
20
|
+
|
21
|
+
The simplest way is to install via rubygems. You don't need to know anything about Ruby, it comes with OSX and is just a delivery system.
|
22
|
+
|
23
|
+
$ [sudo] gem install git_camera
|
24
|
+
|
25
|
+
Alternatively, run from the source.
|
26
|
+
|
27
|
+
Usage
|
28
|
+
---
|
29
|
+
|
30
|
+
cd project_directory
|
31
|
+
git_camera
|
32
|
+
|
33
|
+
When you first run it, it will create a `git_camera` directory with a config file. Make sure to set the project's URL, and any setup that may be required.
|
34
|
+
|
35
|
+
If you need any help with this, I'm @skattyadz on Twitter
|
36
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_camera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -40,13 +40,13 @@ files:
|
|
40
40
|
- Rakefile
|
41
41
|
- bin/git_camera
|
42
42
|
- git_camera.gemspec
|
43
|
-
- git_camera/default_config.rb
|
44
43
|
- lib/default_config.rb
|
45
44
|
- lib/git_camera.rb
|
46
45
|
- lib/git_camera/capture_session.rb
|
47
46
|
- lib/git_camera/config.rb
|
48
47
|
- lib/git_camera/version.rb
|
49
48
|
- lib/phantom_task.js
|
49
|
+
- readme.md
|
50
50
|
homepage: http://rubygems.org/gems/git-camera
|
51
51
|
licenses: []
|
52
52
|
post_install_message:
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# The page to capture
|
2
|
-
page_url "http://tomorrowsharvest.dev"
|
3
|
-
|
4
|
-
# The path of the project. Will assume current directory if not set (doesn't work yet)
|
5
|
-
# repo_path "/Users/skattyadz/Dropbox/code/tomorrowsharvest"
|
6
|
-
|
7
|
-
# Screen resolution to render at
|
8
|
-
resolution "800x600"
|
9
|
-
|
10
|
-
# Optional delay (in milliseconds) to wait for the server to load before taking a screenshot
|
11
|
-
# delay 250
|
12
|
-
|
13
|
-
# Optional hooks for before/after each individual screenshot, as well as before/after the capture session as a whole
|
14
|
-
# Each hook can either be a string to be executed on the command line, or a block of Ruby code
|
15
|
-
|
16
|
-
before_each "forever start server.js"
|
17
|
-
after_each "forever stop server.js"
|
18
|
-
|
19
|
-
before_all do
|
20
|
-
puts "This is some ruby code executed before capturing starts"
|
21
|
-
end
|
22
|
-
|
23
|
-
after_all do
|
24
|
-
puts "This code will run after everything's finished"
|
25
|
-
end
|
26
|
-
|
27
|
-
# I'd hope this one's obvious enough
|
28
|
-
frames_per_second 1
|
29
|
-
|
30
|
-
# Uncomment if you don't want to delete the source frames when finished (doesn't work yet)
|
31
|
-
# keep_images
|
32
|
-
|