rb-inotify 0.8.8 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.8
1
+ 0.9.0
data/lib/rb-inotify.rb CHANGED
@@ -13,5 +13,5 @@ module INotify
13
13
  # An array containing the version number of rb-inotify.
14
14
  # The numbers in the array are the major, minor, and patch versions,
15
15
  # respectively.
16
- VERSION = [0, 8, 8]
16
+ VERSION = [0, 9, 0]
17
17
  end
@@ -8,7 +8,7 @@ module INotify
8
8
  # @private
9
9
  module Native
10
10
  extend FFI::Library
11
- ffi_lib "c"
11
+ ffi_lib FFI::Library::LIBC
12
12
 
13
13
  # The C struct describing an inotify event.
14
14
  #
@@ -189,7 +189,8 @@ module INotify
189
189
  def watch(path, *flags, &callback)
190
190
  return Watcher.new(self, path, *flags, &callback) unless flags.include?(:recursive)
191
191
 
192
- Dir.glob(File.join(path, '*'), File::FNM_DOTMATCH).each do |d|
192
+ Dir.new(path).each do |base|
193
+ d = File.join(path, base)
193
194
  binary_d = d.respond_to?(:force_encoding) ? d.dup.force_encoding('BINARY') : d
194
195
  next if binary_d =~ /\/\.\.?$/ # Current or parent directory
195
196
  watch(d, *flags, &callback) if !RECURSIVE_BLACKLIST.include?(d) && File.directory?(d)
@@ -247,11 +248,11 @@ module INotify
247
248
  FFI.errno)
248
249
  end
249
250
 
250
- private
251
-
252
251
  # Blocks until there are one or more filesystem events
253
252
  # that this notifier has watchers registered for.
254
253
  # Once there are events, returns their {Event} objects.
254
+ #
255
+ # {#run} or {#process} are ususally preferable to calling this directly.
255
256
  def read_events
256
257
  size = 64 * Native::Event.size
257
258
  tries = 1
@@ -279,6 +280,8 @@ module INotify
279
280
  events
280
281
  end
281
282
 
283
+ private
284
+
282
285
  # Same as IO#readpartial, or as close as we need.
283
286
  def readpartial(size)
284
287
  # Use Ruby's readpartial if possible, to avoid blocking other threads.
data/rb-inotify.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{rb-inotify}
8
- s.version = "0.8.8"
7
+ s.name = "rb-inotify"
8
+ s.version = "0.9.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Nathan Weizenbaum"]
12
- s.date = %q{2011-09-27}
13
- s.description = %q{A Ruby wrapper for Linux's inotify, using FFI}
14
- s.email = %q{nex342@gmail.com}
12
+ s.date = "2013-01-12"
13
+ s.description = "A Ruby wrapper for Linux's inotify, using FFI"
14
+ s.email = "nex342@gmail.com"
15
15
  s.extra_rdoc_files = [
16
16
  "README.md"
17
17
  ]
@@ -29,13 +29,12 @@ Gem::Specification.new do |s|
29
29
  "lib/rb-inotify/watcher.rb",
30
30
  "rb-inotify.gemspec"
31
31
  ]
32
- s.homepage = %q{http://github.com/nex3/rb-inotify}
32
+ s.homepage = "http://github.com/nex3/rb-inotify"
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = %q{1.3.7}
35
- s.summary = %q{A Ruby wrapper for Linux's inotify, using FFI}
34
+ s.rubygems_version = "1.8.24"
35
+ s.summary = "A Ruby wrapper for Linux's inotify, using FFI"
36
36
 
37
37
  if s.respond_to? :specification_version then
38
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
39
38
  s.specification_version = 3
40
39
 
41
40
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
metadata CHANGED
@@ -1,61 +1,55 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rb-inotify
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 8
8
- - 8
9
- version: 0.8.8
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Nathan Weizenbaum
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-09-27 00:00:00 -07:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2013-01-12 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: ffi
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 5
31
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 0.5.0
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: yard
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
39
25
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- segments:
44
- - 0
45
- - 4
46
- - 0
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 0.5.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: yard
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
47
37
  version: 0.4.0
48
38
  type: :development
49
- version_requirements: *id002
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 0.4.0
50
46
  description: A Ruby wrapper for Linux's inotify, using FFI
51
47
  email: nex342@gmail.com
52
48
  executables: []
53
-
54
49
  extensions: []
55
-
56
- extra_rdoc_files:
50
+ extra_rdoc_files:
57
51
  - README.md
58
- files:
52
+ files:
59
53
  - .yardopts
60
54
  - MIT-LICENSE
61
55
  - README.md
@@ -68,37 +62,28 @@ files:
68
62
  - lib/rb-inotify/notifier.rb
69
63
  - lib/rb-inotify/watcher.rb
70
64
  - rb-inotify.gemspec
71
- has_rdoc: true
72
65
  homepage: http://github.com/nex3/rb-inotify
73
66
  licenses: []
74
-
75
67
  post_install_message:
76
68
  rdoc_options: []
77
-
78
- require_paths:
69
+ require_paths:
79
70
  - lib
80
- required_ruby_version: !ruby/object:Gem::Requirement
71
+ required_ruby_version: !ruby/object:Gem::Requirement
81
72
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- segments:
86
- - 0
87
- version: "0"
88
- required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
89
78
  none: false
90
- requirements:
91
- - - ">="
92
- - !ruby/object:Gem::Version
93
- segments:
94
- - 0
95
- version: "0"
79
+ requirements:
80
+ - - ! '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
96
83
  requirements: []
97
-
98
84
  rubyforge_project:
99
- rubygems_version: 1.3.7
85
+ rubygems_version: 1.8.24
100
86
  signing_key:
101
87
  specification_version: 3
102
88
  summary: A Ruby wrapper for Linux's inotify, using FFI
103
89
  test_files: []
104
-