hanami 0.7.1 → 0.7.2

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
  SHA1:
3
- metadata.gz: 8b7009c4b87b140d19b16be7a2dcf3b7809c1519
4
- data.tar.gz: 2593b7fce5f032a478e6977ff407e33237189c6d
3
+ metadata.gz: 0cda1a54a84b8301f94a0bf94c46028cf0523908
4
+ data.tar.gz: c5e4356f43e5f5d3a51e1dca770e9f0382450d76
5
5
  SHA512:
6
- metadata.gz: 5b718475924f9d0af9892d412cef58cf97e8eb24a54f7977be6d0061ece7703082cdca2f77a1ca7eaf9d05b9c32bd1fc6d01f3ff290bf60d6f4a300cbde8fc12
7
- data.tar.gz: 754321b70b997b1416732336de62a5822e675e879475e994572d5b616161ee40844292415b5b68b4176bae25ec211c48695b83e060046a8d632e3d4624e69734
6
+ metadata.gz: 51e192587e0b3df1144b7aea2400d01e8c032cb4a7a2a3b168610aedb81be9102024572c20b31b2f35bac4395d9342743806bd3705bbc7dec9027595b6bdd883
7
+ data.tar.gz: 2f2e9af512a21f40550873d270c03f612b124a59e2ae7f5091aaa30483e307ec7e38afb7e5ddcd156973689730f8b83f88643cd347440ca9c067985ef0d73269
@@ -1,6 +1,10 @@
1
1
  # Hanami
2
2
  The web, with simplicity.
3
3
 
4
+ ## v0.7.2 - 2016-02-09
5
+ ### Fixed
6
+ - [Alfonso Uceda Pompa] Fixed routing issue when static assets server tried to hijiack paths that are matching directories in public directory
7
+
4
8
  ## v0.7.1 - 2016-02-05
5
9
  ### Fixed
6
10
  - [Anton Davydov] Fixed routing issue when static assets server tried to hijiack requests belonging to dynamic endpoints
@@ -36,13 +36,19 @@ module Hanami
36
36
 
37
37
  def can_serve(path, original = nil)
38
38
  file_path = path.gsub(URL_SEPARATOR, ::File::SEPARATOR)
39
- destination = Dir[PUBLIC_DIRECTORY].find do |file|
40
- file.end_with?(file_path)
39
+ destination = find_asset do |asset|
40
+ asset.end_with?(file_path)
41
41
  end
42
42
 
43
43
  (super(path) || !!destination) && _fresh?(original, destination)
44
44
  end
45
45
 
46
+ def find_asset
47
+ Dir[PUBLIC_DIRECTORY].find do |asset|
48
+ yield asset unless ::File.directory?(asset)
49
+ end
50
+ end
51
+
46
52
  def _fresh?(original, destination)
47
53
  # At this point we're sure that destination exist.
48
54
  #
@@ -2,5 +2,5 @@ module Hanami
2
2
  # Defines the version
3
3
  #
4
4
  # @since 0.1.0
5
- VERSION = '0.7.1'.freeze
5
+ VERSION = '0.7.2'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hanami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-02-05 00:00:00.000000000 Z
13
+ date: 2016-02-09 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hanami-utils