liquid4-rails5 0.1.5 → 0.2.1

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: '04811eb8e8a59f3c13d332dfe1c4dc160f886afd'
4
- data.tar.gz: 486cd19af25af23e3a5af0947e34b947db765722
3
+ metadata.gz: a0accabc83ca1c951eae826837a0c678ddaae243
4
+ data.tar.gz: 85f55167dbcc776bae246168b3352bedc0493588
5
5
  SHA512:
6
- metadata.gz: 7fd3e1e483bf787f467f0b0d3cd6fe3b2ea15a8516b187556df6317a70c4a3a2e951504fa23b1e87ce2e71b1110b6e51fa13774fe5df39ce1512db53663571f0
7
- data.tar.gz: 47eaccbc231b7f557eb29ff114d81597de81c3b51f9a11114df2a2894979b4e9a6b3601099cebde346cbe83e72c195682f8868732189c3cc7cb8528b7f5b6ff5
6
+ metadata.gz: b003d9a49347be1a9ab2871c9730e8f111db40559056ed61c769402124146c4b27c395ef4716a49ebed946ed93418170001cf829be5a257d8cba5dac13775003
7
+ data.tar.gz: f993c02dca25e049673a00108c1f73f54120b4098d376314e5c387e433d2d035e013830f6d15e8b4d552c7edbfc3ee64d30860b849639bc7d85e233dbc73bdc6
data/.gitignore CHANGED
@@ -21,4 +21,3 @@ tmp
21
21
  *.a
22
22
  mkmf.log
23
23
  spec/dummy/log/*
24
- gemfiles/*.lock
@@ -1,22 +1,14 @@
1
1
  language: ruby
2
- script: "bundle exec rake spec"
3
2
  rvm:
4
- - 2.0.0
5
- - 2.1.5
6
- - 2.2.0
7
- env:
8
- - CODECLIMATE_REPO_TOKEN=891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
9
- gemfile:
10
- - gemfiles/rails_32.gemfile
11
- - gemfiles/rails_40.gemfile
12
- - gemfiles/rails_41.gemfile
13
- - gemfiles/rails_42.gemfile
3
+ - 2.3.3
14
4
  notifications:
15
5
  email: false
16
- matrix:
17
- exclude:
18
- - rvm: 2.2.0
19
- gemfile: gemfiles/rails_32.gemfile
20
6
  addons:
21
7
  code_climate:
22
- repo_token: 891d362268d07d6ff0f5534f92252b6195f6be8795054d3627643eb6314a8c9e
8
+ repo_token: 19eacae3f704e69e605854bd8e178e910a808a40ed7de846e87d89a0aec47a0a
9
+ after_success:
10
+ - bundle exec codeclimate-test-reporter
11
+ cache: bundler
12
+ script:
13
+ - bundle exec rspec
14
+ sudo: false
data/Gemfile CHANGED
@@ -3,10 +3,3 @@ source 'https://rubygems.org'
3
3
  # Specify your gem's dependencies in liquid-rails.gemspec
4
4
  gemspec
5
5
 
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'
@@ -1,4 +1,4 @@
1
- Copyright (c) 2014 Chamnap Chhorn
1
+ Copyright (c) 2017 Viktor Fonic
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  [![Test Coverage](https://codeclimate.com/github/vfonic/liquid4-rails5/badges/coverage.svg)](https://codeclimate.com/github/vfonic/liquid4-rails5/coverage)
6
6
  [![Gem Version](https://badge.fury.io/rb/liquid4-rails5.svg)](http://badge.fury.io/rb/liquid4-rails5)
7
7
  [![security](https://hakiri.io/github/vfonic/liquid4-rails5/master.svg)](https://hakiri.io/github/vfonic/liquid4-rails5/master)
8
- [![git.legal](https://git.legal/projects/3620/badge.svg?key=5c097d05a251758abac3 "Number of libraries approved")](https://git.legal/projects/3620)
8
+ [![git.legal](https://git.legal/projects/3623/badge.svg?key=e845da4a03552f24d670 "Number of libraries approved")](https://git.legal/projects/3623)
9
9
 
10
10
  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.
11
11
 
data/Rakefile CHANGED
@@ -17,21 +17,3 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
17
17
  end
18
18
 
19
19
  task default: 'spec:all'
20
-
21
- namespace :spec do
22
- %w(rails_42 rails_41 rails_40 rails_32).each do |gemfile|
23
- desc "Run Tests against #{gemfile}"
24
- task gemfile do
25
- sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
26
- sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
27
- end
28
- end
29
-
30
- desc "Run Tests against rails versions"
31
- task :all do
32
- %w(rails_42 rails_41 rails_40 rails_32).each do |gemfile|
33
- sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle --quiet"
34
- sh "BUNDLE_GEMFILE='gemfiles/#{gemfile}.gemfile' bundle exec rake spec"
35
- end
36
- end
37
- end
@@ -7,11 +7,8 @@ module Liquid
7
7
  def setup_view_and_controller
8
8
  @view = ActionView::Base.new
9
9
  @controller = ApplicationController.new
10
- @request = ActionController::TestRequest.new('PATH_INFO' => '/')
11
- @response = ActionController::TestResponse.new
12
- @response.request = @request
10
+ @request = ActionDispatch::TestRequest.create('PATH_INFO' => '/')
13
11
  @controller.request = @request
14
- @controller.response = @response
15
12
  @controller.params = {}
16
13
  @view.assign_controller(@controller)
17
14
  @view.class.send(:include, @controller._helpers)
@@ -42,4 +39,4 @@ module Liquid
42
39
  end
43
40
  end
44
41
  end
45
- end
42
+ end
@@ -1,5 +1,5 @@
1
1
  module Liquid
2
2
  module Rails
3
- VERSION = '0.1.5'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['viktor.fonic@gmail.com']
11
11
  spec.summary = %q{Renders liquid templates with layout and partial support}
12
12
  spec.description = %q{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.}
13
- spec.homepage = ''
13
+ spec.homepage = 'https://github.com/vfonic/liquid4-rails5'
14
14
  spec.license = 'MIT'
15
15
  spec.required_ruby_version = '>= 2.0.0'
16
16
  spec.required_rubygems_version = '>= 1.8.11'
@@ -20,7 +20,15 @@ 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', '>= 3.2'
23
+ spec.add_dependency 'rails', '>= 5'
24
24
  spec.add_dependency 'liquid', '>= 3.0.0'
25
25
  spec.add_dependency 'kaminari', '>= 0.16.1'
26
+
27
+ spec.add_development_dependency 'codeclimate-test-reporter'
28
+ spec.add_development_dependency 'rails', '~> 5'
29
+ spec.add_development_dependency 'rspec-rails', '~> 3.2'
30
+ spec.add_development_dependency 'guard-rspec', '~> 4.5.0'
31
+ spec.add_development_dependency 'capybara', '~> 2.4.1'
32
+ spec.add_development_dependency 'pry-rails'
33
+ spec.add_development_dependency 'simplecov'
26
34
  end
@@ -1,5 +1,5 @@
1
1
  class HomeController < ApplicationController
2
- before_filter :set_book
2
+ before_action :set_book
3
3
 
4
4
  def index
5
5
  render layout: false
@@ -1,5 +1,5 @@
1
1
  class PagesController < ApplicationController
2
- before_filter :set_book
2
+ before_action :set_book
3
3
 
4
4
  def index_witout_filter
5
5
  end
@@ -13,4 +13,4 @@ class PagesController < ApplicationController
13
13
  def set_book
14
14
  @book = { 'name' => 'Liquid on Rails' }
15
15
  end
16
- end
16
+ end
@@ -0,0 +1,30 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rails secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ # Shared secrets are available across all environments.
14
+
15
+ shared:
16
+ api_key: 123
17
+
18
+ # Environmental secrets are only available for that specific environment.
19
+
20
+ development:
21
+ secret_key_base: 6c8ad54079996a5a3a75a6c237fc3b24b395062ebb253d94124463d0a8886769e44b5577dd22843ddee62a2111f73ccf3a476e0790816fcbf7e24ccff0d84d5b
22
+
23
+ test:
24
+ secret_key_base: 5e9938a8de5615369f24fd059a7701e85cc1ee3335b7ae0581d52a5b29559683b9cc5ecb640c1ac66dc5e29b5a8829306f80dde272a7cc539171268be41081a9
25
+
26
+ # Do not keep production secrets in the repository,
27
+ # instead read values from the environment.
28
+
29
+ production:
30
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -31,10 +31,9 @@ module Liquid
31
31
  expect(drop).to be_instance_of(ProfileDrop)
32
32
  end
33
33
 
34
- it "instantitates with `Liquid::Rails::Drop` when its inferred drop class doesn't exist" do
35
- drop = Liquid::Rails::Drop.dropify(Model.new)
36
-
37
- expect(drop).to be_instance_of(Liquid::Rails::Drop)
34
+ it "raises NameError when its inferred drop class doesn't exist" do
35
+ expect{ Liquid::Rails::Drop.dropify(Model.new) }
36
+ .to raise_error(NameError)
38
37
  end
39
38
 
40
39
  it "instantitates with the caller drop class" do
@@ -4,22 +4,23 @@ module Liquid
4
4
  module Rails
5
5
  describe MiscFilter do
6
6
  let(:context) { ::Liquid::Context.new }
7
+ let(:parse_context) { ParseContext.new({}) }
7
8
 
8
9
  context '#index' do
9
10
  it 'returns value at the specified index' do
10
11
  context['array'] = [1, 2, 3]
11
- expect(::Liquid::Variable.new("array | index: 0").render(context)).to eq(1)
12
+ expect(::Liquid::Variable.new("array | index: 0", parse_context).render(context)).to eq(1)
12
13
  end
13
14
 
14
15
  it 'returns nil when outside range' do
15
16
  context['array'] = [1, 2, 3]
16
- expect(::Liquid::Variable.new("array | index: 5").render(context)).to eq(nil)
17
+ expect(::Liquid::Variable.new("array | index: 5", parse_context).render(context)).to eq(nil)
17
18
  end
18
19
  end
19
20
 
20
21
  it '#jsonify' do
21
22
  context['listing'] = { name: 'Listing A' }
22
- expect(::Liquid::Variable.new("listing | jsonify").render(context)).to eq(%|{"name":"Listing A"}|)
23
+ expect(::Liquid::Variable.new("listing | jsonify", parse_context).render(context)).to eq(%|{"name":"Listing A"}|)
23
24
  end
24
25
  end
25
26
  end
@@ -4,25 +4,26 @@ module Liquid
4
4
  module Rails
5
5
  describe TranslateFilter do
6
6
  let(:context) { ::Liquid::Context.new }
7
+ let(:parse_context) { ParseContext.new({}) }
7
8
 
8
9
  before do
9
10
  context.registers[:view] = ActionView::Base.new
10
11
  end
11
12
 
12
13
  it 'translate with default locale' do
13
- expect(::Liquid::Variable.new("'welcome' | translate").render(context)).to eq('Welcome everyone!')
14
+ expect(::Liquid::Variable.new("'welcome' | translate", parse_context).render(context)).to eq('Welcome everyone!')
14
15
  end
15
16
 
16
17
  it 'translate with specified locale' do
17
- expect(::Liquid::Variable.new("'welcome' | translate: locale: 'km'").render(context)).to eq('សូមស្វាគមន៍')
18
+ expect(::Liquid::Variable.new("'welcome' | translate: locale: 'km'", parse_context).render(context)).to eq('សូមស្វាគមន៍')
18
19
  end
19
20
 
20
21
  it 'translate with scope' do
21
- expect(::Liquid::Variable.new("'home' | translate: locale: 'km', scope: 'links'").render(context)).to eq('ទំព័រដើម')
22
+ expect(::Liquid::Variable.new("'home' | translate: locale: 'km', scope: 'links'", parse_context).render(context)).to eq('ទំព័រដើម')
22
23
  end
23
24
 
24
25
  it 'translate with interpolation' do
25
- expect(::Liquid::Variable.new("'welcome_name' | translate: locale: 'en', name: 'Jeremy'").render(context)).to eq('Welcome, Jeremy')
26
+ expect(::Liquid::Variable.new("'welcome_name' | translate: locale: 'en', name: 'Jeremy'", parse_context).render(context)).to eq('Welcome, Jeremy')
26
27
  end
27
28
  end
28
29
  end
@@ -1,10 +1,8 @@
1
1
  if ENV['CI'] || ENV['COVERAGE']
2
- require 'coveralls'
3
2
  require 'simplecov'
4
3
 
5
4
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
6
- SimpleCov::Formatter::HTMLFormatter,
7
- Coveralls::SimpleCov::Formatter
5
+ SimpleCov::Formatter::HTMLFormatter
8
6
  ]
9
7
 
10
8
  SimpleCov.start do
@@ -38,5 +36,5 @@ RSpec.configure do |config|
38
36
  config.run_all_when_everything_filtered = true
39
37
  config.include Capybara::RSpecMatchers
40
38
  config.include ActiveSupport::Testing::SetupAndTeardown
41
- config.include ActionController::TestCase::Behavior
42
- end
39
+ config.include ActionDispatch::IntegrationTest::Behavior
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid4-rails5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viktor Fonic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '5'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '3.2'
26
+ version: '5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: liquid
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,104 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.16.1
55
+ - !ruby/object:Gem::Dependency
56
+ name: codeclimate-test-reporter
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '5'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '5'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard-rspec
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 4.5.0
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: 4.5.0
111
+ - !ruby/object:Gem::Dependency
112
+ name: capybara
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: 2.4.1
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: 2.4.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry-rails
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: simplecov
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
55
153
  description: It allows you to render .liquid templates with layout and partial support.
56
154
  It also provides filters, tags, drops class to be used inside your liquid template.
57
155
  email:
@@ -71,10 +169,6 @@ files:
71
169
  - LICENSE.txt
72
170
  - README.md
73
171
  - Rakefile
74
- - gemfiles/rails_32.gemfile
75
- - gemfiles/rails_40.gemfile
76
- - gemfiles/rails_41.gemfile
77
- - gemfiles/rails_42.gemfile
78
172
  - lib/liquid-rails.rb
79
173
  - lib/liquid-rails/drops/collection_drop.rb
80
174
  - lib/liquid-rails/drops/drop.rb
@@ -154,6 +248,7 @@ files:
154
248
  - spec/dummy/config/locales/en.yml
155
249
  - spec/dummy/config/locales/km.yml
156
250
  - spec/dummy/config/routes.rb
251
+ - spec/dummy/config/secrets.yml
157
252
  - spec/dummy/lib/assets/.keep
158
253
  - spec/dummy/log/.keep
159
254
  - spec/dummy/public/404.html
@@ -177,7 +272,7 @@ files:
177
272
  - spec/lib/liquid-rails/template_handler_spec.rb
178
273
  - spec/spec_helper.rb
179
274
  - spec/support/delegate_matcher.rb
180
- homepage: ''
275
+ homepage: https://github.com/vfonic/liquid4-rails5
181
276
  licenses:
182
277
  - MIT
183
278
  metadata: {}
@@ -249,6 +344,7 @@ test_files:
249
344
  - spec/dummy/config/locales/en.yml
250
345
  - spec/dummy/config/locales/km.yml
251
346
  - spec/dummy/config/routes.rb
347
+ - spec/dummy/config/secrets.yml
252
348
  - spec/dummy/lib/assets/.keep
253
349
  - spec/dummy/log/.keep
254
350
  - spec/dummy/public/404.html
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- 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'
10
-
11
- gemspec path: '../'
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- 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'
10
-
11
- gemspec path: '../'
@@ -1,11 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- 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'
10
-
11
- gemspec path: '../'
@@ -1,11 +0,0 @@
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: '../'