filewatcher 0.1.8 → 0.1.9
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.rdoc +19 -17
- data/VERSION +1 -1
- data/lib/filewatcher.rb +5 -1
- metadata +6 -6
data/README.rdoc
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Simple file watcher. Monitors changes in files by polling.
|
|
4
4
|
|
|
5
|
+
= Install
|
|
6
|
+
|
|
7
|
+
Needs Ruby and Rubygems:
|
|
8
|
+
|
|
9
|
+
$ [sudo] gem install filewatcher
|
|
10
|
+
|
|
5
11
|
= Command line utility
|
|
6
12
|
|
|
7
13
|
Filewatcher scans filesystem and execute shell commands when files changes.
|
|
@@ -12,27 +18,28 @@ Where
|
|
|
12
18
|
filename: filename(s) to scan.
|
|
13
19
|
shell command: shell command to execute when file changes on disk.
|
|
14
20
|
|
|
15
|
-
= Examples
|
|
21
|
+
= Examples
|
|
16
22
|
|
|
17
23
|
Run the echo command when the file myfile is changed:
|
|
18
24
|
|
|
19
25
|
$ filewatcher "myfile" "echo 'myfile has changed'"
|
|
20
26
|
|
|
21
|
-
Run
|
|
27
|
+
Run any javascript in current folder when it is updated on Linux/OSX:
|
|
28
|
+
$ filewatcher *.js "node $FILENAME"
|
|
22
29
|
|
|
23
|
-
|
|
30
|
+
In Windows Powershell:
|
|
24
31
|
|
|
25
|
-
|
|
32
|
+
> filewatcher *.js "node %FILENAME%"
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
Run the ruby script when it is changed:
|
|
28
35
|
|
|
29
|
-
$ filewatcher -
|
|
36
|
+
$ filewatcher -e ruby-script.rb
|
|
30
37
|
|
|
31
|
-
|
|
38
|
+
Works with ruby, perl, python and awk by detecting file extensions.
|
|
32
39
|
|
|
33
|
-
Print a list of all files matching *.css
|
|
40
|
+
Print a list of all files matching *.css first and the print filename when a file is beeing updated:
|
|
34
41
|
|
|
35
|
-
$ filewatcher -l *.css
|
|
42
|
+
$ filewatcher -l *.css 'echo file: $FILENAME'
|
|
36
43
|
|
|
37
44
|
= Available enviroment variables
|
|
38
45
|
|
|
@@ -43,8 +50,9 @@ has to be enclosed in single quotes. To run node whenever a javascript file is u
|
|
|
43
50
|
|
|
44
51
|
The environment variables $FILEPATH and $FILEDIR is also available.
|
|
45
52
|
|
|
46
|
-
|
|
47
|
-
|
|
53
|
+
= Command line options
|
|
54
|
+
|
|
55
|
+
--interval, -i <f>: Interval in seconds to scan filesystem. Defaults to 0.5 seconds.
|
|
48
56
|
--exec, -e: Execute file as a script when file is updated.
|
|
49
57
|
--recurse, -r <s>: Recurse into the directory, watching everything matching 'expression'
|
|
50
58
|
--include, -n <s>: Include files (default: *)
|
|
@@ -53,12 +61,6 @@ Options:
|
|
|
53
61
|
--version, -v: Print version and exit
|
|
54
62
|
--help, -h: Show this message
|
|
55
63
|
|
|
56
|
-
= Install
|
|
57
|
-
|
|
58
|
-
sudo gem install filewatcher
|
|
59
|
-
|
|
60
|
-
You need ruby and rubygems installed.
|
|
61
|
-
|
|
62
64
|
= Ruby API
|
|
63
65
|
|
|
64
66
|
Examples:
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.1.
|
|
1
|
+
0.1.9
|
data/lib/filewatcher.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: filewatcher
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.9
|
|
5
5
|
prerelease:
|
|
6
6
|
platform: ruby
|
|
7
7
|
authors:
|
|
@@ -9,11 +9,11 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2013-
|
|
12
|
+
date: 2013-07-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: thoughtbot-shoulda
|
|
16
|
-
requirement: &
|
|
16
|
+
requirement: &70294480940300 !ruby/object:Gem::Requirement
|
|
17
17
|
none: false
|
|
18
18
|
requirements:
|
|
19
19
|
- - ! '>='
|
|
@@ -21,10 +21,10 @@ dependencies:
|
|
|
21
21
|
version: '0'
|
|
22
22
|
type: :development
|
|
23
23
|
prerelease: false
|
|
24
|
-
version_requirements: *
|
|
24
|
+
version_requirements: *70294480940300
|
|
25
25
|
- !ruby/object:Gem::Dependency
|
|
26
26
|
name: trollop
|
|
27
|
-
requirement: &
|
|
27
|
+
requirement: &70294480939160 !ruby/object:Gem::Requirement
|
|
28
28
|
none: false
|
|
29
29
|
requirements:
|
|
30
30
|
- - ! '>='
|
|
@@ -32,7 +32,7 @@ dependencies:
|
|
|
32
32
|
version: 1.16.2
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
|
-
version_requirements: *
|
|
35
|
+
version_requirements: *70294480939160
|
|
36
36
|
description: Detect changes in files.
|
|
37
37
|
email: thomas.flemming@gmail.com
|
|
38
38
|
executables:
|