core-watch 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/core/watch/callback.rb +4 -0
- data/lib/core/watch/callbacks/path.rb +3 -0
- data/lib/core/watch/callbacks/regexp.rb +4 -0
- data/lib/core/watch/diff.rb +3 -0
- data/lib/core/watch/snapshot.rb +4 -0
- data/lib/core/watch/status.rb +5 -0
- data/lib/core/watch/strategies/digest.rb +3 -0
- data/lib/core/watch/strategies/timestamp.rb +4 -0
- data/lib/core/watch/strategy.rb +4 -0
- data/lib/core/watch/system.rb +3 -0
- data/lib/core/watch/version.rb +1 -1
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b842f39a01164cc86186d2d6f4d460f072da58c49db6edfa16d1b539d7aebd23
|
4
|
+
data.tar.gz: b0793753ed9a521036bce634849297e8192a130afdf54c791c9110cda0065c5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f811b6a0c04956fe4ecdf04739c56d4495dec0b3b637647007655dae6f04d4ff5c87ad2a0633f058780c6207d6abe6f0f945ff8912f98e4008a70d82a2bb8d4c
|
7
|
+
data.tar.gz: eb57fdb8e3185fe68f6fa69c47a97c13cdd15df6fb41767d6949da19af767e45bf6bba7263300f50a6f7c3e90c6ee54da44e9f5d3df70e1c515368d95cfc162b
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [v0.2.0](https://github.com/metabahn/corerb/releases/tag/2021-07-15)
|
2
|
+
|
3
|
+
*released on 2021-07-15*
|
4
|
+
|
5
|
+
* `add` [#56](https://github.com/metabahn/corerb/pull/56) Make all watch objects inspectable ([bryanp](https://github.com/bryanp))
|
6
|
+
|
1
7
|
## [v0.1.0](https://github.com/metabahn/corerb/releases/tag/2021-07-07)
|
2
8
|
|
3
9
|
*released on 2021-07-07*
|
data/lib/core/watch/callback.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
4
|
+
|
3
5
|
module Core
|
4
6
|
module Watch
|
5
7
|
# [public] Callback for a watched system.
|
@@ -22,6 +24,8 @@ module Core
|
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
27
|
+
include Is::Inspectable
|
28
|
+
|
25
29
|
def initialize(&block)
|
26
30
|
@block = block
|
27
31
|
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
3
4
|
require "pathname"
|
4
5
|
|
5
6
|
module Core
|
@@ -8,6 +9,8 @@ module Core
|
|
8
9
|
# [public] Callback that wraps a path.
|
9
10
|
#
|
10
11
|
class Path < Callback
|
12
|
+
include Is::Inspectable
|
13
|
+
|
11
14
|
def initialize(value, **kwargs, &block)
|
12
15
|
super(**kwargs, &block)
|
13
16
|
|
@@ -1,11 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
4
|
+
|
3
5
|
module Core
|
4
6
|
module Watch
|
5
7
|
module Callbacks
|
6
8
|
# [public] Callback that wraps a regular expression.
|
7
9
|
#
|
8
10
|
class Regexp < Callback
|
11
|
+
include Is::Inspectable
|
12
|
+
|
9
13
|
def initialize(regexp, **kwargs, &block)
|
10
14
|
super(**kwargs, &block)
|
11
15
|
|
data/lib/core/watch/diff.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
3
4
|
require "pathname"
|
4
5
|
|
5
6
|
module Core
|
@@ -7,6 +8,8 @@ module Core
|
|
7
8
|
# [public] Contains changes to a watched system, organized by operation.
|
8
9
|
#
|
9
10
|
class Diff
|
11
|
+
include Is::Inspectable
|
12
|
+
|
10
13
|
OPERATIONS = %i[added changed removed].freeze
|
11
14
|
|
12
15
|
def initialize
|
data/lib/core/watch/snapshot.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
4
|
+
|
3
5
|
require_relative "diff"
|
4
6
|
|
5
7
|
module Core
|
@@ -15,6 +17,8 @@ module Core
|
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
20
|
+
include Is::Inspectable
|
21
|
+
|
18
22
|
def initialize(*paths, ignore: [], strategy: self.class.default_strategy)
|
19
23
|
@ignore = ignore
|
20
24
|
@watched = {}
|
data/lib/core/watch/status.rb
CHANGED
@@ -1,10 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
4
|
+
|
3
5
|
module Core
|
4
6
|
module Watch
|
5
7
|
# [public] The status of a system watch.
|
6
8
|
#
|
7
9
|
class Status
|
10
|
+
include Is::Inspectable
|
11
|
+
inspects without: [:@mutex]
|
12
|
+
|
8
13
|
STATES = %i[running paused stopped].freeze
|
9
14
|
|
10
15
|
def initialize
|
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
3
4
|
require "openssl"
|
4
5
|
|
5
6
|
require_relative "../strategy"
|
@@ -10,6 +11,8 @@ module Core
|
|
10
11
|
# [public] Identifies a path by digest or modified time (for directories).
|
11
12
|
#
|
12
13
|
class Digest
|
14
|
+
include Is::Inspectable
|
15
|
+
|
13
16
|
BUFFER_LENGTH = 16_384
|
14
17
|
|
15
18
|
# [public]
|
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
4
|
+
|
3
5
|
require_relative "../strategy"
|
4
6
|
|
5
7
|
module Core
|
@@ -8,6 +10,8 @@ module Core
|
|
8
10
|
# [public] Identifies a path by modified time.
|
9
11
|
#
|
10
12
|
class Timestamp
|
13
|
+
include Is::Inspectable
|
14
|
+
|
11
15
|
# [public]
|
12
16
|
#
|
13
17
|
def identify(path)
|
data/lib/core/watch/strategy.rb
CHANGED
data/lib/core/watch/system.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require "is/inspectable"
|
3
4
|
require "pathname"
|
4
5
|
|
5
6
|
require "core/async"
|
@@ -14,6 +15,8 @@ module Core
|
|
14
15
|
#
|
15
16
|
class System
|
16
17
|
include Is::Async
|
18
|
+
include Is::Inspectable
|
19
|
+
inspects without: [:@mutex, :@working]
|
17
20
|
|
18
21
|
# [public] The configured polling interval.
|
19
22
|
#
|
data/lib/core/watch/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: core-watch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Powell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: core-async
|
@@ -16,14 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.8'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: core-inspect
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.0'
|
27
41
|
description: Watches the filesystem for changes.
|
28
42
|
email: bryan@metabahn.com
|
29
43
|
executables: []
|