filewatch 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/filewatch/tail.rb +9 -1
  2. metadata +21 -20
@@ -10,6 +10,8 @@ module FileWatch
10
10
 
11
11
  attr_accessor :logger
12
12
 
13
+ class NoSinceDBPathGiven < StandardError; end
14
+
13
15
  public
14
16
  def initialize(opts={})
15
17
  if opts[:logger]
@@ -28,11 +30,17 @@ module FileWatch
28
30
  @statcache = {}
29
31
  @opts = {
30
32
  :sincedb_write_interval => 10,
31
- :sincedb_path => ENV["SINCEDB_PATH"] || File.join(ENV["HOME"], ".sincedb"),
32
33
  :stat_interval => 1,
33
34
  :discover_interval => 5,
34
35
  :exclude => [],
35
36
  }.merge(opts)
37
+ if !@opts.include?(:sincedb_path)
38
+ @opts[:sincedb_path] = File.join(ENV["HOME"], ".sincedb") if ENV.include?("HOME")
39
+ @opts[:sincedb_path] = ENV["SINCEDB_PATH"] if ENV.include?("SINCEDB_PATH")
40
+ end
41
+ if !@opts.include?(:sincedb_path)
42
+ raise NoSinceDBPathGiven.new("No HOME or SINCEDB_PATH set in environment. I need one of these set so I can keep track of the files I am following.")
43
+ end
36
44
  @watch.exclude(@opts[:exclude])
37
45
 
38
46
  _sincedb_open
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: filewatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-01-26 00:00:00.000000000 Z
13
+ date: 2012-08-21 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Watch files and directories in ruby. Also supports tailing and glob file
16
16
  patterns.
@@ -22,31 +22,31 @@ executables:
22
22
  extensions: []
23
23
  extra_rdoc_files: []
24
24
  files:
25
- - lib/filewatch/buftok.rb
26
25
  - lib/filewatch/tail.rb
26
+ - lib/filewatch/buftok.rb
27
27
  - lib/filewatch/watch.rb
28
- - test/globtail/test1.data
29
- - test/globtail/test8.sh
30
- - test/globtail/test10.sh
31
- - test/globtail/test8.data
32
- - test/globtail/test6.data
33
- - test/globtail/test2.sh
34
- - test/globtail/test4.data
35
- - test/globtail/test7.sh
36
- - test/globtail/test7.data
37
28
  - test/globtail/test9.data
38
- - test/globtail/test5.data
39
- - test/globtail/test9.sh
29
+ - test/globtail/test10.sh
30
+ - test/globtail/test3.sh
31
+ - test/globtail/test8.sh
40
32
  - test/globtail/test6.sh
33
+ - test/globtail/test4.data
41
34
  - test/globtail/framework.sh
42
- - test/globtail/test5.sh
43
- - test/globtail/test3.data
44
- - test/globtail/test3.sh
45
- - test/globtail/test4.sh
46
- - test/globtail/test10.data
47
35
  - test/globtail/Makefile
36
+ - test/globtail/test5.data
37
+ - test/globtail/test6.data
38
+ - test/globtail/test7.data
48
39
  - test/globtail/test2.data
40
+ - test/globtail/test5.sh
41
+ - test/globtail/test10.data
42
+ - test/globtail/test8.data
49
43
  - test/globtail/test1.sh
44
+ - test/globtail/test4.sh
45
+ - test/globtail/test3.data
46
+ - test/globtail/test1.data
47
+ - test/globtail/test7.sh
48
+ - test/globtail/test2.sh
49
+ - test/globtail/test9.sh
50
50
  - bin/globtail
51
51
  homepage: https://github.com/jordansissel/ruby-filewatch
52
52
  licenses: []
@@ -69,8 +69,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  version: '0'
70
70
  requirements: []
71
71
  rubyforge_project:
72
- rubygems_version: 1.8.10
72
+ rubygems_version: 1.8.24
73
73
  signing_key:
74
74
  specification_version: 3
75
75
  summary: filewatch - file watching for ruby
76
76
  test_files: []
77
+ has_rdoc: