rscript 0.7.1 → 0.7.2

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: 87de3007d89a229148c3dbb1c7c1f166dc9c1fc2bac1b7471587713d1550c11d
4
- data.tar.gz: 67b9ad3063e3c4f90f210d7e738883ab1eaeafda7e5f8c2f2717c5cd3003e592
3
+ metadata.gz: 845e770b89f51965807fd09565b493e371f7cde6cf731e0cb2b6735f3570ed83
4
+ data.tar.gz: e0a90d763a8ddc14d020f429d301a2c2ba476a5bd2600e7fcd4ee07ba6b4c715
5
5
  SHA512:
6
- metadata.gz: 6b76c85bcf4bdf8420a35243852d6fee32873b3605f0e9b35fe321fb21b61513f0d67fb6b89e5d6f4f4d7759f973292303f347fa3b22c01ca23a7ba05315e51f
7
- data.tar.gz: 4d976cda6b2aad249550384ba6b70b1dc0582c4db36f5fd97ad44efd91d6da53e62be62a38c55f718d9f2b9dce2734ed1f204087aaff0a19d23c4ee5bff9ac36
6
+ metadata.gz: deda38285fdc3d090a80fdc571e117508f4f81477d744e07e53157451c325974d984e1812b691bb160f1b6c487bdc12effdf7c3de247316c8b40b7765548e54e
7
+ data.tar.gz: c65076ba2fcad742663ce5ecad832f76dc9800d0c41b21b7b6116374da2dfb672a55a826ddd9a312dba77df5e0d8baecd5c94fdae47c4ee4cf88c89ced45b2f6
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -3,10 +3,12 @@
3
3
  # file: rscript.rb
4
4
 
5
5
  # created: 1-Jul-2009
6
- # updated: 05-Mar-2019
6
+ # updated: 00-Mar-2019
7
7
 
8
8
  # modification:
9
9
 
10
+ # 00-Mar-2019: feature: An explicit path or implicit path now can be
11
+ # specified in the src attribute
10
12
  # 05-Mar-2019: feature: Added the class RScriptRW for :get, :post typed jobs
11
13
  # 13-Oct-2018: bug fix: The log is now only written when the log exists
12
14
  # 30-Jul-2018: feature: A list of job ids can now be returned
@@ -169,13 +171,17 @@ class RScript < RScriptBase
169
171
  puts 'args: ' + args.inspect if @debug
170
172
  rsfile = args[0]; args.shift
171
173
 
174
+ url = File.dirname rsfile
175
+ @url_dir = url[/(?:\w+:\/\/|.*)[^\/]*(\/.*)/,1]
176
+ @url_base = url[/(\w+:\/\/[^\/]+|.*)/]
177
+
172
178
  $rsfile = rsfile[/[^\/]+(?=\.rsf)/]
173
179
 
174
180
  a = @cache ? @rsf_cache.read(rsfile) { build_a(rsfile) } : build_a(rsfile)
175
181
  puts 'read_rsfdoc a: ' + a.inspect if @debug
176
182
 
177
- @url_base = rsfile[/\w+:\/\/[^\/]+/]
178
-
183
+
184
+
179
185
  return a
180
186
 
181
187
  end
@@ -7,6 +7,7 @@ require 'open-uri'
7
7
  require 'rxfhelper'
8
8
 
9
9
  class RScriptBase
10
+ using ColouredText
10
11
 
11
12
  def initialize(debug: false)
12
13
  @debug = debug
@@ -19,7 +20,7 @@ class RScriptBase
19
20
  protected
20
21
 
21
22
  def read_script(script)
22
- puts 'inside read_script' if @debug
23
+ puts 'inside read_script'.info if @debug
23
24
  out_buffer = ''
24
25
 
25
26
  src = script.attributes[:src]
@@ -34,8 +35,20 @@ class RScriptBase
34
35
  end
35
36
 
36
37
  def read_sourcecode(rsf)
37
- puts 'inside read_sourcecode' if @debug
38
- buffer, _ = RXFHelper.read rsf, auto: false
38
+
39
+ puts 'inside read_sourcecode'.info if @debug
40
+ #@log.debug 'rsf: ' + rsf.inspect if @log
41
+ #@log.debug 'url_base: ' + @url_base.inspect if @log
42
+
43
+ path = case rsf
44
+ when /^\//
45
+ @url_base =~ /^\// ? rsf : File.join(@url_base, rsf)
46
+ when /\w+:/ then rsf
47
+ else
48
+ File.join(@url_base, @url_dir, rsf)
49
+ end
50
+
51
+ buffer, _ = RXFHelper.read path, auto: false
39
52
  return buffer
40
53
  end
41
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -35,7 +35,7 @@ cert_chain:
35
35
  H+WbcZlnDVw3xyetJLKgUOqsjkXnFyv2ansbZtghG1wEvnd/0sNdyfRnjXv3gAt2
36
36
  OUyieSgHfrd2srDrlcNHFJY8
37
37
  -----END CERTIFICATE-----
38
- date: 2019-03-05 00:00:00.000000000 Z
38
+ date: 2019-03-09 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: hashcache
metadata.gz.sig CHANGED
Binary file