opswalrus 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  opswalrus is a tool that runs scripts against hosts. It's kind of like Ansible, but aims to be simpler to use.
4
4
 
5
+ # Getting started
6
+
7
+ You have two options:
8
+ - Install via Rubygems
9
+ - Install via Docker
10
+
11
+ ## Rubygems install
12
+
13
+ ## Docker install
14
+
15
+ ```shell
16
+ alias ops='docker run --rm -it -v $HOME/.ssh:/root/.ssh -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}/:/workdir ghcr.io/opswalrus/ops'
17
+
18
+ ops --version
19
+ ```
20
+
5
21
  # Examples
6
22
 
7
23
  ```bash
@@ -224,12 +224,12 @@ module OpsWalrus
224
224
  @runtime_env.resolve_import_reference(@ops_file_script.ops_file, import_reference)
225
225
  end
226
226
 
227
- def params(*keys)
227
+ def params(*keys, default: nil)
228
228
  keys = keys.map(&:to_s)
229
229
  if keys.empty?
230
230
  @params
231
231
  else
232
- @params.dig(*keys)
232
+ @params.dig(*keys) || default
233
233
  end
234
234
  end
235
235
 
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require "citrus"
2
+ require "ostruct"
2
3
  require "stringio"
3
4
 
4
5
  module WalrusLang
@@ -54,9 +55,17 @@ module WalrusLang
54
55
 
55
56
  Citrus.eval(Grammar)
56
57
 
57
- def self.render(template, binding)
58
+ # binding_obj : Binding | Hash
59
+ def self.render(template, binding_obj)
60
+ binding_obj = binding_obj.to_binding if binding_obj.is_a?(Hash)
58
61
  ast = WalrusLang::Parser.parse(template)
59
- ast.render(binding)
62
+ ast.render(binding_obj)
63
+ end
64
+ end
65
+
66
+ class Hash
67
+ def to_binding
68
+ OpenStruct.new(self).instance_eval { binding }
60
69
  end
61
70
  end
62
71
 
data/opswalrus.gemspec CHANGED
@@ -3,14 +3,15 @@
3
3
  require_relative "lib/opswalrus/version"
4
4
 
5
5
  Gem::Specification.new do |spec|
6
- spec.name = "opswalrus"
7
- spec.version = OpsWalrus::VERSION
8
- spec.authors = ["David Ellis"]
9
- spec.email = ["david@conquerthelawn.com"]
10
-
11
- spec.summary = "opswalrus is a tool that runs scripts against a fleet of hosts"
12
- spec.description = "opswalrus is a tool that runs scripts against a fleet of hosts hosts. It's kind of like Ansible, but aims to be simpler to use."
13
- spec.homepage = "https://github.com/opswalrus/opswalrus"
6
+ spec.name = "opswalrus"
7
+ spec.version = OpsWalrus::VERSION
8
+ spec.authors = ["David Ellis"]
9
+ spec.email = ["david@conquerthelawn.com"]
10
+
11
+ spec.summary = "opswalrus is a tool that runs scripts against a fleet of hosts"
12
+ spec.description = "opswalrus is a tool that runs scripts against a fleet of hosts hosts. It's kind of like Ansible, but aims to be simpler to use."
13
+ spec.homepage = "https://github.com/opswalrus/opswalrus"
14
+ spec.license = 'EPL-2.0'
14
15
  spec.required_ruby_version = ">= 2.6.0"
15
16
 
16
17
  # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
@@ -31,14 +32,14 @@ Gem::Specification.new do |spec|
31
32
  spec.require_paths = ["lib"]
32
33
 
33
34
  # gem dependencies
34
- spec.add_dependency "citrus"
35
- spec.add_dependency "gli"
36
- spec.add_dependency "git"
37
- spec.add_dependency "rubyzip"
38
-
39
- spec.add_dependency "bcrypt_pbkdf"
40
- spec.add_dependency "ed25519"
41
- spec.add_dependency "sshkit"
35
+ spec.add_dependency "citrus", "~> 3.0"
36
+ spec.add_dependency "gli", '~> 2.21'
37
+ spec.add_dependency "git", '~> 1.18'
38
+ spec.add_dependency "rubyzip", '~> 2.3'
39
+
40
+ spec.add_dependency "bcrypt_pbkdf", '~> 1.1'
41
+ spec.add_dependency "ed25519", '~> 1.3'
42
+ spec.add_dependency "sshkit", '~> 1.21'
42
43
 
43
44
  # For more information and examples about making a new gem, check out our
44
45
  # guide at: https://bundler.io/guides/creating_gem.html
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis
@@ -14,100 +14,100 @@ dependencies:
14
14
  name: citrus
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '3.0'
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: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gli
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '2.21'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '2.21'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: git
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.18'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.18'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rubyzip
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2.3'
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: '0'
68
+ version: '2.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: bcrypt_pbkdf
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '1.1'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: ed25519
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '1.3'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '1.3'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sshkit
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.21'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.21'
111
111
  description: opswalrus is a tool that runs scripts against a fleet of hosts hosts.
112
112
  It's kind of like Ansible, but aims to be simpler to use.
113
113
  email:
@@ -118,6 +118,7 @@ extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
120
  - ".rspec"
121
+ - Dockerfile
121
122
  - Gemfile
122
123
  - Gemfile.lock
123
124
  - LICENSE
@@ -150,7 +151,8 @@ files:
150
151
  - opswalrus.gemspec
151
152
  - sig/opswalrus.rbs
152
153
  homepage: https://github.com/opswalrus/opswalrus
153
- licenses: []
154
+ licenses:
155
+ - EPL-2.0
154
156
  metadata:
155
157
  homepage_uri: https://github.com/opswalrus/opswalrus
156
158
  source_code_uri: https://github.com/opswalrus/opswalrus