lifer 0.12.0 → 0.12.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5f018de3a46e9674b5d0da11bb7d0dd5e111c7f8119d4c901fa2fb5d2458a9ab
4
- data.tar.gz: a17f6d9a91115594caa0f786f4bbecb01b4f3afc2925864ed62cf8ead11de457
3
+ metadata.gz: 71407123cb005d99c9ffc1cde0c263921d0c45c22936c95b0ccced6bc189cb54
4
+ data.tar.gz: 2b4a5ba58c99283e8df136e492c653bd04761c0b07ea643e7de7ed00216bfb37
5
5
  SHA512:
6
- metadata.gz: 5d2f01b4f70b947cba613f7bf23be66d777f23d9188d055a453586b1bca8ef46ef818faccb108d909ce2d809c9a4e15a162c0822f6a6e0d340682bbd525e436e
7
- data.tar.gz: d3cfc16e8436ff73cfc0c01deb2e5f78574f202b8160b2dca64288980f1ea0c75699176150c87acaf24010cdedaddfa7f98871dadacad5fa2f16293ecdfe3e7c
6
+ metadata.gz: 4dfed0a714043b38b861c0dbdae8f12d22c0b3fb4dda11f494dfed56cb346e6abcdfb87ce270dd9b17b2259751ef99b05516eee039c933b2d4b53c45897c9456
7
+ data.tar.gz: 42a12372430de5c6a2e96ddeb211b82e9c82fde78be316d4cc4b5fbbdfaa87877fce7940e32dfb49bbc69ceb0e64a4b57f228a6a53ba536c017e3c92aa06a83e
@@ -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,27 @@
1
1
  ## Next
2
2
 
3
+ ## v0.12.3
4
+
5
+ This release just resolves some issues I was having with the platform in
6
+ the gem specification being set wrong. Unfortunately, it was set wrong for
7
+ both the 0.12.1 and 0.12.2 releases. So, this release is just a resolution
8
+ to this little issue.
9
+
10
+ ## v0.12.2
11
+
12
+ This release makes minor improvements to the development server by adding
13
+ additional servable MIME types. That's all.
14
+
15
+ ## v0.12.1
16
+
17
+ This patch release resolves a couple of issues that may affect users:
18
+
19
+ - This release makes the implicit dependency on `base64` explicit. This
20
+ is necessary because as of Ruby 3.4, `base64` is no longer part of Ruby's
21
+ standard library.
22
+ - Resolves errors when `Lifer::Utilities#stringify_keys` or `#symbolize_keys`
23
+ are passed `nil` or an empty hash.
24
+
3
25
  ## v0.12.0
4
26
 
5
27
  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.3)
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
@@ -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,78 @@ 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 ".avi" then "video/x-msvideo"
52
+ when ".avif" then "image/avif"
53
+ when ".bin" then "application/octet-stream"
54
+ when ".bmp" then "image/bmp"
41
55
  when ".css" then "text/css"
56
+ when ".csv" then "text/csv"
57
+ when ".epub" then "application/epub+zip"
58
+ when ".gz" then "application/gzip"
59
+ when ".gif" then "image/gif"
42
60
  when ".html" then "text/html"
43
61
  when ".ico" then "image/ico"
62
+ when ".ics" then "text/calendar"
63
+ when ".jpeg", ".jpg" then "image/jpg"
44
64
  when ".js" then "text/javascript"
65
+ when ".json" then "application/json"
66
+ when ".jsonld" then "application/ld+json"
67
+ when ".mid", ".midi" then "audio/midi"
45
68
  when ".map" then "application/json"
69
+ when ".mpkg" then "application/vnd.apple.installer+xml"
70
+ when ".mp3" then "audio/mpeg"
71
+ when ".mp4" then "video/mp4"
72
+ when ".mpeg" then "video/mpeg"
73
+ when ".oga" then "audio/ogg"
74
+ when ".ogv" then "video/ogg"
75
+ when ".ogx" then "application/ogg"
76
+ when ".opus" then "audio/ogg"
77
+ when ".otf" then "font/otf"
78
+ when ".pdf" then "application/pdf"
79
+ when ".png" then "image/png"
80
+ when ".rar" then "application/vnd.rar"
81
+ when ".rtf" then "application/rtf"
82
+ when ".sh" then "application/x-sh"
83
+ when ".svg" then "image/svg+xml"
84
+ when ".tar" then "application/x-tar"
85
+ when ".tif", ".tiff" then "image/tiff"
86
+ when ".ttf" then "font/tff"
46
87
  when ".txt" then "text/plain"
47
- when ".woff" then "application/font-woff2"
48
- when ".woff2" then "application/font-woff2"
88
+ when ".wav" then "audio/wav"
89
+ when ".weba" then "audio/webm"
90
+ when ".webm" then "video/webm"
91
+ when ".webmanifest" then "application/manifest+json"
92
+ when ".webp" then "image/webp"
93
+ when ".woff", ".woff2" then "application/font-woff2"
94
+ when ".xml" then "application/xml"
95
+ when ".xhtml" then "application/xhtml+xml"
49
96
  when ".xml" then "application/xml"
97
+ when ".xul" then "application/vnd.mozilla.xul+xml"
98
+ when ".zip" then "application/zip"
99
+ when ".7z" then "application/x-7z-compressed"
50
100
  else
51
101
  raise NotImplementedError,
52
102
  I18n.t("dev.router.content_type_not_implemented", path:)
53
103
  end
54
104
  end
55
105
 
56
- def status
57
- File.exist?(path) ? 200 : 404
58
- end
106
+ def status = File.exist?(path) ? 200 : 404
59
107
  end
60
108
  end
@@ -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.3"
3
3
  end
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,29 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - benjamin wil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-01 00:00:00.000000000 Z
11
+ date: 2026-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: base64
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: i18n
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -210,8 +224,8 @@ licenses:
210
224
  - MIT
211
225
  metadata:
212
226
  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
227
+ homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.12.3/README.md
228
+ source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.12.3
215
229
  changelog_uri: https://github.com/benjaminwil/lifer/blob/main/CHANGELOG.md
216
230
  post_install_message:
217
231
  rdoc_options: []
@@ -228,7 +242,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
242
  - !ruby/object:Gem::Version
229
243
  version: '0'
230
244
  requirements: []
231
- rubygems_version: 3.5.16
245
+ rubygems_version: 3.5.22
232
246
  signing_key:
233
247
  specification_version: 4
234
248
  summary: Minimal static weblog generator.