Skip to content

Commit

Permalink
Few updates
Browse files Browse the repository at this point in the history
  • Loading branch information
chamnap committed Dec 31, 2017
1 parent ec01b59 commit 6181b7b
Show file tree
Hide file tree
Showing 24 changed files with 179 additions and 96 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.2.0
ruby-2.3.1
6 changes: 2 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
language: ruby
script: "bundle exec rake spec"
rvm:
- 2.0.0
- 2.1.5
- 2.2.0
- 2.3.1
env:
- CODECLIMATE_REPO_TOKEN=891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
gemfile:
Expand All @@ -19,4 +17,4 @@ matrix:
gemfile: gemfiles/rails_32.gemfile
addons:
code_climate:
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Overview

## 0.1.4

### Resolved Issues

* Fix Filter overrides registered public methods as non public: h
* Support Liquid v3.0.6, Rails belows 5, and Kaminari below v1.0.0

## 0.1.2

### New Features
Expand Down Expand Up @@ -33,4 +40,4 @@

## 0.1.0

* Initial Release
* Initial Release
15 changes: 8 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in liquid-rails.gemspec
gemspec

gem 'rails', '~> 4.0.13'
gem 'rspec-rails', '~> 3.2.0'
gem 'guard-rspec', '~> 4.5.0'
gem 'capybara', '~> 2.4.1'
gem 'pry-rails'
gem 'coveralls'
gem 'simplecov'
gem 'rails', '~> 4.2.10'
gem 'rake', '~> 12.3.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'capybara', '~> 2.16.1'
gem 'pry-rails', '~> 0.3.6'
gem 'coveralls', '~> 0.8.21'
gem 'simplecov', '~> 0.14.1'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![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)
[![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)
# Liquid-Rails

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.
Expand Down
16 changes: 9 additions & 7 deletions gemfiles/rails_32.gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
source 'https://rubygems.org'

gem 'rails', '~> 3.2.21'
gem 'rspec-rails', '~> 3.2.0'
gem 'guard-rspec', '~> 4.5.0'
gem 'capybara', '~> 2.4.1'
gem 'pry-rails'
gem 'coveralls'
gem 'simplecov'
gem 'rake', '~> 12.3.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'capybara', '~> 2.16.1'
gem 'test-unit', '~> 3.0'
gem 'pry-rails', '~> 0.3.6'
gem 'coveralls', '~> 0.8.21'
gem 'simplecov', '~> 0.14.1'

gemspec path: '../'
gemspec path: '../'
15 changes: 8 additions & 7 deletions gemfiles/rails_40.gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
source 'https://rubygems.org'

gem 'rails', '~> 4.0.13'
gem 'rspec-rails', '~> 3.2.0'
gem 'guard-rspec', '~> 4.5.0'
gem 'capybara', '~> 2.4.1'
gem 'pry-rails'
gem 'coveralls'
gem 'simplecov'
gem 'rake', '~> 12.3.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'capybara', '~> 2.16.1'
gem 'pry-rails', '~> 0.3.6'
gem 'coveralls', '~> 0.8.21'
gem 'simplecov', '~> 0.14.1'

gemspec path: '../'
gemspec path: '../'
15 changes: 8 additions & 7 deletions gemfiles/rails_41.gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
source 'https://rubygems.org'

gem 'rails', '~> 4.1.9'
gem 'rspec-rails', '~> 3.2.0'
gem 'guard-rspec', '~> 4.5.0'
gem 'capybara', '~> 2.4.1'
gem 'pry-rails'
gem 'coveralls'
gem 'simplecov'
gem 'rake', '~> 12.3.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'capybara', '~> 2.16.1'
gem 'pry-rails', '~> 0.3.6'
gem 'coveralls', '~> 0.8.21'
gem 'simplecov', '~> 0.14.1'

gemspec path: '../'
gemspec path: '../'
15 changes: 8 additions & 7 deletions gemfiles/rails_42.gemfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
source 'https://rubygems.org'

gem 'rails', '~> 4.2.0'
gem 'rspec-rails', '~> 3.2.0'
gem 'guard-rspec', '~> 4.5.0'
gem 'capybara', '~> 2.4.1'
gem 'pry-rails'
gem 'coveralls'
gem 'simplecov'
gem 'rake', '~> 12.3.0'
gem 'rspec-rails', '~> 3.5.2'
gem 'guard-rspec', '~> 4.7.3'
gem 'capybara', '~> 2.16.1'
gem 'pry-rails', '~> 0.3.6'
gem 'coveralls', '~> 0.8.21'
gem 'simplecov', '~> 0.14.1'

gemspec path: '../'
gemspec path: '../'
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/asset_tag_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ module AssetTagFilter
:stylesheet_link_tag,
:video_tag,

to: :h
to: :__h__

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)
Liquid::Template.register_filter(Liquid::Rails::AssetTagFilter)
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/asset_url_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ module AssetUrlFilter
:video_path,
:video_url,

to: :h
to: :__h__

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)
Liquid::Template.register_filter(Liquid::Rails::AssetUrlFilter)
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/date_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module DateFilter
:distance_of_time_in_words,
:time_ago_in_words,

to: :h
to: :__h__

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::DateFilter)
Liquid::Template.register_filter(Liquid::Rails::DateFilter)
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/number_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ module NumberFilter
:number_to_human_size,
:number_to_human,

to: :h
to: :__h__

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::NumberFilter)
Liquid::Template.register_filter(Liquid::Rails::NumberFilter)
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/sanitize_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ module SanitizeFilter
:strip_tags,
:strip_links,

to: :h
to: :__h__

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)
Liquid::Template.register_filter(Liquid::Rails::SanitizeFilter)
8 changes: 4 additions & 4 deletions lib/liquid-rails/filters/text_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module TextFilter
:word_wrap,
:simple_format,

to: :h
to: :__h__

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

private

def h
@h ||= @context.registers[:view]
def __h__
@context.registers[:view]
end
end
end
end

Liquid::Template.register_filter(Liquid::Rails::TextFilter)
Liquid::Template.register_filter(Liquid::Rails::TextFilter)
2 changes: 1 addition & 1 deletion lib/liquid-rails/filters/url_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ def current_page?(path)
end
end

Liquid::Template.register_filter(Liquid::Rails::UrlFilter)
Liquid::Template.register_filter(Liquid::Rails::UrlFilter)
4 changes: 2 additions & 2 deletions lib/liquid-rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Liquid
module Rails
VERSION = '0.1.3'
VERSION = '0.1.4'
end
end
end
6 changes: 3 additions & 3 deletions liquid-rails.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ['lib']

spec.add_dependency 'rails', '>= 3.2'
spec.add_dependency 'liquid', '>= 3.0.0'
spec.add_dependency 'kaminari', '>= 0.16.1'
spec.add_dependency 'rails', ">= 3.2", "< 5"
spec.add_dependency 'liquid', '~> 3.0.6'
spec.add_dependency 'kaminari', '~> 0.17.0'
end
18 changes: 9 additions & 9 deletions spec/lib/liquid-rails/filters/asset_tag_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ module Rails
describe AssetTagFilter do
subject { AssetTagFilterKlass.new }

it { should delegate(:audio_tag).to(:h) }
it { should delegate(:auto_discovery_link_tag).to(:h) }
it { should delegate(:favicon_link_tag).to(:h) }
it { should delegate(:image_alt).to(:h) }
it { should delegate(:image_tag).to(:h) }
it { should delegate(:javascript_include_tag).to(:h) }
it { should delegate(:stylesheet_link_tag).to(:h) }
it { should delegate(:video_tag).to(:h) }
it { should delegate(:audio_tag).to(:__h__) }
it { should delegate(:auto_discovery_link_tag).to(:__h__) }
it { should delegate(:favicon_link_tag).to(:__h__) }
it { should delegate(:image_alt).to(:__h__) }
it { should delegate(:image_tag).to(:__h__) }
it { should delegate(:javascript_include_tag).to(:__h__) }
it { should delegate(:stylesheet_link_tag).to(:__h__) }
it { should delegate(:video_tag).to(:__h__) }
end
end
end
end
30 changes: 15 additions & 15 deletions spec/lib/liquid-rails/filters/asset_url_filter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,26 @@ module Rails
describe AssetUrlFilter do
subject { AssetUrlFilterKlass.new }

it { should delegate(:asset_path).to(:h) }
it { should delegate(:asset_url).to(:h) }
it { should delegate(:asset_path).to(:__h__) }
it { should delegate(:asset_url).to(:__h__) }

it { should delegate(:audio_path).to(:h) }
it { should delegate(:audio_url).to(:h) }
it { should delegate(:audio_path).to(:__h__) }
it { should delegate(:audio_url).to(:__h__) }

it { should delegate(:font_path).to(:h) }
it { should delegate(:font_url).to(:h) }
it { should delegate(:font_path).to(:__h__) }
it { should delegate(:font_url).to(:__h__) }

it { should delegate(:image_path).to(:h) }
it { should delegate(:image_url).to(:h) }
it { should delegate(:image_path).to(:__h__) }
it { should delegate(:image_url).to(:__h__) }

it { should delegate(:javascript_path).to(:h) }
it { should delegate(:javascript_url).to(:h) }
it { should delegate(:javascript_path).to(:__h__) }
it { should delegate(:javascript_url).to(:__h__) }

it { should delegate(:stylesheet_path).to(:h) }
it { should delegate(:stylesheet_url).to(:h) }
it { should delegate(:stylesheet_path).to(:__h__) }
it { should delegate(:stylesheet_url).to(:__h__) }

it { should delegate(:video_path).to(:h) }
it { should delegate(:video_url).to(:h) }
it { should delegate(:video_path).to(:__h__) }
it { should delegate(:video_url).to(:__h__) }
end
end
end
end
16 changes: 16 additions & 0 deletions spec/lib/liquid-rails/filters/date_filter_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require 'spec_helper'

class DateFilterKlass
include Liquid::Rails::DateFilter
end

module Liquid
module Rails
describe DateFilter do
subject { DateFilterKlass.new }

it { should delegate(:distance_of_time_in_words).to(:__h__) }
it { should delegate(:time_ago_in_words).to(:__h__) }
end
end
end
Loading

0 comments on commit 6181b7b

Please sign in to comment.