captured 0.1.6 → 0.1.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.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.auto_detect_watch_path,
9
9
  :growl_path => "/usr/local/bin/growlnotify" }
10
10
 
11
11
  OptionParser.new do |opts|
@@ -8,6 +8,7 @@ class FileTracker
8
8
 
9
9
  def scan(paths, state)
10
10
  puts "Scanning #{paths}"
11
+ os_version = `sw_vers | awk '/ProductVersion:/ {print $2}'`.strip
11
12
  paths.each do |path|
12
13
  Dir["#{path}#{@options[:watch_pattern]}"].each do |file|
13
14
  self.add file, state
data/lib/captured.rb CHANGED
@@ -6,6 +6,14 @@ class Captured
6
6
  "#{ENV['HOME']}/.captured.yml"
7
7
  end
8
8
 
9
+ def self.auto_detect_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
+ end
16
+
9
17
  def self.run_once!(options)
10
18
  watch_path = options[:watch_path] || "#{ENV['HOME']}/Desktop/"
11
19
  Dir["#{watch_path}#{options[:watch_pattern]}"].each do |file|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: captured
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Sexton