condensation 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a393d9eb0299b23e66c0c038680659d49c11fff8
|
4
|
+
data.tar.gz: ee168fe8b748bf9b35768588f031516c0d12fad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8477f1b77f70c36435754c7cc6afeb605fe1305f882582bbca5f1402e800a89123f980abfe87ca961233ab8c66b6abe6b2a9fdf2c1d66dc04ab5262aab8b2149
|
7
|
+
data.tar.gz: d83ee28d60416959410dd61e4fc17094c465ccba94c6f324b17cf015454293e3bd12bd7859d9984afa9e3ede0b8d976696f9955384c3c7b89dee70070956a0ed
|
data/lib/condensation/filters.rb
CHANGED
@@ -3,4 +3,5 @@ require "condensation/filters/hyperlink"
|
|
3
3
|
require "condensation/filters/replace_inner_html"
|
4
4
|
require "condensation/filters/days_since"
|
5
5
|
require "condensation/filters/days_until"
|
6
|
-
require "condensation/filters/url_encode"
|
6
|
+
require "condensation/filters/url_encode"
|
7
|
+
require "condensation/filters/strip_commas"
|
data/lib/condensation/version.rb
CHANGED
data/lib/condensation.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper.rb'
|
2
|
+
|
3
|
+
describe Condensation::Filters::StripCommas do
|
4
|
+
def render_with_filter(template, context)
|
5
|
+
template.render(context, :filters => [Condensation::Filters::StripCommas])
|
6
|
+
end
|
7
|
+
|
8
|
+
describe "#strip_commas" do
|
9
|
+
it "remove commas" do
|
10
|
+
tag = "foo, bar, bop"
|
11
|
+
template = Liquid::Template.parse("{{ tag | strip_commas }}")
|
12
|
+
result = render_with_filter(template, { "tag" => tag })
|
13
|
+
result.must_equal "foo bar bop"
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should handle nil values" do
|
17
|
+
tag = nil
|
18
|
+
template = Liquid::Template.parse("{{ tags | strip_commas }}")
|
19
|
+
result = render_with_filter(template, { "tag" => tag })
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Derrick Reimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-12 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/strip_commas.rb
|
109
110
|
- lib/condensation/filters/url_encode.rb
|
110
111
|
- lib/condensation/sanitizer.rb
|
111
112
|
- lib/condensation/version.rb
|
@@ -114,6 +115,7 @@ files:
|
|
114
115
|
- spec/condensation/filters/default_spec.rb
|
115
116
|
- spec/condensation/filters/hyperlink_spec.rb
|
116
117
|
- spec/condensation/filters/replace_inner_html_spec.rb
|
118
|
+
- spec/condensation/filters/strip_commas_spec.rb
|
117
119
|
- spec/condensation/filters/url_encode_spec.rb
|
118
120
|
- spec/condensation/sanitizer_spec.rb
|
119
121
|
- spec/condensation_spec.rb
|
@@ -137,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
139
|
version: '0'
|
138
140
|
requirements: []
|
139
141
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.0
|
142
|
+
rubygems_version: 2.3.0
|
141
143
|
signing_key:
|
142
144
|
specification_version: 4
|
143
145
|
summary: Condensation is a collection of handy extensions to the Liquid templating
|
@@ -148,7 +150,9 @@ test_files:
|
|
148
150
|
- spec/condensation/filters/default_spec.rb
|
149
151
|
- spec/condensation/filters/hyperlink_spec.rb
|
150
152
|
- spec/condensation/filters/replace_inner_html_spec.rb
|
153
|
+
- spec/condensation/filters/strip_commas_spec.rb
|
151
154
|
- spec/condensation/filters/url_encode_spec.rb
|
152
155
|
- spec/condensation/sanitizer_spec.rb
|
153
156
|
- spec/condensation_spec.rb
|
154
157
|
- spec/spec_helper.rb
|
158
|
+
has_rdoc:
|