rscript 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/lib/rscript.rb +13 -19
  5. metadata +29 -29
  6. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 637dfba8b518c286c39e17994ddd96357d84b66b
4
- data.tar.gz: 9be617af59c02e2330dc1bf374c19bfaec418c46
3
+ metadata.gz: d510750d5310ec2a14bb6870768d91c854264c67
4
+ data.tar.gz: e0209e8f7b96455bfa7d3140283fd266fb3bf109
5
5
  SHA512:
6
- metadata.gz: 466210623c9c24c3c2cf02f1a78f1b231bd3fde6e0c59dfc93db44501da197a7e681ab20b70fa37d0f0432a9e6ce13a525b25dc5c57c699e9ef572d74eb82f85
7
- data.tar.gz: 538f53d3912b7dd65b67b86b18548860beb4319f3789a45606e4d907a1cc286f0ba8039c682be4f104d68162b4fc3e2758024fc73aa13c4760422202837d3c69
6
+ metadata.gz: 9160525ba3453c07c198aa17b9f5663eef501c11fda60149423c215c6b9695a272c8f00d4428fecdd7e742a5dd2c23a2de7fc40c4f06a79c992b859a8d9b6748
7
+ data.tar.gz: d0ee8e32c36e235f6f22cb131e0858c4cf6387040f161c6ec6bc5fcfcf4cffcc2f4189ecc8ed76988d50c6667b128a382cec62ac9f705f9b1d34d4bdc946f1e9
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -2,11 +2,12 @@
2
2
 
3
3
  # file: rscript.rb
4
4
 
5
- # created: 1-Jul-2009
6
- # updated: 24-Dec-2016
5
+ # created: 1-Jul-2009
6
+ # updated: 7-Nov-2017
7
7
 
8
8
  # modification:
9
9
 
10
+ # 07-Nov-2017: feature: The log object is now passed into initialize()
10
11
  # 24-Dec-2016: Bug fix: An argument can now include an integer
11
12
  # 12-Dec-2016: The cache size can now be changed from initialize()
12
13
  # 21-Jun-2016: Replaced the initialize hash options with inline named params
@@ -41,22 +42,17 @@ require 'rexle'
41
42
 
42
43
  class RScript < RScriptBase
43
44
 
44
- def initialize(logfile: '', logrotate: 'daily', pkg_src: '', cache: 5)
45
+ def initialize(log: nil, pkg_src: '', cache: 5)
45
46
 
46
- @logger = Logger.new logfile, logrotate unless logfile.nil? or logfile.empty?
47
+ @log = log
47
48
  @cache = cache
48
49
  @rsf_cache = HashCache.new({cache: cache}) if cache > 0
49
50
 
50
51
  end
51
52
 
52
53
  def read(args=[])
53
-
54
- if @logger then
55
-
56
- @logger.debug 'inside RScript#read'
57
- @logger.debug 'RScript -> args: ' + args.inspect
58
54
 
59
- end
55
+ @log.info 'RScript/read: args: ' + args.inspect if @log
60
56
 
61
57
  threads = []
62
58
 
@@ -83,9 +79,9 @@ class RScript < RScriptBase
83
79
 
84
80
  else
85
81
  out = read_rsf(args) {|doc| doc.root.xpath('//script').map {|s| read_script(s)}}.join("\n")
86
- end
87
-
88
- @logger.debug 'RScript -> out: ' + out.inspect[0..250] if @logger
82
+ end
83
+
84
+ @log.info 'RScript/read: code: ' + out.inspect if @log
89
85
 
90
86
  [out, args]
91
87
  end
@@ -97,10 +93,7 @@ class RScript < RScriptBase
97
93
  # note: run() was copied from the development file rscript-wrapper.rb
98
94
  def run(raw_args, params={}, rws=self)
99
95
 
100
- if @logger then
101
- @logger.debug 'inside RScript#run'
102
- @logger.debug 'RScript -> raw_args: ' + raw_args.inspect
103
- end
96
+ @log.info 'RScript/run: raw_args: ' + raw_args.inspect if @log
104
97
 
105
98
  if params[:splat] then
106
99
  params.each do |k,v|
@@ -117,7 +110,8 @@ class RScript < RScriptBase
117
110
  end
118
111
 
119
112
  code2, args = self.read raw_args
120
- @logger.debug 'RScript -> code2: ' + code2.inspect[0..250] if @logger
113
+
114
+ @log.info 'RScript/run: code2: ' + code2 if @log
121
115
 
122
116
  begin
123
117
 
@@ -177,4 +171,4 @@ if __FILE__ == $0 then
177
171
  rs = RScript.new()
178
172
  code, args = rs.read(raw_args)
179
173
  puts eval(code).join("\n")
180
- end
174
+ end
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.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -12,26 +12,26 @@ cert_chain:
12
12
  -----BEGIN CERTIFICATE-----
13
13
  MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
14
  YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE2MDExNDIxMzM1N1oXDTE3MDExMzIxMzM1N1owSDESMBAG
15
+ 8ixkARkWAmV1MB4XDTE3MTEwNzExMjQwMVoXDTE4MTEwNzExMjQwMVowSDESMBAG
16
16
  A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
17
  EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBAM4rXRN2dI2T811f1lUPK/1+4SNjbO37Jfw9z+mPsT0Ffsl40pbT4DL73Ks9
19
- ooU92wYkMDCGQ9Ql7j6LkNM4Et7TKhdhuGdMclvYiSWuLegHEF0fjpTkdrgWXwmZ
20
- Crdj/vblfq120A0qGOFT5PtG/17W690lFgwA0kFwnTiSPIMfMddCpXT7+Y6n48EB
21
- j6lxjVZilY88cba+YUky7wSKp7cfRnf5cEzE7ScNQWlbFBg6D7VIcyeXH3Ob3BVu
22
- K1uaOf7J8GCi/AYGmmhUoHZxPKFta5WoLv/dMCPc9M+X4oOiISd/uqmDJ4LhBd2i
23
- AjnPtQyXXKb+Lk6IV+bBsurJQ8UCAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
-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YW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAs93QhCVT
27
+ FUsRHEhQSWzHXjrz91vttIT2xamtOB/EL6V1pP+lTck8jkuejn0Xh4pv8BrbWsDN
28
+ XB+0ypuCqjWm6uQfLMaeoCUec0ue+gfyqU6XtosViTyXlIarGr/QSPBaMMamCcFv
29
+ eApQIEUoxne7bRBHlN9hk+9GDbMhi3gV34pGWwIAEnUzJQgmN/YFy0ix5XJTpfgA
30
+ xj+tZ4/g/En7EMods00s7POLSpHhvN7LQT8nRttEmIm0AXNeZ7tSfxRZ4n7hgEQM
31
+ TqGxWMRGelsOt2zNIFH+8d4Yz1dYsNbhK66Q8KRR2vHoT/9T3IJGBPHdsR6Kl6yB
32
+ e5SlxbsP/R/Leg==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-12-24 00:00:00.000000000 Z
34
+ date: 2017-11-07 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hashcache
@@ -59,42 +59,42 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '0.3'
62
+ version: '0.4'
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 0.3.0
65
+ version: 0.4.3
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
69
69
  requirements:
70
70
  - - "~>"
71
71
  - !ruby/object:Gem::Version
72
- version: '0.3'
72
+ version: '0.4'
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.0
75
+ version: 0.4.3
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rexle
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '1.4'
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
- version: 1.3.34
85
+ version: 1.4.10
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  requirements:
90
90
  - - "~>"
91
91
  - !ruby/object:Gem::Version
92
- version: '1.3'
92
+ version: '1.4'
93
93
  - - ">="
94
94
  - !ruby/object:Gem::Version
95
- version: 1.3.34
95
+ version: 1.4.10
96
96
  description:
97
- email: james@r0bertson.co.uk
97
+ email: james@jamesrobertson.eu
98
98
  executables: []
99
99
  extensions: []
100
100
  extra_rdoc_files: []
@@ -121,9 +121,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  version: '0'
122
122
  requirements: []
123
123
  rubyforge_project:
124
- rubygems_version: 2.5.1
124
+ rubygems_version: 2.6.13
125
125
  signing_key:
126
126
  specification_version: 4
127
- summary: rscript previously known as rcscript, reads Ruby code which is embedded within
128
- an rscript XML file.
127
+ summary: Reads or executes a job contained within a package (XML document), whereby
128
+ the package is typically read from a URL
129
129
  test_files: []
metadata.gz.sig CHANGED
Binary file