itamae 1.2.8 → 1.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/itamae/recipe.rb +6 -6
- data/lib/itamae/version.txt +1 -1
- data/spec/integration/recipes/default.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5514849fd07f64a8e08cddcd429e6dbd366ad79
|
4
|
+
data.tar.gz: 7844bbff4c0e017f03bcb540e18ae797499903af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c59c0be2d8f9b0270ec042ee839f6766d7f832aac8fb0c3724c2c3de3647348983264b747f251dfd89528b50fbdfbfbb50dfd528dff7e6c40e181d46b00d4ce4
|
7
|
+
data.tar.gz: e4d08541ddf828cd2d716a8bd13640c4a67ef16cb2fce234281538146a34cc238c6a8ac56dd0991b507d255c20c1433e53b3acc077b9da9564e589d8f8144d62
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
## v1.2.9
|
2
|
+
|
3
|
+
Bugfixes
|
4
|
+
|
5
|
+
- Do not use local variable named `variables`.
|
6
|
+
|
7
|
+
If `variables` is used as local variable's name, the following causes a syntax error.
|
8
|
+
|
9
|
+
```
|
10
|
+
template "..." do
|
11
|
+
variables foo: bar
|
12
|
+
# variables(foo: bar) # This never cause a syntax error
|
13
|
+
end
|
14
|
+
```
|
15
|
+
|
16
|
+
See also: https://bugs.ruby-lang.org/issues/11016
|
17
|
+
|
1
18
|
## v1.2.8
|
2
19
|
|
3
20
|
Improvements
|
data/lib/itamae/recipe.rb
CHANGED
@@ -36,8 +36,8 @@ module Itamae
|
|
36
36
|
::File.dirname(@path)
|
37
37
|
end
|
38
38
|
|
39
|
-
def load(
|
40
|
-
context = EvalContext.new(self,
|
39
|
+
def load(vars = {})
|
40
|
+
context = EvalContext.new(self, vars)
|
41
41
|
context.instance_eval(File.read(path), path, 1)
|
42
42
|
end
|
43
43
|
|
@@ -62,10 +62,10 @@ module Itamae
|
|
62
62
|
end
|
63
63
|
|
64
64
|
class EvalContext
|
65
|
-
def initialize(recipe,
|
65
|
+
def initialize(recipe, vars)
|
66
66
|
@recipe = recipe
|
67
67
|
|
68
|
-
|
68
|
+
vars.each do |k, v|
|
69
69
|
define_singleton_method(k) { v }
|
70
70
|
end
|
71
71
|
end
|
@@ -128,8 +128,8 @@ module Itamae
|
|
128
128
|
class RecipeFromDefinition < Recipe
|
129
129
|
attr_accessor :definition
|
130
130
|
|
131
|
-
def load(
|
132
|
-
context = EvalContext.new(self,
|
131
|
+
def load(vars = {})
|
132
|
+
context = EvalContext.new(self, vars)
|
133
133
|
context.instance_eval(&@definition.class.definition_block)
|
134
134
|
end
|
135
135
|
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.9
|
@@ -103,12 +103,12 @@ end
|
|
103
103
|
|
104
104
|
template "/tmp/template" do
|
105
105
|
source "hello.erb"
|
106
|
-
variables
|
106
|
+
variables goodbye: "Good bye"
|
107
107
|
end
|
108
108
|
|
109
109
|
template "/tmp/template_auto" do
|
110
110
|
source :auto
|
111
|
-
variables
|
111
|
+
variables goodbye: "Good bye"
|
112
112
|
end
|
113
113
|
|
114
114
|
file "/tmp/file" do
|