lifer 0.12.0 → 0.12.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f018de3a46e9674b5d0da11bb7d0dd5e111c7f8119d4c901fa2fb5d2458a9ab
4
- data.tar.gz: a17f6d9a91115594caa0f786f4bbecb01b4f3afc2925864ed62cf8ead11de457
3
+ metadata.gz: 56e9416088ac954ed5ede64c4f4675153d8d6fb0a0a1d6cc04b91d387538c388
4
+ data.tar.gz: 638c9b87b742d4aa393bc312649f6d5801d855fd3c95dc16fb774c6d5a415fd2
5
5
  SHA512:
6
- metadata.gz: 5d2f01b4f70b947cba613f7bf23be66d777f23d9188d055a453586b1bca8ef46ef818faccb108d909ce2d809c9a4e15a162c0822f6a6e0d340682bbd525e436e
7
- data.tar.gz: d3cfc16e8436ff73cfc0c01deb2e5f78574f202b8160b2dca64288980f1ea0c75699176150c87acaf24010cdedaddfa7f98871dadacad5fa2f16293ecdfe3e7c
6
+ metadata.gz: 2b65f34b010f2117b52598cb10586717c13bac9ecb5bae417968fcf8919ab0128bb266e8ff02de7ac31ff578e4525e067423c2ad78bbaaeb594a9a81cc14d23b
7
+ data.tar.gz: df56506ab2cc5d0fae8a7714e59d0dc2a55b01ccbf77f07e787e8f0ee6d3995120b2b42c3ebd8f71f8ef69a720467cd396c7f0554374629d1f9eeb4a4f1049fc
@@ -7,11 +7,11 @@ jobs:
7
7
  name: Run RSpec test suite
8
8
  runs-on: ubuntu-latest
9
9
  steps:
10
- - uses: actions/checkout@v2
10
+ - uses: actions/checkout@v6
11
11
  - name: Set up Ruby
12
12
  uses: ruby/setup-ruby@v1
13
13
  with:
14
- ruby-version: 3.3.4
14
+ ruby-version: 3.4
15
15
  bundler-cache: true
16
16
  - name: Run the default task
17
17
  run: bundle exec rake
data/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  ## Next
2
2
 
3
+ ## v0.12.4
4
+
5
+ This release resolves two issues:
6
+
7
+ 1. An issue where reading entry frontmatter (metadata within a `---` cage)
8
+ wasn't working properly when other `---` strings appeared later on in the
9
+ entry. We just needed to make the `Lifer::FRONTMATTER_REGEX` less greedy.
10
+ 2. It allows the development server to serve `.asc` files. :-)
11
+
12
+ ## v0.12.3
13
+
14
+ This release just resolves some issues I was having with the platform in
15
+ the gem specification being set wrong. Unfortunately, it was set wrong for
16
+ both the 0.12.1 and 0.12.2 releases. So, this release is just a resolution
17
+ to this little issue.
18
+
19
+ ## v0.12.2
20
+
21
+ This release makes minor improvements to the development server by adding
22
+ additional servable MIME types. That's all.
23
+
24
+ ## v0.12.1
25
+
26
+ This patch release resolves a couple of issues that may affect users:
27
+
28
+ - This release makes the implicit dependency on `base64` explicit. This
29
+ is necessary because as of Ruby 3.4, `base64` is no longer part of Ruby's
30
+ standard library.
31
+ - Resolves errors when `Lifer::Utilities#stringify_keys` or `#symbolize_keys`
32
+ are passed `nil` or an empty hash.
33
+
3
34
  ## v0.12.0
4
35
 
5
36
  This release adds a new `#render` method that can be used in any ERB files being
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lifer (0.12.0)
4
+ lifer (0.12.4)
5
+ base64
5
6
  i18n (< 2)
6
7
  kramdown (~> 2.4)
7
8
  liquid (~> 5.6, < 6)
@@ -14,9 +15,10 @@ PATH
14
15
  GEM
15
16
  remote: https://rubygems.org/
16
17
  specs:
17
- addressable (2.8.7)
18
- public_suffix (>= 2.0.2, < 7.0)
19
- bigdecimal (3.2.2)
18
+ addressable (2.8.8)
19
+ public_suffix (>= 2.0.2, < 8.0)
20
+ base64 (0.3.0)
21
+ bigdecimal (4.0.1)
20
22
  bump (0.10.0)
21
23
  capybara (3.40.0)
22
24
  addressable
@@ -27,96 +29,99 @@ GEM
27
29
  rack-test (>= 0.6.3)
28
30
  regexp_parser (>= 1.5, < 3.0)
29
31
  xpath (~> 3.2)
30
- concurrent-ruby (1.3.5)
31
- debug (1.9.2)
32
+ concurrent-ruby (1.3.6)
33
+ date (3.5.1)
34
+ debug (1.11.1)
32
35
  irb (~> 1.10)
33
36
  reline (>= 0.3.8)
34
- diff-lcs (1.5.1)
35
- ffi (1.17.2-arm64-darwin)
36
- ffi (1.17.2-x86_64-darwin)
37
- ffi (1.17.2-x86_64-linux-gnu)
38
- i18n (1.14.7)
37
+ diff-lcs (1.6.2)
38
+ erb (6.0.1)
39
+ ffi (1.17.3)
40
+ i18n (1.14.8)
39
41
  concurrent-ruby (~> 1.0)
40
- io-console (0.7.2)
41
- irb (1.14.0)
42
+ io-console (0.8.2)
43
+ irb (1.16.0)
44
+ pp (>= 0.6.0)
42
45
  rdoc (>= 4.0.0)
43
46
  reline (>= 0.4.2)
44
- kramdown (2.5.1)
45
- rexml (>= 3.3.9)
46
- language_server-protocol (3.17.0.3)
47
- liquid (5.8.7)
47
+ kramdown (2.5.2)
48
+ rexml (>= 3.4.4)
49
+ language_server-protocol (3.17.0.5)
50
+ liquid (5.11.0)
48
51
  bigdecimal
49
52
  strscan (>= 3.1.1)
50
- listen (3.9.0)
53
+ listen (3.10.0)
54
+ logger
51
55
  rb-fsevent (~> 0.10, >= 0.10.3)
52
56
  rb-inotify (~> 0.9, >= 0.9.10)
53
- logger (1.6.1)
54
- matrix (0.4.2)
57
+ logger (1.7.0)
58
+ matrix (0.4.3)
55
59
  mini_mime (1.1.5)
56
- nio4r (2.7.4)
57
- nokogiri (1.16.7-arm64-darwin)
58
- racc (~> 1.4)
59
- nokogiri (1.16.7-x86_64-darwin)
60
- racc (~> 1.4)
61
- nokogiri (1.16.7-x86_64-linux)
60
+ mini_portile2 (2.8.9)
61
+ nio4r (2.7.5)
62
+ nokogiri (1.19.0)
63
+ mini_portile2 (~> 2.8.2)
62
64
  racc (~> 1.4)
63
- parallel (1.26.3)
64
- parallel_tests (4.7.2)
65
+ parallel (1.27.0)
66
+ parallel_tests (5.5.0)
65
67
  parallel
66
- prism (1.0.0)
67
- psych (5.1.2)
68
+ pp (0.6.3)
69
+ prettyprint
70
+ prettyprint (0.2.0)
71
+ prism (1.9.0)
72
+ psych (5.3.1)
73
+ date
68
74
  stringio
69
- public_suffix (6.0.1)
70
- puma (6.6.0)
75
+ public_suffix (7.0.2)
76
+ puma (6.6.1)
71
77
  nio4r (~> 2.0)
72
78
  racc (1.8.1)
73
- rack (3.1.7)
74
- rack-test (2.1.0)
79
+ rack (3.2.4)
80
+ rack-test (2.2.0)
75
81
  rack (>= 1.3)
76
- rake (13.2.1)
82
+ rake (13.3.1)
77
83
  rb-fsevent (0.11.2)
78
84
  rb-inotify (0.11.1)
79
85
  ffi (~> 1.0)
80
- rbs (3.5.3)
86
+ rbs (3.10.3)
81
87
  logger
82
- rdoc (6.7.0)
88
+ tsort
89
+ rdoc (7.1.0)
90
+ erb
83
91
  psych (>= 4.0.0)
84
- regexp_parser (2.9.2)
85
- reline (0.5.10)
92
+ tsort
93
+ regexp_parser (2.11.3)
94
+ reline (0.6.3)
86
95
  io-console (~> 0.5)
87
- rexml (3.4.1)
88
- rspec (3.13.0)
96
+ rexml (3.4.4)
97
+ rspec (3.13.2)
89
98
  rspec-core (~> 3.13.0)
90
99
  rspec-expectations (~> 3.13.0)
91
100
  rspec-mocks (~> 3.13.0)
92
- rspec-core (3.13.1)
101
+ rspec-core (3.13.6)
93
102
  rspec-support (~> 3.13.0)
94
- rspec-expectations (3.13.3)
103
+ rspec-expectations (3.13.5)
95
104
  diff-lcs (>= 1.2.0, < 2.0)
96
105
  rspec-support (~> 3.13.0)
97
- rspec-mocks (3.13.1)
106
+ rspec-mocks (3.13.7)
98
107
  diff-lcs (>= 1.2.0, < 2.0)
99
108
  rspec-support (~> 3.13.0)
100
- rspec-support (3.13.1)
101
- rss (0.3.1)
109
+ rspec-support (3.13.7)
110
+ rss (0.3.2)
102
111
  rexml
103
- ruby-lsp (0.17.17)
112
+ ruby-lsp (0.26.5)
104
113
  language_server-protocol (~> 3.17.0)
105
- prism (~> 1.0)
106
- rbs (>= 3, < 4)
107
- sorbet-runtime (>= 0.5.10782)
108
- sorbet-runtime (0.5.11558)
109
- stringio (3.1.1)
110
- strscan (3.1.5)
114
+ prism (>= 1.2, < 2.0)
115
+ rbs (>= 3, < 5)
116
+ stringio (3.2.0)
117
+ strscan (3.1.7)
118
+ tsort (0.2.0)
111
119
  xpath (3.2.0)
112
120
  nokogiri (~> 1.8)
113
- yard (0.9.37)
121
+ yard (0.9.38)
114
122
 
115
123
  PLATFORMS
116
- arm64-darwin-22
117
- x86_64-darwin-21
118
- x86_64-darwin-22
119
- x86_64-linux
124
+ ruby
120
125
 
121
126
  DEPENDENCIES
122
127
  bump
@@ -131,4 +136,4 @@ DEPENDENCIES
131
136
  yard
132
137
 
133
138
  BUNDLED WITH
134
- 2.3.21
139
+ 2.6.9
@@ -57,7 +57,7 @@ class Lifer::Builder
57
57
  return cached_value if cached_value
58
58
 
59
59
  contents = File.read layout_file
60
- contents = contents.gsub(Lifer::FRONTMATTER_REGEX, "") unless raw
60
+ contents = contents.sub(Lifer::FRONTMATTER_REGEX, "") unless raw
61
61
 
62
62
  instance_variable_set cache_variable, contents
63
63
  end
@@ -21,9 +21,7 @@ module Lifer::Dev
21
21
  # 3. The HTTP body response.
22
22
  #
23
23
  # @return [Array] A Rack-compatible response.
24
- def build
25
- [status, {"Content-Type": content_type}, contents]
26
- end
24
+ def build = [status, {"Content-Type": content_type}, contents]
27
25
 
28
26
  private
29
27
 
@@ -33,28 +31,79 @@ module Lifer::Dev
33
31
  [File.read(path)]
34
32
  end
35
33
 
36
- # @fixme It would be very nice to not manually manage this list of
34
+
35
+ # The MIME type for the current path. Because Lifer only offers a server
36
+ # for development mode, this is just a simple map based on common known
37
+ # MIME types. We recommend submitting a patch or monkey-patching this
38
+ # method if it does not suit your needs in development. For more
39
+ # information:
40
+ #
41
+ # https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types
42
+ #
43
+ # @fixme It would be very nice to not manually manage this list of
37
44
  # content types. Is there a nice, dependency-free way to do this?
38
45
  #
46
+ # @return [String] The MIME type for the current path's file extension.
39
47
  def content_type
40
48
  case File.extname(path)
49
+ when ".aac" then "audio/aac"
50
+ when ".apng" then "image/apng"
51
+ when ".asc" then "application/pgp-signature"
52
+ when ".avi" then "video/x-msvideo"
53
+ when ".avif" then "image/avif"
54
+ when ".bin" then "application/octet-stream"
55
+ when ".bmp" then "image/bmp"
41
56
  when ".css" then "text/css"
57
+ when ".csv" then "text/csv"
58
+ when ".epub" then "application/epub+zip"
59
+ when ".gz" then "application/gzip"
60
+ when ".gif" then "image/gif"
42
61
  when ".html" then "text/html"
43
62
  when ".ico" then "image/ico"
63
+ when ".ics" then "text/calendar"
64
+ when ".jpeg", ".jpg" then "image/jpg"
44
65
  when ".js" then "text/javascript"
66
+ when ".json" then "application/json"
67
+ when ".jsonld" then "application/ld+json"
68
+ when ".mid", ".midi" then "audio/midi"
45
69
  when ".map" then "application/json"
70
+ when ".mpkg" then "application/vnd.apple.installer+xml"
71
+ when ".mp3" then "audio/mpeg"
72
+ when ".mp4" then "video/mp4"
73
+ when ".mpeg" then "video/mpeg"
74
+ when ".oga" then "audio/ogg"
75
+ when ".ogv" then "video/ogg"
76
+ when ".ogx" then "application/ogg"
77
+ when ".opus" then "audio/ogg"
78
+ when ".otf" then "font/otf"
79
+ when ".pdf" then "application/pdf"
80
+ when ".png" then "image/png"
81
+ when ".rar" then "application/vnd.rar"
82
+ when ".rtf" then "application/rtf"
83
+ when ".sh" then "application/x-sh"
84
+ when ".svg" then "image/svg+xml"
85
+ when ".tar" then "application/x-tar"
86
+ when ".tif", ".tiff" then "image/tiff"
87
+ when ".ttf" then "font/tff"
46
88
  when ".txt" then "text/plain"
47
- when ".woff" then "application/font-woff2"
48
- when ".woff2" then "application/font-woff2"
89
+ when ".wav" then "audio/wav"
90
+ when ".weba" then "audio/webm"
91
+ when ".webm" then "video/webm"
92
+ when ".webmanifest" then "application/manifest+json"
93
+ when ".webp" then "image/webp"
94
+ when ".woff", ".woff2" then "application/font-woff2"
95
+ when ".xml" then "application/xml"
96
+ when ".xhtml" then "application/xhtml+xml"
49
97
  when ".xml" then "application/xml"
98
+ when ".xul" then "application/vnd.mozilla.xul+xml"
99
+ when ".zip" then "application/zip"
100
+ when ".7z" then "application/x-7z-compressed"
50
101
  else
51
102
  raise NotImplementedError,
52
103
  I18n.t("dev.router.content_type_not_implemented", path:)
53
104
  end
54
105
  end
55
106
 
56
- def status
57
- File.exist?(path) ? 200 : 404
58
- end
107
+ def status = File.exist?(path) ? 200 : 404
59
108
  end
60
109
  end
data/lib/lifer/entry.rb CHANGED
@@ -143,7 +143,7 @@ module Lifer
143
143
  def body
144
144
  return full_text.strip unless frontmatter?
145
145
 
146
- full_text.gsub(Lifer::FRONTMATTER_REGEX, "").strip
146
+ full_text.sub(Lifer::FRONTMATTER_REGEX, "").strip
147
147
  end
148
148
 
149
149
  def feedable?
@@ -101,7 +101,7 @@ module Lifer::Utilities
101
101
  def stringify_keys(hash)
102
102
  stringified_hash = {}
103
103
 
104
- hash.each do |key, value|
104
+ hash&.each do |key, value|
105
105
  stringified_hash[(key.to_s rescue key) || key] =
106
106
  value.is_a?(Hash) ? stringify_keys(value) : value
107
107
 
@@ -119,7 +119,7 @@ module Lifer::Utilities
119
119
  def symbolize_keys(hash)
120
120
  symbolized_hash = {}
121
121
 
122
- hash.each do |key, value|
122
+ hash&.each do |key, value|
123
123
  symbolized_hash[(key.to_sym rescue key) || key] =
124
124
  value.is_a?(Hash) ? symbolize_keys(value) : value
125
125
 
data/lib/lifer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lifer
2
- VERSION = "0.12.0"
2
+ VERSION = "0.12.4"
3
3
  end
data/lib/lifer.rb CHANGED
@@ -26,7 +26,7 @@ module Lifer
26
26
 
27
27
  # We expect frontmatter in any file to be provided in the following format.
28
28
  #
29
- FRONTMATTER_REGEX = /^---\n(.*)---\n/m
29
+ FRONTMATTER_REGEX = /^---\n(.*?)---\n/m
30
30
 
31
31
  class << self
32
32
  # The first time `Lifer.brain` is referenced, we build a new `Lifer::Brain`
data/lifer.gemspec CHANGED
@@ -36,6 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.files.grep(%r{\Abin/}) { |bin_file| File.basename(bin_file) }
37
37
  spec.require_paths = ["lib"]
38
38
 
39
+ spec.add_dependency "base64"
39
40
  spec.add_dependency "i18n", "< 2"
40
41
  spec.add_dependency "kramdown", "~> 2.4"
41
42
  spec.add_dependency "liquid", ["~> 5.6", "< 6"]
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lifer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin wil
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-07-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: base64
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: i18n
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -210,10 +223,9 @@ licenses:
210
223
  - MIT
211
224
  metadata:
212
225
  allowed_push_host: https://rubygems.org
213
- homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.12.0/README.md
214
- source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.12.0
226
+ homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.12.4/README.md
227
+ source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.12.4
215
228
  changelog_uri: https://github.com/benjaminwil/lifer/blob/main/CHANGELOG.md
216
- post_install_message:
217
229
  rdoc_options: []
218
230
  require_paths:
219
231
  - lib
@@ -228,8 +240,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
240
  - !ruby/object:Gem::Version
229
241
  version: '0'
230
242
  requirements: []
231
- rubygems_version: 3.5.16
232
- signing_key:
243
+ rubygems_version: 3.6.9
233
244
  specification_version: 4
234
245
  summary: Minimal static weblog generator.
235
246
  test_files: []