mote 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +5 -5
  2. data/lib/mote.rb +3 -3
  3. data/test/mote_test.rb +8 -0
  4. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: cdd4825c5458059af60c35d0a45e2d9efec430f8
4
- data.tar.gz: 2f454858806c6d3843cd1633fd08f87ab964032e
2
+ SHA256:
3
+ metadata.gz: 505a571d37072d62d6a1de88ef80388861411beb832dee8a959a0aaf44250b3c
4
+ data.tar.gz: e71a2d24a0f66ad9d12e006114b0c3ab8c2e2d0f08c945e76042aa6bd1ab3505
5
5
  SHA512:
6
- metadata.gz: 801c98128e08fcf1ff39c063298bd4b62441d61fbadf909a540a4af28ef81c2457e1e7066e88b41eaf7fd8f0e03693ee9e888d67ffd4b942c6e10b3eb6da48d7
7
- data.tar.gz: 504696651e81f5b179039167fe424e0bd5f191dadaf1c26a37d38594f1d8af2ec8518975def4711509c88a81ca547b201507b91e660258cf38b489fd360f10e5
6
+ metadata.gz: 41df91b9f277c509c6b5d438ac7039f07e5265889e58e8235d8d630bd4db7c263e2a9406776b691b86e0310736da1c3b91cff1d84d0b3cad86723844748d81b7
7
+ data.tar.gz: 1587c00e41e9bfeaf5a180b8297e3fb1f84e097c0c2d432fa2b2f86e7e7b4da921ab3919ced687d954733bcfaad5a6c028ea12000f52453ef9db0d4f8e721f89
data/lib/mote.rb CHANGED
@@ -18,7 +18,7 @@
18
18
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
19
  # THE SOFTWARE.
20
20
  class Mote
21
- VERSION = "1.3.0"
21
+ VERSION = "1.3.1"
22
22
 
23
23
  # The regex has three alternative blocks that capture the embedded
24
24
  # Ruby code. The rest is left as is.
@@ -49,8 +49,8 @@ class Mote
49
49
  code << "__o; end"
50
50
  end
51
51
 
52
- def self.parse(template, context = self, vars = [], name = "template")
53
- context.instance_eval(src(template, vars), name, -1)
52
+ def self.parse(_template, _context = self, _vars = [], _name = "template")
53
+ _context.instance_eval(src(_template, _vars), _name, -1)
54
54
  end
55
55
 
56
56
  module Helpers
data/test/mote_test.rb CHANGED
@@ -90,6 +90,14 @@ scope do
90
90
  example = Mote.parse("{{ user }}", context)
91
91
  assert_equal "Bruno", example.call
92
92
  end
93
+
94
+ test "context with name" do
95
+ context = Object.new
96
+ def context.name; "Sebas"; end
97
+
98
+ example = Mote.parse("{{ self.name }}", context)
99
+ assert_equal "Sebas", example.call
100
+ end
93
101
 
94
102
  test "locals" do
95
103
  example = Mote.parse("{{ user }}", TOPLEVEL_BINDING, [:user])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mote
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Martens
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-05 00:00:00.000000000 Z
11
+ date: 2021-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cutest
@@ -57,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
59
  requirements: []
60
- rubyforge_project:
61
- rubygems_version: 2.6.11
60
+ rubygems_version: 3.0.3
62
61
  signing_key:
63
62
  specification_version: 4
64
63
  summary: Minimum Operational Template.