hanami-controller 2.1.0.beta1 → 2.1.0.rc1

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: 58299df4276e04c035c82a7afcf6c012bd5059213d5fcc375ecc2e001900aa9b
4
- data.tar.gz: 9c7d4d3a80766da72364f2eee2d6909785a70ef9c63f6e1739d46af11bd9e49b
3
+ metadata.gz: daf2c6091f7e6fbff6ffbdd826b548250b32b0e52a475b8c7c9c1997fb307fa8
4
+ data.tar.gz: 43729833cfcac37032afafbab8172b82b00e5280b1e5c3e5a28432a25b4c17db
5
5
  SHA512:
6
- metadata.gz: 63d21bbd06003cac35e8b12d94fb829bdaf9a95164b948a7059aab745cb49ca8b9f100b7ac27a244a9cd9c4e9c1db6a1c7cb0c279859e6bf56eb75aa846bfd1c
7
- data.tar.gz: a04360570cf34f82caff342a04a2d46ca55c951c3aa718c1c15d0ff723f79b9b87b56e8e8ec57489a9f4d06a10ec35ad7f1681b9e6695aa393943a97c191fc99
6
+ metadata.gz: af07362be43e8174a48f90abb1c77fecc4abb221f95c4e38db0a7f9848e5763e58f3d03e56adfc4fd14892b8e81ee0dd3860731c4c26c8b5ff1df3214cc16d38
7
+ data.tar.gz: 750e1b4d42ca5433041c654d5a417f3c4408241387f4af13e1464af9f1eca20f4085c163ee2657fd7129af45405ca15ffd82a89d721fa65eb02680b0de4bd789
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  Complete, fast and testable actions for Rack
4
4
 
5
+ ## v2.1.0.rc1 - 2023-11-01
6
+
7
+ ### Fixed
8
+
9
+ - [Luca Guidi] Ensure Rack compatibility of `Hanami::Action::Response#send_file` (#431)
10
+
11
+ ## v2.1.0.beta2 - 2023-10-04
12
+
13
+ ### Fixed
14
+
15
+ - [Luca Guidi] `Hanami::Action::Config#root`: don't check realpath existence to simplify the boot process of Hanami (#429)
16
+
5
17
  ## v2.1.0.beta1 - 2023-06-29
6
18
 
7
19
  ### Added
@@ -73,8 +73,7 @@ module Hanami
73
73
  @length = 0
74
74
  @body = EMPTY_BODY.dup
75
75
 
76
- # FIXME: there could be a bug that prevents Content-Length to be sent for files
77
- if str.is_a?(::Rack::File::Iterator)
76
+ if str.is_a?(::Rack::Files::BaseIterator)
78
77
  @body = str
79
78
  else
80
79
  write(str) unless str.nil? || str == EMPTY_BODY
@@ -275,24 +274,26 @@ module Hanami
275
274
  #
276
275
  # @return [void]
277
276
  #
278
- # @see Config#public_directory
277
+ # @see Hanami::Action::Config#public_directory
278
+ # @see Hanami::Action::Rack::File
279
279
  #
280
280
  # @since 2.0.0
281
281
  # @api public
282
282
  def send_file(path)
283
283
  _send_file(
284
- Rack::File.new(path, @config.public_directory).call(env)
284
+ Action::Rack::File.new(path, @config.public_directory).call(env)
285
285
  )
286
286
  end
287
287
 
288
288
  # Send the file at the given path as the response, for a file anywhere in the file system.
289
289
  #
290
- # @see #send_file
291
- #
292
290
  # @param path [String, Pathname] path to the file to be sent
293
291
  #
294
292
  # @return [void]
295
293
  #
294
+ # @see #send_file
295
+ # @see Hanami::Action::Rack::File
296
+ #
296
297
  # @since 2.0.0
297
298
  # @api public
298
299
  def unsafe_send_file(path)
@@ -303,7 +304,7 @@ module Hanami
303
304
  end
304
305
 
305
306
  _send_file(
306
- Rack::File.new(path, directory).call(env)
307
+ Action::Rack::File.new(path, directory).call(env)
307
308
  )
308
309
  end
309
310
 
data/lib/hanami/action.rb CHANGED
@@ -67,7 +67,7 @@ module Hanami
67
67
  cookie_options.to_h.compact
68
68
  }
69
69
  setting :root_directory, constructor: -> (dir) {
70
- Pathname(File.expand_path(dir || Dir.pwd)).realpath
70
+ Pathname(File.expand_path(dir || Dir.pwd))
71
71
  }
72
72
  setting :public_directory, default: Config::DEFAULT_PUBLIC_DIRECTORY
73
73
  setting :before_callbacks, default: Utils::Callbacks::Chain.new, mutable: true
@@ -8,6 +8,6 @@ module Hanami
8
8
  #
9
9
  # @since 0.1.0
10
10
  # @api public
11
- VERSION = "2.1.0.beta1"
11
+ VERSION = "2.1.0.rc1"
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami-controller
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0.beta1
4
+ version: 2.1.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack