flavour_saver 2.0.2 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +1 -1
- data/CHANGELOG.md +22 -4
- data/Gemfile.lock +41 -27
- data/README.md +11 -5
- data/flavour_saver.gemspec +6 -6
- data/lib/flavour_saver/helpers.rb +1 -0
- data/lib/flavour_saver/version.rb +1 -1
- data/spec/lib/flavour_saver/runtime_spec.rb +23 -0
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3df26be0de52a237229d3a2a5a1c338121798a29f4305e910beeadbdc9f62a43
|
4
|
+
data.tar.gz: 13b10ec7f3bd2c8ce9a5d5d97d6e2af1e43f58cb18e55106561513786ed056e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9ad09f324afa9bd3dae912d8ab8df820e3a3fe9cc96f1641d6ab74a36780e46084ad2e67a56f76e231570ce1fb2e727fe8ef0ae7e892fc8a76399268afd1b94
|
7
|
+
data.tar.gz: b9d4480e34b9e61c4c79e47fd7bf29b7a332d45f311a861303a40d0d0597fecd06844ee58cb19291ca9e7f5b097b6f45448eb59ee288c5a0df97cbbfebaae5f9
|
data/.github/workflows/ci.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
-
##
|
10
|
+
## 3.0.0
|
11
|
+
|
12
|
+
### Added
|
13
|
+
|
14
|
+
* Ruby 3.2, 3.3, and 3.4 added to the test matrix
|
15
|
+
|
16
|
+
### Changed
|
17
|
+
|
18
|
+
* Bumped locked dependency versions
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
* Handle paths with array indices called on nil context objects (#63)
|
23
|
+
|
24
|
+
### Removed
|
25
|
+
|
26
|
+
* Dropped support for Ruby 2.6
|
27
|
+
|
28
|
+
## 2.0.2
|
11
29
|
|
12
30
|
### Fixed
|
13
31
|
|
@@ -17,13 +35,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
17
35
|
|
18
36
|
* Relaxed version constraint on activesupport dependency (#60)
|
19
37
|
|
20
|
-
##
|
38
|
+
## 2.0.1
|
21
39
|
|
22
40
|
### Fixed
|
23
41
|
|
24
42
|
* Ability to dereference arrays at a specific index (#57)
|
25
43
|
|
26
|
-
##
|
44
|
+
## 2.0.0
|
27
45
|
|
28
46
|
### Breaking Changes
|
29
47
|
|
@@ -40,7 +58,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
40
58
|
|
41
59
|
* Lex number literals that start with 0 (#53)
|
42
60
|
|
43
|
-
##
|
61
|
+
## 1.0.0
|
44
62
|
|
45
63
|
### Added
|
46
64
|
|
data/Gemfile.lock
CHANGED
@@ -1,54 +1,68 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
flavour_saver (
|
5
|
-
rltk (
|
6
|
-
tilt
|
4
|
+
flavour_saver (3.0.0)
|
5
|
+
rltk (< 3.0)
|
6
|
+
tilt (~> 2.6)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (
|
11
|
+
activesupport (7.1.5.1)
|
12
|
+
base64
|
13
|
+
benchmark (>= 0.3)
|
14
|
+
bigdecimal
|
12
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
16
|
+
connection_pool (>= 2.2.5)
|
17
|
+
drb
|
13
18
|
i18n (>= 1.6, < 2)
|
19
|
+
logger (>= 1.4.2)
|
14
20
|
minitest (>= 5.1)
|
21
|
+
mutex_m
|
22
|
+
securerandom (>= 0.3)
|
15
23
|
tzinfo (~> 2.0)
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
24
|
+
base64 (0.2.0)
|
25
|
+
benchmark (0.4.0)
|
26
|
+
bigdecimal (3.1.9)
|
27
|
+
concurrent-ruby (1.3.5)
|
28
|
+
connection_pool (2.5.0)
|
29
|
+
diff-lcs (1.5.1)
|
30
|
+
drb (2.2.1)
|
31
|
+
ffi (1.17.1)
|
32
|
+
i18n (1.14.7)
|
21
33
|
concurrent-ruby (~> 1.0)
|
22
|
-
|
23
|
-
|
34
|
+
logger (1.6.5)
|
35
|
+
minitest (5.25.4)
|
36
|
+
mutex_m (0.3.0)
|
37
|
+
rake (13.2.1)
|
24
38
|
rltk (2.2.1)
|
25
39
|
ffi (>= 1.0.0)
|
26
|
-
rspec (3.
|
27
|
-
rspec-core (~> 3.
|
28
|
-
rspec-expectations (~> 3.
|
29
|
-
rspec-mocks (~> 3.
|
30
|
-
rspec-core (3.
|
31
|
-
rspec-support (~> 3.
|
32
|
-
rspec-expectations (3.
|
40
|
+
rspec (3.13.0)
|
41
|
+
rspec-core (~> 3.13.0)
|
42
|
+
rspec-expectations (~> 3.13.0)
|
43
|
+
rspec-mocks (~> 3.13.0)
|
44
|
+
rspec-core (3.13.2)
|
45
|
+
rspec-support (~> 3.13.0)
|
46
|
+
rspec-expectations (3.13.3)
|
33
47
|
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-mocks (3.
|
48
|
+
rspec-support (~> 3.13.0)
|
49
|
+
rspec-mocks (3.13.2)
|
36
50
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-support (3.
|
39
|
-
|
40
|
-
|
51
|
+
rspec-support (~> 3.13.0)
|
52
|
+
rspec-support (3.13.2)
|
53
|
+
securerandom (0.3.2)
|
54
|
+
tilt (2.6.0)
|
55
|
+
tzinfo (2.0.6)
|
41
56
|
concurrent-ruby (~> 1.0)
|
42
|
-
zeitwerk (2.5.3)
|
43
57
|
|
44
58
|
PLATFORMS
|
45
59
|
ruby
|
46
60
|
|
47
61
|
DEPENDENCIES
|
48
|
-
activesupport (<
|
62
|
+
activesupport (< 7.2)
|
49
63
|
flavour_saver!
|
50
64
|
rake
|
51
65
|
rspec
|
52
66
|
|
53
67
|
BUNDLED WITH
|
54
|
-
2.
|
68
|
+
2.3.7
|
data/README.md
CHANGED
@@ -6,14 +6,20 @@
|
|
6
6
|

|
7
7
|
[](https://codeclimate.com/github/FlavourSaver/FlavourSaver/maintainability)
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
FlavourSaver is a ruby-based implementation of the [Handlebars.js](http://handlebarsjs.com)
|
9
|
+
FlavourSaver is a Ruby-based implementation of the [Handlebars.js](http://handlebarsjs.com)
|
12
10
|
templating language. FlavourSaver supports Handlebars template rendering natively on
|
13
11
|
Rails and on other frameworks (such as Sinatra) via Tilt.
|
14
12
|
|
15
13
|
Please use it, break it, and send issues/PR's for improvement.
|
16
14
|
|
15
|
+
## Status
|
16
|
+
|
17
|
+
This project is currently in maintenance mode. Here's what this means:
|
18
|
+
|
19
|
+
* The maintainers of this project are not actively developing new features
|
20
|
+
* Issues and pull requests are still welcome
|
21
|
+
* New versions of the gem will be released as changes are merged
|
22
|
+
|
17
23
|
## License
|
18
24
|
|
19
25
|
FlavourSaver is Copyright (c) 2013 Resistor Limited and licensed under the terms
|
@@ -37,11 +43,11 @@ Or install it yourself as:
|
|
37
43
|
## Usage
|
38
44
|
|
39
45
|
FlavourSaver provides an interface to the amazing
|
40
|
-
[Tilt](https://github.com/
|
46
|
+
[Tilt](https://github.com/jeremyevans/tilt) templating library, meaning that it
|
41
47
|
should work with anything that has Tilt support (Sinatra, etc) and has a
|
42
48
|
native Rails template handler.
|
43
49
|
|
44
|
-
##
|
50
|
+
## Features
|
45
51
|
|
46
52
|
FlavourSaver is in its infancy, your pull requests are greatly appreciated.
|
47
53
|
|
data/flavour_saver.gemspec
CHANGED
@@ -22,12 +22,12 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.require_paths = ["lib"]
|
23
23
|
gem.version = FlavourSaver::VERSION
|
24
24
|
|
25
|
-
gem.required_ruby_version = ">= 2.
|
25
|
+
gem.required_ruby_version = ">= 2.7.0"
|
26
26
|
|
27
|
-
gem.add_development_dependency
|
28
|
-
gem.add_development_dependency
|
29
|
-
gem.add_development_dependency
|
27
|
+
gem.add_development_dependency "rake"
|
28
|
+
gem.add_development_dependency "rspec"
|
29
|
+
gem.add_development_dependency "activesupport", "< 7.2"
|
30
30
|
|
31
|
-
gem.add_dependency
|
32
|
-
gem.add_dependency
|
31
|
+
gem.add_dependency "rltk", "< 3.0"
|
32
|
+
gem.add_dependency "tilt", "~> 2.6"
|
33
33
|
end
|
@@ -152,6 +152,29 @@ describe FlavourSaver::Runtime do
|
|
152
152
|
end
|
153
153
|
end
|
154
154
|
|
155
|
+
describe 'when called with an path containing array indexes' do
|
156
|
+
let (:template) { "{{hello.[0].[1]}}" }
|
157
|
+
|
158
|
+
it 'indexes the value of a nested array' do
|
159
|
+
array2 = ['w00t', 'vr00m']
|
160
|
+
array = [array2]
|
161
|
+
expect(context).to receive(:hello).and_return(array)
|
162
|
+
expect(subject.evaluate_expression(expr)).to eq 'vr00m'
|
163
|
+
end
|
164
|
+
|
165
|
+
it 'handles non-existent indexes' do
|
166
|
+
world = ['w00t']
|
167
|
+
array = [world]
|
168
|
+
expect(context).to receive(:hello).and_return(array)
|
169
|
+
expect(subject.evaluate_expression(expr)).to eq nil
|
170
|
+
end
|
171
|
+
|
172
|
+
it 'handles calling on nil values' do
|
173
|
+
expect(context).to receive(:hello).and_return(nil)
|
174
|
+
expect(subject.evaluate_expression(expr)).to eq nil
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
155
178
|
describe 'when called with a parent call node without a surrounding block' do
|
156
179
|
let (:template) { "{{../foo}}" }
|
157
180
|
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flavour_saver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clayton Passmore
|
8
8
|
- James Harton
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2025-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -45,42 +45,42 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - "<"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '7.2'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "<"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
55
|
+
version: '7.2'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rltk
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- - "
|
60
|
+
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
62
|
+
version: '3.0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- - "
|
67
|
+
- - "<"
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: '3.0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: tilt
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- - "
|
74
|
+
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
76
|
+
version: '2.6'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- - "
|
81
|
+
- - "~>"
|
82
82
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
83
|
+
version: '2.6'
|
84
84
|
description: FlavourSaver is a pure-ruby implimentation of the Handlebars templating
|
85
85
|
language
|
86
86
|
email:
|
@@ -148,7 +148,7 @@ metadata:
|
|
148
148
|
changelog_uri: http://github.com/FlavourSaver/FlavourSaver/blob/master/CHANGELOG.md
|
149
149
|
homepage_uri: http://github.com/FlavourSaver/FlavourSaver
|
150
150
|
source_code_uri: http://github.com/FlavourSaver/FlavourSaver
|
151
|
-
post_install_message:
|
151
|
+
post_install_message:
|
152
152
|
rdoc_options: []
|
153
153
|
require_paths:
|
154
154
|
- lib
|
@@ -156,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: 2.
|
159
|
+
version: 2.7.0
|
160
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
161
|
requirements:
|
162
162
|
- - ">="
|
@@ -164,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
164
|
version: '0'
|
165
165
|
requirements: []
|
166
166
|
rubygems_version: 3.1.6
|
167
|
-
signing_key:
|
167
|
+
signing_key:
|
168
168
|
specification_version: 4
|
169
169
|
summary: Handlebars.js without the .js
|
170
170
|
test_files:
|