condensation 1.0.2 → 1.0.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 760318c47617620c742ac22ed0517be0475048f4
|
4
|
+
data.tar.gz: eea54bd7785eee3024a5e6e5dd00ba1976149366
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4a22ba563281a17cc06638a010b400b07db726e81490dc16a19329d301f03c8a40c409f0be2b08601f114bc4e871b3bb8ca479cce74bdcc774fa8450eb03692
|
7
|
+
data.tar.gz: 783bc3a8afee5244217be2588ab01c3c92545e8e35dde533f5ca181814fc40d92f40690d4b4fa43aaeaad90156ebe8fdb0dd7d5756e19eca5de1bce524274cba
|
data/lib/condensation/filters.rb
CHANGED
@@ -2,4 +2,5 @@ require "condensation/filters/default"
|
|
2
2
|
require "condensation/filters/hyperlink"
|
3
3
|
require "condensation/filters/replace_inner_html"
|
4
4
|
require "condensation/filters/days_since"
|
5
|
-
require "condensation/filters/days_until"
|
5
|
+
require "condensation/filters/days_until"
|
6
|
+
require "condensation/filters/url_encode"
|
data/lib/condensation/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
+
|
3
|
+
describe Condensation::Filters::UrlEncode do
|
4
|
+
def render_with_filter(template, context)
|
5
|
+
template.render(context, :filters => [Condensation::Filters::UrlEncode])
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "#url_encode" do
|
9
|
+
it "encode the input" do
|
10
|
+
email = "derrick+1@example.com"
|
11
|
+
template = Liquid::Template.parse("{{ email | url_encode }}")
|
12
|
+
result = render_with_filter(template, { "email" => email })
|
13
|
+
result.must_equal "derrick%2B1%40example.com"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should handle nil values" do
|
17
|
+
email = nil
|
18
|
+
template = Liquid::Template.parse("{{ email | url_encode }}")
|
19
|
+
result = render_with_filter(template, { "email" => email })
|
20
|
+
result.must_equal ""
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: condensation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derrick Reimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/condensation/filters/default.rb
|
107
107
|
- lib/condensation/filters/hyperlink.rb
|
108
108
|
- lib/condensation/filters/replace_inner_html.rb
|
109
|
+
- lib/condensation/filters/url_encode.rb
|
109
110
|
- lib/condensation/sanitizer.rb
|
110
111
|
- lib/condensation/version.rb
|
111
112
|
- spec/condensation/filters/days_since_spec.rb
|
@@ -113,6 +114,7 @@ files:
|
|
113
114
|
- spec/condensation/filters/default_spec.rb
|
114
115
|
- spec/condensation/filters/hyperlink_spec.rb
|
115
116
|
- spec/condensation/filters/replace_inner_html_spec.rb
|
117
|
+
- spec/condensation/filters/url_encode_spec.rb
|
116
118
|
- spec/condensation/sanitizer_spec.rb
|
117
119
|
- spec/condensation_spec.rb
|
118
120
|
- spec/spec_helper.rb
|
@@ -146,6 +148,7 @@ test_files:
|
|
146
148
|
- spec/condensation/filters/default_spec.rb
|
147
149
|
- spec/condensation/filters/hyperlink_spec.rb
|
148
150
|
- spec/condensation/filters/replace_inner_html_spec.rb
|
151
|
+
- spec/condensation/filters/url_encode_spec.rb
|
149
152
|
- spec/condensation/sanitizer_spec.rb
|
150
153
|
- spec/condensation_spec.rb
|
151
154
|
- spec/spec_helper.rb
|