arvados 2.1.0 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arvados.rb +17 -16
- data/lib/arvados/google_api_client.rb +0 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a090c9d1730a7be4e1f98149d5fa4603b79ad816032eac48c7cd66481ed8852c
|
4
|
+
data.tar.gz: 6f6a6154b6c59934f2c036bcf8dbe6663018c54a3024aba9ea362c5426446c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0b1c9e194480a2cf352c59864d9244f18f11c7af6f7aeee4a70b6e71e094a557fdbffcdbeb6b0113fd77014d3c0e5dc304ad2bfef0257ddfa877169d62063b8
|
7
|
+
data.tar.gz: 57b68564349cd35a1c397aa3c4f03d201584f6d40bd3064b8d82e74a98c0b884a768b44b90336726f7acc83c1f54b9a8a9e16710e210e013cdf756e098376161
|
data/lib/arvados.rb
CHANGED
@@ -19,7 +19,6 @@ class Arvados
|
|
19
19
|
class TransactionFailedError < StandardError
|
20
20
|
end
|
21
21
|
|
22
|
-
@@config = nil
|
23
22
|
@@debuglevel = 0
|
24
23
|
class << self
|
25
24
|
attr_accessor :debuglevel
|
@@ -31,12 +30,16 @@ class Arvados
|
|
31
30
|
|
32
31
|
@arvados_api_version = opts[:api_version] || 'v1'
|
33
32
|
|
34
|
-
@
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
33
|
+
@config = nil
|
34
|
+
[[:api_host, 'ARVADOS_API_HOST'],
|
35
|
+
[:api_token, 'ARVADOS_API_TOKEN']].each do |op, en|
|
36
|
+
if opts[op]
|
37
|
+
config[en] = opts[op]
|
38
|
+
end
|
39
|
+
if !config[en]
|
40
|
+
raise "#{$0}: no :#{op} or ENV[#{en}] provided."
|
41
|
+
end
|
42
|
+
end
|
40
43
|
|
41
44
|
if (opts[:suppress_ssl_warnings] or
|
42
45
|
%w(1 true yes).index(config['ARVADOS_API_HOST_INSECURE'].
|
@@ -91,17 +94,15 @@ class Arvados
|
|
91
94
|
# result looks like Arvados::A26949680::Job.
|
92
95
|
namespace_class.const_set classname, klass
|
93
96
|
|
94
|
-
self.
|
95
|
-
|
96
|
-
klass
|
97
|
-
end
|
97
|
+
self.define_singleton_method classname.underscore do
|
98
|
+
klass
|
98
99
|
end
|
99
100
|
end
|
100
101
|
end
|
101
102
|
|
102
103
|
def client
|
103
104
|
@client ||= Google::APIClient.
|
104
|
-
new(:host =>
|
105
|
+
new(:host => config["ARVADOS_API_HOST"],
|
105
106
|
:application_name => @application_name,
|
106
107
|
:application_version => @application_version.to_s)
|
107
108
|
end
|
@@ -119,7 +120,7 @@ class Arvados
|
|
119
120
|
end
|
120
121
|
|
121
122
|
def config(config_file_path="~/.config/arvados/settings.conf")
|
122
|
-
return
|
123
|
+
return @config if @config
|
123
124
|
|
124
125
|
# Initialize config settings with environment variables.
|
125
126
|
config = {}
|
@@ -137,7 +138,7 @@ class Arvados
|
|
137
138
|
# Note: If we start using additional configuration settings from
|
138
139
|
# this file in the future, we might have to read the file anyway
|
139
140
|
# instead of returning here.
|
140
|
-
return (
|
141
|
+
return (@config = config)
|
141
142
|
end
|
142
143
|
|
143
144
|
begin
|
@@ -164,7 +165,7 @@ class Arvados
|
|
164
165
|
debuglog "Ignoring error reading #{config_file_path}: #{e}", 0
|
165
166
|
end
|
166
167
|
|
167
|
-
|
168
|
+
@config = config
|
168
169
|
end
|
169
170
|
|
170
171
|
class Model
|
@@ -202,7 +203,7 @@ class Arvados
|
|
202
203
|
:parameters => parameters,
|
203
204
|
:body_object => body,
|
204
205
|
:headers => {
|
205
|
-
:authorization => '
|
206
|
+
:authorization => 'Bearer '+arvados.config['ARVADOS_API_TOKEN']
|
206
207
|
})
|
207
208
|
resp = JSON.parse result.body, :symbolize_names => true
|
208
209
|
if resp[:errors]
|
@@ -3,11 +3,6 @@
|
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
4
4
|
|
5
5
|
require 'google/api_client'
|
6
|
-
# Monkeypatch google-api-client gem to avoid sending newline characters
|
7
|
-
# on headers to make ruby-2.3.7+ happy.
|
8
|
-
# See: https://dev.arvados.org/issues/13920
|
9
|
-
Google::APIClient::ENV::OS_VERSION.strip!
|
10
|
-
|
11
6
|
require 'json'
|
12
7
|
require 'tempfile'
|
13
8
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arvados
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arvados Authors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -132,8 +132,8 @@ dependencies:
|
|
132
132
|
- - "<"
|
133
133
|
- !ruby/object:Gem::Version
|
134
134
|
version: '2'
|
135
|
-
description: Arvados client library, git commit
|
136
|
-
email:
|
135
|
+
description: Arvados client library, git commit d0f0460e84dbdb455cdac2b11caaf563029fc2fe
|
136
|
+
email: packaging@arvados.org
|
137
137
|
executables: []
|
138
138
|
extensions: []
|
139
139
|
extra_rdoc_files: []
|