arvados 2.0.3.1 → 2.1.3

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: 638bf6b2120e2635de466a18c8b368157d740685fb10d24850e5309c898a40d3
4
- data.tar.gz: d6d81dd2a4fc4e91c030b182bb4ecc0ed90e8370177a7a8f7c97f52bbe678623
3
+ metadata.gz: a909f257cbb0e456f5c68fa04db94c8f41a8ca4125939a99981d6607facf5167
4
+ data.tar.gz: 6e86c7905e3ac545dd89a5f0ad38575cd85f1cd42403b1049f3e27a9ef581a13
5
5
  SHA512:
6
- metadata.gz: 57de02c1416c26118bd5230d47b2bcb92dcdeccb8e7bd75ff4edf95fba4f97d0e347380579d083b4b57d6dbd00c11385ab6fc92c8d52ff0f7a73a5f40319196c
7
- data.tar.gz: bf7bfd50176a6d63da97efb3faa5bf7e9007f4e783786e719c615ff5b09832e3e404205396f7e469203d801b5388f9b94ddb875ec77787f19cb8e83763ac665e
6
+ metadata.gz: fccc20fc30c80a5d8e7bf1b4e69aeec32e1cfede1f7360d9ca5bcfd5ebc25f123f3444ee1fdb7e2c746a2e86a4068916279746ab8c90a2995cc0bf8f6316bc65
7
+ data.tar.gz: 0c46a1c661e2eccb9893deca2fadb50f95ec362bd25731c410ab1fba71050d682d301ade4d0348fe551c2315cc8fc3d4ab4368b2374f8eb7eb27d38b50f5064b
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.3.1
4
+ version: 2.1.3
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-28 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 4a5a9fd04a23005cb27556b4cf4366eca27157d0
136
+ email: packaging@arvados.org
137
137
  executables: []
138
138
  extensions: []
139
139
  extra_rdoc_files: []