dry-stack 0.0.65 → 0.0.66

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: f96a3143d144e622ba0c06a2eb67d6fee7d325f0f4e3f984c8313b9d8833e7e1
4
- data.tar.gz: d4433df530534df768005e58bf26a9f3b1ef9c2d4164276614f0a1063642fa5a
3
+ metadata.gz: 0744df1483b4323addc08c050c291eef4ad60cdd2a9f715cead6f5eca28a816b
4
+ data.tar.gz: f1f35fd550ad5d6b5f78d18aab2e9fb63ca53d8b419f6ba7b51114dbedc81cbf
5
5
  SHA512:
6
- metadata.gz: 76982a0d87feb4cb38e12857fe6a513b9e77d33c64ba82a9142b763dde262069ced3d802af1c52f841e1e3e90404e7555190aa996b6ba99953a2d2145d2ef1b4
7
- data.tar.gz: 104859829b364ebc61ed45ab1924a453cd1e77ed8db490d9edaf557c2de4aa53b9b46a0bc29d5de20b63610bad23dd20674a385de26dedbc6b516178a78a03e0
6
+ metadata.gz: bf2be88c5378759774f873a3afcc54c9d625b83a7a8eb25b9375764914c79db07a7468a52065867aaea0f517e7dec3fddf0242fb8f22531acab8aa78ce3a998b
7
+ data.tar.gz: 99bddd3ffd562d103cf16e84a56b85166fd323e1a44e7fff6244345662b7043f39b2f7f792910c5b1b7929ccb4be3ccddab6467c036f5b59a6eac3a2a52df724
@@ -29,6 +29,8 @@ module Dry
29
29
  raise 'Invalid .env file'
30
30
  end
31
31
 
32
+ def safe_eval(str) = Dry::Stack() { eval str, self.binding }
33
+
32
34
  def run(args)
33
35
  params = {}
34
36
 
@@ -69,7 +71,8 @@ module Dry
69
71
  stack_text = File.read(params[:stack]) if params[:stack]
70
72
  stack_text ||= STDIN.read unless $stdin.tty?
71
73
 
72
- Dry::Stack() { eval stack_text }
74
+ safe_eval stack_text # isolate context
75
+
73
76
  Stack.last_stack.name = params[:name] if params[:name]
74
77
  COMMANDS[command.to_sym].run Stack.last_stack, params
75
78
  rescue => e
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  class Stack
3
- VERSION = '0.0.65'
3
+ VERSION = '0.0.66'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.65
4
+ version: 0.0.66
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-13 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake