bashly 1.3.5 → 1.3.6
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 +4 -4
- data/lib/bashly/commands/generate.rb +1 -3
- data/lib/bashly/commands/render.rb +1 -2
- data/lib/bashly/version.rb +1 -1
- data/lib/bashly/watch.rb +57 -0
- data/lib/bashly.rb +1 -1
- metadata +15 -40
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c216518e1752d66966dfa1b8efad9a24afb5d55119a350ac9ad460abea748be0
|
|
4
|
+
data.tar.gz: 8626f99cfc41d424363969bbe46474fc86f8998f44c17d8196c03044281fbf6e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b49310fec1d05dcf12504a8be34493d4e6d8af7ef9b2e35ea57da6424ca0820ee6abb7145ea54835ac31778db0ff89e6c6999050133f5851545ac67dc7f5b6c
|
|
7
|
+
data.tar.gz: 0b443ed8497671ff9faf2c720961d3344a5bbfb670096c9a74388cb54541f782b4316a198e4b2dfc7ed17b45a83991df2894ce05f3d76f943f694a63aa090bb2
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require 'filewatcher'
|
|
2
|
-
|
|
3
1
|
module Bashly
|
|
4
2
|
module Commands
|
|
5
3
|
class Generate < Base
|
|
@@ -41,7 +39,7 @@ module Bashly
|
|
|
41
39
|
def watch
|
|
42
40
|
quiet_say "g`watching` #{Settings.source_dir}\n"
|
|
43
41
|
|
|
44
|
-
|
|
42
|
+
Watch.new(Settings.source_dir).on_change do
|
|
45
43
|
reset
|
|
46
44
|
generate
|
|
47
45
|
rescue Bashly::ConfigurationError => e
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require 'filewatcher'
|
|
2
1
|
require 'tty-markdown'
|
|
3
2
|
|
|
4
3
|
module Bashly
|
|
@@ -75,7 +74,7 @@ module Bashly
|
|
|
75
74
|
def watch
|
|
76
75
|
say "g`watching`\n"
|
|
77
76
|
|
|
78
|
-
|
|
77
|
+
Watch.new(*watchables).on_change do
|
|
79
78
|
render
|
|
80
79
|
say "g`waiting`\n"
|
|
81
80
|
end
|
data/lib/bashly/version.rb
CHANGED
data/lib/bashly/watch.rb
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
require 'listen'
|
|
2
|
+
|
|
3
|
+
module Bashly
|
|
4
|
+
# File system watcher - an ergonomic wrapper around the Listen gem
|
|
5
|
+
class Watch
|
|
6
|
+
attr_reader :dirs, :options
|
|
7
|
+
|
|
8
|
+
DEFAULT_OPTIONS = {
|
|
9
|
+
force_polling: true,
|
|
10
|
+
latency: 1.0,
|
|
11
|
+
}.freeze
|
|
12
|
+
|
|
13
|
+
def initialize(*dirs, **options)
|
|
14
|
+
@options = DEFAULT_OPTIONS.merge(options).freeze
|
|
15
|
+
@dirs = dirs.empty? ? ['.'] : dirs
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def on_change(&)
|
|
19
|
+
start(&)
|
|
20
|
+
wait
|
|
21
|
+
ensure
|
|
22
|
+
stop
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def build_listener
|
|
28
|
+
listen.to(*dirs, **options) do |modified, added, removed|
|
|
29
|
+
yield changes(modified, added, removed)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def start(&block)
|
|
34
|
+
raise ArgumentError, 'block required' unless block
|
|
35
|
+
|
|
36
|
+
@listener = build_listener(&block)
|
|
37
|
+
@listener.start
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def stop
|
|
41
|
+
@listener&.stop
|
|
42
|
+
@listener = nil
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def changes(modified, added, removed)
|
|
46
|
+
{ modified:, added:, removed: }
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def wait
|
|
50
|
+
sleep
|
|
51
|
+
rescue ::Interrupt => e
|
|
52
|
+
raise Bashly::Interrupt, cause: e
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def listen = Listen
|
|
56
|
+
end
|
|
57
|
+
end
|
data/lib/bashly.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Bashly
|
|
|
12
12
|
|
|
13
13
|
autoloads 'bashly', %i[
|
|
14
14
|
CLI Config ConfigValidator Library LibrarySource LibrarySourceConfig
|
|
15
|
-
MessageStrings RenderContext RenderSource Settings VERSION
|
|
15
|
+
MessageStrings RenderContext RenderSource Settings VERSION Watch
|
|
16
16
|
]
|
|
17
17
|
|
|
18
18
|
autoloads 'bashly/concerns', %i[
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bashly
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.3.
|
|
4
|
+
version: 1.3.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Danny Ben Shitrit
|
|
@@ -38,33 +38,33 @@ dependencies:
|
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
39
|
version: 0.7.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
41
|
+
name: gtx
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
|
44
44
|
- - "~>"
|
|
45
45
|
- !ruby/object:Gem::Version
|
|
46
|
-
version:
|
|
46
|
+
version: 0.1.1
|
|
47
47
|
type: :runtime
|
|
48
48
|
prerelease: false
|
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
50
|
requirements:
|
|
51
51
|
- - "~>"
|
|
52
52
|
- !ruby/object:Gem::Version
|
|
53
|
-
version:
|
|
53
|
+
version: 0.1.1
|
|
54
54
|
- !ruby/object:Gem::Dependency
|
|
55
|
-
name:
|
|
55
|
+
name: listen
|
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
|
57
57
|
requirements:
|
|
58
58
|
- - "~>"
|
|
59
59
|
- !ruby/object:Gem::Version
|
|
60
|
-
version:
|
|
60
|
+
version: '3.9'
|
|
61
61
|
type: :runtime
|
|
62
62
|
prerelease: false
|
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
64
|
requirements:
|
|
65
65
|
- - "~>"
|
|
66
66
|
- !ruby/object:Gem::Version
|
|
67
|
-
version:
|
|
67
|
+
version: '3.9'
|
|
68
68
|
- !ruby/object:Gem::Dependency
|
|
69
69
|
name: lp
|
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -85,14 +85,14 @@ dependencies:
|
|
|
85
85
|
requirements:
|
|
86
86
|
- - "~>"
|
|
87
87
|
- !ruby/object:Gem::Version
|
|
88
|
-
version: 0.
|
|
88
|
+
version: 0.9.0
|
|
89
89
|
type: :runtime
|
|
90
90
|
prerelease: false
|
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
92
|
requirements:
|
|
93
93
|
- - "~>"
|
|
94
94
|
- !ruby/object:Gem::Version
|
|
95
|
-
version: 0.
|
|
95
|
+
version: 0.9.0
|
|
96
96
|
- !ruby/object:Gem::Dependency
|
|
97
97
|
name: requires
|
|
98
98
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -125,42 +125,16 @@ dependencies:
|
|
|
125
125
|
name: logger
|
|
126
126
|
requirement: !ruby/object:Gem::Requirement
|
|
127
127
|
requirements:
|
|
128
|
-
- - "
|
|
129
|
-
- !ruby/object:Gem::Version
|
|
130
|
-
version: '1'
|
|
131
|
-
- - "<"
|
|
132
|
-
- !ruby/object:Gem::Version
|
|
133
|
-
version: '3'
|
|
134
|
-
type: :runtime
|
|
135
|
-
prerelease: false
|
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
137
|
-
requirements:
|
|
138
|
-
- - ">="
|
|
139
|
-
- !ruby/object:Gem::Version
|
|
140
|
-
version: '1'
|
|
141
|
-
- - "<"
|
|
142
|
-
- !ruby/object:Gem::Version
|
|
143
|
-
version: '3'
|
|
144
|
-
- !ruby/object:Gem::Dependency
|
|
145
|
-
name: ostruct
|
|
146
|
-
requirement: !ruby/object:Gem::Requirement
|
|
147
|
-
requirements:
|
|
148
|
-
- - ">="
|
|
149
|
-
- !ruby/object:Gem::Version
|
|
150
|
-
version: '0'
|
|
151
|
-
- - "<"
|
|
128
|
+
- - "~>"
|
|
152
129
|
- !ruby/object:Gem::Version
|
|
153
|
-
version: '
|
|
130
|
+
version: '1.7'
|
|
154
131
|
type: :runtime
|
|
155
132
|
prerelease: false
|
|
156
133
|
version_requirements: !ruby/object:Gem::Requirement
|
|
157
134
|
requirements:
|
|
158
|
-
- - "
|
|
159
|
-
- !ruby/object:Gem::Version
|
|
160
|
-
version: '0'
|
|
161
|
-
- - "<"
|
|
135
|
+
- - "~>"
|
|
162
136
|
- !ruby/object:Gem::Version
|
|
163
|
-
version: '
|
|
137
|
+
version: '1.7'
|
|
164
138
|
description: Generate bash command line tools using YAML configuration
|
|
165
139
|
email: db@dannyben.com
|
|
166
140
|
executables:
|
|
@@ -336,6 +310,7 @@ files:
|
|
|
336
310
|
- lib/bashly/views/wrapper/bash3_bouncer.gtx
|
|
337
311
|
- lib/bashly/views/wrapper/header.gtx
|
|
338
312
|
- lib/bashly/views/wrapper/wrapper.gtx
|
|
313
|
+
- lib/bashly/watch.rb
|
|
339
314
|
homepage: https://github.com/bashly-framework/bashly
|
|
340
315
|
licenses:
|
|
341
316
|
- MIT
|
|
@@ -359,7 +334,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
359
334
|
- !ruby/object:Gem::Version
|
|
360
335
|
version: '0'
|
|
361
336
|
requirements: []
|
|
362
|
-
rubygems_version: 4.0.
|
|
337
|
+
rubygems_version: 4.0.3
|
|
363
338
|
specification_version: 4
|
|
364
339
|
summary: Bash Command Line Tool Generator
|
|
365
340
|
test_files: []
|