smparkes-watchr 0.5.7 → 0.5.7.1
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 +20 -9
- data/lib/watchr/event_handlers/em.rb +1 -7
- data/watchr.gemspec +1 -1
- metadata +1 -1
data/README.rdoc
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
=== Summary
|
2
2
|
|
3
|
-
This is a fork of the Watchr gem at
|
3
|
+
This is a fork of the Watchr gem at http://github.com/mynyml/watchr.
|
4
4
|
|
5
5
|
The are a number of differences. It's been ported to EventMachine for
|
6
6
|
file-events and has some extensions for how watches can be written.
|
7
7
|
|
8
|
+
To install, you can clone the repo (http://github.com/smparkes/watchr)
|
9
|
+
or install the gem, <tt>smparkes-watchr</tt>. Note that you'll need my
|
10
|
+
copy of EventMachine (http://github.com/smparkes/eventmachine or
|
11
|
+
the <tt>smparkes-eventmachine</tt> gem) for directory watches to work
|
12
|
+
well. (Hoping these changes will get pulled upstream ...)
|
13
|
+
|
8
14
|
== EventMachine
|
9
15
|
|
10
16
|
Not much to say. It supports EM as well as Rev. The default is still
|
@@ -13,7 +19,7 @@ Rev. To use EventMachine, after installing the EM gem, I just add
|
|
13
19
|
begin; require 'watchr/event_handlers/em'; rescue LoadError; end
|
14
20
|
|
15
21
|
to my <tt>watchr.cnf</tt>. It'll use the first required backend, or
|
16
|
-
Rev if none are (and Rev is installed). There may be better ways to
|
22
|
+
Rev if none are found (and Rev is installed). There may be better ways to
|
17
23
|
do this.
|
18
24
|
|
19
25
|
=== Event processing extensions
|
@@ -50,14 +56,15 @@ to make my <tt>watchr.cnf</tt> work:
|
|
50
56
|
The purpose of the first watch is to cause watchr to refresh when
|
51
57
|
directories change. This allows new files to be picked up. The watch
|
52
58
|
pattern matches all files in the current directory tree (though not
|
53
|
-
<tt>.</tt> itself), and watches for
|
54
|
-
an extra lambda that is processed
|
55
|
-
directories will get watches put on
|
56
|
-
|
59
|
+
<tt>.</tt> itself; probably should), and watches for
|
60
|
+
<tt>:modified</tt> events. It adds an extra lambda that is processed
|
61
|
+
while looking at file paths: only directories will get watches put on
|
62
|
+
them. (Otherwise <tt>%r(.*)</tt> would put watches on every
|
63
|
+
file/directory in the tree, which seems kinda bad.)
|
57
64
|
|
58
65
|
The second watch looks for HAML files in my public directory and
|
59
66
|
automatically converts them to HTML. These are static files, not
|
60
|
-
served by an app server like Rails
|
67
|
+
served by an app server like Rails: even with static files, I hate
|
61
68
|
writing raw HTML. The extension here is that instead of a single event
|
62
69
|
type, I can pass an array. In addition to the <tt>:modified</tt>,
|
63
70
|
event, this will get called when watchr notes that a new file of this
|
@@ -75,8 +82,12 @@ first started, similar to what autotest does.
|
|
75
82
|
|
76
83
|
1. Batch up specs instead of running them individually (not a big deal for jazrb and haml; a big detail for rspec)
|
77
84
|
|
78
|
-
1.
|
85
|
+
1. Filter spec runs that run as individual commands so they look like a single command (requires batching)
|
86
|
+
|
87
|
+
1. Integrate upstream (if they want it)
|
79
88
|
|
80
89
|
1. Move directory watch into watchr itself
|
81
90
|
|
82
|
-
1. Handle user interrupt processing more systematically
|
91
|
+
1. Handle user interrupt processing more systematically
|
92
|
+
|
93
|
+
1. Perhaps add the event type to the watch callback, since multiple events can fire now. But haven't neede this.
|
@@ -38,6 +38,7 @@ module Watchr
|
|
38
38
|
|
39
39
|
def file_modified
|
40
40
|
SingleFileWatcher.handler.notify(path, type)
|
41
|
+
update_reference_times
|
41
42
|
end
|
42
43
|
|
43
44
|
def file_moved
|
@@ -50,13 +51,6 @@ module Watchr
|
|
50
51
|
SingleFileWatcher.handler.notify(path, type)
|
51
52
|
end
|
52
53
|
|
53
|
-
# Callback. Called on file change event
|
54
|
-
# Delegates to Controller#update, passing in path and event type
|
55
|
-
def on_change
|
56
|
-
self.class.handler.notify(path, type)
|
57
|
-
update_reference_times unless type == :deleted
|
58
|
-
end
|
59
|
-
|
60
54
|
private
|
61
55
|
|
62
56
|
def update_reference_times
|
data/watchr.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = 'smparkes-watchr'
|
4
|
-
s.version = '0.5.7'
|
4
|
+
s.version = '0.5.7.1'
|
5
5
|
s.summary = "Modern continious testing (flexible alternative to autotest)"
|
6
6
|
s.description = "Modern continious testing (flexible alternative to autotest)."
|
7
7
|
s.author = "mynyml"
|