itamae 1.2.8 → 1.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8815e26260fcdb26ad53e3dfef5d0fffb1282244
4
- data.tar.gz: 0db4ddf34079e91eab44ea5a39338e9591e92d8b
3
+ metadata.gz: c5514849fd07f64a8e08cddcd429e6dbd366ad79
4
+ data.tar.gz: 7844bbff4c0e017f03bcb540e18ae797499903af
5
5
  SHA512:
6
- metadata.gz: 5479683a14d33546ef79cec19304e37bc9b1b1bd69a95ca72c2e29f7cbb4131ec6482646c5934aa34208dbc064f143bc392cac5593635822bd192c1f4ff35a60
7
- data.tar.gz: 16b612e907f4c981e42b9964d322423413244ba55ac53777cf71f171b0da590c249031cb6c67b2d7e65c56592061810b31edb1a15e9618451bf4e35d51137fa6
6
+ metadata.gz: c59c0be2d8f9b0270ec042ee839f6766d7f832aac8fb0c3724c2c3de3647348983264b747f251dfd89528b50fbdfbfbb50dfd528dff7e6c40e181d46b00d4ce4
7
+ data.tar.gz: e4d08541ddf828cd2d716a8bd13640c4a67ef16cb2fce234281538146a34cc238c6a8ac56dd0991b507d255c20c1433e53b3acc077b9da9564e589d8f8144d62
@@ -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
@@ -36,8 +36,8 @@ module Itamae
36
36
  ::File.dirname(@path)
37
37
  end
38
38
 
39
- def load(variables = {})
40
- context = EvalContext.new(self, variables)
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, variables)
65
+ def initialize(recipe, vars)
66
66
  @recipe = recipe
67
67
 
68
- variables.each do |k, v|
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(variables = {})
132
- context = EvalContext.new(self, variables)
131
+ def load(vars = {})
132
+ context = EvalContext.new(self, vars)
133
133
  context.instance_eval(&@definition.class.definition_block)
134
134
  end
135
135
 
@@ -1 +1 @@
1
- 1.2.8
1
+ 1.2.9
@@ -103,12 +103,12 @@ end
103
103
 
104
104
  template "/tmp/template" do
105
105
  source "hello.erb"
106
- variables(goodbye: "Good bye")
106
+ variables goodbye: "Good bye"
107
107
  end
108
108
 
109
109
  template "/tmp/template_auto" do
110
110
  source :auto
111
- variables(goodbye: "Good bye")
111
+ variables goodbye: "Good bye"
112
112
  end
113
113
 
114
114
  file "/tmp/file" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.8
4
+ version: 1.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai