mote 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/lib/mote.rb +8 -6
  4. data/mote.gemspec +0 -1
  5. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 530e8a86da4e1fcb06a1bebd2e953a4a6b5be56c
4
- data.tar.gz: 18eed6501b852ae5bb4540980a5bfa6e8cc527f4
3
+ metadata.gz: cdd4825c5458059af60c35d0a45e2d9efec430f8
4
+ data.tar.gz: 2f454858806c6d3843cd1633fd08f87ab964032e
5
5
  SHA512:
6
- metadata.gz: 9d9ebffd32633732750fe63bb190f7e2c81bf7438c8a7bf8bb975b21012b130bf40a20f027ae69c980aced146296b065912948deb563ccf2d14ea991f0fbc407
7
- data.tar.gz: 63cae29cdfeae148549e82a531fef12bbc72b07c58562058046b5201e5a74af6c7b310001d19f1d525bd6c54428614792f998acc844cc1538867484ef51999a0
6
+ metadata.gz: 801c98128e08fcf1ff39c063298bd4b62441d61fbadf909a540a4af28ef81c2457e1e7066e88b41eaf7fd8f0e03693ee9e888d67ffd4b942c6e10b3eb6da48d7
7
+ data.tar.gz: 504696651e81f5b179039167fe424e0bd5f191dadaf1c26a37d38594f1d8af2ec8518975def4711509c88a81ca547b201507b91e660258cf38b489fd360f10e5
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2015 Michel Martens
1
+ Copyright (c) 2011 Michel Martens
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  of this software and associated documentation files (the "Software"), to deal
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2011-2015 Michel Martens
1
+ # Copyright (c) 2011 Michel Martens
2
2
  #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
4
4
  # of this software and associated documentation files (the "Software"), to deal
@@ -18,17 +18,17 @@
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.2.0"
21
+ VERSION = "1.3.0"
22
22
 
23
- # The regex have three alternative blocks that capture the embedded Ruby code,
24
- # the rest is left as is.
23
+ # The regex has three alternative blocks that capture the embedded
24
+ # Ruby code. The rest is left as is.
25
25
  PATTERN = /
26
26
  ^[^\S\n]*(%)[^\S\n]*(.*?)(?:\n|\Z) | # Ruby evaluated lines
27
27
  (<\?)\s+(.*?)\s+\?> | # Multiline Ruby blocks
28
28
  (\{\{)(.*?)\}\} # Ruby evaluated to strings
29
29
  /mx
30
30
 
31
- def self.parse(template, context = self, vars = [], name = "template")
31
+ def self.src(template, vars = [])
32
32
  terms = template.split(PATTERN)
33
33
 
34
34
  code = "Proc.new do |params, __o| params ||= {}; __o ||= '';"
@@ -47,8 +47,10 @@ class Mote
47
47
  end
48
48
 
49
49
  code << "__o; end"
50
+ end
50
51
 
51
- context.instance_eval(code, name, -1)
52
+ def self.parse(template, context = self, vars = [], name = "template")
53
+ context.instance_eval(src(template, vars), name, -1)
52
54
  end
53
55
 
54
56
  module Helpers
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
12
12
  "LICENSE",
13
13
  "AUTHORS",
14
14
  "README.md",
15
- "Rakefile",
16
15
  "lib/**/*.rb",
17
16
  "*.gemspec",
18
17
  "test/**/*.rb"
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.2.0
4
+ version: 1.3.0
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-02-23 00:00:00.000000000 Z
11
+ date: 2017-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cutest
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.4.5.1
61
+ rubygems_version: 2.6.11
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Minimum Operational Template.