listen 0.3.3 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,28 @@
1
+ module Listen
2
+ # Allows two threads to wait on eachother.
3
+ #
4
+ # @note Only two threads can be used with this Turnstile
5
+ # because of the current implementation.
6
+ class Turnstile
7
+
8
+ # Initialize the turnstile.
9
+ #
10
+ def initialize
11
+ # Until ruby offers semahpores, only queues can be used
12
+ # to implement a turnstile.
13
+ @q = Queue.new
14
+ end
15
+
16
+ # Blocks the current thread until a signal is received.
17
+ #
18
+ def wait
19
+ @q.pop if @q.num_waiting == 0
20
+ end
21
+
22
+ # Unblocks the waiting thread if there is one.
23
+ #
24
+ def signal
25
+ @q.push :dummy if @q.num_waiting == 1
26
+ end
27
+ end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Listen
2
- VERSION = '0.3.3'
2
+ VERSION = '0.4.0'
3
3
  end
metadata CHANGED
@@ -1,30 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thibaud Guillaume-Gentil
9
+ - Maher Sallam
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2012-03-06 00:00:00.000000000 Z
13
+ date: 2012-04-09 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rb-fsevent
16
- requirement: &70344951028040 !ruby/object:Gem::Requirement
17
+ requirement: &70142623977580 !ruby/object:Gem::Requirement
17
18
  none: false
18
19
  requirements:
19
20
  - - ~>
20
21
  - !ruby/object:Gem::Version
21
- version: 0.9.0
22
+ version: 0.9.1
22
23
  type: :runtime
23
24
  prerelease: false
24
- version_requirements: *70344951028040
25
+ version_requirements: *70142623977580
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: rb-inotify
27
- requirement: &70344951027580 !ruby/object:Gem::Requirement
28
+ requirement: &70142623977120 !ruby/object:Gem::Requirement
28
29
  none: false
29
30
  requirements:
30
31
  - - ~>
@@ -32,10 +33,10 @@ dependencies:
32
33
  version: 0.8.8
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *70344951027580
36
+ version_requirements: *70142623977120
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: rb-fchange
38
- requirement: &70344951027120 !ruby/object:Gem::Requirement
39
+ requirement: &70142623976660 !ruby/object:Gem::Requirement
39
40
  none: false
40
41
  requirements:
41
42
  - - ~>
@@ -43,10 +44,10 @@ dependencies:
43
44
  version: 0.0.5
44
45
  type: :runtime
45
46
  prerelease: false
46
- version_requirements: *70344951027120
47
+ version_requirements: *70142623976660
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: bundler
49
- requirement: &70344951026740 !ruby/object:Gem::Requirement
50
+ requirement: &70142623976280 !ruby/object:Gem::Requirement
50
51
  none: false
51
52
  requirements:
52
53
  - - ! '>='
@@ -54,11 +55,12 @@ dependencies:
54
55
  version: '0'
55
56
  type: :development
56
57
  prerelease: false
57
- version_requirements: *70344951026740
58
+ version_requirements: *70142623976280
58
59
  description: The Listen gem listens to file modifications and notifies you about the
59
60
  changes. Works everywhere!
60
61
  email:
61
62
  - thibaud@thibaud.me
63
+ - maher@sallam.me
62
64
  executables: []
63
65
  extensions: []
64
66
  extra_rdoc_files: []
@@ -68,7 +70,10 @@ files:
68
70
  - lib/listen/adapters/linux.rb
69
71
  - lib/listen/adapters/polling.rb
70
72
  - lib/listen/adapters/windows.rb
73
+ - lib/listen/directory_record.rb
71
74
  - lib/listen/listener.rb
75
+ - lib/listen/multi_listener.rb
76
+ - lib/listen/turnstile.rb
72
77
  - lib/listen/version.rb
73
78
  - lib/listen.rb
74
79
  - CHANGELOG.md