arvados 2.0.4 → 2.1.4

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: 1ec1b09ea886e3e78ddc8b4a35f7e63fb8037c29d5432fd6cf10631d4082dcac
4
- data.tar.gz: 932eef1e18cc75db99012dc971d466d2c355d297a439e785c550f4b5a41e2b3f
3
+ metadata.gz: f5ed67ab0c426f6f3a103bfdf385c3d4801fe4c28490d338fabc69bbd32aad5a
4
+ data.tar.gz: d4d523832e0f2243c4cb216948a798ca4de4cd24b159bef9086bb79999602062
5
5
  SHA512:
6
- metadata.gz: 3e93c139b5a38f6c6a378efbc5256ae077d8aa5bd5f3bf4c4d5d4fab69c08d25aa9a4284c373b6383a42c80139a9865dccf0f536a9c9bde3b3d45f9c09ba5413
7
- data.tar.gz: d29e86406a09db6aae06c045968836da57213bed4adce5feb4e4e4866d718ea5626f890766b29d0923f503daa1a8451b7abae03dfe02e6f927961f0ca7cc8591
6
+ metadata.gz: 525b03385c87eb90c4b7c3fd29973eef4e01c7bd2f2dc39e0b04c76c60297c6d2bce559e80df1663ca75aa7b996360117036c6f9b4c72d4a534dfefcb319177c
7
+ data.tar.gz: 2dbf9b25485fba3f92c49c31eecf8aaa916d3267e3f6fd9742a2487204e9b56ec545c8290ea050bdaa00fd72cba5eb4b1aed4e3c30bc7c2e039c2e25e68869a4
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
- @arvados_api_host = opts[:api_host] ||
35
- config['ARVADOS_API_HOST'] or
36
- raise "#{$0}: no :api_host or ENV[ARVADOS_API_HOST] provided."
37
- @arvados_api_token = opts[:api_token] ||
38
- config['ARVADOS_API_TOKEN'] or
39
- raise "#{$0}: no :api_token or ENV[ARVADOS_API_TOKEN] provided."
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.class.class_eval do
95
- define_method classname.underscore do
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 => @arvados_api_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 @@config if @@config
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 (@@config = config)
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
- @@config = config
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 => 'OAuth2 '+arvados.config['ARVADOS_API_TOKEN']
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]
@@ -6,7 +6,8 @@ require 'google/api_client'
6
6
  # Monkeypatch google-api-client gem to avoid sending newline characters
7
7
  # on headers to make ruby-2.3.7+ happy.
8
8
  # See: https://dev.arvados.org/issues/13920
9
- Google::APIClient::ENV::OS_VERSION.strip!
9
+ # Addendum: OS_VERSION sometimes is not mutable, that's why we duplicate it (See: #17738)
10
+ Google::APIClient::ENV::OS_VERSION = +Google::APIClient::ENV::OS_VERSION.strip!
10
11
 
11
12
  require 'json'
12
13
  require 'tempfile'
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.0.4
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arvados Authors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-03 00:00:00.000000000 Z
11
+ date: 2021-05-27 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 8014ce0457ef848bba8ce18ad5980b9883105cc9
136
- email: gem-dev@curoverse.com
135
+ description: Arvados client library, git commit bfcade85c7aa6f88d25a002c271b3120d68f1120
136
+ email: packaging@arvados.org
137
137
  executables: []
138
138
  extensions: []
139
139
  extra_rdoc_files: []