loom-core 0.0.7 → 0.0.9
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/Gemfile.lock +104 -70
- data/lib/loom/config.rb +1 -1
- data/lib/loom/method_signature.rb +1 -1
- data/lib/loom/mods/action_proxy.rb +2 -2
- data/lib/loom/mods/mod_loader.rb +3 -3
- data/lib/loom/mods/module.rb +6 -5
- data/lib/loom/pattern/definition_context.rb +3 -1
- data/lib/loom/pattern/dsl.rb +10 -2
- data/lib/loom/pattern/expanding_reference.rb +7 -13
- data/lib/loom/pattern/loader.rb +1 -1
- data/lib/loom/shell/api.rb +3 -3
- data/lib/loom/shell/cmd_wrapper.rb +5 -2
- data/lib/loom/shell/core.rb +1 -1
- data/lib/loom/version.rb +1 -1
- data/lib/loomext/coremods/systemd/all.rb +1 -0
- data/lib/loomext/coremods/systemd/hostname.rb +10 -0
- data/loom.gemspec +3 -3
- data/spec/.loom/regression.loom +23 -0
- data/spec/.loom/test.loom +4 -0
- data/spec/loom/host_spec_spec.rb +1 -1
- data/spec/test_loom_spec.rb +1 -1
- metadata +17 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76771b34a40961ff3eec048ed42682f49488cfd2f770d35ca2e19c255b534051
|
4
|
+
data.tar.gz: f9a8fec00bf59b419af9669b263ff09fa34224429640dd49d68aa110de49ea5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1b14c69e8ce6a26d399f0f7bdc8fa71c2d41204b3199169d7c0ec00b37549c378bb50a7e30c4875661e43b0da7cead2aaa58936bf644d9bd9e716965bc39dd3
|
7
|
+
data.tar.gz: 152a387d0f25af816f35b6695c3a0827fe576acaf049be7c94931261d00f53b03402c2c79db0459854df0d25ba11aa4cb330649a786b67727bdf2d93b0250c2b
|
data/Gemfile.lock
CHANGED
@@ -1,34 +1,47 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
loom-core (0.0.
|
4
|
+
loom-core (0.0.8)
|
5
5
|
bcrypt_pbkdf (>= 1.0, < 2.0)
|
6
6
|
commander (~> 4.4)
|
7
7
|
ed25519 (>= 1.0, < 2.0)
|
8
8
|
net-ssh (>= 5)
|
9
|
-
rbnacl-libsodium (= 1.0.
|
10
|
-
sshkit (~> 1.
|
9
|
+
rbnacl-libsodium (= 1.0.16)
|
10
|
+
sshkit (~> 1.23)
|
11
11
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
ast (2.4.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
15
|
+
ast (2.4.2)
|
16
|
+
base64 (0.2.0)
|
17
|
+
bcrypt_pbkdf (1.1.1)
|
18
|
+
bcrypt_pbkdf (1.1.1-arm64-darwin)
|
19
|
+
bcrypt_pbkdf (1.1.1-x86_64-darwin)
|
20
|
+
byebug (11.1.3)
|
21
|
+
coderay (1.1.3)
|
22
|
+
commander (4.6.0)
|
23
|
+
highline (~> 2.0.0)
|
24
|
+
diff-lcs (1.5.1)
|
25
|
+
ed25519 (1.3.0)
|
26
|
+
ffi (1.17.0)
|
27
|
+
ffi (1.17.0-aarch64-linux-gnu)
|
28
|
+
ffi (1.17.0-aarch64-linux-musl)
|
29
|
+
ffi (1.17.0-arm-linux-gnu)
|
30
|
+
ffi (1.17.0-arm-linux-musl)
|
31
|
+
ffi (1.17.0-arm64-darwin)
|
32
|
+
ffi (1.17.0-x86-linux-gnu)
|
33
|
+
ffi (1.17.0-x86-linux-musl)
|
34
|
+
ffi (1.17.0-x86_64-darwin)
|
35
|
+
ffi (1.17.0-x86_64-linux-gnu)
|
36
|
+
ffi (1.17.0-x86_64-linux-musl)
|
37
|
+
formatador (1.1.0)
|
38
|
+
guard (2.19.0)
|
26
39
|
formatador (>= 0.2.4)
|
27
40
|
listen (>= 2.7, < 4.0)
|
28
|
-
lumberjack (
|
41
|
+
lumberjack (>= 1.0.12, < 2.0)
|
29
42
|
nenv (~> 0.1)
|
30
43
|
notiffany (~> 0.0)
|
31
|
-
pry (>= 0.
|
44
|
+
pry (>= 0.13.0)
|
32
45
|
shellany (~> 0.0)
|
33
46
|
thor (>= 0.18.1)
|
34
47
|
guard-compat (1.2.1)
|
@@ -36,77 +49,98 @@ GEM
|
|
36
49
|
guard (~> 2.1)
|
37
50
|
guard-compat (~> 1.1)
|
38
51
|
rspec (>= 2.99.0, < 4.0)
|
39
|
-
highline (
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
rb-
|
44
|
-
|
45
|
-
lumberjack (1.
|
46
|
-
method_source (
|
52
|
+
highline (2.0.3)
|
53
|
+
json (2.8.2)
|
54
|
+
language_server-protocol (3.17.0.3)
|
55
|
+
listen (3.9.0)
|
56
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
57
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
58
|
+
lumberjack (1.2.10)
|
59
|
+
method_source (1.1.0)
|
47
60
|
nenv (0.3.0)
|
48
|
-
net-scp (
|
49
|
-
net-ssh (>= 2.6.5)
|
50
|
-
net-
|
51
|
-
|
61
|
+
net-scp (4.0.0)
|
62
|
+
net-ssh (>= 2.6.5, < 8.0.0)
|
63
|
+
net-sftp (4.0.0)
|
64
|
+
net-ssh (>= 5.0.0, < 8.0.0)
|
65
|
+
net-ssh (7.3.0)
|
66
|
+
notiffany (0.1.3)
|
52
67
|
nenv (~> 0.1)
|
53
68
|
shellany (~> 0.0)
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
pry-byebug (3.
|
63
|
-
byebug (~>
|
64
|
-
pry (
|
65
|
-
|
69
|
+
ostruct (0.6.1)
|
70
|
+
parallel (1.26.3)
|
71
|
+
parser (3.3.6.0)
|
72
|
+
ast (~> 2.4.1)
|
73
|
+
racc
|
74
|
+
pry (0.14.2)
|
75
|
+
coderay (~> 1.1)
|
76
|
+
method_source (~> 1.0)
|
77
|
+
pry-byebug (3.10.1)
|
78
|
+
byebug (~> 11.0)
|
79
|
+
pry (>= 0.13, < 0.15)
|
80
|
+
racc (1.8.1)
|
81
|
+
rainbow (3.1.1)
|
66
82
|
rake (11.3.0)
|
67
|
-
rb-fsevent (0.
|
68
|
-
rb-inotify (0.
|
69
|
-
ffi (
|
70
|
-
rbnacl (
|
71
|
-
ffi
|
72
|
-
rbnacl-libsodium (1.0.
|
83
|
+
rb-fsevent (0.11.2)
|
84
|
+
rb-inotify (0.11.1)
|
85
|
+
ffi (~> 1.0)
|
86
|
+
rbnacl (7.1.2)
|
87
|
+
ffi (~> 1)
|
88
|
+
rbnacl-libsodium (1.0.16)
|
73
89
|
rbnacl (>= 3.0.1)
|
74
|
-
|
75
|
-
|
76
|
-
rspec-
|
77
|
-
rspec-
|
78
|
-
|
79
|
-
|
80
|
-
|
90
|
+
regexp_parser (2.9.3)
|
91
|
+
rspec (3.13.0)
|
92
|
+
rspec-core (~> 3.13.0)
|
93
|
+
rspec-expectations (~> 3.13.0)
|
94
|
+
rspec-mocks (~> 3.13.0)
|
95
|
+
rspec-core (3.13.2)
|
96
|
+
rspec-support (~> 3.13.0)
|
97
|
+
rspec-expectations (3.13.3)
|
81
98
|
diff-lcs (>= 1.2.0, < 2.0)
|
82
|
-
rspec-support (~> 3.
|
83
|
-
rspec-mocks (3.
|
99
|
+
rspec-support (~> 3.13.0)
|
100
|
+
rspec-mocks (3.13.2)
|
84
101
|
diff-lcs (>= 1.2.0, < 2.0)
|
85
|
-
rspec-support (~> 3.
|
86
|
-
rspec-support (3.
|
87
|
-
rubocop (
|
88
|
-
|
102
|
+
rspec-support (~> 3.13.0)
|
103
|
+
rspec-support (3.13.1)
|
104
|
+
rubocop (1.69.0)
|
105
|
+
json (~> 2.3)
|
106
|
+
language_server-protocol (>= 3.17.0)
|
89
107
|
parallel (~> 1.10)
|
90
|
-
parser (>=
|
91
|
-
powerpack (~> 0.1)
|
108
|
+
parser (>= 3.3.0.2)
|
92
109
|
rainbow (>= 2.2.2, < 4.0)
|
110
|
+
regexp_parser (>= 2.4, < 3.0)
|
111
|
+
rubocop-ast (>= 1.36.1, < 2.0)
|
93
112
|
ruby-progressbar (~> 1.7)
|
94
|
-
unicode-display_width (
|
95
|
-
|
96
|
-
|
113
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
114
|
+
rubocop-ast (1.36.2)
|
115
|
+
parser (>= 3.3.1.0)
|
116
|
+
ruby-progressbar (1.13.0)
|
97
117
|
shellany (0.0.1)
|
98
|
-
|
99
|
-
|
118
|
+
sshkit (1.23.2)
|
119
|
+
base64
|
100
120
|
net-scp (>= 1.1.2)
|
121
|
+
net-sftp (>= 2.1.2)
|
101
122
|
net-ssh (>= 2.8.0)
|
102
|
-
|
103
|
-
|
123
|
+
ostruct
|
124
|
+
thor (1.3.2)
|
125
|
+
unicode-display_width (3.1.2)
|
126
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
127
|
+
unicode-emoji (4.0.4)
|
104
128
|
|
105
129
|
PLATFORMS
|
130
|
+
aarch64-linux-gnu
|
131
|
+
aarch64-linux-musl
|
132
|
+
arm-linux-gnu
|
133
|
+
arm-linux-musl
|
134
|
+
arm64-darwin
|
106
135
|
ruby
|
136
|
+
x86-linux-gnu
|
137
|
+
x86-linux-musl
|
138
|
+
x86_64-darwin
|
139
|
+
x86_64-linux-gnu
|
140
|
+
x86_64-linux-musl
|
107
141
|
|
108
142
|
DEPENDENCIES
|
109
|
-
bundler
|
143
|
+
bundler
|
110
144
|
guard-rspec (~> 4.7)
|
111
145
|
loom-core!
|
112
146
|
pry (~> 0.10)
|
@@ -116,4 +150,4 @@ DEPENDENCIES
|
|
116
150
|
rubocop
|
117
151
|
|
118
152
|
BUNDLED WITH
|
119
|
-
|
153
|
+
2.5.23
|
data/lib/loom/config.rb
CHANGED
@@ -40,7 +40,7 @@ module Loom::Mods
|
|
40
40
|
# idiomatic.
|
41
41
|
bound_action_name = tuple[1]
|
42
42
|
|
43
|
-
define_method public_action_name do |*args, &block|
|
43
|
+
define_method public_action_name do |*args, **kwargs, &block|
|
44
44
|
# TODO[P0]: Effectively this is the API for all mods, but it's
|
45
45
|
# burried here in the middle of nowhere. Add documentation - or make
|
46
46
|
# it easier to read.
|
@@ -48,7 +48,7 @@ module Loom::Mods
|
|
48
48
|
"proxy to mod action: #{public_action_name} => #{bound_action_name}, #{@mod}"
|
49
49
|
end
|
50
50
|
|
51
|
-
@mod.send bound_action_name, *args, &block
|
51
|
+
@mod.send bound_action_name, *args, **kwargs, &block
|
52
52
|
end
|
53
53
|
Loom.log.debug2 self do
|
54
54
|
"defined action proxy action: #{public_action_name} => #{bound_action_name}"
|
data/lib/loom/mods/mod_loader.rb
CHANGED
@@ -54,14 +54,14 @@ module Loom::Mods
|
|
54
54
|
raise ModDefinedError, name if instance_methods.include? name
|
55
55
|
registered_mods[mod_klass.name] = [name]
|
56
56
|
|
57
|
-
define_method name do |shell, *args, &pattern_block|
|
57
|
+
define_method name do |shell, *args, **kwargs, &pattern_block|
|
58
58
|
Loom.log.debug3(self) do
|
59
|
-
"handling mod call => #{mod_klass}##{name} #{args} #{pattern_block}"
|
59
|
+
"handling mod call => #{mod_klass}##{name} #{args} #{kwargs} #{pattern_block}"
|
60
60
|
end
|
61
61
|
load_mod_klass mod_klass, shell
|
62
62
|
|
63
63
|
mod = mod_klass.new shell, @loom_config
|
64
|
-
mod.execute *args, &pattern_block
|
64
|
+
mod.execute *args, **kwargs, &pattern_block
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
data/lib/loom/mods/module.rb
CHANGED
@@ -32,13 +32,13 @@ module Loom::Mods
|
|
32
32
|
@action_block = pattern_block
|
33
33
|
end
|
34
34
|
|
35
|
-
def execute(*args, &pattern_block)
|
35
|
+
def execute(*args, **kwargs, &pattern_block)
|
36
36
|
if respond_to? :mod_block
|
37
37
|
Loom.log.debug3(self) { "executing mod block => #{args} #{pattern_block}" }
|
38
|
-
mod_block *args, &pattern_block
|
38
|
+
mod_block *args, **kwargs, &pattern_block
|
39
39
|
else
|
40
40
|
Loom.log.debug3(self) { "initing action => #{args}" }
|
41
|
-
init_action *args, &pattern_block
|
41
|
+
init_action *args, **kwargs, &pattern_block
|
42
42
|
|
43
43
|
# TODO: ooohhh... the action_proxy code path is fucking
|
44
44
|
# crazy. ActionProxy needs some documentation.
|
@@ -99,11 +99,12 @@ module Loom::Mods
|
|
99
99
|
# (e.g.) to each instance of Module. (actually I think it's because this
|
100
100
|
# is executing from the subclass (via import_actions), so it's only that
|
101
101
|
# class). in any case, add more docs and code pointers.
|
102
|
-
define_method bound_method_name do |*args, &block|
|
102
|
+
define_method bound_method_name do |*args, **kwargs, &block|
|
103
103
|
Loom.log.debug1(self) { "exec mod action #{self.class}##{bound_method_name}" }
|
104
104
|
|
105
105
|
bound_method = unbound_method.bind self
|
106
|
-
|
106
|
+
|
107
|
+
bound_method.call *args, **kwargs, &block
|
107
108
|
end
|
108
109
|
Loom.log.debug2(self) { "bound mod action => #{self.class.name}##{action_name}" }
|
109
110
|
|
@@ -46,7 +46,9 @@ module Loom::Pattern
|
|
46
46
|
|
47
47
|
if value.nil? || value.equal?(Loom::Facts::EMPTY)
|
48
48
|
Loom.log.error "value of let expression[:#{let_key}] is nil"
|
49
|
-
|
49
|
+
# TODO: I'm not sure what to do here, but raising an error isn't
|
50
|
+
# very user friendly.... as I just learned.
|
51
|
+
# raise NilLetValueError, "empty value for let[#{let_key}]"
|
50
52
|
end
|
51
53
|
scope_object.define_singleton_method(let_key) { value }
|
52
54
|
end
|
data/lib/loom/pattern/dsl.rb
CHANGED
@@ -17,8 +17,14 @@
|
|
17
17
|
# DSL#pattern/report/weave (anythin else that creates a pattern) to add a new
|
18
18
|
# PatternBuilder to the module. Use the builder to implement the TODO above
|
19
19
|
# ("Add a phase..."). Implement analysis on the builder.
|
20
|
+
|
20
21
|
# [master]
|
21
22
|
# * ... ongoing ... ways to test and +verify+ pattern execution
|
23
|
+
# - IDEA: launch a container on host before executing a pattern, w/ an overlay
|
24
|
+
# fs of "/". Use this to canary a command sequence before executing on the
|
25
|
+
# actual host. This way no rollback, or idempotence checks, or state
|
26
|
+
# management, or history needs to be kept. Only the volatile container image
|
27
|
+
# needs to be torn down.
|
22
28
|
|
23
29
|
# TODO: DSL extensions:
|
24
30
|
# - More Mods! .... ondeck:
|
@@ -72,6 +78,8 @@
|
|
72
78
|
# -- Best way is to migrate loom/mods/module and loom/mods/action_proxy into base classes of
|
73
79
|
# themselves. The isolate the shell specific behavior into a subclass of each to preserve the
|
74
80
|
# current behavior. A new "cli" module and "cli" action proxy would enable the implementation.
|
81
|
+
#
|
82
|
+
# - Add a "groups" flag to `loom i` to display inventory groupings
|
75
83
|
|
76
84
|
=begin
|
77
85
|
|
@@ -313,9 +321,9 @@ module Loom::Pattern
|
|
313
321
|
# The Loom DSL definition. See documentation above.
|
314
322
|
module DSL
|
315
323
|
DSL_METHODS.each do |m|
|
316
|
-
define_method m do |*args, &block|
|
324
|
+
define_method m do |*args, **kwargs, &block|
|
317
325
|
Loom.log.debug1(self) { "delegating Pattern::DSL call to DSLBuilder+#{m}+" }
|
318
|
-
@dsl_builder.send(m, *args, &block)
|
326
|
+
@dsl_builder.send(m, *args, **kwargs, &block)
|
319
327
|
end
|
320
328
|
end
|
321
329
|
|
@@ -24,13 +24,10 @@ module Loom::Pattern
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def expand_slugs
|
27
|
-
slug_matchers = @reference_slugs.map do |s|
|
28
|
-
Matcher.get_matcher(s)
|
29
|
-
end
|
30
|
-
|
31
27
|
# O(MN) :(
|
32
|
-
expanded_slugs = @reference_slugs.flat_map do |
|
33
|
-
|
28
|
+
expanded_slugs = @reference_slugs.flat_map do |my_slug|
|
29
|
+
matcher = Matcher.get_matcher(my_slug)
|
30
|
+
@reference_set.slugs.select { |your_slug| matcher.match? your_slug }
|
34
31
|
end.uniq
|
35
32
|
Loom.log.debug3(self) { "Loom::Pattern::ExpandingReference@reference_slugs+: #{@reference_slugs.join(",")}"}
|
36
33
|
Loom.log.debug3(self) { "Loom::Pattern::ExpandingReference+expanded_slugs+: #{expanded_slugs.join(",")}"}
|
@@ -68,16 +65,13 @@ module Loom::Pattern
|
|
68
65
|
module GlobMatcher
|
69
66
|
MATCH_P = /(\*)$/
|
70
67
|
|
71
|
-
def self.handles_pattern?(
|
72
|
-
|
68
|
+
def self.handles_pattern?(my_slug)
|
69
|
+
res = my_slug.match? MATCH_P
|
70
|
+
Loom.log.debug2(self) { "#{p}.match? #{MATCH_P} = #{res}" }
|
71
|
+
res
|
73
72
|
end
|
74
73
|
|
75
74
|
def match?(your_pattern)
|
76
|
-
# TODO: This can be made RE2 compliant later.
|
77
|
-
unless GlobMatcher.handles_pattern?(@my_slug)
|
78
|
-
raise 'WTF? invalid pattern, must end in "*": %s' % @my_slug
|
79
|
-
end
|
80
|
-
|
81
75
|
prefix = @my_slug.to_s.gsub(MATCH_P, "")
|
82
76
|
Loom.log.debug2(self) { "GlobMatcher+match?+ #{@my_slug} #{your_pattern}, prefix: #{prefix}"}
|
83
77
|
your_pattern.to_s.start_with? prefix
|
data/lib/loom/pattern/loader.rb
CHANGED
data/lib/loom/shell/api.rb
CHANGED
@@ -20,14 +20,14 @@ module Loom::Shell
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# This is the entry point for `loom.foo` calls from .loom files.
|
23
|
-
def method_missing(name, *args, &block)
|
24
|
-
Loom.log.debug3(self) { "shell api => #{name} #{args} #{block}" }
|
23
|
+
def method_missing(name, *args, **kwargs, &block)
|
24
|
+
Loom.log.debug3(self) { "shell api => #{name} #{args} #{kwargs} #{block}" }
|
25
25
|
# TODO: The relationship between shell and mod_loader seems leaky here, a
|
26
26
|
# Shell::Api should have a shell and not care about the mod_loader,
|
27
27
|
# currently it seems to violate Demeter. The shell should dispatch to the
|
28
28
|
# mod_loader only as an implementation detail. Otherwise this is harder to
|
29
29
|
# test.
|
30
|
-
@mod_loader.send name, @shell, *args, &block
|
30
|
+
@mod_loader.send name, @shell, *args, **kwargs, &block
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require "shellwords"
|
1
|
+
require "shellwords"
|
2
2
|
|
3
3
|
module Loom::Shell
|
4
4
|
|
@@ -27,7 +27,7 @@ module Loom::Shell
|
|
27
27
|
parts
|
28
28
|
end
|
29
29
|
end
|
30
|
-
CmdWrapper.new *cmd_parts.flatten, {
|
30
|
+
CmdWrapper.new *cmd_parts.flatten, **{
|
31
31
|
:should_quote => should_quote,
|
32
32
|
:is_wrapped => true
|
33
33
|
}
|
@@ -39,6 +39,9 @@ module Loom::Shell
|
|
39
39
|
# @param :redirc [Array<CmdRedirect>] STDIO redirection for the command
|
40
40
|
# in quotes.
|
41
41
|
def initialize(*cmd, should_quote: false, is_wrapped: false, redirect: [])
|
42
|
+
if cmd.last.is_a?(Hash)
|
43
|
+
raise ArgumentError.new "kwargs mixed into cmd"
|
44
|
+
end
|
42
45
|
@cmd_parts = cmd.flatten
|
43
46
|
@should_quote = should_quote
|
44
47
|
@is_wrapped = is_wrapped
|
data/lib/loom/shell/core.rb
CHANGED
@@ -171,7 +171,7 @@ module Loom::Shell
|
|
171
171
|
sshkit_result = if @dry_run
|
172
172
|
wrap(:printf, first: true) do
|
173
173
|
r = execute_internal(*cmd_parts, **cmd_opts)
|
174
|
-
Loom.log.info { "\t%s" % prompt_fmt(
|
174
|
+
Loom.log.info { "\t%s" % prompt_fmt(r.full_stdout.strip) }
|
175
175
|
r
|
176
176
|
end
|
177
177
|
else
|
data/lib/loom/version.rb
CHANGED
data/loom.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
16
16
|
s.require_paths = %w[lib]
|
17
17
|
|
18
|
-
s.add_dependency 'sshkit', '~> 1.
|
18
|
+
s.add_dependency 'sshkit', '~> 1.23'
|
19
19
|
s.add_dependency 'commander', '~> 4.4'
|
20
20
|
|
21
21
|
# *** Obsolete, see new issue below ***
|
@@ -28,14 +28,14 @@ Gem::Specification.new do |s|
|
|
28
28
|
# I can manually `gem install net-ssh --version 4.0.0.beta3` for now.
|
29
29
|
# s.add_dependency 'net-ssh', '>= 4.0.0.beta3'
|
30
30
|
s.add_dependency 'net-ssh', '>= 5'
|
31
|
-
s.add_dependency 'rbnacl-libsodium', '1.0.
|
31
|
+
s.add_dependency 'rbnacl-libsodium', '1.0.16'
|
32
32
|
s.add_dependency 'bcrypt_pbkdf', ">= 1.0", "< 2.0"
|
33
33
|
|
34
34
|
# New net-ssh requiremetns for ed25519
|
35
35
|
# https://github.com/net-ssh/net-ssh/issues/565
|
36
36
|
s.add_dependency 'ed25519', '>=1.0', '<2.0'
|
37
37
|
|
38
|
-
s.add_development_dependency 'bundler'
|
38
|
+
s.add_development_dependency 'bundler'
|
39
39
|
s.add_development_dependency 'rake', '~> 11.3'
|
40
40
|
s.add_development_dependency 'rspec', '~> 3.5'
|
41
41
|
s.add_development_dependency 'guard-rspec', '~> 4.7'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Regression tests for issues that I've spent too much time debugging.
|
2
|
+
# These must be safe to run on localhost.
|
3
|
+
module Regression
|
4
|
+
include Loom::Pattern
|
5
|
+
|
6
|
+
# For some reason, weave glob expansion is more confusing than it should be.
|
7
|
+
weave :verify_no_glob_expansion, [
|
8
|
+
"regression:dummies:date",
|
9
|
+
"regression:dummies:echo",
|
10
|
+
]
|
11
|
+
|
12
|
+
weave :verify_glob_expansion, [
|
13
|
+
"regression:dummies:*",
|
14
|
+
]
|
15
|
+
|
16
|
+
module Dummies
|
17
|
+
include Loom::Pattern
|
18
|
+
|
19
|
+
pattern(:date) { |l, _| l.x :date }
|
20
|
+
pattern(:echo) { |l, _| l.x :echo, :hello }
|
21
|
+
pattern(:uptime) { |l, _| l.x :uptime }
|
22
|
+
end
|
23
|
+
end
|
data/spec/.loom/test.loom
CHANGED
data/spec/loom/host_spec_spec.rb
CHANGED
@@ -85,7 +85,7 @@ describe Loom::HostSpec do
|
|
85
85
|
end
|
86
86
|
|
87
87
|
context "ipv6 addresses" do
|
88
|
-
let(:host_string) { "[2a02:120b:2c28:5920:6257:18ff:febf:13c8:22
|
88
|
+
let(:host_string) { "[2a02:120b:2c28:5920:6257:18ff:febf:13c8]:22" }
|
89
89
|
|
90
90
|
it "parses user@localhost configurations as remote" do
|
91
91
|
expect(subject.is_localhost?).to be false
|
data/spec/test_loom_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loom-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erick Johnson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sshkit
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.23'
|
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: '1.
|
26
|
+
version: '1.23'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: commander
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.0.
|
61
|
+
version: 1.0.16
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.0.
|
68
|
+
version: 1.0.16
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: bcrypt_pbkdf
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,16 +110,16 @@ dependencies:
|
|
110
110
|
name: bundler
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
|
-
- - "
|
113
|
+
- - ">="
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: '
|
115
|
+
version: '0'
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- - "
|
120
|
+
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: '
|
122
|
+
version: '0'
|
123
123
|
- !ruby/object:Gem::Dependency
|
124
124
|
name: rake
|
125
125
|
requirement: !ruby/object:Gem::Requirement
|
@@ -282,6 +282,7 @@ files:
|
|
282
282
|
- lib/loomext/coremods/package/package.rb
|
283
283
|
- lib/loomext/coremods/systemd.rb
|
284
284
|
- lib/loomext/coremods/systemd/all.rb
|
285
|
+
- lib/loomext/coremods/systemd/hostname.rb
|
285
286
|
- lib/loomext/coremods/systemd/systemd.rb
|
286
287
|
- lib/loomext/coremods/systemd/systemd_units.rb
|
287
288
|
- lib/loomext/coremods/user.rb
|
@@ -299,6 +300,7 @@ files:
|
|
299
300
|
- spec/.loom/net.loom
|
300
301
|
- spec/.loom/pattern_context.loom
|
301
302
|
- spec/.loom/pkg.loom
|
303
|
+
- spec/.loom/regression.loom
|
302
304
|
- spec/.loom/shell.loom
|
303
305
|
- spec/.loom/test.loom
|
304
306
|
- spec/.loom/user.loom
|
@@ -319,11 +321,11 @@ files:
|
|
319
321
|
- spec/systemd.loom
|
320
322
|
- spec/test_loom_spec.rb
|
321
323
|
- test
|
322
|
-
homepage:
|
324
|
+
homepage:
|
323
325
|
licenses:
|
324
326
|
- MIT
|
325
327
|
metadata: {}
|
326
|
-
post_install_message:
|
328
|
+
post_install_message:
|
327
329
|
rdoc_options: []
|
328
330
|
require_paths:
|
329
331
|
- lib
|
@@ -338,9 +340,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
338
340
|
- !ruby/object:Gem::Version
|
339
341
|
version: '0'
|
340
342
|
requirements: []
|
341
|
-
|
342
|
-
|
343
|
-
signing_key:
|
343
|
+
rubygems_version: 3.5.22
|
344
|
+
signing_key:
|
344
345
|
specification_version: 4
|
345
346
|
summary: Repeatable management of remote hosts over SSH
|
346
347
|
test_files:
|