capture 0.0.1 → 0.0.2
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/History.txt +5 -0
- data/Manifest.txt +1 -2
- data/README +10 -0
- data/bin/capture +6 -4
- data/config/hoe.rb +1 -1
- data/lib/capture/screen.rb +3 -1
- data/lib/capture/version.rb +1 -1
- data/script/destroy +0 -0
- data/script/generate +0 -0
- data/script/txt2html +0 -0
- data/website/index.html +14 -4
- data/website/index.txt +9 -2
- metadata +20 -11
- data/README.txt +0 -1
- data/tasks/rspec.rake +0 -21
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
History.txt
|
3
3
|
MIT-LICENSE
|
4
4
|
Manifest.txt
|
5
|
-
README
|
5
|
+
README
|
6
6
|
Rakefile
|
7
7
|
bin/capture
|
8
8
|
config/hoe.rb
|
@@ -21,7 +21,6 @@ spec/spec.opts
|
|
21
21
|
spec/spec_helper.rb
|
22
22
|
tasks/deployment.rake
|
23
23
|
tasks/environment.rake
|
24
|
-
tasks/rspec.rake
|
25
24
|
tasks/website.rake
|
26
25
|
website/images/nikon.jpg
|
27
26
|
website/index.html
|
data/README
ADDED
data/bin/capture
CHANGED
@@ -13,7 +13,8 @@ require 'capture'
|
|
13
13
|
require 'optparse'
|
14
14
|
|
15
15
|
OPTIONS = {
|
16
|
-
:output
|
16
|
+
:output => '~/capture.jpg',
|
17
|
+
:delay => 0
|
17
18
|
}
|
18
19
|
|
19
20
|
parser = OptionParser.new do |opts|
|
@@ -28,13 +29,14 @@ BANNER
|
|
28
29
|
opts.on("-o", "--output=PATH", String,
|
29
30
|
"The output path for the captured screenshot",
|
30
31
|
"Default: ~/capture.jpg") { |OPTIONS[:path]| }
|
32
|
+
opts.on("-d", "--delay=X", Float,
|
33
|
+
"Delay X seconds before screen capture is taken") { |OPTIONS[:delay]| }
|
31
34
|
opts.on("-h", "--help",
|
32
35
|
"Show this help message.") { puts opts; exit }
|
33
36
|
opts.parse!(ARGV)
|
34
37
|
end
|
35
38
|
|
36
39
|
output = OPTIONS[:output]
|
40
|
+
delay = OPTIONS[:delay]
|
37
41
|
|
38
|
-
|
39
|
-
|
40
|
-
Capture::Screen.capture.save(output)
|
42
|
+
Capture::Screen.capture(delay).save(output)
|
data/config/hoe.rb
CHANGED
@@ -2,7 +2,7 @@ require 'capture/version'
|
|
2
2
|
|
3
3
|
AUTHOR = 'Marcus Crafter' # can also be an array of Authors
|
4
4
|
EMAIL = "crafterm@redartisan.com"
|
5
|
-
DESCRIPTION = "Capture is a command line utility tool to take screenshots of your Mac OS X desktop
|
5
|
+
DESCRIPTION = "Capture is a command line utility tool to take screenshots of your Mac OS X desktop via RubyCocoa"
|
6
6
|
GEM_NAME = 'capture' # what ppl will type to install your gem
|
7
7
|
RUBYFORGE_PROJECT = 'capture' # The unix name for your project
|
8
8
|
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
data/lib/capture/screen.rb
CHANGED
@@ -4,7 +4,9 @@ require 'capture/extensions'
|
|
4
4
|
module Capture
|
5
5
|
class Screen
|
6
6
|
|
7
|
-
def self.capture
|
7
|
+
def self.capture(delay = 0)
|
8
|
+
sleep delay if delay > 0
|
9
|
+
|
8
10
|
fade do
|
9
11
|
screenshot = OSX::CGWindowListCreateImage(OSX::CGRectInfinite, OSX::KCGWindowListOptionOnScreenOnly, OSX::KCGNullWindowID, OSX::KCGWindowImageDefault)
|
10
12
|
OSX::CIImage.imageWithCGImage(screenshot)
|
data/lib/capture/version.rb
CHANGED
data/script/destroy
CHANGED
File without changes
|
data/script/generate
CHANGED
File without changes
|
data/script/txt2html
CHANGED
File without changes
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>capture</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/capture"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/capture" class="numbers">0.0.
|
36
|
+
<a href="http://rubyforge.org/projects/capture" class="numbers">0.0.2</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘capture’</h1>
|
39
39
|
|
@@ -52,14 +52,17 @@
|
|
52
52
|
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">capture</span></pre></p>
|
53
53
|
|
54
54
|
|
55
|
-
<h2>
|
55
|
+
<h2>Usage</h2>
|
56
56
|
|
57
57
|
|
58
|
-
<pre>$> capture</pre>
|
58
|
+
<pre>$> capture [options]</pre>
|
59
59
|
|
60
60
|
<p>By default ‘capture’ will save the desktop screenshot to a file named ~/capture.jpg. You can set a target filename using the -o parameter.</p>
|
61
61
|
|
62
62
|
|
63
|
+
<p>Additionally, you can specify a delay parameter via ‘-d X’, where ‘capture’ will delay the creation of the screenshot X seconds so that you may hide or re-arrange windows.</p>
|
64
|
+
|
65
|
+
|
63
66
|
<p>During the capture, the desktop screen will fade in and out to provide feedback of the screen capture taking place.</p>
|
64
67
|
|
65
68
|
|
@@ -70,6 +73,13 @@
|
|
70
73
|
RDocs <a href="http://capture.rubyforge.org/rdoc/"><span class="caps">API</span></a> is also available.</p>
|
71
74
|
|
72
75
|
|
76
|
+
<h2>Requirements</h2>
|
77
|
+
|
78
|
+
|
79
|
+
<p>Mac <span class="caps">OS X</span> Leopard (ie 10.5.x).
|
80
|
+
RubyCocoa (Mac <span class="caps">OS X</span> Leopard includes RubyCocoa by default).</p>
|
81
|
+
|
82
|
+
|
73
83
|
<h2>License</h2>
|
74
84
|
|
75
85
|
|
@@ -87,7 +97,7 @@ RDocs <a href="http://capture.rubyforge.org/rdoc/"><span class="caps">API</span>
|
|
87
97
|
|
88
98
|
<p>Special thanks to <a href="http://www.flickr.com/photos/dsevilla/249202834/">DSevilla</a> for the camera image used in the project licensed under <a href="http://creativecommons.org/licenses/by-nc/2.0/">creative commons</a>.</p>
|
89
99
|
<p class="coda">
|
90
|
-
<a href="crafterm@redartisan.com">Marcus Crafter</a>,
|
100
|
+
<a href="crafterm@redartisan.com">Marcus Crafter</a>, 19th January 2008<br>
|
91
101
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
92
102
|
</p>
|
93
103
|
</div>
|
data/website/index.txt
CHANGED
@@ -12,12 +12,14 @@ h2. Installing
|
|
12
12
|
|
13
13
|
<pre syntax="ruby">sudo gem install capture</pre>
|
14
14
|
|
15
|
-
h2.
|
15
|
+
h2. Usage
|
16
16
|
|
17
|
-
<pre>$> capture</pre>
|
17
|
+
<pre>$> capture [options]</pre>
|
18
18
|
|
19
19
|
By default 'capture' will save the desktop screenshot to a file named ~/capture.jpg. You can set a target filename using the -o parameter.
|
20
20
|
|
21
|
+
Additionally, you can specify a delay parameter via '-d X', where 'capture' will delay the creation of the screenshot X seconds so that you may hide or re-arrange windows.
|
22
|
+
|
21
23
|
During the capture, the desktop screen will fade in and out to provide feedback of the screen capture taking place.
|
22
24
|
|
23
25
|
h2. Code
|
@@ -25,6 +27,11 @@ h2. Code
|
|
25
27
|
The trunk repository is <code>svn://rubyforge.org/var/svn/capture/trunk</code> for anonymous access.
|
26
28
|
RDocs "API":http://capture.rubyforge.org/rdoc/ is also available.
|
27
29
|
|
30
|
+
h2. Requirements
|
31
|
+
|
32
|
+
Mac OS X Leopard (ie 10.5.x).
|
33
|
+
RubyCocoa (Mac OS X Leopard includes RubyCocoa by default).
|
34
|
+
|
28
35
|
h2. License
|
29
36
|
|
30
37
|
This code is free to use under the terms of the MIT license.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capture
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Crafter
|
@@ -9,11 +9,20 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-11-09 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
|
-
dependencies:
|
15
|
-
|
16
|
-
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.3.3
|
24
|
+
version:
|
25
|
+
description: Capture is a command line utility tool to take screenshots of your Mac OS X desktop via RubyCocoa
|
17
26
|
email: crafterm@redartisan.com
|
18
27
|
executables:
|
19
28
|
- capture
|
@@ -22,14 +31,13 @@ extensions: []
|
|
22
31
|
extra_rdoc_files:
|
23
32
|
- History.txt
|
24
33
|
- Manifest.txt
|
25
|
-
- README.txt
|
26
34
|
- website/index.txt
|
27
35
|
files:
|
28
36
|
- .gitignore
|
29
37
|
- History.txt
|
30
38
|
- MIT-LICENSE
|
31
39
|
- Manifest.txt
|
32
|
-
- README
|
40
|
+
- README
|
33
41
|
- Rakefile
|
34
42
|
- bin/capture
|
35
43
|
- config/hoe.rb
|
@@ -48,7 +56,6 @@ files:
|
|
48
56
|
- spec/spec_helper.rb
|
49
57
|
- tasks/deployment.rake
|
50
58
|
- tasks/environment.rake
|
51
|
-
- tasks/rspec.rake
|
52
59
|
- tasks/website.rake
|
53
60
|
- website/images/nikon.jpg
|
54
61
|
- website/index.html
|
@@ -58,6 +65,8 @@ files:
|
|
58
65
|
- website/template.rhtml
|
59
66
|
has_rdoc: true
|
60
67
|
homepage: http://capture.rubyforge.org
|
68
|
+
licenses: []
|
69
|
+
|
61
70
|
post_install_message:
|
62
71
|
rdoc_options:
|
63
72
|
- --main
|
@@ -79,9 +88,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
88
|
requirements: []
|
80
89
|
|
81
90
|
rubyforge_project: capture
|
82
|
-
rubygems_version: 1.
|
91
|
+
rubygems_version: 1.3.5
|
83
92
|
signing_key:
|
84
|
-
specification_version:
|
85
|
-
summary: Capture is a command line utility tool to take screenshots of your Mac OS X desktop
|
93
|
+
specification_version: 3
|
94
|
+
summary: Capture is a command line utility tool to take screenshots of your Mac OS X desktop via RubyCocoa
|
86
95
|
test_files: []
|
87
96
|
|
data/README.txt
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
README
|
data/tasks/rspec.rake
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'spec'
|
3
|
-
rescue LoadError
|
4
|
-
require 'rubygems'
|
5
|
-
require 'spec'
|
6
|
-
end
|
7
|
-
begin
|
8
|
-
require 'spec/rake/spectask'
|
9
|
-
rescue LoadError
|
10
|
-
puts <<-EOS
|
11
|
-
To use rspec for testing you must install rspec gem:
|
12
|
-
gem install rspec
|
13
|
-
EOS
|
14
|
-
exit(0)
|
15
|
-
end
|
16
|
-
|
17
|
-
desc "Run the specs under spec/models"
|
18
|
-
Spec::Rake::SpecTask.new do |t|
|
19
|
-
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
-
t.spec_files = FileList['spec/*_spec.rb']
|
21
|
-
end
|