liquidize 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -2
- data/.rubocop.yml +19 -0
- data/.ruby-version +1 -1
- data/.travis.yml +19 -2
- data/Appraisals +7 -0
- data/README.md +10 -8
- data/Rakefile +4 -2
- data/gemfiles/4.2.gemfile +7 -0
- data/gemfiles/5.0.gemfile +7 -0
- data/lib/liquidize/helper.rb +37 -2
- data/lib/liquidize/model.rb +59 -65
- data/lib/liquidize/version.rb +1 -1
- data/liquidize.gemspec +5 -4
- data/spec/dummy/app/models/non_active_record_page.rb +1 -1
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/config.ru +1 -1
- data/spec/dummy/config/application.rb +1 -2
- data/spec/dummy/config/environments/production.rb +1 -1
- data/spec/dummy/config/environments/test.rb +1 -1
- data/spec/dummy/config/initializers/cookies_serializer.rb +1 -1
- data/spec/lib/liquidize/helper_spec.rb +3 -3
- data/spec/lib/liquidize/model_spec.rb +12 -12
- data/spec/spec_helper.rb +3 -4
- metadata +38 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7588d0c8fa7b57e0147975dd777589b3b4902b04
|
4
|
+
data.tar.gz: 7231948f6a368e575bcd45fcfeb73e82e8244bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6eb61967fbe68a16086b4f28ac55b72f23d5d7d791005b43b323890135c0ab231530abda1172fb7fdf0b958572141e5de27cb31120ddbf39c90228908c31edb
|
7
|
+
data.tar.gz: d1d9ab17e0885be471b8faaa94995092f78077e0b20b03e59877beaf647603c939cd663d5dfde496bedefb4141f8713fddc632cee3766c3fcc01bdadb6bf83f7
|
data/.gitignore
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- spec/dummy/db/schema.rb
|
4
|
+
|
5
|
+
Documentation:
|
6
|
+
Enabled: false
|
7
|
+
|
8
|
+
Metrics/LineLength:
|
9
|
+
Max: 90
|
10
|
+
Exclude:
|
11
|
+
- liquidize.gemspec
|
12
|
+
- spec/**/*
|
13
|
+
|
14
|
+
Metrics/MethodLength:
|
15
|
+
Exclude:
|
16
|
+
- lib/liquidize/model.rb
|
17
|
+
|
18
|
+
FrozenStringLiteralComment:
|
19
|
+
Enabled: false
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.1
|
1
|
+
2.3.1
|
data/.travis.yml
CHANGED
@@ -1,13 +1,30 @@
|
|
1
1
|
language: ruby
|
2
|
+
|
2
3
|
rvm:
|
3
|
-
- 1.9.3
|
4
4
|
- 2.0.0
|
5
5
|
- 2.1.0
|
6
|
+
- 2.2.2
|
7
|
+
- 2.3.0
|
6
8
|
- ruby-head
|
9
|
+
|
10
|
+
gemfile:
|
11
|
+
- gemfiles/4.2.gemfile
|
12
|
+
- gemfiles/5.0.gemfile
|
13
|
+
|
14
|
+
matrix:
|
15
|
+
exclude:
|
16
|
+
- gemfile: gemfiles/5.0.gemfile
|
17
|
+
rvm: 2.0.0
|
18
|
+
- gemfile: gemfiles/5.0.gemfile
|
19
|
+
rvm: 2.1.0
|
20
|
+
allow_failures:
|
21
|
+
- rvm: ruby-head
|
22
|
+
|
7
23
|
env:
|
8
24
|
- DB=sqlite
|
25
|
+
|
9
26
|
script:
|
10
27
|
- cd spec/dummy/
|
11
28
|
- RAILS_ENV=test bundle exec rake db:migrate
|
12
29
|
- cd ../../
|
13
|
-
- bundle exec rspec spec/
|
30
|
+
- bundle exec rspec spec/
|
data/Appraisals
ADDED
data/README.md
CHANGED
@@ -17,7 +17,9 @@ And then execute:
|
|
17
17
|
|
18
18
|
## Usage
|
19
19
|
|
20
|
-
|
20
|
+
### PORO
|
21
|
+
|
22
|
+
Include `Liquidize::Model` mixin to your model and specify the liquidized attribute:
|
21
23
|
|
22
24
|
class Page
|
23
25
|
include Liquidize::Model
|
@@ -28,7 +30,7 @@ Include `Liquidize::Model` mixin to your model and specify liquidized attribute:
|
|
28
30
|
Now you can set the body and render it with any options:
|
29
31
|
|
30
32
|
page = Page.new
|
31
|
-
page.body =
|
33
|
+
page.body = 'Hello, {{username}}!'
|
32
34
|
page.render_body(username: 'John') # => "Hello, John!"
|
33
35
|
|
34
36
|
Liquid works much faster if once parsed template is cached. Just add `liquid_*` pair attribute and Liquidize will use it to store dump of parsed template.
|
@@ -68,17 +70,17 @@ Use it the same way:
|
|
68
70
|
reloaded_email.render_message # parses template again
|
69
71
|
# => "Oops, I changed the message!"
|
70
72
|
|
71
|
-
It makes record invalid if there
|
73
|
+
It makes record invalid if there are any syntax errors in the liquid template:
|
72
74
|
|
73
|
-
|
74
|
-
|
75
|
+
email.message = 'Hey, {{username, I think, there is an error.'
|
76
|
+
email.valid? # => false
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
+
email.message = 'Hey, {{username}}, everything is ok now.'
|
79
|
+
email.valid? # => true
|
78
80
|
|
79
81
|
## Contributing
|
80
82
|
|
81
|
-
1. Fork it (
|
83
|
+
1. Fork it (https://github.com/ImmaculatePine/liquidize/fork)
|
82
84
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
83
85
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
84
86
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/Rakefile
CHANGED
data/lib/liquidize/helper.rb
CHANGED
@@ -6,9 +6,44 @@ module Liquidize
|
|
6
6
|
def self.recursive_stringify_keys(options)
|
7
7
|
if options.is_a?(Hash)
|
8
8
|
options.stringify_keys!
|
9
|
-
options.each { |
|
9
|
+
options.each { |_k, v| recursive_stringify_keys(v) }
|
10
|
+
elsif options.is_a?(Array)
|
11
|
+
options.map! { |a| recursive_stringify_keys(a) }
|
10
12
|
end
|
11
13
|
options
|
12
14
|
end
|
15
|
+
|
16
|
+
# Encodes Ruby object into marshalled dump
|
17
|
+
# @param value [Object] Ruby object
|
18
|
+
# @return [String] encoded dump
|
19
|
+
def self.encode(value)
|
20
|
+
Base64.strict_encode64(Marshal.dump(value))
|
21
|
+
end
|
22
|
+
|
23
|
+
# Decodes dump into the Ruby object
|
24
|
+
# @param dump [String] encoded dump
|
25
|
+
# @return [Object] decoded object
|
26
|
+
def self.decode(dump)
|
27
|
+
Marshal.load(Base64.strict_decode64(dump))
|
28
|
+
end
|
29
|
+
|
30
|
+
# Analogue of the ActiveSupport #present? method
|
31
|
+
# @param value [Object] value that should be checked
|
32
|
+
# @return [Boolean] whether value is present
|
33
|
+
def self.present?(value)
|
34
|
+
!value.to_s.strip.empty?
|
35
|
+
end
|
36
|
+
|
37
|
+
# Checks if the object is an ActiveRecord class or instance
|
38
|
+
# @param object [Object] any object
|
39
|
+
# @return [Boolean] whether it is AR class or instance
|
40
|
+
def self.activerecord?(object)
|
41
|
+
return false unless defined?(ActiveRecord)
|
42
|
+
if object.is_a?(Class)
|
43
|
+
object.ancestors.include?(ActiveRecord::Base)
|
44
|
+
else
|
45
|
+
object.class.ancestors.include?(ActiveRecord::Base)
|
46
|
+
end
|
47
|
+
end
|
13
48
|
end
|
14
|
-
end
|
49
|
+
end
|
data/lib/liquidize/model.rb
CHANGED
@@ -2,13 +2,11 @@ require 'liquid'
|
|
2
2
|
|
3
3
|
module Liquidize
|
4
4
|
module Model
|
5
|
-
|
6
5
|
def self.included(base)
|
7
6
|
base.extend ClassMethods
|
8
7
|
end
|
9
|
-
|
10
|
-
module ClassMethods
|
11
8
|
|
9
|
+
module ClassMethods
|
12
10
|
# Adds Liquid support to the following attribute
|
13
11
|
# @param attribute [String, Symbol] attribute to be liquidized
|
14
12
|
def liquidize(attribute)
|
@@ -16,86 +14,82 @@ module Liquidize
|
|
16
14
|
define_parse_liquid_method(attribute)
|
17
15
|
define_render_method(attribute)
|
18
16
|
override_setter(attribute)
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
end
|
17
|
+
return unless Liquidize::Helper.activerecord?(self)
|
18
|
+
define_validator(attribute)
|
19
|
+
validate "validate_#{attribute}_liquid_syntax"
|
23
20
|
end
|
24
21
|
|
25
22
|
private
|
26
23
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
rescue Liquid::SyntaxError => error
|
37
|
-
instance_variable_set("@#{attribute}_syntax_error", error.message)
|
24
|
+
def define_parse_liquid_method(attribute)
|
25
|
+
define_method "parse_liquid_#{attribute}!" do
|
26
|
+
begin
|
27
|
+
original_value = public_send(attribute)
|
28
|
+
parsed_value = Liquid::Template.parse(original_value)
|
29
|
+
instance_variable_set("@liquid_#{attribute}_template", parsed_value)
|
30
|
+
if Liquidize::Helper.activerecord?(self) && respond_to?("liquid_#{attribute}")
|
31
|
+
marshalled_value = Liquidize::Helper.encode(parsed_value)
|
32
|
+
public_send("liquid_#{attribute}=", marshalled_value)
|
38
33
|
end
|
34
|
+
rescue Liquid::SyntaxError => error
|
35
|
+
instance_variable_set("@#{attribute}_syntax_error", error.message)
|
39
36
|
end
|
40
37
|
end
|
38
|
+
end
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
if respond_to?("liquid_#{attribute}") && send("liquid_#{attribute}").present?
|
48
|
-
dump = send("liquid_#{attribute}")
|
49
|
-
decoded_template = Marshal.load(Base64.strict_decode64(dump))
|
50
|
-
instance_variable_set("@liquid_#{attribute}_template", decoded_template)
|
51
|
-
else
|
52
|
-
send("parse_#{attribute}_template!")
|
53
|
-
save if activerecord?
|
54
|
-
end
|
40
|
+
def define_liquid_template_method(attribute)
|
41
|
+
define_method "liquid_#{attribute}_template" do
|
42
|
+
result = instance_variable_get("@liquid_#{attribute}_template")
|
43
|
+
return result unless result.nil?
|
55
44
|
|
56
|
-
|
45
|
+
method_name = "liquid_#{attribute}"
|
46
|
+
dump = respond_to?(method_name) ? public_send(method_name) : nil
|
47
|
+
if Liquidize::Helper.present?(dump)
|
48
|
+
decoded_template = Liquidize::Helper.decode(dump)
|
49
|
+
instance_variable_set("@liquid_#{attribute}_template", decoded_template)
|
50
|
+
else
|
51
|
+
public_send("parse_#{attribute}_template!")
|
52
|
+
save if Liquidize::Helper.activerecord?(self)
|
57
53
|
end
|
54
|
+
|
55
|
+
instance_variable_get("@liquid_#{attribute}_template")
|
58
56
|
end
|
57
|
+
end
|
59
58
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
def define_render_method(attribute)
|
60
|
+
define_method "render_#{attribute}" do |options = {}|
|
61
|
+
public_send("liquid_#{attribute}_template").render(
|
62
|
+
Liquidize::Helper.recursive_stringify_keys(options)
|
63
|
+
)
|
64
64
|
end
|
65
|
+
end
|
65
66
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
67
|
+
def define_validator(attribute)
|
68
|
+
define_method("validate_#{attribute}_liquid_syntax") do
|
69
|
+
syntax_error = instance_variable_get("@#{attribute}_syntax_error")
|
70
|
+
errors.add(attribute, syntax_error) if syntax_error.present?
|
71
71
|
end
|
72
|
+
end
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
def override_setter(attribute)
|
75
|
+
# Undefine old method to prevent warning
|
76
|
+
undef_method "#{attribute}=".to_sym if method_defined? "#{attribute}="
|
76
77
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
end
|
88
|
-
send("parse_liquid_#{attribute}!")
|
89
|
-
value
|
78
|
+
# Define new method
|
79
|
+
define_method "#{attribute}=" do |value|
|
80
|
+
# Set *_syntax_error instance variable to nil because:
|
81
|
+
# * old value could be invalid, but the new one is valid
|
82
|
+
# * it prevents warning
|
83
|
+
instance_variable_set("@#{attribute}_syntax_error", nil)
|
84
|
+
if Liquidize::Helper.activerecord?(self)
|
85
|
+
write_attribute(attribute, value)
|
86
|
+
else
|
87
|
+
instance_variable_set("@#{attribute}", value)
|
90
88
|
end
|
89
|
+
public_send("parse_liquid_#{attribute}!")
|
90
|
+
value
|
91
91
|
end
|
92
|
-
end
|
93
|
-
|
94
|
-
private
|
95
|
-
|
96
|
-
def activerecord?
|
97
|
-
defined?(ActiveRecord) && self.class.ancestors.include?(ActiveRecord::Base)
|
98
92
|
end
|
99
|
-
|
93
|
+
end
|
100
94
|
end
|
101
|
-
end
|
95
|
+
end
|
data/lib/liquidize/version.rb
CHANGED
data/liquidize.gemspec
CHANGED
@@ -9,8 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['Alexander Borovykh']
|
10
10
|
spec.email = ['immaculate.pine@gmail.com']
|
11
11
|
spec.summary = 'Ruby library that adds Liquid template language support to your project.'
|
12
|
-
spec.
|
13
|
-
spec.homepage = ''
|
12
|
+
spec.homepage = 'https://github.com/ImmaculatePine/liquidize'
|
14
13
|
spec.license = 'MIT'
|
15
14
|
|
16
15
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,13 +17,15 @@ Gem::Specification.new do |spec|
|
|
18
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
18
|
spec.require_paths = ['lib']
|
20
19
|
|
21
|
-
spec.required_ruby_version = '>=
|
20
|
+
spec.required_ruby_version = '>= 2.0.0'
|
22
21
|
|
23
22
|
spec.add_dependency 'liquid', '~> 3.0.6'
|
24
23
|
|
25
|
-
spec.add_development_dependency 'bundler',
|
24
|
+
spec.add_development_dependency 'bundler', '~> 1.6'
|
26
25
|
spec.add_development_dependency 'rake'
|
27
26
|
spec.add_development_dependency 'rails', '>= 4.0.0'
|
28
27
|
spec.add_development_dependency 'sqlite3'
|
29
28
|
spec.add_development_dependency 'rspec'
|
29
|
+
spec.add_development_dependency 'rubocop'
|
30
|
+
spec.add_development_dependency 'appraisal'
|
30
31
|
end
|
data/spec/dummy/bin/rails
CHANGED
data/spec/dummy/config.ru
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
5
|
Bundler.require(*Rails.groups)
|
6
|
-
require
|
6
|
+
require 'liquidize'
|
7
7
|
|
8
8
|
module Dummy
|
9
9
|
class Application < Rails::Application
|
@@ -20,4 +20,3 @@ module Dummy
|
|
20
20
|
# config.i18n.default_locale = :de
|
21
21
|
end
|
22
22
|
end
|
23
|
-
|
@@ -20,7 +20,7 @@ Rails.application.configure do
|
|
20
20
|
# config.action_dispatch.rack_cache = true
|
21
21
|
|
22
22
|
# Disable Rails's static asset server (Apache or nginx will already do this).
|
23
|
-
config.
|
23
|
+
config.serve_static_files = false
|
24
24
|
|
25
25
|
# Compress JavaScripts and CSS.
|
26
26
|
config.assets.js_compressor = :uglifier
|
@@ -13,7 +13,7 @@ Rails.application.configure do
|
|
13
13
|
config.eager_load = false
|
14
14
|
|
15
15
|
# Configure static asset server for tests with Cache-Control for performance.
|
16
|
-
config.
|
16
|
+
config.serve_static_files = true
|
17
17
|
config.static_cache_control = 'public, max-age=3600'
|
18
18
|
|
19
19
|
# Show full error reports and disable caching.
|
@@ -2,11 +2,11 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
RSpec.describe Liquidize::Helper do
|
4
4
|
describe '.recursive_stringify_keys' do
|
5
|
-
let(:original) { { first: { a: 'a', b: 'b', c: 3}, second: :qwerty, third: [] } }
|
6
|
-
let(:result) { { 'first' => { 'a' => 'a', 'b' => 'b', 'c' => 3}, 'second' => :qwerty, 'third' => [] } }
|
5
|
+
let(:original) { { first: { a: 'a', b: 'b', c: 3 }, second: :qwerty, third: [{ x: 1, y: 2 }] } }
|
6
|
+
let(:result) { { 'first' => { 'a' => 'a', 'b' => 'b', 'c' => 3 }, 'second' => :qwerty, 'third' => ['x' => 1, 'y' => 2] } }
|
7
7
|
|
8
8
|
it 'converts all keys to strings' do
|
9
9
|
expect(Liquidize::Helper.recursive_stringify_keys(original)).to eq(result)
|
10
10
|
end
|
11
11
|
end
|
12
|
-
end
|
12
|
+
end
|
@@ -12,7 +12,7 @@ RSpec.describe Liquidize::Model do
|
|
12
12
|
describe 'include' do
|
13
13
|
shared_examples 'both' do
|
14
14
|
it 'adds class methods' do
|
15
|
-
expect(klass).to respond_to(:liquidize
|
15
|
+
expect(klass).to respond_to(:liquidize)
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -51,7 +51,7 @@ RSpec.describe Liquidize::Model do
|
|
51
51
|
shared_examples 'both' do
|
52
52
|
it 'renders valid template' do
|
53
53
|
page.body = 'Hello, {{username}}!'
|
54
|
-
expect(page.render_body(
|
54
|
+
expect(page.render_body(username: 'Alex')).to eq('Hello, Alex!')
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -67,13 +67,13 @@ RSpec.describe Liquidize::Model do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
describe 'setter' do
|
70
|
-
let(:valid_body) {
|
71
|
-
let(:invalid_body) {
|
70
|
+
let(:valid_body) { 'Hi, {{username}}' }
|
71
|
+
let(:invalid_body) { 'Hi, {{username' }
|
72
72
|
let(:syntax_error_message) { "Liquid syntax error: Variable '{{' was not properly terminated with regexp: /\\}\\}/" }
|
73
73
|
|
74
74
|
shared_examples 'both' do
|
75
75
|
it 'still works as default setter' do
|
76
|
-
expect{ page.body = valid_body }.to change(page, :body).from(nil).to(valid_body)
|
76
|
+
expect { page.body = valid_body }.to change(page, :body).from(nil).to(valid_body)
|
77
77
|
end
|
78
78
|
|
79
79
|
it 'parses new value' do
|
@@ -83,18 +83,18 @@ RSpec.describe Liquidize::Model do
|
|
83
83
|
|
84
84
|
it 'does not set @*_syntax_error instance variable with valid body' do
|
85
85
|
page.instance_variable_set(:@body_syntax_error, nil) # prevent warning
|
86
|
-
expect{ page.body = valid_body }.not_to change{ page.instance_variable_get(:@body_syntax_error) }
|
87
|
-
end
|
86
|
+
expect { page.body = valid_body }.not_to change { page.instance_variable_get(:@body_syntax_error) }
|
87
|
+
end
|
88
88
|
|
89
89
|
it 'sets @*_syntax_error instance variable with invalid body' do
|
90
90
|
page.instance_variable_set(:@body_syntax_error, nil) # prevent warning
|
91
|
-
expect{ page.body = invalid_body }.to change{ page.instance_variable_get(:@body_syntax_error) }.from(nil).to(syntax_error_message)
|
91
|
+
expect { page.body = invalid_body }.to change { page.instance_variable_get(:@body_syntax_error) }.from(nil).to(syntax_error_message)
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'resets syntax error when valid value is passed' do
|
95
95
|
page.instance_variable_set(:@body_syntax_error, nil) # prevent warning
|
96
|
-
expect{ page.body = invalid_body }.to change{ page.instance_variable_get(:@body_syntax_error) }.from(nil).to(syntax_error_message)
|
97
|
-
expect{ page.body = valid_body }.to change{ page.instance_variable_get(:@body_syntax_error) }.from(syntax_error_message).to(nil)
|
96
|
+
expect { page.body = invalid_body }.to change { page.instance_variable_get(:@body_syntax_error) }.from(nil).to(syntax_error_message)
|
97
|
+
expect { page.body = valid_body }.to change { page.instance_variable_get(:@body_syntax_error) }.from(syntax_error_message).to(nil)
|
98
98
|
end
|
99
99
|
end
|
100
100
|
|
@@ -114,14 +114,14 @@ RSpec.describe Liquidize::Model do
|
|
114
114
|
it 'value with syntax error makes record invalid' do
|
115
115
|
page.body = invalid_body
|
116
116
|
expect(page).not_to be_valid
|
117
|
-
expect(page.errors.messages).to eq(
|
117
|
+
expect(page.errors.messages).to eq(body: [syntax_error_message])
|
118
118
|
end
|
119
119
|
|
120
120
|
it 'does not parse body for the second time if it was already parsed and saved' do
|
121
121
|
page = Page.create(body: valid_body)
|
122
122
|
page_from_db = Page.find(page.id)
|
123
123
|
expect(page_from_db).not_to receive(:parse_liquid_body!)
|
124
|
-
render = page_from_db.render_body(
|
124
|
+
render = page_from_db.render_body(username: 'Alex')
|
125
125
|
expect(render).to eq('Hi, Alex')
|
126
126
|
end
|
127
127
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Configure Rails Environment
|
2
2
|
ENV['RAILS_ENV'] = 'test'
|
3
3
|
|
4
|
-
require File.expand_path('../dummy/config/environment.rb',
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
5
|
require 'liquidize'
|
6
6
|
|
7
7
|
# This file was generated by the `rspec --init` command. Conventionally, all
|
@@ -21,8 +21,8 @@ require 'liquidize'
|
|
21
21
|
#
|
22
22
|
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
23
23
|
RSpec.configure do |config|
|
24
|
-
# The settings below are suggested to provide a good initial experience
|
25
|
-
# with RSpec, but feel free to customize to your heart's content.
|
24
|
+
# The settings below are suggested to provide a good initial experience
|
25
|
+
# with RSpec, but feel free to customize to your heart's content.
|
26
26
|
|
27
27
|
# These two settings work together to allow you to limit a spec run
|
28
28
|
# to individual examples or groups you care about by tagging them with
|
@@ -80,5 +80,4 @@ RSpec.configure do |config|
|
|
80
80
|
# a real object. This is generally recommended.
|
81
81
|
mocks.verify_partial_doubles = true
|
82
82
|
end
|
83
|
-
|
84
83
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: liquidize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Borovykh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -94,7 +94,35 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: appraisal
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description:
|
98
126
|
email:
|
99
127
|
- immaculate.pine@gmail.com
|
100
128
|
executables: []
|
@@ -103,13 +131,17 @@ extra_rdoc_files: []
|
|
103
131
|
files:
|
104
132
|
- ".gitignore"
|
105
133
|
- ".rspec"
|
134
|
+
- ".rubocop.yml"
|
106
135
|
- ".ruby-gemset"
|
107
136
|
- ".ruby-version"
|
108
137
|
- ".travis.yml"
|
138
|
+
- Appraisals
|
109
139
|
- Gemfile
|
110
140
|
- LICENSE.txt
|
111
141
|
- README.md
|
112
142
|
- Rakefile
|
143
|
+
- gemfiles/4.2.gemfile
|
144
|
+
- gemfiles/5.0.gemfile
|
113
145
|
- lib/liquidize.rb
|
114
146
|
- lib/liquidize/helper.rb
|
115
147
|
- lib/liquidize/model.rb
|
@@ -162,7 +194,7 @@ files:
|
|
162
194
|
- spec/lib/liquidize/model_spec.rb
|
163
195
|
- spec/lib/liquidize_spec.rb
|
164
196
|
- spec/spec_helper.rb
|
165
|
-
homepage:
|
197
|
+
homepage: https://github.com/ImmaculatePine/liquidize
|
166
198
|
licenses:
|
167
199
|
- MIT
|
168
200
|
metadata: {}
|
@@ -174,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
206
|
requirements:
|
175
207
|
- - ">="
|
176
208
|
- !ruby/object:Gem::Version
|
177
|
-
version:
|
209
|
+
version: 2.0.0
|
178
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
211
|
requirements:
|
180
212
|
- - ">="
|
@@ -182,7 +214,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
214
|
version: '0'
|
183
215
|
requirements: []
|
184
216
|
rubyforge_project:
|
185
|
-
rubygems_version: 2.
|
217
|
+
rubygems_version: 2.6.4
|
186
218
|
signing_key:
|
187
219
|
specification_version: 4
|
188
220
|
summary: Ruby library that adds Liquid template language support to your project.
|