jruby-notify 0.0.2 → 0.0.3

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/lib/jruby-notify.rb CHANGED
@@ -3,7 +3,7 @@ require 'jnotify/jnotify-0.93.jar'
3
3
 
4
4
  module JRubyNotify
5
5
 
6
- VERSION = '0.0.2'
6
+ VERSION = '0.0.3'
7
7
 
8
8
  FILE_CREATED = 1
9
9
  FILE_DELETED = 2
@@ -7,19 +7,33 @@ module JRubyNotify
7
7
  end
8
8
 
9
9
  def file_renamed(watch, path, file, old)
10
- @callback.call(path, file, old)
10
+ clean_call(path, file, old)
11
11
  end
12
12
 
13
13
  def file_modified(watch, path, file)
14
- @callback.call(path, file)
14
+ clean_call(path, file)
15
15
  end
16
16
 
17
17
  def file_deleted(watch, path, file)
18
- @callback.call(path, file)
18
+ clean_call(path, file)
19
19
  end
20
20
 
21
21
  def file_created(watch, path, file)
22
- @callback.call(path, file)
22
+ clean_call(path, file)
23
+ end
24
+
25
+ private
26
+
27
+ #
28
+ # Ensure that all paths have File::SEPARATOR as separator
29
+ # This avoid a mix of different separators within the paths
30
+ #
31
+ def clean_call(*paths)
32
+ if File::ALT_SEPARATOR
33
+ @callback.call paths.map { |p| p.tr(File::ALT_SEPARATOR, File::SEPARATOR) }
34
+ else
35
+ @callback.call paths
36
+ end
23
37
  end
24
38
 
25
39
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Kessler
@@ -14,11 +14,12 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-02-21 00:00:00 +01:00
17
+ date: 2011-02-22 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake
22
+ prerelease: false
22
23
  requirement: &id001 !ruby/object:Gem::Requirement
23
24
  none: false
24
25
  requirements:
@@ -28,10 +29,10 @@ dependencies:
28
29
  - 0
29
30
  version: "0"
30
31
  type: :development
31
- prerelease: false
32
32
  version_requirements: *id001
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: bundler
35
+ prerelease: false
35
36
  requirement: &id002 !ruby/object:Gem::Requirement
36
37
  none: false
37
38
  requirements:
@@ -43,10 +44,10 @@ dependencies:
43
44
  - 10
44
45
  version: 1.0.10
45
46
  type: :development
46
- prerelease: false
47
47
  version_requirements: *id002
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
+ prerelease: false
50
51
  requirement: &id003 !ruby/object:Gem::Requirement
51
52
  none: false
52
53
  requirements:
@@ -58,7 +59,6 @@ dependencies:
58
59
  - 0
59
60
  version: 2.5.0
60
61
  type: :development
61
- prerelease: false
62
62
  version_requirements: *id003
63
63
  description: JRuby-Notify is an thin wrapper around the JNotify library.
64
64
  email: michi@netzpiraten.ch
@@ -94,7 +94,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ">="
96
96
  - !ruby/object:Gem::Version
97
- hash: -3585833415011794431
98
97
  segments:
99
98
  - 0
100
99
  version: "0"
@@ -103,7 +102,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
102
  requirements:
104
103
  - - ">="
105
104
  - !ruby/object:Gem::Version
106
- hash: -3585833415011794431
107
105
  segments:
108
106
  - 0
109
107
  version: "0"