arvados 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/arvados.rb +17 -16
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ad00e8109202664d0bd0ebfc83e1808a7a8a83756a717c73a7bf10383693b64
4
- data.tar.gz: 0c7da57f535c7d23d1e30641df729f51f856b5d1f967cff7a6afe2dfe7092352
3
+ metadata.gz: b6126e67d588ee7eed3b467357cdd13fbace3c46740460eac7cb824ccfbf76ae
4
+ data.tar.gz: 5168370d9c487d572931b13f64654f88aa15c81b4d986817b6307e1baf2e0ed5
5
5
  SHA512:
6
- metadata.gz: bd677b779828f640a90f5f8851e3a7cf4b5ce0f37331940b9003babeae82158f6426105b6bb5a5156792dfad20a428ef58c8e96c20214853154ffcc628721d4f
7
- data.tar.gz: fa471f6145c2f564e9c8fe500efd3ba3551ac5be3f85c8f61c039373c4b0b60e7f2cbaac43c363dd670b9d7fc9ae1ec0ec96381cc81600d7887b0534e2ce7354
6
+ metadata.gz: 6bbe189487f2a675ba3b4d0cc80b0a90f8ed77b8404ba044b21e6540b9345c4e00bdc4f8323566b011284f61e3b8631dc394e062f74c39a17b90fdfd7f625e06
7
+ data.tar.gz: 13386d6c2b88e678e8bf21a30b88ebe8abd7b6e08803698d3ee65baa4626b8df8fcc93ec44c9105692611ab116e545370e65c4a90b7ed41f2da4efbe05ae63d6
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]
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.1
4
+ version: 2.1.2
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-02-22 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 af5e26a900bbfa779ad325491d80f43eaf75de1d
136
- email: gem-dev@curoverse.com
135
+ description: Arvados client library, git commit 78096170b070a9eb17b37f913798397744fa1ff5
136
+ email: packaging@arvados.org
137
137
  executables: []
138
138
  extensions: []
139
139
  extra_rdoc_files: []