filewatcher 0.1.2 → 0.1.4
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/VERSION +1 -1
- data/bin/filewatcher +4 -8
- metadata +6 -6
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.4
|
data/bin/filewatcher
CHANGED
|
@@ -4,7 +4,7 @@ require 'filewatcher'
|
|
|
4
4
|
require 'trollop'
|
|
5
5
|
|
|
6
6
|
options = Trollop::options do
|
|
7
|
-
version "filewatcher, version 0.1.
|
|
7
|
+
version "filewatcher, version 0.1.4 by Thomas Flemming 2011"
|
|
8
8
|
banner <<-EOS
|
|
9
9
|
Filewatcher scans filesystem and execute shell commands when files changes.
|
|
10
10
|
|
|
@@ -20,16 +20,12 @@ Examples:
|
|
|
20
20
|
|
|
21
21
|
Options:
|
|
22
22
|
EOS
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
opt :interval, "Interval to scan filesystem. Defaults to 0.5 seconds.", :short => 'i', :type => :float, :default => 0.5
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
Trollop::die "must have one or two arguments" if(ARGV.size == 0 or ARGV.size > 2)
|
|
27
28
|
|
|
28
|
-
interval = 0.5
|
|
29
|
-
if(options[:interval] > 0.0)then
|
|
30
|
-
interval = options[:interval]
|
|
31
|
-
end
|
|
32
|
-
|
|
33
29
|
files = []
|
|
34
30
|
ARGV[0].split(/\s+/).each do |arg|
|
|
35
31
|
Dir.glob(arg).each do |file|
|
|
@@ -37,7 +33,7 @@ ARGV[0].split(/\s+/).each do |arg|
|
|
|
37
33
|
end
|
|
38
34
|
end
|
|
39
35
|
|
|
40
|
-
FileWatcher.new(files).watch(interval) do |filename|
|
|
36
|
+
FileWatcher.new(files).watch(options[:interval]) do |filename|
|
|
41
37
|
if(ARGV[1])then
|
|
42
38
|
system(ARGV[1])
|
|
43
39
|
else
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: filewatcher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
5
|
-
prerelease:
|
|
4
|
+
hash: 19
|
|
5
|
+
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 1
|
|
9
|
-
-
|
|
10
|
-
version: 0.1.
|
|
9
|
+
- 4
|
|
10
|
+
version: 0.1.4
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Thomas Flemming
|
|
@@ -15,7 +15,7 @@ autorequire:
|
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
17
|
|
|
18
|
-
date: 2011-01-
|
|
18
|
+
date: 2011-01-26 00:00:00 +01:00
|
|
19
19
|
default_executable: filewatcher
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
requirements: []
|
|
97
97
|
|
|
98
98
|
rubyforge_project:
|
|
99
|
-
rubygems_version: 1.
|
|
99
|
+
rubygems_version: 1.4.2
|
|
100
100
|
signing_key:
|
|
101
101
|
specification_version: 3
|
|
102
102
|
summary: Simple filewatcher.
|