weaver 0.9.10 → 0.9.11
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/exe/weaver +14 -0
- data/lib/weaver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e9783796e6634d6bcf752a441dfa26bc5e4cd268b48fe0de848f8ec8e5f94b90
|
|
4
|
+
data.tar.gz: 0cd59698543c171bf7471415470be4f386f34bf787949434b0ead02e6ea7e3c9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f6a9d060ad3483eb92cb25eecb30d2f732c87581b808483d1535e88c20212c49a6775c9cc23af7479e08d082f557d2585411d3af732c06f33c615f5d86b2430
|
|
7
|
+
data.tar.gz: 9d69cce3eb98324d257dd8d69eb66b878a6c529a2cf6f553f774dbd08d62368f3003d74edbbf5525a7dc5b247129e7b4ab6f7ba038a2c3f1f491d1373ddc9b2a
|
data/exe/weaver
CHANGED
|
@@ -11,6 +11,15 @@ class Website < Sinatra::Base
|
|
|
11
11
|
set :bind, '0.0.0.0'
|
|
12
12
|
set :port, ENV['PORT'] || 4567
|
|
13
13
|
set :host_authorization, { permitted_hosts: [] }
|
|
14
|
+
mime_type :webmanifest, 'application/manifest+json'
|
|
15
|
+
|
|
16
|
+
# Files in the project's root/ directory are served at the top of the site (and
|
|
17
|
+
# `weaver build` copies them there): favicons, robots.txt, CNAME, service workers...
|
|
18
|
+
def root_file(path)
|
|
19
|
+
root = File.expand_path('root')
|
|
20
|
+
file = File.expand_path(path, root)
|
|
21
|
+
file if file.start_with?("#{root}/") && File.file?(file)
|
|
22
|
+
end
|
|
14
23
|
|
|
15
24
|
def getWeavefile(viewname)
|
|
16
25
|
pathToFile = viewname.split('/').delete_if(&:empty?)
|
|
@@ -40,6 +49,10 @@ class Website < Sinatra::Base
|
|
|
40
49
|
end
|
|
41
50
|
|
|
42
51
|
get '/*' do
|
|
52
|
+
if (file = root_file(params[:splat].first))
|
|
53
|
+
return send_file(file, disposition: 'inline')
|
|
54
|
+
end
|
|
55
|
+
|
|
43
56
|
if params[:splat].first.start_with? 'images/'
|
|
44
57
|
return send_file(params[:splat].first, disposition: 'inline')
|
|
45
58
|
end
|
|
@@ -102,6 +115,7 @@ def build!(_args)
|
|
|
102
115
|
FileUtils.rm_rf buildDir
|
|
103
116
|
FileUtils.cp_r(File.join(Gem.loaded_specs['weaver'].full_gem_path, 'data', 'weaver'), buildDir, preserve: preserve)
|
|
104
117
|
FileUtils.cp_r('images', buildDir, preserve: preserve) if Dir.exist? 'images'
|
|
118
|
+
FileUtils.cp_r('root/.', buildDir, preserve: preserve) if Dir.exist? 'root'
|
|
105
119
|
if Dir.exist? 'js'
|
|
106
120
|
Dir['js/**/*.*'].each do |x|
|
|
107
121
|
FileUtils.mkdir_p File.dirname(File.join(buildDir, x))
|
data/lib/weaver/version.rb
CHANGED