frise 0.5.1 → 0.6.0

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
  SHA256:
3
- metadata.gz: 68f89536d127f91e812a1c23258ad32ca3d4331970c9af0632cb3f95fce06e52
4
- data.tar.gz: 129230d3c50d29a25f4e060bfdf4e839d19aa579607c6bead51acf6237ac9c20
3
+ metadata.gz: 89f413918114d497ca91dc779d1e02e5abe17283c50541a2c5f41e530262a1c8
4
+ data.tar.gz: 249420e836978cd01c7639ba72d9bb8d23bafde1e36c0bd2f2a4d39325a4bb5a
5
5
  SHA512:
6
- metadata.gz: 61f5a83ff2ba3e17ae022dbac6639fa3a316c4739685ed3cec8634a9a12789dd280c4373763bdebea85d82821b02856327df0df6fbb423d55affb8010252ec64
7
- data.tar.gz: bc65274a574e25cdbe6142bd7bc2dbe7d6d9275143c211987845dc916156ebe2f0d3ff5739490ea177b67157545b6c5c4aef0a96bbe6dfbaa6f9061c35fcfd73
6
+ metadata.gz: 013403a018b4536d8d4a15359a7f95dc8aaab9962313206666653d8b3fb6f6a59d2e4b9e43502480da9d19a1e5fa2b8a4b080fa6aa6837d52a7c99bd33f9ea44
7
+ data.tar.gz: 21e416ce8cb88cafcd7ac40b715ab574cd028a7ffc094f85785c0a8cb116ae73763df6380f0cc9f25935cb81d938a1f5f763b831d69dfa13da7e24ec22235ed0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 0.6.0 (April 7, 2022)
2
+
3
+ - Breaking changes
4
+ - Liquid parsing is now strict ([#29](https://github.com/velocidi/frise/pull/29)).
5
+ - Update liquid gem to `5.3.0` ([#29](https://github.com/velocidi/frise/pull/29)).
6
+
7
+ - New features
8
+ - Add `json` liquid filter ([#28](https://github.com/velocidi/frise/pull/28)).
9
+
1
10
  ### 0.5.1 (March 28, 2022)
2
11
 
3
12
  - Breaking changes
data/frise.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.require_paths = ['lib']
21
21
  spec.required_ruby_version = '>= 2.6.0'
22
22
 
23
- spec.add_dependency 'liquid', '~> 4.0'
23
+ spec.add_dependency 'liquid', '~> 5.3.0'
24
24
 
25
25
  spec.add_development_dependency 'bundler', '~> 2.0'
26
26
  spec.add_development_dependency 'rake', '~> 13.0'
data/lib/frise/parser.rb CHANGED
@@ -16,7 +16,12 @@ module Frise
16
16
  def parse_as_text(file, symbol_table = nil)
17
17
  return nil unless File.file? file
18
18
  content = File.read(file)
19
- content = Liquid::Template.parse(content).render with_internal_vars(file, symbol_table) if symbol_table
19
+ template = Liquid::Template.parse(content, error_mode: :strict)
20
+ if symbol_table
21
+ content = template.render!(with_internal_vars(file, symbol_table), {
22
+ strict_filters: true
23
+ })
24
+ end
20
25
  content
21
26
  end
22
27
 
data/lib/frise/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Frise
4
- VERSION = '0.5.1'
4
+ VERSION = '0.6.0'
5
5
  end
data/lib/frise.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'liquid/liquid'
4
+
3
5
  require 'frise/defaults_loader'
4
6
  require 'frise/loader/lazy'
5
7
  require 'frise/loader'
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ # Converts a variable into its JSON representation
6
+ module JsonFilter
7
+ def json(object)
8
+ JSON.dump(object)
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'liquid'
4
+
5
+ require_relative 'json_filter'
6
+
7
+ Liquid::Template.register_filter(JsonFilter)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Velocidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-28 00:00:00.000000000 Z
11
+ date: 2022-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '4.0'
19
+ version: 5.3.0
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: '4.0'
26
+ version: 5.3.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -132,6 +132,8 @@ files:
132
132
  - lib/frise/parser.rb
133
133
  - lib/frise/validator.rb
134
134
  - lib/frise/version.rb
135
+ - lib/liquid/json_filter.rb
136
+ - lib/liquid/liquid.rb
135
137
  homepage: https://github.com/velocidi/frise
136
138
  licenses:
137
139
  - Apache-2.0