snippr 0.15.23 → 0.15.24
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 +4 -4
- data/lib/snippr/processor/dynamics.rb +1 -1
- data/snippr.gemspec +1 -1
- data/spec/snippr/processor/dynamics_spec.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae2d0b5629b7140a0d8b124a4e16299c0b9ded4
|
4
|
+
data.tar.gz: 8b6c014d9e147e85f0243a1b76ef4d2e33a6c0d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ad49375b5ab78a91a1a626769f30911289050a616cbb9b74fb2d039b8201e37cd763bc0bf8c681ad6db511305ffeeac058042ddefb3b2f38f9e47b9817a8cb
|
7
|
+
data.tar.gz: d5f6b0fd8c8c939a70f61f9991ebefa25f2e666ad8d5532ae5a1854b86f472e3a152399bee0752831b18967d3c2c3aedc2d2153e861aa786ce305153f4ff8497
|
@@ -47,7 +47,7 @@ module Snippr
|
|
47
47
|
(?:\|(.*?))? # $5: optional default value when snippet content empty
|
48
48
|
\} # and thats it
|
49
49
|
) # end capture of variable area
|
50
|
-
([
|
50
|
+
((?!"[),])|$) # $6: this allows he capture of method calls in method calls
|
51
51
|
}xm
|
52
52
|
end
|
53
53
|
|
data/snippr.gemspec
CHANGED
@@ -18,6 +18,11 @@ describe Snippr::Processor::Dynamics do
|
|
18
18
|
})).to eq("Your topup of 15,00 € at #{today} was successful.")
|
19
19
|
end
|
20
20
|
|
21
|
+
it 'parses the placeholden when surrounded by quotes' do
|
22
|
+
tpl = 'start class="{var}" end'
|
23
|
+
expect(subject.process(tpl, :var => "cssclass")).to eq('start class="cssclass" end');
|
24
|
+
end
|
25
|
+
|
21
26
|
it "parses multi-line parameters" do
|
22
27
|
tpl = "An instance {var.method2(\"PARAM\t\nETER\")}"
|
23
28
|
expect(subject.process(tpl, :var => Klass.new)).to eq("An instance METHOD WITH PARAMETER")
|
@@ -43,12 +48,6 @@ describe Snippr::Processor::Dynamics do
|
|
43
48
|
expect(subject.process(tpl, :var => Klass.new)).to eq("An instance METHOD WITH PARAMETER1 AND PARAMETER2")
|
44
49
|
end
|
45
50
|
|
46
|
-
it "allows usage of snippr substitution inside method call parameters" do
|
47
|
-
pending 'fix it or use version 0.15.19'
|
48
|
-
tpl = 'An instance {var.method3("{var2.method()}","PARAMETER2")}'
|
49
|
-
expect(subject.process(tpl, :var => Klass.new, :var2 => Klass.new)).to eq('An instance METHOD WITH METHOD AND PARAMETER2')
|
50
|
-
end
|
51
|
-
|
52
51
|
it "keeps the {snip} if calling a method but the method is not defined" do
|
53
52
|
expect(subject.process("An instance {var.method_not_exist()}", :var => Klass.new)).to eq("An instance {var.method_not_exist()}")
|
54
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snippr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-06-
|
13
|
+
date: 2014-06-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|