happo 2.0.2 → 2.0.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 +4 -4
- data/lib/happo/server.rb +14 -10
- data/lib/happo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfa1d5f7b53de566a64a6710794a4deea0a756db
|
4
|
+
data.tar.gz: db582e13b81de2322f8da87531e37230eea83800
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 762fc9435e4b284e6c2d3c5bb475d1b0e7d8bd23215acb9404b767311fa6328440c328450ce2f1f14ebd0cbb60fa13624c06c3bedf78ea0831f8b9f8ecb5f795
|
7
|
+
data.tar.gz: cb059925a90d2398b09bb5a0aac0297911a8e221d4bdd73fff1920e722baefc715f0922caf653e14cef95de6540e8e3a3ba6f453cbdf8996d08cf96e4d98034d
|
data/lib/happo/server.rb
CHANGED
@@ -39,18 +39,22 @@ module Happo
|
|
39
39
|
end
|
40
40
|
|
41
41
|
get '/*' do
|
42
|
-
|
42
|
+
# If this file is part of Happo itself (e.g. some bit of JavaScript), we
|
43
|
+
# want to give that precedence so that Happo can work properly.
|
43
44
|
file = params[:splat].first
|
44
|
-
if File.exist?(file)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
45
|
+
return send_file(file) if File.exist?(file)
|
46
|
+
|
47
|
+
# The requested file is not part of Happo, so let's look in the configured
|
48
|
+
# public directories. This is useful for serving up e.g. custom font files
|
49
|
+
# that your components depend on to be rendered correctly.
|
50
|
+
config = Happo::Utils.config
|
51
|
+
config['public_directories'].each do |pub_dir|
|
52
|
+
filepath = File.join(Dir.pwd, pub_dir, file)
|
53
|
+
return send_file(filepath) if File.exist?(filepath)
|
53
54
|
end
|
55
|
+
|
56
|
+
status 404 # not found
|
57
|
+
body '404 error: not found'
|
54
58
|
end
|
55
59
|
|
56
60
|
run!
|
data/lib/happo/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: happo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henric Trotzig
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-07-
|
12
|
+
date: 2016-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: chunky_png
|