fsevent 0.3 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c80e06a6aa6324c5a9d77f57fea9c837d34c335c
4
- data.tar.gz: 0522ec2031f9b54b06719c7c97dc7d6fb7d5a31c
3
+ metadata.gz: 717fd9c24a23ac9feb8d368adb2d93ce1f1adf0b
4
+ data.tar.gz: 0772a949f60980f999429c8f626ffb2bd250d99e
5
5
  SHA512:
6
- metadata.gz: 655e1f86025488fa852eadb61f5df04c604d062e7aa2e7019e9b12c2b2919b92489c4f3d132b923fd10d9eacdde7815fa7b443842c89f38e3686cd63cfe04dba
7
- data.tar.gz: b1f09c8e4526f7c1c0550a2d623d72469312ce0ce916098b20a7f13ba4f4de38a9f7d963ef6f13f58d69d911cacb36eb8ef1199172ce03760ce6a9b0dff233b1
6
+ metadata.gz: e8c5ccf242522308dcf0f192bf1958ac8d4fa45bf0ade0e044c2c8ddca64f0c4a3e1d284055d0a44cd04ac39dbfaf8997330b5b873dca8d486046057d254879b
7
+ data.tar.gz: 3910521d60aa1c7b7195fe822211f55467c2320d6b79f56aa8b0d97b51ee5562c892cacc680af0fdbf737ce3128189103b80eed486feb3c668ee59f37400f51d
data/TODO ADDED
@@ -0,0 +1,7 @@
1
+ * Run a device on another host via ssh.
2
+
3
+ * Dump logs.
4
+
5
+ * Cache the result of lookup_watchers.
6
+
7
+ * Extract status as a class?
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'fsevent'
3
- s.version = '0.3'
4
- s.date = '2013-06-30'
3
+ s.version = '0.4'
4
+ s.date = '2013-07-01'
5
5
  s.author = 'Tanaka Akira'
6
6
  s.email = 'tanaka-akira@aist.go.jp'
7
7
  s.license = 'GPL-3.0+'
@@ -12,6 +12,7 @@ Gem::Specification.new do |s|
12
12
  .gitignore
13
13
  LICENSE
14
14
  README.md
15
+ TODO
15
16
  fsevent.gemspec
16
17
  lib/fsevent.rb
17
18
  lib/fsevent/abstractdevice.rb
@@ -24,6 +25,7 @@ Gem::Specification.new do |s|
24
25
  lib/fsevent/schedulemerger.rb
25
26
  lib/fsevent/simpledevice.rb
26
27
  lib/fsevent/util.rb
28
+ lib/fsevent/valueiddevice.rb
27
29
  lib/fsevent/watchset.rb
28
30
  sample/repeat.rb
29
31
  sample/repeat2.rb
@@ -32,6 +32,7 @@ require 'fsevent/debugdumper'
32
32
  require 'fsevent/simpledevice'
33
33
  require 'fsevent/processdevice'
34
34
  require 'fsevent/processdevicec'
35
- require 'fsevent/failsafedevice.rb'
35
+ require 'fsevent/failsafedevice'
36
36
  require 'fsevent/schedulemerger'
37
37
  require 'fsevent/periodicschedule'
38
+ require 'fsevent/valueiddevice'
@@ -0,0 +1,56 @@
1
+ # valueiddevice.rb --- value identity device
2
+ #
3
+ # Copyright (C) 2014 National Institute of Advanced Industrial Science and Technology (AIST)
4
+ #
5
+ # This program is free software: you can redistribute it and/or modify
6
+ # it under the terms of the GNU General Public License as published by
7
+ # the Free Software Foundation, either version 3 of the License, or
8
+ # (at your option) any later version.
9
+ #
10
+ # This program is distributed in the hope that it will be useful,
11
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ # GNU General Public License for more details.
14
+ #
15
+ # You should have received a copy of the GNU General Public License
16
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
+
18
+ class FSEvent::ValueIdDevice < FSEvent::AbstractDevice
19
+ def initialize(device_name, target_device_name, status_name)
20
+ super device_name
21
+ @target_device_name = target_device_name
22
+ @status_name = status_name
23
+ @defined = false
24
+ @old_value = nil
25
+ @id = 0
26
+ end
27
+
28
+ def registered
29
+ add_watch @target_device_name, @status_name, :immediate
30
+ end
31
+
32
+ def run(watched_status, changed_status)
33
+ if watched_status.has_key?(@target_device_name) && watched_status[@target_device_name].has_key?(@status_name)
34
+ value, id = watched_status[@target_device_name][@status_name]
35
+ if !@defined
36
+ @id += 1
37
+ define_status(@status_name, [value, @id])
38
+ @defined = true
39
+ @old_value = value
40
+ else
41
+ if @old_value != value
42
+ @id += 1
43
+ modify_status(@status_name, [value, @id])
44
+ @old_value = value
45
+ end
46
+ end
47
+ else
48
+ if @defined
49
+ @id += 1
50
+ undefine_status(@status_name)
51
+ @defined = false
52
+ @old_value = nil
53
+ end
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fsevent
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanaka Akira
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-30 00:00:00.000000000 Z
11
+ date: 2013-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: depq
@@ -48,6 +48,7 @@ files:
48
48
  - ".gitignore"
49
49
  - LICENSE
50
50
  - README.md
51
+ - TODO
51
52
  - fsevent.gemspec
52
53
  - lib/fsevent.rb
53
54
  - lib/fsevent/abstractdevice.rb
@@ -60,6 +61,7 @@ files:
60
61
  - lib/fsevent/schedulemerger.rb
61
62
  - lib/fsevent/simpledevice.rb
62
63
  - lib/fsevent/util.rb
64
+ - lib/fsevent/valueiddevice.rb
63
65
  - lib/fsevent/watchset.rb
64
66
  - sample/repeat.rb
65
67
  - sample/repeat2.rb