rack-rscript 0.7.0 → 0.7.1

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
  SHA1:
3
- metadata.gz: b667f493e91891962a5c7faf606bd8c2aedcc5fe
4
- data.tar.gz: 9edf50304adf17122603d4faa2d1466a3bd34cd8
3
+ metadata.gz: c1aecdceddae7e8344cdbf8798790c72ec9dc20d
4
+ data.tar.gz: 7f0c196b9ceeab8c7ef2f2cbbfcb35fb7b666455
5
5
  SHA512:
6
- metadata.gz: eef3cc82c16906d5befc5b00f7142af99c24be094a29a95b6eb55a6d87185d0f4ce4774b18f45e3d2570ec831ef89c558546d8bee57615732c702662041f4095
7
- data.tar.gz: a82bee559a6e1340fdfcd9752dc024ab05f9fdb305ee1f88106330b50b0811885f97cf68f4c2adde4bb6b38c493448050d8cae735f80089ae394faf2e4459293
6
+ metadata.gz: 7b7067382b26de914c7005f283a7574bc79e1a7e9e0b227271facfa304d9de42d311883850708711c96dd36cdeb5ec38c9453aa695ebcc9150982ff66ee3470a
7
+ data.tar.gz: bc4e243eb52d0d27bf53a7b8b93416e1a97e32f02600b8193f8c4dc5e73edadaeb495bfad43be6b0b6088609b04fe17154ae2f081f04e6d24df650bf0a592e72
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -97,6 +97,7 @@ class RackRscript
97
97
  'text/xml' => passthru_proc,
98
98
  'text/css' => passthru_proc,
99
99
  'application/xml' => passthru_proc,
100
+ 'application/json' => passthru_proc,
100
101
  'image/png' => passthru_proc,
101
102
  'image/jpeg' => passthru_proc
102
103
  }
@@ -196,22 +197,32 @@ class RackRscript
196
197
  [@rrscript.read([url, '//job:' + job]).first, 'text/plain']
197
198
  end
198
199
 
199
- get '/source/:package' do |package,job|
200
+ get '/source/:package' do |package,job|
200
201
 
201
- url = "%s%s.rsf" % [@url_base, package]
202
-
203
- begin
204
-
202
+ url = "%s%s.rsf" % [@url_base, package]
203
+
204
+ begin
205
+
205
206
  [RXFHelper.read(url).first,'text/plain']
207
+
208
+ rescue
206
209
 
207
- rescue
208
-
209
210
  ['url: ' + url + '; ' + ($!).inspect + \
210
- 'couldn\'t find that package', 'text/plain']
211
- end
211
+ 'couldn\'t find that package', 'text/plain']
212
+ end
212
213
 
213
214
  end
214
-
215
+
216
+ get '/ls' do
217
+
218
+ File.exists? @url_base
219
+ filepath = @url_base
220
+
221
+ [Dir.glob(filepath + '/*.rsf').map{|x| x[/([^\/]+)\.rsf$/,1]}.to_json,\
222
+ 'application/json']
223
+
224
+ end
225
+
215
226
 
216
227
  end
217
228
 
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: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file