captured 0.1.7 → 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.
@@ -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 => Captured.auto_detect_watch_path,
8
+ :watch_pattern => Captured.guess_watch_path,
9
9
  :growl_path => "/usr/local/bin/growlnotify" }
10
10
 
11
11
  OptionParser.new do |opts|
@@ -6,12 +6,15 @@ class Captured
6
6
  "#{ENV['HOME']}/.captured.yml"
7
7
  end
8
8
 
9
- def self.auto_detect_watch_path
9
+ def self.guess_watch_path
10
10
  if `sw_vers | awk '/ProductVersion:/ {print $2}'`.strip.start_with? "10.5"
11
- "Picture**.png"
12
- else
13
- "Screenshot**.png"
11
+ "Picture**.png"
12
+ else
13
+ "Screenshot**.png"
14
14
  end
15
+ rescue => e
16
+ puts e
17
+ "Screenshot**.png"
15
18
  end
16
19
 
17
20
  def self.run_once!(options)
@@ -8,7 +8,6 @@ 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
12
11
  paths.each do |path|
13
12
  Dir["#{path}#{@options[:watch_pattern]}"].each do |file|
14
13
  self.add file, state
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.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Sexton