rack-rscript 1.2.3 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d065f87d5e3da283e01c8c83906b1ff8c47b83bcb988303ca74c1992b18c6f5
4
- data.tar.gz: 85232d65a5635ebd2f7f3bfcfc18f3e1dbc8aa0e601feacc1a91506a577894a8
3
+ metadata.gz: 9179db367dd0bf801e2734f5a3bd9ca3000105a7ee5b1340462fc61f8bda56f6
4
+ data.tar.gz: e5a0cb3510707ca6090521f9114f9875fa5657e144d6822b14a1ead00156f66a
5
5
  SHA512:
6
- metadata.gz: e537f297872d82494924488c6519a120d00a621057801b118338235c088d5eb1ee50d6d06dc4d9ea3abc2a94d3bcd3c072e1de4c55685913a2e1cb59acf94c3d
7
- data.tar.gz: 6b466d9f51bfeb33915d5462caf05a4d048cd1c4ca0fa384056eee13ad301ab400c4f8390c36cb536ce865c5432504d94887850ebbee48851531a14519969507
6
+ metadata.gz: 5150189b578838c95947a8dd5f2d7934f97524a805330d0c5ba1fdd2ae6f49a59da2dc653022a8c339b8393edeb9cd7a8b3446342a8f1429e484a6ecbdf350ea
7
+ data.tar.gz: c4faabb77d7806075a732ceba3d8a7d7aa0984fd4a05fbc68beaaabd0440d6a08f341ce9ca62425a714663ee4f7869716ee0a8f7d67c0da2f05a381030ef134b
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/rack-rscript.rb CHANGED
@@ -13,6 +13,8 @@ require 'rscript'
13
13
  require 'app-routes'
14
14
  require 'uri'
15
15
  require 'polyrex-links'
16
+ require 'nthrut'
17
+ require 'rxfreadwrite'
16
18
 
17
19
 
18
20
  class Redirect
@@ -26,12 +28,9 @@ end
26
28
  class RackRscriptError < Exception
27
29
  end
28
30
 
29
-
30
-
31
-
32
31
  class RackRscript
33
32
  include AppRoutes
34
- include RXFHelperModule
33
+ include RXFReadWriteModule
35
34
  using ColouredText
36
35
 
37
36
  attr_reader :req, :rsc
@@ -42,14 +41,15 @@ class RackRscript
42
41
  pxlinks: nil, debug: false, root: '', static: {})
43
42
 
44
43
  @log, @debug, @static = log, debug, static
45
- #=begin
46
- puts '@app_root: ' + @app_root.inspect if @debug
44
+
47
45
  puts 'root: ' + root.inspect if @debug
46
+ puts 'pkg_Src: ' + pkg_src.inspect if @debug
48
47
 
49
48
  @params = {}
50
49
 
51
50
  @templates = {}
52
51
 
52
+ @log.debug 'pkg_src: ' + pkg_src.inspect if @log
53
53
  @rscript = RScriptRW.new log: log, pkg_src: pkg_src, cache: cache, debug: true
54
54
  @render = NThrut.new(self)
55
55
 
@@ -58,7 +58,7 @@ class RackRscript
58
58
 
59
59
  if pxlinks then
60
60
 
61
- src, _ = RXFHelper.read(pxlinks)
61
+ src, _ = RXFReader.read(pxlinks)
62
62
 
63
63
  if src =~ /^<\?/ then
64
64
 
@@ -88,7 +88,7 @@ class RackRscript
88
88
 
89
89
  @root, @static = root, static
90
90
  @initialized = {}
91
- #=end
91
+
92
92
  end
93
93
 
94
94
  def call(env, testmode: false)
@@ -190,7 +190,6 @@ class RackRscript
190
190
  @initialized[url] = true
191
191
  end
192
192
 
193
-
194
193
  r = eval result
195
194
 
196
195
  return r
@@ -282,7 +281,7 @@ class RackRscript
282
281
 
283
282
  begin
284
283
 
285
- [RXFHelper.read(url).first,'text/plain']
284
+ [RXFReader.read(url).first,'text/plain']
286
285
 
287
286
  rescue
288
287
 
@@ -297,7 +296,7 @@ class RackRscript
297
296
  FileX.exists? @url_base
298
297
  filepath = @url_base
299
298
 
300
- [Dir.glob(filepath + '/*.rsf').map{|x| x[/([^\/]+)\.rsf$/,1]}.to_json,\
299
+ [DirX.glob(filepath + '/*.rsf').map{|x| x[/([^\/]+)\.rsf$/,1]}.to_json,\
301
300
  'application/json']
302
301
 
303
302
  end
@@ -312,7 +311,7 @@ class RackRscript
312
311
 
313
312
  path = raw_path
314
313
  puts 'path: ' + path.inspect if @debug
315
- filepath = File.join(@app_root, @root, path )
314
+ filepath = File.join(@root, path )
316
315
 
317
316
  else
318
317
 
@@ -342,30 +341,20 @@ class RackRscript
342
341
  end
343
342
 
344
343
  end
344
+
345
345
  end
346
346
 
347
347
  get /^\/$/ do
348
348
 
349
349
  if @root.length > 0 then
350
350
  file = File.join(@root, 'index.html')
351
- File.read file
351
+ FileX.read file
352
352
  else
353
353
  Time.now.inspect
354
354
  end
355
355
 
356
356
  end
357
357
 
358
- # file exists?
359
- a = Dir.glob( File.join(@root.to_s, '*')).select do |x|
360
- File::ftype(x) == 'directory'
361
- end
362
-
363
- get /^\/#{a.join('|')}/ do
364
-
365
- 'found' + a.inspect
366
-
367
- end
368
-
369
358
  end
370
359
 
371
360
  def run_request(request)
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.2.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  uQ8ts8x2DfuJYY/PmLbqwXkzMzb1EgnUBWZ3mZCdlL0UBst5ypPAFTn1b2qRUC92
36
36
  UtKkOrrEmCXrBnFtpv6a1ULk
37
37
  -----END CERTIFICATE-----
38
- date: 2021-12-30 00:00:00.000000000 Z
38
+ date: 2022-02-23 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rack
@@ -81,22 +81,42 @@ dependencies:
81
81
  name: rscript
82
82
  requirement: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 0.8.0
87
84
  - - "~>"
88
85
  - !ruby/object:Gem::Version
89
- version: '0.8'
86
+ version: '0.9'
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 0.9.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.9'
94
97
  - - ">="
95
98
  - !ruby/object:Gem::Version
96
- version: 0.8.0
99
+ version: 0.9.0
100
+ - !ruby/object:Gem::Dependency
101
+ name: haml
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
97
104
  - - "~>"
98
105
  - !ruby/object:Gem::Version
99
- version: '0.8'
106
+ version: '5.2'
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: 5.2.2
110
+ type: :runtime
111
+ prerelease: false
112
+ version_requirements: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - "~>"
115
+ - !ruby/object:Gem::Version
116
+ version: '5.2'
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: 5.2.2
100
120
  - !ruby/object:Gem::Dependency
101
121
  name: tilt
102
122
  requirement: !ruby/object:Gem::Requirement
@@ -121,42 +141,42 @@ dependencies:
121
141
  name: slim
122
142
  requirement: !ruby/object:Gem::Requirement
123
143
  requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- version: 4.1.0
127
144
  - - "~>"
128
145
  - !ruby/object:Gem::Version
129
146
  version: '4.1'
147
+ - - ">="
148
+ - !ruby/object:Gem::Version
149
+ version: 4.1.0
130
150
  type: :runtime
131
151
  prerelease: false
132
152
  version_requirements: !ruby/object:Gem::Requirement
133
153
  requirements:
134
- - - ">="
135
- - !ruby/object:Gem::Version
136
- version: 4.1.0
137
154
  - - "~>"
138
155
  - !ruby/object:Gem::Version
139
156
  version: '4.1'
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 4.1.0
140
160
  - !ruby/object:Gem::Dependency
141
161
  name: rexslt
142
162
  requirement: !ruby/object:Gem::Requirement
143
163
  requirements:
144
- - - ">="
145
- - !ruby/object:Gem::Version
146
- version: 0.7.0
147
164
  - - "~>"
148
165
  - !ruby/object:Gem::Version
149
- version: '0.7'
166
+ version: '0.8'
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: 0.8.0
150
170
  type: :runtime
151
171
  prerelease: false
152
172
  version_requirements: !ruby/object:Gem::Requirement
153
173
  requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: 0.7.0
157
174
  - - "~>"
158
175
  - !ruby/object:Gem::Version
159
- version: '0.7'
176
+ version: '0.8'
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: 0.8.0
160
180
  - !ruby/object:Gem::Dependency
161
181
  name: rsc
162
182
  requirement: !ruby/object:Gem::Requirement
@@ -183,20 +203,40 @@ dependencies:
183
203
  requirements:
184
204
  - - "~>"
185
205
  - !ruby/object:Gem::Version
186
- version: '0.4'
206
+ version: '0.5'
187
207
  - - ">="
188
208
  - !ruby/object:Gem::Version
189
- version: 0.4.3
209
+ version: 0.5.0
190
210
  type: :runtime
191
211
  prerelease: false
192
212
  version_requirements: !ruby/object:Gem::Requirement
193
213
  requirements:
194
214
  - - "~>"
195
215
  - !ruby/object:Gem::Version
196
- version: '0.4'
216
+ version: '0.5'
217
+ - - ">="
218
+ - !ruby/object:Gem::Version
219
+ version: 0.5.0
220
+ - !ruby/object:Gem::Dependency
221
+ name: nthrut
222
+ requirement: !ruby/object:Gem::Requirement
223
+ requirements:
224
+ - - "~>"
225
+ - !ruby/object:Gem::Version
226
+ version: '0.1'
227
+ - - ">="
228
+ - !ruby/object:Gem::Version
229
+ version: 0.1.0
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
235
+ - !ruby/object:Gem::Version
236
+ version: '0.1'
197
237
  - - ">="
198
238
  - !ruby/object:Gem::Version
199
- version: 0.4.3
239
+ version: 0.1.0
200
240
  description:
201
241
  email: digital.robertson@gmail.com
202
242
  executables: []
@@ -223,8 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
263
  - !ruby/object:Gem::Version
224
264
  version: '0'
225
265
  requirements: []
226
- rubyforge_project:
227
- rubygems_version: 2.7.10
266
+ rubygems_version: 3.2.22
228
267
  signing_key:
229
268
  specification_version: 4
230
269
  summary: Rack-Rscript is a light-weight alternative to Sinatra-Rscript.
metadata.gz.sig CHANGED
Binary file