snippr 0.15.15 → 0.15.16
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 +5 -13
- data/README.md +6 -1
- data/lib/snippr/processor/functions.rb +2 -1
- data/snippr.gemspec +1 -1
- data/spec/snippr/processor/functions_spec.rb +25 -10
- metadata +20 -21
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
YzM1NGU3MDgxZWIwZDNhMWIzYmUxMWZhMmJhZjFmZmY2YTM4ZDFmZA==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5e25773d2d7ad82e84565b0b71c6e84148da25b7
|
4
|
+
data.tar.gz: 5a2d3ee1f3f6cb03005a33a5723bd27c86f8b03f
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NTAwOGRlMDQ3ODc2NmIzYWQwNGQyMTVmMDIyMTk0ZDRiMGQ0NjQxZWFhZTMz
|
11
|
-
MGFjZTkwYzg5MmM0NjE1OTQxNGI1Njg1N2FmZTM4YmJlYzRhNTc=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
OWNjNzc1MTUzYWVkNmJhZDAzMjQxMWI5ODc1OGE5NzkyMTUyOTcyN2JkNTll
|
14
|
-
MzFiMGU0OTM1NjY3NTI3NGM5ZWQyN2VlNmFlY2JiNDk1OTNlYjRkMmExZTU5
|
15
|
-
MzgyYTk1ZTk2YzZiN2RlMzUzMGJjZjA5NGU2NzM2NzE0MzEwMWM=
|
6
|
+
metadata.gz: cf7690affccd3f54b7a2f37094c7075e4f86ffb00db5cbab7430ffa7d324be7ebcd0a3117f88e748b1c3161d8d71b2a6ba3e4c111394935ed28d63f28bed39dc
|
7
|
+
data.tar.gz: 6883b8fcae4c16d40a8d9febe9cdefe25c93fd65695ec70f615734cb541e962d7fcd2f119c2133c7a1accb21fe83737febd6ec1ad20b188099e9cce28ff910c8
|
data/README.md
CHANGED
@@ -127,7 +127,12 @@ You can pass additional dynamic values when using `{snip}`. These will override
|
|
127
127
|
|
128
128
|
{snip:filepath/of/snip,dyn_key1=dyn_value,dyn_key2=dyn_value2}
|
129
129
|
|
130
|
-
|
130
|
+
or
|
131
|
+
|
132
|
+
{snip:filepath/of/snip,dyn_key1="dyn_value",dyn_key2='dyn_value2'}
|
133
|
+
|
134
|
+
Those will be available as {dyn_key1} and {dyn_key2} in filepath/of/snip.snip
|
135
|
+
Outer quotes and double quotes will be removed
|
131
136
|
|
132
137
|
### Segments (as of Snippr 0.15.0)
|
133
138
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
# = Snippr::Processor::Functions
|
2
3
|
#
|
3
4
|
# Processes several functions in {command:options} syntax.
|
@@ -38,7 +39,7 @@ module Snippr
|
|
38
39
|
opt_value = opt_key
|
39
40
|
opt_key = :default
|
40
41
|
end
|
41
|
-
options[opt_key.to_sym] = opt_value
|
42
|
+
options[opt_key.to_sym] = opt_value.match(/^["']?(.*?)["']?$/)[1]
|
42
43
|
end
|
43
44
|
options
|
44
45
|
end
|
data/snippr.gemspec
CHANGED
@@ -1,34 +1,41 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
1
2
|
require "spec_helper"
|
2
3
|
|
3
4
|
describe Snippr::Processor::Functions do
|
4
5
|
|
5
6
|
describe "#cmd_snip" do
|
6
7
|
|
7
|
-
it "
|
8
|
+
it "includes snips inside of snips" do
|
8
9
|
subject.process('Include a {snip:home} inside a snip').should == "Include a <!-- starting snippr: home -->\n<p>Home</p>\n<!-- closing snippr: home --> inside a snip"
|
9
10
|
end
|
10
11
|
|
11
|
-
|
12
|
-
it "should pass parameters to the include" do
|
12
|
+
it "passes parameters to the include" do
|
13
13
|
subject.process('Include a {snip:topup/success} inside a snip', {
|
14
14
|
:topup_amount => '10',
|
15
15
|
:date_today => '123'
|
16
16
|
}).should == "Include a <!-- starting snippr: topup/success -->\n<p>You're topup of 10 at 123 was successful.</p>\n<!-- closing snippr: topup/success --> inside a snip"
|
17
17
|
end
|
18
18
|
|
19
|
-
it "
|
19
|
+
it "allows additional parameters to be passed to the included snippet" do
|
20
20
|
subject.process('Include a {snip:topup/success,topup_amount=99} inside a snip', {
|
21
21
|
:date_today => '123'
|
22
22
|
}).should == "Include a <!-- starting snippr: topup/success -->\n<p>You're topup of 99 at 123 was successful.</p>\n<!-- closing snippr: topup/success --> inside a snip"
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "allows additional parameters of the snip call to override parent options" do
|
26
26
|
subject.process('Include a {snip:topup/success,topup_amount=99} inside a snip', {
|
27
27
|
:date_today => '123',
|
28
28
|
:topup_amount => '1'
|
29
29
|
}).should == "Include a <!-- starting snippr: topup/success -->\n<p>You're topup of 99 at 123 was successful.</p>\n<!-- closing snippr: topup/success --> inside a snip"
|
30
30
|
end
|
31
31
|
|
32
|
+
it "allows additional parameters of the snip call to override parent options" do
|
33
|
+
subject.process('Include a {snip:topup/success,topup_amount="A B C"} inside a snip', {
|
34
|
+
:date_today => '123',
|
35
|
+
:topup_amount => '1'
|
36
|
+
}).should == "Include a <!-- starting snippr: topup/success -->\n<p>You're topup of A B C at 123 was successful.</p>\n<!-- closing snippr: topup/success --> inside a snip"
|
37
|
+
end
|
38
|
+
|
32
39
|
context "for home/show/blauappOverviewBoxMobile (regression test)" do
|
33
40
|
|
34
41
|
before do
|
@@ -41,7 +48,7 @@ describe Snippr::Processor::Functions do
|
|
41
48
|
Snippr::Normalizer.normalizers.pop # remove second normalizer
|
42
49
|
end
|
43
50
|
|
44
|
-
it "
|
51
|
+
it "works" do
|
45
52
|
subject.process("{snip:home/show/blauappOverviewBoxMobile}").should == "<!-- missing snippr: home/show/blauappOverviewBoxMobile_de -->"
|
46
53
|
end
|
47
54
|
|
@@ -51,22 +58,30 @@ describe Snippr::Processor::Functions do
|
|
51
58
|
|
52
59
|
describe "#hashify" do
|
53
60
|
|
54
|
-
it "
|
61
|
+
it "processes a single argument with no value as default" do
|
55
62
|
subject.send(:hashify, "test").should == { :default => "test" }
|
56
63
|
end
|
57
64
|
|
58
|
-
it "
|
65
|
+
it "processes a single argument with key and value" do
|
59
66
|
subject.send(:hashify, "key=value").should == { :key => "value" }
|
60
67
|
end
|
61
68
|
|
62
|
-
it "
|
69
|
+
it "processes multiple arguments delimited by comma" do
|
63
70
|
subject.send(:hashify, "key=value,key2=value2").should == { :key => "value", :key2 => "value2" }
|
64
71
|
end
|
65
72
|
|
66
|
-
it "
|
73
|
+
it "processes a combination of all arguments" do
|
67
74
|
subject.send(:hashify, "default,key=value,key2=value2").should == { :default => 'default', :key => "value", :key2 => "value2" }
|
68
75
|
end
|
69
76
|
|
77
|
+
it "removes leading and trailing quotes" do
|
78
|
+
subject.send(:hashify, "key='quoted'").should == { :key => 'quoted' }
|
79
|
+
end
|
80
|
+
|
81
|
+
it "removes leading and trailing double quotes" do
|
82
|
+
subject.send(:hashify, 'key="quoted"').should == { :key => 'quoted' }
|
83
|
+
end
|
84
|
+
|
70
85
|
end
|
71
86
|
|
72
87
|
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.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Harrington
|
@@ -10,90 +10,90 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-
|
13
|
+
date: 2014-03-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: i18n
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ">="
|
20
20
|
- !ruby/object:Gem::Version
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
version: '0'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: activesupport
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
32
32
|
requirements:
|
33
|
-
- -
|
33
|
+
- - ">="
|
34
34
|
- !ruby/object:Gem::Version
|
35
35
|
version: '0'
|
36
36
|
type: :runtime
|
37
37
|
prerelease: false
|
38
38
|
version_requirements: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
|
-
- -
|
40
|
+
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '0'
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: ci_reporter
|
45
45
|
requirement: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- - ~>
|
47
|
+
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: 1.6.5
|
50
50
|
type: :development
|
51
51
|
prerelease: false
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- - ~>
|
54
|
+
- - "~>"
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 1.6.5
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
58
|
name: rspec
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
|
-
- - ~>
|
61
|
+
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 2.14.0
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
|
-
- - ~>
|
68
|
+
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
70
|
version: 2.14.0
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: rake
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
74
74
|
requirements:
|
75
|
-
- - ~>
|
75
|
+
- - "~>"
|
76
76
|
- !ruby/object:Gem::Version
|
77
77
|
version: '10.0'
|
78
78
|
type: :development
|
79
79
|
prerelease: false
|
80
80
|
version_requirements: !ruby/object:Gem::Requirement
|
81
81
|
requirements:
|
82
|
-
- - ~>
|
82
|
+
- - "~>"
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '10.0'
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
86
|
name: pry-debugger
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- -
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
91
|
version: '0'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
94
|
version_requirements: !ruby/object:Gem::Requirement
|
95
95
|
requirements:
|
96
|
-
- -
|
96
|
+
- - ">="
|
97
97
|
- !ruby/object:Gem::Version
|
98
98
|
version: '0'
|
99
99
|
description: This gem provides ways to access file based cms resources from a rails
|
@@ -106,9 +106,9 @@ executables: []
|
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
|
-
- .gitignore
|
110
|
-
- .rspec
|
111
|
-
- .travis.yml
|
109
|
+
- ".gitignore"
|
110
|
+
- ".rspec"
|
111
|
+
- ".travis.yml"
|
112
112
|
- Gemfile
|
113
113
|
- LICENSE
|
114
114
|
- README.md
|
@@ -198,17 +198,17 @@ require_paths:
|
|
198
198
|
- lib
|
199
199
|
required_ruby_version: !ruby/object:Gem::Requirement
|
200
200
|
requirements:
|
201
|
-
- -
|
201
|
+
- - ">="
|
202
202
|
- !ruby/object:Gem::Version
|
203
203
|
version: '0'
|
204
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
205
|
requirements:
|
206
|
-
- -
|
206
|
+
- - ">="
|
207
207
|
- !ruby/object:Gem::Version
|
208
208
|
version: '0'
|
209
209
|
requirements: []
|
210
210
|
rubyforge_project: snippr
|
211
|
-
rubygems_version: 2.2.
|
211
|
+
rubygems_version: 2.2.2
|
212
212
|
signing_key:
|
213
213
|
specification_version: 4
|
214
214
|
summary: File based content management
|
@@ -254,4 +254,3 @@ test_files:
|
|
254
254
|
- spec/snippr/tardis_spec.rb
|
255
255
|
- spec/snippr/view_helper_spec.rb
|
256
256
|
- spec/spec_helper.rb
|
257
|
-
has_rdoc:
|