lifer 0.3.0 → 0.4.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: 5b5555d8af73f17e139a069f5b18b104c7938cf8089525ecd3d27b703d388d64
4
- data.tar.gz: 83ed1f8052bb3f7e241276ca2e7354f870429e5fd5ff5a5a2a97c36d1d756c4c
3
+ metadata.gz: a217d32a3f6c4df0f7048d805e620929ab8f38144587843d452b7384fb70a221
4
+ data.tar.gz: 4e9e38b37aa953832cfefde1f0d5d467278c75ce50825251d032f551b7789573
5
5
  SHA512:
6
- metadata.gz: b79197172aedc215a7d1acab9665406e5065b0aa32451ca5b76d89742021660f87c6ab6366edb581ab2477ad400a3a741468480d5a428cab1113544e11485c3a
7
- data.tar.gz: e09e4484fb63f9b093b7a03ddff94ee49e0dc7c3bca1fe68e316540c9a02f4561f215f7c32bb77e842c83d1e63f30d57d252569218b8d2eddf2aa8823ce06d15
6
+ metadata.gz: 7fe48ea2e1ab8d3715c93af0fa71fca53db5820ad51b83f7c506562bee14a6ec8ed06c2a8b4886c62c37933e141c10d8a97b443acee6daa3a9f28580aa4ac21f
7
+ data.tar.gz: dc39315e31d0fb0129b6fe53a403ac8d721e8bc48e350f4227f9086d2c18742dd09596013fd5e138544fcdb9dd6283594f2b542d9e015a867532090a398f3838
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
+ ## v0.4.0
2
+
3
+ This release locks the `liquid` dependency to Liquid 5.6 or greater. Liquid 5.6
4
+ added `Liquid::Environment` for managing document context that was previously
5
+ stored in `Liquid::Template`, which was global and unsafe. This release ensures
6
+ that Lifer supports the new `Liquid::Environment` way of handling Liquid's local
7
+ filesystem for templates and partials.
8
+
1
9
  ## v0.3.0
2
10
 
3
11
  This version marks the first version of Lifer that is kind of usable. The README
4
- currently describes the big picture best. But I can that as of this version,
12
+ currently describes the big picture best. But I can add that, as of this version,
5
13
  I've documented all of the public interfaces and added a good number of `FIXME`
6
14
  comments to indicate functionality that _works_ but isn't quite where I want it
7
15
  to be long term.
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifer (0.3.0)
4
+ lifer (0.4.0)
5
5
  i18n (< 2)
6
6
  kramdown (~> 2.4)
7
- liquid (< 6)
7
+ liquid (~> 5.6, < 6)
8
8
  listen (< 4)
9
9
  puma (< 7)
10
10
  rack (< 4)
@@ -26,7 +26,7 @@ GEM
26
26
  rack-test (>= 0.6.3)
27
27
  regexp_parser (>= 1.5, < 3.0)
28
28
  xpath (~> 3.2)
29
- concurrent-ruby (1.3.4)
29
+ concurrent-ruby (1.3.5)
30
30
  debug (1.9.2)
31
31
  irb (~> 1.10)
32
32
  reline (>= 0.3.8)
@@ -34,7 +34,7 @@ GEM
34
34
  ffi (1.17.1-arm64-darwin)
35
35
  ffi (1.17.1-x86_64-darwin)
36
36
  ffi (1.17.1-x86_64-linux-gnu)
37
- i18n (1.14.6)
37
+ i18n (1.14.7)
38
38
  concurrent-ruby (~> 1.0)
39
39
  io-console (0.7.2)
40
40
  irb (1.14.0)
@@ -43,9 +43,9 @@ GEM
43
43
  kramdown (2.5.1)
44
44
  rexml (>= 3.3.9)
45
45
  language_server-protocol (3.17.0.3)
46
- liquid (5.6.0)
46
+ liquid (5.7.2)
47
47
  bigdecimal
48
- strscan
48
+ strscan (>= 3.1.1)
49
49
  listen (3.9.0)
50
50
  rb-fsevent (~> 0.10, >= 0.10.3)
51
51
  rb-inotify (~> 0.9, >= 0.9.10)
@@ -66,7 +66,7 @@ GEM
66
66
  psych (5.1.2)
67
67
  stringio
68
68
  public_suffix (6.0.1)
69
- puma (6.5.0)
69
+ puma (6.6.0)
70
70
  nio4r (~> 2.0)
71
71
  racc (1.8.1)
72
72
  rack (3.1.7)
@@ -0,0 +1,30 @@
1
+ class Lifer::Builder::HTML::FromLiquid
2
+ # From the `liquid` gem's README:
3
+ #
4
+ # "In Liquid, a "Environment" is a scoped environment that encapsulates
5
+ # custom tags, filters, and other configurations. This allows you to
6
+ # define and isolate different sets of functionality for different
7
+ # contexts, avoiding global overrides that can lead to conflicts
8
+ # and unexpected behavior."
9
+ #
10
+ # For Lifer, we simply use a single global environment for each build.
11
+ #
12
+ class LiquidEnv
13
+ # Returns the global Liquid environment that contains all local
14
+ # templates, custom tags, and filters.
15
+ #
16
+ # @return [Lifer::Environment]
17
+ def self.global
18
+ Liquid::Environment.build do |environment|
19
+ environment.error_mode = :strict
20
+
21
+ environment.file_system =
22
+ Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
23
+
24
+ environment.register_filter Lifer::Builder::HTML::FromLiquid::Filters
25
+ environment.register_tag "layout",
26
+ Lifer::Builder::HTML::FromLiquid::LayoutTag
27
+ end
28
+ end
29
+ end
30
+ end
@@ -3,6 +3,8 @@ require "liquid"
3
3
  require_relative "from_liquid/drops"
4
4
  require_relative "from_liquid/filters"
5
5
  require_relative "from_liquid/layout_tag"
6
+ require_relative "from_liquid/liquid_env"
7
+
6
8
 
7
9
  class Lifer::Builder::HTML
8
10
  # If the HTML builder is given a Liquid template, it uses this class to parse
@@ -88,16 +90,7 @@ class Lifer::Builder::HTML
88
90
  contents + "\n{% #{LayoutTag::ENDNAME} %}"
89
91
  end
90
92
 
91
- def liquid_environment
92
- @liquid_environment ||= Liquid::Environment.build do |environment|
93
- environment.file_system =
94
- Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
95
-
96
- environment.register_filter Lifer::Builder::HTML::FromLiquid::Filters
97
- environment.register_tag "layout",
98
- Lifer::Builder::HTML::FromLiquid::LayoutTag
99
- end
100
- end
93
+ def liquid_environment = (@liquid_environment ||= LiquidEnv.global)
101
94
 
102
95
  def parse_options
103
96
  {
data/lib/lifer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifer
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
data/lifer.gemspec CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
35
35
 
36
36
  spec.add_dependency "i18n", "< 2"
37
37
  spec.add_dependency "kramdown", "~> 2.4"
38
- spec.add_dependency "liquid", "< 6"
38
+ spec.add_dependency "liquid", ["~> 5.6", "< 6"]
39
39
  spec.add_dependency "listen", "< 4"
40
40
  spec.add_dependency "puma", "< 7"
41
41
  spec.add_dependency "rack", "< 4"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin wil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
11
+ date: 2025-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -42,6 +42,9 @@ dependencies:
42
42
  name: liquid
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.6'
45
48
  - - "<"
46
49
  - !ruby/object:Gem::Version
47
50
  version: '6'
@@ -49,6 +52,9 @@ dependencies:
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
51
54
  requirements:
55
+ - - "~>"
56
+ - !ruby/object:Gem::Version
57
+ version: '5.6'
52
58
  - - "<"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '6'
@@ -171,6 +177,7 @@ files:
171
177
  - lib/lifer/builder/html/from_liquid/drops/settings_drop.rb
172
178
  - lib/lifer/builder/html/from_liquid/filters.rb
173
179
  - lib/lifer/builder/html/from_liquid/layout_tag.rb
180
+ - lib/lifer/builder/html/from_liquid/liquid_env.rb
174
181
  - lib/lifer/builder/rss.rb
175
182
  - lib/lifer/builder/txt.rb
176
183
  - lib/lifer/cli.rb