Skip to content

Commit 6181b7b

Browse files
committed
Few updates
1 parent ec01b59 commit 6181b7b

24 files changed

+179
-96
lines changed

.ruby-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-2.2.0
1+
ruby-2.3.1

.travis.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
language: ruby
22
script: "bundle exec rake spec"
33
rvm:
4-
- 2.0.0
5-
- 2.1.5
6-
- 2.2.0
4+
- 2.3.1
75
env:
86
- CODECLIMATE_REPO_TOKEN=891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
97
gemfile:
@@ -19,4 +17,4 @@ matrix:
1917
gemfile: gemfiles/rails_32.gemfile
2018
addons:
2119
code_climate:
22-
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
20+
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Overview
22

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+
310
## 0.1.2
411

512
### New Features
@@ -33,4 +40,4 @@
3340

3441
## 0.1.0
3542

36-
* Initial Release
43+
* Initial Release

Gemfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in liquid-rails.gemspec
44
gemspec
55

6-
gem 'rails', '~> 4.0.13'
7-
gem 'rspec-rails', '~> 3.2.0'
8-
gem 'guard-rspec', '~> 4.5.0'
9-
gem 'capybara', '~> 2.4.1'
10-
gem 'pry-rails'
11-
gem 'coveralls'
12-
gem 'simplecov'
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'

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://travis-ci.org/yoolk/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)
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)
22
# Liquid-Rails
33

44
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.

gemfiles/rails_32.gemfile

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
source 'https://rubygems.org'
22

33
gem 'rails', '~> 3.2.21'
4-
gem 'rspec-rails', '~> 3.2.0'
5-
gem 'guard-rspec', '~> 4.5.0'
6-
gem 'capybara', '~> 2.4.1'
7-
gem 'pry-rails'
8-
gem 'coveralls'
9-
gem 'simplecov'
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'
1012

11-
gemspec path: '../'
13+
gemspec path: '../'

gemfiles/rails_40.gemfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
source 'https://rubygems.org'
22

33
gem 'rails', '~> 4.0.13'
4-
gem 'rspec-rails', '~> 3.2.0'
5-
gem 'guard-rspec', '~> 4.5.0'
6-
gem 'capybara', '~> 2.4.1'
7-
gem 'pry-rails'
8-
gem 'coveralls'
9-
gem 'simplecov'
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'
1011

11-
gemspec path: '../'
12+
gemspec path: '../'

gemfiles/rails_41.gemfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
source 'https://rubygems.org'
22

33
gem 'rails', '~> 4.1.9'
4-
gem 'rspec-rails', '~> 3.2.0'
5-
gem 'guard-rspec', '~> 4.5.0'
6-
gem 'capybara', '~> 2.4.1'
7-
gem 'pry-rails'
8-
gem 'coveralls'
9-
gem 'simplecov'
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'
1011

11-
gemspec path: '../'
12+
gemspec path: '../'

gemfiles/rails_42.gemfile

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
source 'https://rubygems.org'
22

33
gem 'rails', '~> 4.2.0'
4-
gem 'rspec-rails', '~> 3.2.0'
5-
gem 'guard-rspec', '~> 4.5.0'
6-
gem 'capybara', '~> 2.4.1'
7-
gem 'pry-rails'
8-
gem 'coveralls'
9-
gem 'simplecov'
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'
1011

11-
gemspec path: '../'
12+
gemspec path: '../'

lib/liquid-rails/filters/asset_tag_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ module AssetTagFilter
1111
:stylesheet_link_tag,
1212
:video_tag,
1313

14-
to: :h
14+
to: :__h__
1515

1616
private
1717

18-
def h
19-
@h ||= @context.registers[:view]
18+
def __h__
19+
@context.registers[:view]
2020
end
2121
end
2222
end
2323
end
2424

25-
Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)
25+
Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)

lib/liquid-rails/filters/asset_url_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ module AssetUrlFilter
2323
:video_path,
2424
:video_url,
2525

26-
to: :h
26+
to: :__h__
2727

2828
private
2929

30-
def h
31-
@h ||= @context.registers[:view]
30+
def __h__
31+
@context.registers[:view]
3232
end
3333
end
3434
end
3535
end
3636

37-
Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)
37+
Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)

lib/liquid-rails/filters/date_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ module DateFilter
55
:distance_of_time_in_words,
66
:time_ago_in_words,
77

8-
to: :h
8+
to: :__h__
99

1010
private
1111

12-
def h
13-
@h ||= @context.registers[:view]
12+
def __h__
13+
@context.registers[:view]
1414
end
1515
end
1616
end
1717
end
1818

19-
Liquid::Template.register_filter(Liquid::Rails::DateFilter)
19+
Liquid::Template.register_filter(Liquid::Rails::DateFilter)

lib/liquid-rails/filters/number_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ module NumberFilter
1010
:number_to_human_size,
1111
:number_to_human,
1212

13-
to: :h
13+
to: :__h__
1414

1515
private
1616

17-
def h
18-
@h ||= @context.registers[:view]
17+
def __h__
18+
@context.registers[:view]
1919
end
2020
end
2121
end
2222
end
2323

24-
Liquid::Template.register_filter(Liquid::Rails::NumberFilter)
24+
Liquid::Template.register_filter(Liquid::Rails::NumberFilter)

lib/liquid-rails/filters/sanitize_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ module SanitizeFilter
55
:strip_tags,
66
:strip_links,
77

8-
to: :h
8+
to: :__h__
99

1010
private
1111

12-
def h
13-
@h ||= @context.registers[:view]
12+
def __h__
13+
@context.registers[:view]
1414
end
1515
end
1616
end
1717
end
1818

19-
Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)
19+
Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)

lib/liquid-rails/filters/text_filter.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module TextFilter
88
:word_wrap,
99
:simple_format,
1010

11-
to: :h
11+
to: :__h__
1212

1313
# right justify and padd a string
1414
def rjust(input, integer, padstr = '')
@@ -36,11 +36,11 @@ def concat(input, *args)
3636

3737
private
3838

39-
def h
40-
@h ||= @context.registers[:view]
39+
def __h__
40+
@context.registers[:view]
4141
end
4242
end
4343
end
4444
end
4545

46-
Liquid::Template.register_filter(Liquid::Rails::TextFilter)
46+
Liquid::Template.register_filter(Liquid::Rails::TextFilter)

lib/liquid-rails/filters/url_filter.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ def current_page?(path)
2121
end
2222
end
2323

24-
Liquid::Template.register_filter(Liquid::Rails::UrlFilter)
24+
Liquid::Template.register_filter(Liquid::Rails::UrlFilter)

lib/liquid-rails/version.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Liquid
22
module Rails
3-
VERSION = '0.1.3'
3+
VERSION = '0.1.4'
44
end
5-
end
5+
end

liquid-rails.gemspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
2020
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
2121
spec.require_paths = ['lib']
2222

23-
spec.add_dependency 'rails', '>= 3.2'
24-
spec.add_dependency 'liquid', '>= 3.0.0'
25-
spec.add_dependency 'kaminari', '>= 0.16.1'
23+
spec.add_dependency 'rails', ">= 3.2", "< 5"
24+
spec.add_dependency 'liquid', '~> 3.0.6'
25+
spec.add_dependency 'kaminari', '~> 0.17.0'
2626
end

spec/lib/liquid-rails/filters/asset_tag_filter_spec.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ module Rails
99
describe AssetTagFilter do
1010
subject { AssetTagFilterKlass.new }
1111

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) }
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__) }
2020
end
2121
end
22-
end
22+
end

spec/lib/liquid-rails/filters/asset_url_filter_spec.rb

+15-15
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ module Rails
99
describe AssetUrlFilter do
1010
subject { AssetUrlFilterKlass.new }
1111

12-
it { should delegate(:asset_path).to(:h) }
13-
it { should delegate(:asset_url).to(:h) }
12+
it { should delegate(:asset_path).to(:__h__) }
13+
it { should delegate(:asset_url).to(:__h__) }
1414

15-
it { should delegate(:audio_path).to(:h) }
16-
it { should delegate(:audio_url).to(:h) }
15+
it { should delegate(:audio_path).to(:__h__) }
16+
it { should delegate(:audio_url).to(:__h__) }
1717

18-
it { should delegate(:font_path).to(:h) }
19-
it { should delegate(:font_url).to(:h) }
18+
it { should delegate(:font_path).to(:__h__) }
19+
it { should delegate(:font_url).to(:__h__) }
2020

21-
it { should delegate(:image_path).to(:h) }
22-
it { should delegate(:image_url).to(:h) }
21+
it { should delegate(:image_path).to(:__h__) }
22+
it { should delegate(:image_url).to(:__h__) }
2323

24-
it { should delegate(:javascript_path).to(:h) }
25-
it { should delegate(:javascript_url).to(:h) }
24+
it { should delegate(:javascript_path).to(:__h__) }
25+
it { should delegate(:javascript_url).to(:__h__) }
2626

27-
it { should delegate(:stylesheet_path).to(:h) }
28-
it { should delegate(:stylesheet_url).to(:h) }
27+
it { should delegate(:stylesheet_path).to(:__h__) }
28+
it { should delegate(:stylesheet_url).to(:__h__) }
2929

30-
it { should delegate(:video_path).to(:h) }
31-
it { should delegate(:video_url).to(:h) }
30+
it { should delegate(:video_path).to(:__h__) }
31+
it { should delegate(:video_url).to(:__h__) }
3232
end
3333
end
34-
end
34+
end
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)