gifme 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -0
- data/Rakefile +1 -1
- data/bin/gifme +44 -2
- data/gifme.gemspec +2 -2
- metadata +4 -4
data/README.md
CHANGED
@@ -16,6 +16,10 @@ You'll also need to install ImageMagick. On OS X, this is easy using Homebrew:
|
|
16
16
|
|
17
17
|
brew install imagemagick
|
18
18
|
|
19
|
+
If you want to capture photos using your Mac's iSight camera
|
20
|
+
|
21
|
+
brew install imagesnap
|
22
|
+
|
19
23
|
## Usage
|
20
24
|
|
21
25
|
gifme ~/Desktop/1.png ~/Desktop/2.png
|
data/Rakefile
CHANGED
data/bin/gifme
CHANGED
@@ -4,12 +4,15 @@ require 'optparse'
|
|
4
4
|
require 'open-uri'
|
5
5
|
require 'fileutils'
|
6
6
|
|
7
|
+
timestamp = Time.now.strftime(fmt='%F_%Hh-%Mm-%Ss')
|
8
|
+
|
7
9
|
options = {
|
8
|
-
:output => "#{ENV['HOME']}/Desktop/animated.gif",
|
10
|
+
:output => "#{ENV['HOME']}/Desktop/animated-#{timestamp}.gif",
|
9
11
|
:reverse => false,
|
10
12
|
:width => 500,
|
11
13
|
:delay => 20,
|
12
|
-
:cloudapp => system("which cloudapp 2>&1 > /dev/null")
|
14
|
+
:cloudapp => system("which cloudapp 2>&1 > /dev/null"),
|
15
|
+
:isight => 0
|
13
16
|
}
|
14
17
|
|
15
18
|
parser = OptionParser.new do |opts|
|
@@ -38,6 +41,10 @@ parser = OptionParser.new do |opts|
|
|
38
41
|
options[:width] = width
|
39
42
|
end
|
40
43
|
|
44
|
+
opts.on("-i", "--isight NUMBER", "Use the iSight camera (2 second delay per capture)") do |isight|
|
45
|
+
options[:isight] = isight
|
46
|
+
end
|
47
|
+
|
41
48
|
opts.on("-h", "--help", "Show this message") do
|
42
49
|
puts opts
|
43
50
|
exit
|
@@ -54,6 +61,41 @@ unless system("which convert 2>&1 > /dev/null")
|
|
54
61
|
exit(1)
|
55
62
|
end
|
56
63
|
|
64
|
+
unless system("which imagesnap 2>&1 > /dev/null")
|
65
|
+
puts "You need to install ImageSnap first.\n\n"
|
66
|
+
puts "If you're on a Mac, this should be as easy as:"
|
67
|
+
puts " brew install imagesnap"
|
68
|
+
exit(1)
|
69
|
+
end
|
70
|
+
|
71
|
+
if options[:isight].to_i > 0
|
72
|
+
isights = options[:isight].to_i
|
73
|
+
isight_path = "/tmp/isight"
|
74
|
+
|
75
|
+
# snap the pictures
|
76
|
+
FileUtils.rm_rf isight_path
|
77
|
+
FileUtils.mkdir isight_path
|
78
|
+
|
79
|
+
isights = options[:isight].to_i
|
80
|
+
|
81
|
+
puts "You have 2 seconds to prepare yourself!"
|
82
|
+
|
83
|
+
for i in 1..isights
|
84
|
+
puts "counting down... 2"
|
85
|
+
sleep(1)
|
86
|
+
puts "counting down... 1"
|
87
|
+
sleep(1)
|
88
|
+
puts "Taking iSight snapshot #{i} of #{isights}"
|
89
|
+
system "cd #{isight_path} && imagesnap #{isight_path}/snapshot-#{i}.jpg"
|
90
|
+
end
|
91
|
+
|
92
|
+
# use them
|
93
|
+
files = Dir.entries(isight_path)
|
94
|
+
files.delete(".")
|
95
|
+
files.delete("..")
|
96
|
+
files = files.collect{|f| "#{isight_path}/#{f}"}
|
97
|
+
end
|
98
|
+
|
57
99
|
unless files
|
58
100
|
puts parser.help
|
59
101
|
exit(1)
|
data/gifme.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'gifme'
|
16
|
-
s.version = '0.0.
|
17
|
-
s.date = '2011-
|
16
|
+
s.version = '0.0.7'
|
17
|
+
s.date = '2011-10-12'
|
18
18
|
s.rubyforge_project = 'gifme'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gifme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Zach Holman
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-10-12 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|