Skip to content

Commit 02a7a9a

Browse files
committed
merged with master
2 parents 762b3d4 + dfcf37a commit 02a7a9a

26 files changed

+114
-59
lines changed

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruby-2.1.3
1+
ruby-2.2.0

.travis.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ language: ruby
22
script: "bundle exec rake spec"
33
rvm:
44
- 2.0.0
5-
- 2.1.0
6-
- 2.1.1
7-
- 2.1.2
5+
- 2.1.5
6+
- 2.2.0
87
env:
98
- CODECLIMATE_REPO_TOKEN=891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
109
gemfile:
10+
- gemfiles/rails_32.gemfile
1111
- gemfiles/rails_40.gemfile
1212
- gemfiles/rails_41.gemfile
13+
- gemfiles/rails_42.gemfile
1314
notifications:
1415
email: false
16+
matrix:
17+
exclude:
18+
- rvm: 2.2.0
19+
gemfile: gemfiles/rails_32.gemfile
1520
addons:
1621
code_climate:
1722
repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e

Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ source 'https://rubygems.org'
33
# Specify your gem's dependencies in liquid-rails.gemspec
44
gemspec
55

6-
gem 'rails', '~> 4.0.10'
7-
gem 'rspec-rails', '~> 2.14.2'
6+
gem 'rails', '~> 4.0.13'
7+
gem 'rspec-rails', '~> 3.2.0'
8+
gem 'guard-rspec', '~> 4.5.0'
89
gem 'capybara', '~> 2.4.1'
910
gem 'pry-rails'
1011
gem 'coveralls'
11-
gem 'simplecov'
12-
gem 'guard-rspec'
12+
gem 'simplecov'

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99
task default: 'spec:all'
1010

1111
namespace :spec do
12-
%w(rails_41 rails_40 rails_32).each do |gemfile|
12+
%w(rails_42 rails_41 rails_40 rails_32).each do |gemfile|
1313
desc "Run Tests against #{gemfile}"
1414
task gemfile do
1515
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
@@ -19,7 +19,7 @@ namespace :spec do
1919

2020
desc "Run Tests against rails versions"
2121
task :all do
22-
%w(rails_41 rails_40 rails_32).each do |gemfile|
22+
%w(rails_42 rails_41 rails_40 rails_32).each do |gemfile|
2323
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
2424
sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
2525
end

gemfiles/rails_32.gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 3.2.19'
4-
gem 'rspec-rails', '~> 2.14.2'
3+
gem 'rails', '~> 3.2.21'
4+
gem 'rspec-rails', '~> 3.2.0'
5+
gem 'guard-rspec', '~> 4.5.0'
56
gem 'capybara', '~> 2.4.1'
67
gem 'pry-rails'
78
gem 'coveralls'
89
gem 'simplecov'
9-
gem 'guard-rspec'
1010

1111
gemspec path: '../'

gemfiles/rails_40.gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 4.0.10'
4-
gem 'rspec-rails', '~> 2.14.2'
3+
gem 'rails', '~> 4.0.13'
4+
gem 'rspec-rails', '~> 3.2.0'
5+
gem 'guard-rspec', '~> 4.5.0'
56
gem 'capybara', '~> 2.4.1'
67
gem 'pry-rails'
78
gem 'coveralls'
89
gem 'simplecov'
9-
gem 'guard-rspec'
1010

1111
gemspec path: '../'

gemfiles/rails_41.gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
source 'https://rubygems.org'
22

3-
gem 'rails', '~> 4.1.6'
4-
gem 'rspec-rails', '~> 2.14.2'
3+
gem 'rails', '~> 4.1.9'
4+
gem 'rspec-rails', '~> 3.2.0'
5+
gem 'guard-rspec', '~> 4.5.0'
56
gem 'capybara', '~> 2.4.1'
67
gem 'pry-rails'
78
gem 'coveralls'
89
gem 'simplecov'
9-
gem 'guard-rspec'
1010

1111
gemspec path: '../'

gemfiles/rails_42.gemfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
source 'https://rubygems.org'
2+
3+
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'
10+
11+
gemspec path: '../'

lib/liquid-rails/file_system.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ module Liquid
44
module Rails
55
class FileSystem < ::Liquid::LocalFileSystem
66
def read_template_file(template_path, context)
7-
controller_name = context.registers[:controller].controller_name
8-
template_path = "#{controller_name}/#{template_path}" unless template_path.include?('/')
9-
7+
controller_path = context.registers[:controller].controller_path
8+
template_path = "#{controller_path}/#{template_path}" unless template_path.include?('/')
109
super
1110
end
1211
end
1312
end
14-
end
13+
end

lib/liquid-rails/filters/translate_filter.rb

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
module Liquid
22
module Rails
33
module TranslateFilter
4-
def translate(key, locale = nil, scope = nil)
5-
locale ||= ::I18n.locale.to_s
4+
def translate(key, options={})
5+
options = { 'locale' => ::I18n.locale.to_s }.merge(options)
66

7-
@context.registers[:view].translate(key.to_s, locale: locale, scope: scope)
8-
end
9-
10-
def t(name, vars={})
11-
@context.registers[:view].translate(name).gsub(/\{\{(.*?)\}\}/) {
12-
"#{vars[$1.strip]}"
13-
}
7+
@context.registers[:view].translate(key.to_s, options.with_indifferent_access)
148
end
9+
alias_method :t, :translate
1510
end
1611
end
1712
end

0 commit comments

Comments
 (0)