directory_watcher 0.1.3 → 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/Manifest.txt +4 -0
- data/Rakefile +39 -0
- data/lib/directory_watcher.rb +9 -1
- metadata +22 -10
data/Manifest.txt
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
|
2
|
+
require 'hoe'
|
3
|
+
require 'directory_watcher'
|
4
|
+
|
5
|
+
PKG_VERSION = ENV['VERSION'] || DirectoryWatcher::VERSION
|
6
|
+
|
7
|
+
Hoe.new('directory_watcher', PKG_VERSION) do |proj|
|
8
|
+
proj.rubyforge_name = 'codeforpeople'
|
9
|
+
proj.author = 'Tim Pease'
|
10
|
+
proj.email = 'tim.pease@gmail.com'
|
11
|
+
proj.url = nil
|
12
|
+
proj.extra_deps = []
|
13
|
+
proj.summary = 'A class for watching files within a directory and generating events when those files change'
|
14
|
+
proj.description = <<-DESC
|
15
|
+
The directory watcher operates by scanning a directory at some interval and
|
16
|
+
generating a list of files based on a user supplied glob pattern. As the file
|
17
|
+
list changes from one interval to the next, events are generated and
|
18
|
+
dispatched to registered observers. Three types of events are supported --
|
19
|
+
added, modified, and removed.
|
20
|
+
DESC
|
21
|
+
proj.changes = <<-CHANGES
|
22
|
+
Version 0.1.4 / 2007-08-20
|
23
|
+
* added version information to the class
|
24
|
+
|
25
|
+
Version 0.1.3 / 2006-12-07
|
26
|
+
* fixed documentation generation bug
|
27
|
+
|
28
|
+
Version 0.1.2 / 2006-11-26
|
29
|
+
* fixed warnings
|
30
|
+
|
31
|
+
Version 0.1.1 / 2006-11-10
|
32
|
+
* removed explicit dependency on hoe
|
33
|
+
|
34
|
+
Version 0.1.0 / 2006-11-10
|
35
|
+
* initial release
|
36
|
+
CHANGES
|
37
|
+
end
|
38
|
+
|
39
|
+
# EOF
|
data/lib/directory_watcher.rb
CHANGED
@@ -152,6 +152,8 @@ require 'observer'
|
|
152
152
|
class DirectoryWatcher
|
153
153
|
include Observable
|
154
154
|
|
155
|
+
VERSION = '0.1.4' # :nodoc:
|
156
|
+
|
155
157
|
#
|
156
158
|
# An +Event+ structure contains the _type_ of the event and the file _path_
|
157
159
|
# to which the event pertains. The type can be one of the following:
|
@@ -164,6 +166,12 @@ class DirectoryWatcher
|
|
164
166
|
#
|
165
167
|
Event = Struct.new :type, :path
|
166
168
|
|
169
|
+
# :stopdoc:
|
170
|
+
class Event
|
171
|
+
def to_s( ) "#{type} '#{path}'" end
|
172
|
+
end
|
173
|
+
# :startdoc:
|
174
|
+
|
167
175
|
#
|
168
176
|
# call-seq:
|
169
177
|
# DirectoryWatcher.new( directory, options )
|
@@ -192,7 +200,7 @@ class DirectoryWatcher
|
|
192
200
|
|
193
201
|
if Kernel.test(?e, @dir)
|
194
202
|
unless Kernel.test(?d, @dir)
|
195
|
-
raise ArgumentError, "'#{dir}' is not a directory"
|
203
|
+
raise ArgumentError, "'#{@dir}' is not a directory"
|
196
204
|
end
|
197
205
|
else
|
198
206
|
Dir.create @dir
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.
|
2
|
+
rubygems_version: 0.9.4
|
3
3
|
specification_version: 1
|
4
4
|
name: directory_watcher
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.1.
|
7
|
-
date:
|
6
|
+
version: 0.1.4
|
7
|
+
date: 2007-08-20 00:00:00 -06:00
|
8
8
|
summary: A class for watching files within a directory and generating events when those files change
|
9
9
|
require_paths:
|
10
10
|
- lib
|
11
11
|
email: tim.pease@gmail.com
|
12
12
|
homepage:
|
13
|
-
rubyforge_project: codeforpeople
|
13
|
+
rubyforge_project: codeforpeople
|
14
14
|
description: The directory watcher operates by scanning a directory at some interval and generating a list of files based on a user supplied glob pattern. As the file list changes from one interval to the next, events are generated and dispatched to registered observers. Three types of events are supported -- added, modified, and removed.
|
15
15
|
autorequire:
|
16
16
|
default_executable:
|
@@ -29,19 +29,31 @@ post_install_message:
|
|
29
29
|
authors:
|
30
30
|
- Tim Pease
|
31
31
|
files:
|
32
|
+
- Manifest.txt
|
33
|
+
- Rakefile
|
32
34
|
- README.txt
|
33
35
|
- lib/directory_watcher.rb
|
34
36
|
test_files: []
|
35
37
|
|
36
|
-
rdoc_options:
|
37
|
-
|
38
|
-
|
39
|
-
|
38
|
+
rdoc_options:
|
39
|
+
- --main
|
40
|
+
- README.txt
|
41
|
+
extra_rdoc_files:
|
42
|
+
- Manifest.txt
|
43
|
+
- README.txt
|
40
44
|
executables: []
|
41
45
|
|
42
46
|
extensions: []
|
43
47
|
|
44
48
|
requirements: []
|
45
49
|
|
46
|
-
dependencies:
|
47
|
-
|
50
|
+
dependencies:
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: hoe
|
53
|
+
version_requirement:
|
54
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: 1.2.2
|
59
|
+
version:
|