csexton-captured 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +2 -0
  2. data/bin/captured +1 -1
  3. data/lib/captured.rb +11 -0
  4. 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 => "Screenshot**.png",
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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csexton-captured
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Sexton