rack-rscript 1.1.4 → 1.1.5
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
- checksums.yaml.gz.sig +0 -0
- data/lib/rack-rscript.rb +28 -14
- data.tar.gz.sig +0 -0
- metadata +22 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '0929ad598b28b90a80b39b3d406e7b3c3d054ef8e8009740272e0c4efa871a0f'
|
|
4
|
+
data.tar.gz: 4d61e887c6c4c1d1630f282beec390f4f6cb2e7489bd94d6ffabe0d1e7afe623
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 206d6635be3d06be5c51a3d8ca93e15d2dea9cbcd3c52b1f62ce3600a4e23be54f93559384a47381a1c208ba051b35f01a2f3b75d3f16b965d6f270bf259ebec
|
|
7
|
+
data.tar.gz: 4c05d931033a0c8b8f6fa45a3662c7aa59a73a78f470100eabba4ef00e5b5edfb284c965879a571a6ff64c8619ee9e29876a662dd8e12dcaa45727883dc317b4
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/rack-rscript.rb
CHANGED
|
@@ -28,11 +28,11 @@ end
|
|
|
28
28
|
|
|
29
29
|
class RackRscript
|
|
30
30
|
include AppRoutes
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
include RXFHelperModule
|
|
32
|
+
|
|
33
33
|
def initialize(log: nil, pkg_src: '', cache: 5, rsc_host: 'rse',
|
|
34
34
|
rsc_package_src: nil, pxlinks: nil, debug: false,
|
|
35
|
-
root: 'www', static:
|
|
35
|
+
root: 'www', static: {})
|
|
36
36
|
|
|
37
37
|
@log, @debug, @static = log, debug, static
|
|
38
38
|
|
|
@@ -215,7 +215,7 @@ class RackRscript
|
|
|
215
215
|
|
|
216
216
|
get '/ls' do
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
FileX.exists? @url_base
|
|
219
219
|
filepath = @url_base
|
|
220
220
|
|
|
221
221
|
[Dir.glob(filepath + '/*.rsf').map{|x| x[/([^\/]+)\.rsf$/,1]}.to_json,\
|
|
@@ -225,25 +225,39 @@ class RackRscript
|
|
|
225
225
|
|
|
226
226
|
if @static.any? then
|
|
227
227
|
|
|
228
|
-
get /^(\/(?:#{@static.join('|')}).*)/ do |
|
|
228
|
+
get /^(\/(?:#{@static.keys.join('|')}).*)/ do |raw_path|
|
|
229
|
+
|
|
230
|
+
_, file, tailpath = raw_path.split('/',3)
|
|
231
|
+
|
|
232
|
+
filepath = if @static[file].empty? then
|
|
233
|
+
|
|
234
|
+
path = raw_path
|
|
235
|
+
puts 'path: ' + path.inspect if @debug
|
|
236
|
+
filepath = File.join(@app_root, @root, path )
|
|
237
|
+
|
|
238
|
+
else
|
|
239
|
+
|
|
240
|
+
File.join(@static[file], tailpath)
|
|
241
|
+
|
|
242
|
+
end
|
|
243
|
+
|
|
244
|
+
@log.debug 'RackRscript/default_routes/filepath: ' + filepath.inspect if @log
|
|
229
245
|
|
|
230
|
-
puts 'path: ' + path.inspect if @debug
|
|
231
|
-
filepath = File.join(@app_root, @root, path )
|
|
232
246
|
|
|
233
247
|
if @log then
|
|
234
248
|
@log.info 'DandelionS1/default_routes: ' +
|
|
235
249
|
"root: %s path: %s" % [@root, path]
|
|
236
250
|
end
|
|
237
251
|
|
|
238
|
-
if
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
elsif
|
|
242
|
-
Redirect.new (
|
|
243
|
-
elsif
|
|
252
|
+
if filepath.length < 1 or filepath[-1] == '/' then
|
|
253
|
+
filepath += 'index.html'
|
|
254
|
+
FileX.read filepath
|
|
255
|
+
elsif FileX.directory? filepath then
|
|
256
|
+
Redirect.new (filepath + '/')
|
|
257
|
+
elsif FileX.exists? filepath then
|
|
244
258
|
|
|
245
259
|
content_type = @filetype[filepath[/\w+$/].to_sym]
|
|
246
|
-
[
|
|
260
|
+
[FileX.read(filepath), content_type || 'text/plain']
|
|
247
261
|
else
|
|
248
262
|
'oops, file ' + filepath + ' not found'
|
|
249
263
|
end
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rack-rscript
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- James Robertson
|
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
|
35
35
|
lDqRilVLi+NZf/R9vR/vaL53GOmDC+VoywL5frfWXVSK1Zs1fF7RAMZDJeYF0A8W
|
|
36
36
|
arbgkVprfDCrZHsF1ZnCIvNO
|
|
37
37
|
-----END CERTIFICATE-----
|
|
38
|
-
date: 2019-02-
|
|
38
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
|
39
39
|
dependencies:
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: rack
|
|
@@ -46,7 +46,7 @@ dependencies:
|
|
|
46
46
|
version: '2.0'
|
|
47
47
|
- - ">="
|
|
48
48
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: 2.0.
|
|
49
|
+
version: 2.0.6
|
|
50
50
|
type: :runtime
|
|
51
51
|
prerelease: false
|
|
52
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -56,7 +56,7 @@ dependencies:
|
|
|
56
56
|
version: '2.0'
|
|
57
57
|
- - ">="
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: 2.0.
|
|
59
|
+
version: 2.0.6
|
|
60
60
|
- !ruby/object:Gem::Dependency
|
|
61
61
|
name: app-routes
|
|
62
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -83,20 +83,20 @@ dependencies:
|
|
|
83
83
|
requirements:
|
|
84
84
|
- - "~>"
|
|
85
85
|
- !ruby/object:Gem::Version
|
|
86
|
-
version: '0.
|
|
86
|
+
version: '0.6'
|
|
87
87
|
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
89
|
+
version: 0.6.2
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
94
|
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '0.
|
|
96
|
+
version: '0.6'
|
|
97
97
|
- - ">="
|
|
98
98
|
- !ruby/object:Gem::Version
|
|
99
|
-
version: 0.
|
|
99
|
+
version: 0.6.2
|
|
100
100
|
- !ruby/object:Gem::Dependency
|
|
101
101
|
name: tilt
|
|
102
102
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -106,7 +106,7 @@ dependencies:
|
|
|
106
106
|
version: '2.0'
|
|
107
107
|
- - ">="
|
|
108
108
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 2.0.
|
|
109
|
+
version: 2.0.9
|
|
110
110
|
type: :runtime
|
|
111
111
|
prerelease: false
|
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -116,27 +116,27 @@ dependencies:
|
|
|
116
116
|
version: '2.0'
|
|
117
117
|
- - ">="
|
|
118
118
|
- !ruby/object:Gem::Version
|
|
119
|
-
version: 2.0.
|
|
119
|
+
version: 2.0.9
|
|
120
120
|
- !ruby/object:Gem::Dependency
|
|
121
121
|
name: slim
|
|
122
122
|
requirement: !ruby/object:Gem::Requirement
|
|
123
123
|
requirements:
|
|
124
124
|
- - "~>"
|
|
125
125
|
- !ruby/object:Gem::Version
|
|
126
|
-
version: '
|
|
126
|
+
version: '4.0'
|
|
127
127
|
- - ">="
|
|
128
128
|
- !ruby/object:Gem::Version
|
|
129
|
-
version:
|
|
129
|
+
version: 4.0.1
|
|
130
130
|
type: :runtime
|
|
131
131
|
prerelease: false
|
|
132
132
|
version_requirements: !ruby/object:Gem::Requirement
|
|
133
133
|
requirements:
|
|
134
134
|
- - "~>"
|
|
135
135
|
- !ruby/object:Gem::Version
|
|
136
|
-
version: '
|
|
136
|
+
version: '4.0'
|
|
137
137
|
- - ">="
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
|
-
version:
|
|
139
|
+
version: 4.0.1
|
|
140
140
|
- !ruby/object:Gem::Dependency
|
|
141
141
|
name: json
|
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -166,7 +166,7 @@ dependencies:
|
|
|
166
166
|
version: '0.6'
|
|
167
167
|
- - ">="
|
|
168
168
|
- !ruby/object:Gem::Version
|
|
169
|
-
version: 0.6.
|
|
169
|
+
version: 0.6.13
|
|
170
170
|
type: :runtime
|
|
171
171
|
prerelease: false
|
|
172
172
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -176,27 +176,27 @@ dependencies:
|
|
|
176
176
|
version: '0.6'
|
|
177
177
|
- - ">="
|
|
178
178
|
- !ruby/object:Gem::Version
|
|
179
|
-
version: 0.6.
|
|
179
|
+
version: 0.6.13
|
|
180
180
|
- !ruby/object:Gem::Dependency
|
|
181
181
|
name: rsc
|
|
182
182
|
requirement: !ruby/object:Gem::Requirement
|
|
183
183
|
requirements:
|
|
184
|
-
- - ">="
|
|
185
|
-
- !ruby/object:Gem::Version
|
|
186
|
-
version: 0.4.0
|
|
187
184
|
- - "~>"
|
|
188
185
|
- !ruby/object:Gem::Version
|
|
189
186
|
version: '0.4'
|
|
187
|
+
- - ">="
|
|
188
|
+
- !ruby/object:Gem::Version
|
|
189
|
+
version: 0.4.1
|
|
190
190
|
type: :runtime
|
|
191
191
|
prerelease: false
|
|
192
192
|
version_requirements: !ruby/object:Gem::Requirement
|
|
193
193
|
requirements:
|
|
194
|
-
- - ">="
|
|
195
|
-
- !ruby/object:Gem::Version
|
|
196
|
-
version: 0.4.0
|
|
197
194
|
- - "~>"
|
|
198
195
|
- !ruby/object:Gem::Version
|
|
199
196
|
version: '0.4'
|
|
197
|
+
- - ">="
|
|
198
|
+
- !ruby/object:Gem::Version
|
|
199
|
+
version: 0.4.1
|
|
200
200
|
- !ruby/object:Gem::Dependency
|
|
201
201
|
name: polyrex-links
|
|
202
202
|
requirement: !ruby/object:Gem::Requirement
|
metadata.gz.sig
CHANGED
|
Binary file
|