liquid-rails 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +2 -4
- data/CHANGELOG.md +8 -1
- data/Gemfile +8 -7
- data/README.md +1 -1
- data/gemfiles/rails_32.gemfile +9 -7
- data/gemfiles/rails_40.gemfile +8 -7
- data/gemfiles/rails_41.gemfile +8 -7
- data/gemfiles/rails_42.gemfile +8 -7
- data/lib/liquid-rails/filters/asset_tag_filter.rb +4 -4
- data/lib/liquid-rails/filters/asset_url_filter.rb +4 -4
- data/lib/liquid-rails/filters/date_filter.rb +4 -4
- data/lib/liquid-rails/filters/number_filter.rb +4 -4
- data/lib/liquid-rails/filters/paginate_filter.rb +1 -1
- data/lib/liquid-rails/filters/sanitize_filter.rb +4 -4
- data/lib/liquid-rails/filters/text_filter.rb +4 -4
- data/lib/liquid-rails/filters/url_filter.rb +1 -1
- data/lib/liquid-rails/tags/paginate_tag.rb +3 -3
- data/lib/liquid-rails/version.rb +2 -2
- data/liquid-rails.gemspec +4 -4
- data/spec/lib/liquid-rails/filters/asset_tag_filter_spec.rb +9 -9
- data/spec/lib/liquid-rails/filters/asset_url_filter_spec.rb +15 -15
- data/spec/lib/liquid-rails/filters/date_filter_spec.rb +16 -0
- data/spec/lib/liquid-rails/filters/number_filter_spec.rb +21 -0
- data/spec/lib/liquid-rails/filters/sanitize_filter_spec.rb +16 -0
- data/spec/lib/liquid-rails/filters/text_filter_spec.rb +19 -0
- data/spec/lib/liquid-rails/tags/paginate_tag_spec.rb +3 -3
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d360aa7c06d1c93bf06023b0f4db6b53d572f80
|
4
|
+
data.tar.gz: a9d624b08596805faaa776c47a5ad93aa037dc5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f1630c3e34e20b06e99356aac8ff0f97098457a77e8498f85b0ed726ab6923cefe55d9343ca38131795d47e9933349089ae846aea7a8f54aae33d29b426ddfe
|
7
|
+
data.tar.gz: c5b67fba26918a81ff95741978801fa3c451fd94b0cbd704f43dae0d2920a86d457fa13c909fe8c3de2530d9f41c1c31b13c7a1f6f21caa5c3778561c8bb5d2a
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
ruby-2.
|
1
|
+
ruby-2.3.1
|
data/.travis.yml
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
language: ruby
|
2
2
|
script: "bundle exec rake spec"
|
3
3
|
rvm:
|
4
|
-
- 2.
|
5
|
-
- 2.1.5
|
6
|
-
- 2.2.0
|
4
|
+
- 2.3.1
|
7
5
|
env:
|
8
6
|
- CODECLIMATE_REPO_TOKEN=891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
|
9
7
|
gemfile:
|
@@ -19,4 +17,4 @@ matrix:
|
|
19
17
|
gemfile: gemfiles/rails_32.gemfile
|
20
18
|
addons:
|
21
19
|
code_climate:
|
22
|
-
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
|
20
|
+
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Overview
|
2
2
|
|
3
|
+
## 0.1.4
|
4
|
+
|
5
|
+
### Resolved Issues
|
6
|
+
|
7
|
+
* Fix Filter overrides registered public methods as non public: h
|
8
|
+
* Support Liquid v3.0.6, Rails belows 5, and Kaminari below v1.0.0
|
9
|
+
|
3
10
|
## 0.1.2
|
4
11
|
|
5
12
|
### New Features
|
@@ -33,4 +40,4 @@
|
|
33
40
|
|
34
41
|
## 0.1.0
|
35
42
|
|
36
|
-
* Initial Release
|
43
|
+
* Initial Release
|
data/Gemfile
CHANGED
@@ -3,10 +3,11 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in liquid-rails.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem 'rails', '~> 4.
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
10
|
-
gem '
|
11
|
-
gem '
|
12
|
-
gem '
|
6
|
+
gem 'rails', '~> 4.2.10'
|
7
|
+
gem 'rake', '~> 12.3.0'
|
8
|
+
gem 'rspec-rails', '~> 3.5.2'
|
9
|
+
gem 'guard-rspec', '~> 4.7.3'
|
10
|
+
gem 'capybara', '~> 2.16.1'
|
11
|
+
gem 'pry-rails', '~> 0.3.6'
|
12
|
+
gem 'coveralls', '~> 0.8.21'
|
13
|
+
gem 'simplecov', '~> 0.14.1'
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Build Status](https://travis-ci.org/chamnap/liquid-rails.svg?branch=master)](https://travis-ci.org/yoolk/liquid-rails)[![Coverage Status](https://coveralls.io/repos/yoolk/liquid-rails/badge.png?branch=master)](https://coveralls.io/r/yoolk/liquid-rails?branch=master)[![Gem Version](https://badge.fury.io/rb/liquid-rails.svg)](http://badge.fury.io/rb/liquid-rails)
|
2
2
|
# Liquid-Rails
|
3
3
|
|
4
4
|
It allows you to render `.liquid` templates with layout and partial support. It also provides filters, tags, drops class to be used inside your liquid template.
|
data/gemfiles/rails_32.gemfile
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails', '~> 3.2.21'
|
4
|
-
gem '
|
5
|
-
gem '
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
4
|
+
gem 'rake', '~> 12.3.0'
|
5
|
+
gem 'rspec-rails', '~> 3.5.2'
|
6
|
+
gem 'guard-rspec', '~> 4.7.3'
|
7
|
+
gem 'capybara', '~> 2.16.1'
|
8
|
+
gem 'test-unit', '~> 3.0'
|
9
|
+
gem 'pry-rails', '~> 0.3.6'
|
10
|
+
gem 'coveralls', '~> 0.8.21'
|
11
|
+
gem 'simplecov', '~> 0.14.1'
|
10
12
|
|
11
|
-
gemspec path: '../'
|
13
|
+
gemspec path: '../'
|
data/gemfiles/rails_40.gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails', '~> 4.0.13'
|
4
|
-
gem '
|
5
|
-
gem '
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
4
|
+
gem 'rake', '~> 12.3.0'
|
5
|
+
gem 'rspec-rails', '~> 3.5.2'
|
6
|
+
gem 'guard-rspec', '~> 4.7.3'
|
7
|
+
gem 'capybara', '~> 2.16.1'
|
8
|
+
gem 'pry-rails', '~> 0.3.6'
|
9
|
+
gem 'coveralls', '~> 0.8.21'
|
10
|
+
gem 'simplecov', '~> 0.14.1'
|
10
11
|
|
11
|
-
gemspec path: '../'
|
12
|
+
gemspec path: '../'
|
data/gemfiles/rails_41.gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails', '~> 4.1.9'
|
4
|
-
gem '
|
5
|
-
gem '
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
4
|
+
gem 'rake', '~> 12.3.0'
|
5
|
+
gem 'rspec-rails', '~> 3.5.2'
|
6
|
+
gem 'guard-rspec', '~> 4.7.3'
|
7
|
+
gem 'capybara', '~> 2.16.1'
|
8
|
+
gem 'pry-rails', '~> 0.3.6'
|
9
|
+
gem 'coveralls', '~> 0.8.21'
|
10
|
+
gem 'simplecov', '~> 0.14.1'
|
10
11
|
|
11
|
-
gemspec path: '../'
|
12
|
+
gemspec path: '../'
|
data/gemfiles/rails_42.gemfile
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gem 'rails', '~> 4.2.0'
|
4
|
-
gem '
|
5
|
-
gem '
|
6
|
-
gem '
|
7
|
-
gem '
|
8
|
-
gem '
|
9
|
-
gem '
|
4
|
+
gem 'rake', '~> 12.3.0'
|
5
|
+
gem 'rspec-rails', '~> 3.5.2'
|
6
|
+
gem 'guard-rspec', '~> 4.7.3'
|
7
|
+
gem 'capybara', '~> 2.16.1'
|
8
|
+
gem 'pry-rails', '~> 0.3.6'
|
9
|
+
gem 'coveralls', '~> 0.8.21'
|
10
|
+
gem 'simplecov', '~> 0.14.1'
|
10
11
|
|
11
|
-
gemspec path: '../'
|
12
|
+
gemspec path: '../'
|
@@ -11,15 +11,15 @@ module Liquid
|
|
11
11
|
:stylesheet_link_tag,
|
12
12
|
:video_tag,
|
13
13
|
|
14
|
-
to: :
|
14
|
+
to: :__h__
|
15
15
|
|
16
16
|
private
|
17
17
|
|
18
|
-
def
|
19
|
-
@
|
18
|
+
def __h__
|
19
|
+
@context.registers[:view]
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
24
|
|
25
|
-
Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)
|
25
|
+
Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)
|
@@ -23,15 +23,15 @@ module Liquid
|
|
23
23
|
:video_path,
|
24
24
|
:video_url,
|
25
25
|
|
26
|
-
to: :
|
26
|
+
to: :__h__
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
def
|
31
|
-
@
|
30
|
+
def __h__
|
31
|
+
@context.registers[:view]
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
-
Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)
|
37
|
+
Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)
|
@@ -5,15 +5,15 @@ module Liquid
|
|
5
5
|
:distance_of_time_in_words,
|
6
6
|
:time_ago_in_words,
|
7
7
|
|
8
|
-
to: :
|
8
|
+
to: :__h__
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
def
|
13
|
-
@
|
12
|
+
def __h__
|
13
|
+
@context.registers[:view]
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
Liquid::Template.register_filter(Liquid::Rails::DateFilter)
|
19
|
+
Liquid::Template.register_filter(Liquid::Rails::DateFilter)
|
@@ -10,15 +10,15 @@ module Liquid
|
|
10
10
|
:number_to_human_size,
|
11
11
|
:number_to_human,
|
12
12
|
|
13
|
-
to: :
|
13
|
+
to: :__h__
|
14
14
|
|
15
15
|
private
|
16
16
|
|
17
|
-
def
|
18
|
-
@
|
17
|
+
def __h__
|
18
|
+
@context.registers[:view]
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
-
Liquid::Template.register_filter(Liquid::Rails::NumberFilter)
|
24
|
+
Liquid::Template.register_filter(Liquid::Rails::NumberFilter)
|
@@ -5,15 +5,15 @@ module Liquid
|
|
5
5
|
:strip_tags,
|
6
6
|
:strip_links,
|
7
7
|
|
8
|
-
to: :
|
8
|
+
to: :__h__
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
def
|
13
|
-
@
|
12
|
+
def __h__
|
13
|
+
@context.registers[:view]
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)
|
19
|
+
Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)
|
@@ -8,7 +8,7 @@ module Liquid
|
|
8
8
|
:word_wrap,
|
9
9
|
:simple_format,
|
10
10
|
|
11
|
-
to: :
|
11
|
+
to: :__h__
|
12
12
|
|
13
13
|
# right justify and padd a string
|
14
14
|
def rjust(input, integer, padstr = '')
|
@@ -36,11 +36,11 @@ module Liquid
|
|
36
36
|
|
37
37
|
private
|
38
38
|
|
39
|
-
def
|
40
|
-
@
|
39
|
+
def __h__
|
40
|
+
@context.registers[:view]
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
Liquid::Template.register_filter(Liquid::Rails::TextFilter)
|
46
|
+
Liquid::Template.register_filter(Liquid::Rails::TextFilter)
|
@@ -37,12 +37,12 @@ module Liquid
|
|
37
37
|
@context = context
|
38
38
|
|
39
39
|
context.stack do
|
40
|
-
collection = context[@collection_name]
|
41
|
-
raise ::Liquid::ArgumentError.new("Cannot paginate
|
40
|
+
collection = @context[@collection_name].presence || @context.environments[0][@collection_name]
|
41
|
+
raise ::Liquid::ArgumentError.new("Cannot paginate collection '#{@collection_name}'. Not found.") if collection.nil?
|
42
42
|
|
43
43
|
if collection.is_a? Array
|
44
44
|
paginated_collection = Kaminari.paginate_array(collection.to_a).page(current_page).per(@page_size)
|
45
|
-
elsif collection.respond_to?(:page)
|
45
|
+
elsif collection.respond_to?(:page)
|
46
46
|
paginated_collection = collection.page(current_page).per(@page_size)
|
47
47
|
end
|
48
48
|
|
data/lib/liquid-rails/version.rb
CHANGED
data/liquid-rails.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_dependency 'rails',
|
24
|
-
spec.add_dependency 'liquid', '
|
25
|
-
spec.add_dependency 'kaminari', '~> 0.
|
26
|
-
end
|
23
|
+
spec.add_dependency 'rails', ">= 3.2", "< 5"
|
24
|
+
spec.add_dependency 'liquid', '~> 3.0.6'
|
25
|
+
spec.add_dependency 'kaminari', '~> 0.17.0'
|
26
|
+
end
|
@@ -9,14 +9,14 @@ module Liquid
|
|
9
9
|
describe AssetTagFilter do
|
10
10
|
subject { AssetTagFilterKlass.new }
|
11
11
|
|
12
|
-
it { should delegate(:audio_tag).to(:
|
13
|
-
it { should delegate(:auto_discovery_link_tag).to(:
|
14
|
-
it { should delegate(:favicon_link_tag).to(:
|
15
|
-
it { should delegate(:image_alt).to(:
|
16
|
-
it { should delegate(:image_tag).to(:
|
17
|
-
it { should delegate(:javascript_include_tag).to(:
|
18
|
-
it { should delegate(:stylesheet_link_tag).to(:
|
19
|
-
it { should delegate(:video_tag).to(:
|
12
|
+
it { should delegate(:audio_tag).to(:__h__) }
|
13
|
+
it { should delegate(:auto_discovery_link_tag).to(:__h__) }
|
14
|
+
it { should delegate(:favicon_link_tag).to(:__h__) }
|
15
|
+
it { should delegate(:image_alt).to(:__h__) }
|
16
|
+
it { should delegate(:image_tag).to(:__h__) }
|
17
|
+
it { should delegate(:javascript_include_tag).to(:__h__) }
|
18
|
+
it { should delegate(:stylesheet_link_tag).to(:__h__) }
|
19
|
+
it { should delegate(:video_tag).to(:__h__) }
|
20
20
|
end
|
21
21
|
end
|
22
|
-
end
|
22
|
+
end
|
@@ -9,26 +9,26 @@ module Liquid
|
|
9
9
|
describe AssetUrlFilter do
|
10
10
|
subject { AssetUrlFilterKlass.new }
|
11
11
|
|
12
|
-
it { should delegate(:asset_path).to(:
|
13
|
-
it { should delegate(:asset_url).to(:
|
12
|
+
it { should delegate(:asset_path).to(:__h__) }
|
13
|
+
it { should delegate(:asset_url).to(:__h__) }
|
14
14
|
|
15
|
-
it { should delegate(:audio_path).to(:
|
16
|
-
it { should delegate(:audio_url).to(:
|
15
|
+
it { should delegate(:audio_path).to(:__h__) }
|
16
|
+
it { should delegate(:audio_url).to(:__h__) }
|
17
17
|
|
18
|
-
it { should delegate(:font_path).to(:
|
19
|
-
it { should delegate(:font_url).to(:
|
18
|
+
it { should delegate(:font_path).to(:__h__) }
|
19
|
+
it { should delegate(:font_url).to(:__h__) }
|
20
20
|
|
21
|
-
it { should delegate(:image_path).to(:
|
22
|
-
it { should delegate(:image_url).to(:
|
21
|
+
it { should delegate(:image_path).to(:__h__) }
|
22
|
+
it { should delegate(:image_url).to(:__h__) }
|
23
23
|
|
24
|
-
it { should delegate(:javascript_path).to(:
|
25
|
-
it { should delegate(:javascript_url).to(:
|
24
|
+
it { should delegate(:javascript_path).to(:__h__) }
|
25
|
+
it { should delegate(:javascript_url).to(:__h__) }
|
26
26
|
|
27
|
-
it { should delegate(:stylesheet_path).to(:
|
28
|
-
it { should delegate(:stylesheet_url).to(:
|
27
|
+
it { should delegate(:stylesheet_path).to(:__h__) }
|
28
|
+
it { should delegate(:stylesheet_url).to(:__h__) }
|
29
29
|
|
30
|
-
it { should delegate(:video_path).to(:
|
31
|
-
it { should delegate(:video_url).to(:
|
30
|
+
it { should delegate(:video_path).to(:__h__) }
|
31
|
+
it { should delegate(:video_url).to(:__h__) }
|
32
32
|
end
|
33
33
|
end
|
34
|
-
end
|
34
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class DateFilterKlass
|
4
|
+
include Liquid::Rails::DateFilter
|
5
|
+
end
|
6
|
+
|
7
|
+
module Liquid
|
8
|
+
module Rails
|
9
|
+
describe DateFilter do
|
10
|
+
subject { DateFilterKlass.new }
|
11
|
+
|
12
|
+
it { should delegate(:distance_of_time_in_words).to(:__h__) }
|
13
|
+
it { should delegate(:time_ago_in_words).to(:__h__) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class NumberFilterKlass
|
4
|
+
include Liquid::Rails::NumberFilter
|
5
|
+
end
|
6
|
+
|
7
|
+
module Liquid
|
8
|
+
module Rails
|
9
|
+
describe NumberFilter do
|
10
|
+
subject { NumberFilterKlass.new }
|
11
|
+
|
12
|
+
it { should delegate(:number_to_phone).to(:__h__) }
|
13
|
+
it { should delegate(:number_to_currency).to(:__h__) }
|
14
|
+
it { should delegate(:number_to_percentage).to(:__h__) }
|
15
|
+
it { should delegate(:number_with_delimiter).to(:__h__) }
|
16
|
+
it { should delegate(:number_with_precision).to(:__h__) }
|
17
|
+
it { should delegate(:number_to_human_size).to(:__h__) }
|
18
|
+
it { should delegate(:number_to_human).to(:__h__) }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class SanitizeFilterKlass
|
4
|
+
include Liquid::Rails::SanitizeFilter
|
5
|
+
end
|
6
|
+
|
7
|
+
module Liquid
|
8
|
+
module Rails
|
9
|
+
describe SanitizeFilter do
|
10
|
+
subject { SanitizeFilterKlass.new }
|
11
|
+
|
12
|
+
it { should delegate(:strip_tags).to(:__h__) }
|
13
|
+
it { should delegate(:strip_links).to(:__h__) }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
class TextFilterKlass
|
4
|
+
include Liquid::Rails::TextFilter
|
5
|
+
end
|
6
|
+
|
7
|
+
module Liquid
|
8
|
+
module Rails
|
9
|
+
describe TextFilter do
|
10
|
+
subject { TextFilterKlass.new }
|
11
|
+
|
12
|
+
it { should delegate(:highlight).to(:__h__) }
|
13
|
+
it { should delegate(:excerpt).to(:__h__) }
|
14
|
+
it { should delegate(:pluralize).to(:__h__) }
|
15
|
+
it { should delegate(:word_wrap).to(:__h__) }
|
16
|
+
it { should delegate(:simple_format).to(:__h__) }
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -142,17 +142,17 @@ module Liquid
|
|
142
142
|
|
143
143
|
it 'is in the first_page' do
|
144
144
|
controller.params[:page] = 1
|
145
|
-
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li class="active"><span>1</span></li> <li><a href="/?page=2">2</a></li> <li><a href="/?page=3">3</a></li> <li><a href="/?page=2" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </nav
|
145
|
+
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li class="disabled"><a href="#" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li class="active"><span>1</span></li> <li><a href="/?page=2">2</a></li> <li><a href="/?page=3">3</a></li> <li><a href="/?page=2" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </ul></nav>|, { 'post' => @post_drop })
|
146
146
|
end
|
147
147
|
|
148
148
|
it 'is in the second_page' do
|
149
149
|
controller.params[:page] = 2
|
150
|
-
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li><a href="/?page=1" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li><a href="/?page=1">1</a></li> <li class="active"><span>2</span></li> <li><a href="/?page=3">3</a></li> <li><a href="/?page=3" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </nav
|
150
|
+
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li><a href="/?page=1" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li><a href="/?page=1">1</a></li> <li class="active"><span>2</span></li> <li><a href="/?page=3">3</a></li> <li><a href="/?page=3" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </ul></nav>|, { 'post' => @post_drop })
|
151
151
|
end
|
152
152
|
|
153
153
|
it 'is in the last_page' do
|
154
154
|
controller.params[:page] = 3
|
155
|
-
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li><a href="/?page=2" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li><a href="/?page=1">1</a></li> <li><a href="/?page=2">2</a></li> <li class="active"><span>3</span></li> <li class="disabled"><a href="#" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </nav
|
155
|
+
expect_template_result("{% paginate post.comments by 2 %}{{ paginate | bootstrap_pagination }}{% endpaginate %}", %|<nav><ul class="pagination "> <li><a href="/?page=2" aria-label="Previous"><span aria-hidden="true">« Previous</span></a></li> <li><a href="/?page=1">1</a></li> <li><a href="/?page=2">2</a></li> <li class="active"><span>3</span></li> <li class="disabled"><a href="#" aria-label="Next"><span aria-hidden="true">Next »</span></a></li> </ul></nav>|, { 'post' => @post_drop })
|
156
156
|
end
|
157
157
|
end
|
158
158
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquid-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chamnap Chhorn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3.2'
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '5'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,34 +27,37 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: '3.2'
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: liquid
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - "
|
37
|
+
- - "~>"
|
32
38
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.0.
|
39
|
+
version: 3.0.6
|
34
40
|
type: :runtime
|
35
41
|
prerelease: false
|
36
42
|
version_requirements: !ruby/object:Gem::Requirement
|
37
43
|
requirements:
|
38
|
-
- - "
|
44
|
+
- - "~>"
|
39
45
|
- !ruby/object:Gem::Version
|
40
|
-
version: 3.0.
|
46
|
+
version: 3.0.6
|
41
47
|
- !ruby/object:Gem::Dependency
|
42
48
|
name: kaminari
|
43
49
|
requirement: !ruby/object:Gem::Requirement
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
53
|
+
version: 0.17.0
|
48
54
|
type: :runtime
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
60
|
+
version: 0.17.0
|
55
61
|
description: It allows you to render .liquid templates with layout and partial support.
|
56
62
|
It also provides filters, tags, drops class to be used inside your liquid template.
|
57
63
|
email:
|
@@ -164,8 +170,12 @@ files:
|
|
164
170
|
- spec/lib/liquid-rails/drops/drop_spec.rb
|
165
171
|
- spec/lib/liquid-rails/filters/asset_tag_filter_spec.rb
|
166
172
|
- spec/lib/liquid-rails/filters/asset_url_filter_spec.rb
|
173
|
+
- spec/lib/liquid-rails/filters/date_filter_spec.rb
|
167
174
|
- spec/lib/liquid-rails/filters/google_static_map_url_filter_spec.rb
|
168
175
|
- spec/lib/liquid-rails/filters/misc_filter_spec.rb
|
176
|
+
- spec/lib/liquid-rails/filters/number_filter_spec.rb
|
177
|
+
- spec/lib/liquid-rails/filters/sanitize_filter_spec.rb
|
178
|
+
- spec/lib/liquid-rails/filters/text_filter_spec.rb
|
169
179
|
- spec/lib/liquid-rails/filters/translate_filter_spec.rb
|
170
180
|
- spec/lib/liquid-rails/railtie_spec.rb
|
171
181
|
- spec/lib/liquid-rails/rspec/drop_matchers_spec.rb
|
@@ -197,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
197
207
|
version: 1.8.11
|
198
208
|
requirements: []
|
199
209
|
rubyforge_project:
|
200
|
-
rubygems_version: 2.
|
210
|
+
rubygems_version: 2.5.1
|
201
211
|
signing_key:
|
202
212
|
specification_version: 4
|
203
213
|
summary: Renders liquid templates with layout and partial support
|
@@ -259,8 +269,12 @@ test_files:
|
|
259
269
|
- spec/lib/liquid-rails/drops/drop_spec.rb
|
260
270
|
- spec/lib/liquid-rails/filters/asset_tag_filter_spec.rb
|
261
271
|
- spec/lib/liquid-rails/filters/asset_url_filter_spec.rb
|
272
|
+
- spec/lib/liquid-rails/filters/date_filter_spec.rb
|
262
273
|
- spec/lib/liquid-rails/filters/google_static_map_url_filter_spec.rb
|
263
274
|
- spec/lib/liquid-rails/filters/misc_filter_spec.rb
|
275
|
+
- spec/lib/liquid-rails/filters/number_filter_spec.rb
|
276
|
+
- spec/lib/liquid-rails/filters/sanitize_filter_spec.rb
|
277
|
+
- spec/lib/liquid-rails/filters/text_filter_spec.rb
|
264
278
|
- spec/lib/liquid-rails/filters/translate_filter_spec.rb
|
265
279
|
- spec/lib/liquid-rails/railtie_spec.rb
|
266
280
|
- spec/lib/liquid-rails/rspec/drop_matchers_spec.rb
|