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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/exe/weaver +14 -0
  3. data/lib/weaver/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4303f00ba8bdc586f8634a5f88cab24bc63e6786d8ffc0fa6cddb9e2a92c9db0
4
- data.tar.gz: 6b7f855c1edb7728a26dba236b3c6f0ecb6ac3cb132d26a550f0e369afa9f72f
3
+ metadata.gz: e9783796e6634d6bcf752a441dfa26bc5e4cd268b48fe0de848f8ec8e5f94b90
4
+ data.tar.gz: 0cd59698543c171bf7471415470be4f386f34bf787949434b0ead02e6ea7e3c9
5
5
  SHA512:
6
- metadata.gz: ae459746271b1ad28163cd2799bc4a7bdbd8a80c43c0dbabc946d78098090317697a45fe6f7bbba0dee2e97ce456db69817bf48d474cde7ef4451b4b8c18a847
7
- data.tar.gz: 78a2565cde8e982cea6a8d029469a2545450b4f8a5fc0e6ddd6c766a78ee9dceea80a016d7dea027314944c883e72c8510aefc4a95342f6c002d094bc63b64a0
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))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weaver
4
- VERSION = '0.9.10'
4
+ VERSION = '0.9.11'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weaver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.10
4
+ version: 0.9.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Siaw