opswalrus 1.0.28 → 1.0.29

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0ed3ebf666e1e12461a109ace60e4429008e5016fde3c4f0605e1b1f0e8c3a01
4
- data.tar.gz: 88a949890ddb41d16d69e667e6440e4894a4d1ef369b0e4db301ce5f751c5570
3
+ metadata.gz: 95be80c5fc4ff5b54b579adbf681ae134f9f1e32ebfee9ee5654da294a6ee4ec
4
+ data.tar.gz: 7443c58118a65cb8643093de761a74c97f6f86c8f134a403d06f7864a26e156a
5
5
  SHA512:
6
- metadata.gz: 8625724d93eea350e367d57468b8c4072a3f1e4946469afba2e950305b93d564e056afd368ee5af5c44483364ed41b3aa003bedeabb6e40281c0d65c6a10f8be
7
- data.tar.gz: c75cfe115140ec4bcb09059e9f3ce96ea2b51bca4c60552221a53f4415c91b3da55ad1acef2f61fcf08cb93cfb20580390317862fa9f288f56a8787959189324
6
+ metadata.gz: 71d5e41176f93c0d01f07ff2c893de09b81776d1068bab235343b2cfb283c1bf7725cb1f64baf99762f93cef0a64a3817ff9f460cdb1b23f634f7f77aee9aaa0
7
+ data.tar.gz: 59aa3c3fb801afa462c83dbef214b2b4baba528924b1fc1f194ce792b212c762f991f5c89df7fd316e95a6875f8aef661168384145130bfe6723181b01ff5604
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opswalrus (1.0.28)
4
+ opswalrus (1.0.29)
5
5
  amazing_print (~> 1.5)
6
6
  bcrypt_pbkdf (~> 1.1)
7
7
  citrus (~> 3.0)
@@ -75,6 +75,13 @@ module OpsWalrus
75
75
  end
76
76
  end
77
77
 
78
+ class EnvParams < InvocationParams
79
+ # params : Hash | ArrayOrHashNavigationProxy
80
+ def initialize(hashlike_params = ENV)
81
+ super(hashlike_params)
82
+ end
83
+ end
84
+
78
85
  class OpsFileScript
79
86
 
80
87
  def self.define_for(ops_file, ruby_script)
@@ -175,9 +175,9 @@ module OpsWalrus
175
175
  def env(*keys)
176
176
  keys = keys.map(&:to_s)
177
177
  if keys.empty?
178
- @env
178
+ @runtime_env.env
179
179
  else
180
- @env.dig(*keys)
180
+ @runtime_env.env.dig(*keys)
181
181
  end
182
182
  end
183
183
 
@@ -234,9 +234,11 @@ module OpsWalrus
234
234
 
235
235
  attr_accessor :app
236
236
  attr_accessor :pty
237
+ attr_reader :env
237
238
 
238
239
  def initialize(app)
239
240
  @app = app
241
+ @env = EnvParams.new(ENV)
240
242
  @bundle_load_path = LoadPath.new(self, @app.bundle_dir)
241
243
  @app_load_path = LoadPath.new(self, @app.pwd)
242
244
 
@@ -1,3 +1,3 @@
1
1
  module OpsWalrus
2
- VERSION = "1.0.28"
2
+ VERSION = "1.0.29"
3
3
  end
@@ -63,6 +63,12 @@ module WalrusLang
63
63
  end
64
64
  end
65
65
 
66
+ class String
67
+ def render_template(hash)
68
+ WalrusLang.render(self, hash)
69
+ end
70
+ end
71
+
66
72
  class Hash
67
73
  def to_binding
68
74
  OpenStruct.new(self).instance_eval { binding }
@@ -77,7 +83,7 @@ end
77
83
 
78
84
  def mustache(&block)
79
85
  template_string = block.call
80
- template_string =~ /{{.*}}/ ? WalrusLang.render(block.call, block.binding) : template_string
86
+ template_string =~ /{{.*}}/ ? WalrusLang.render(template_string, block.binding) : template_string
81
87
  end
82
88
 
83
89
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opswalrus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.28
4
+ version: 1.0.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Ellis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-25 00:00:00.000000000 Z
11
+ date: 2023-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amazing_print