csexton-captured 0.1.6 → 0.1.8
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.markdown +2 -0
- data/bin/captured +1 -1
- data/lib/captured.rb +11 -0
- metadata +1 -1
data/README.markdown
CHANGED
@@ -23,6 +23,7 @@ The simplest way is to use the scp type.
|
|
23
23
|
* url - the public url to the remote host+path
|
24
24
|
* path - the remote path to upload to
|
25
25
|
|
26
|
+
<pre>
|
26
27
|
upload:
|
27
28
|
type: scp
|
28
29
|
user: user
|
@@ -30,6 +31,7 @@ The simplest way is to use the scp type.
|
|
30
31
|
host: example.com
|
31
32
|
path: path/to/captured/
|
32
33
|
url: "http://example.com/captured/"
|
34
|
+
</pre>
|
33
35
|
|
34
36
|
|
35
37
|
|
data/bin/captured
CHANGED
@@ -5,7 +5,7 @@ require "#{File.dirname(__FILE__)}/../lib/captured"
|
|
5
5
|
|
6
6
|
options = {:config_file => "#{ENV['HOME']}/.captured.yml",
|
7
7
|
:watch_path => "#{ENV['HOME']}/Desktop/",
|
8
|
-
:watch_pattern =>
|
8
|
+
:watch_pattern => Captured.guess_watch_path,
|
9
9
|
:growl_path => "/usr/local/bin/growlnotify" }
|
10
10
|
|
11
11
|
OptionParser.new do |opts|
|
data/lib/captured.rb
CHANGED
@@ -6,6 +6,17 @@ class Captured
|
|
6
6
|
"#{ENV['HOME']}/.captured.yml"
|
7
7
|
end
|
8
8
|
|
9
|
+
def self.guess_watch_path
|
10
|
+
if `sw_vers | awk '/ProductVersion:/ {print $2}'`.strip.start_with? "10.5"
|
11
|
+
"Picture**.png"
|
12
|
+
else
|
13
|
+
"Screenshot**.png"
|
14
|
+
end
|
15
|
+
rescue => e
|
16
|
+
puts e
|
17
|
+
"Screenshot**.png"
|
18
|
+
end
|
19
|
+
|
9
20
|
def self.run_once!(options)
|
10
21
|
watch_path = options[:watch_path] || "#{ENV['HOME']}/Desktop/"
|
11
22
|
Dir["#{watch_path}#{options[:watch_pattern]}"].each do |file|
|