solvebio 1.7.3 → 1.7.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 1.7.3
2
+ current_version = 1.7.4
3
3
  files = lib/solvebio/version.rb
4
4
  commit = True
5
5
  tag = False
data/installer CHANGED
@@ -67,11 +67,13 @@ fi
67
67
  GEM_OWNER=`ls -l $GEM | awk '{ print $3 }'`
68
68
 
69
69
  if [ "$GEM_OWNER" == "root" ]; then
70
- GEM="sudo ${GEM}"
70
+ GEM_SUDO="sudo ${GEM}"
71
71
  echo " IMPORTANT: Your computer's password may be required. It will NOT be sent to SolveBio."
72
+ else
73
+ GEM_SUDO=$GEM
72
74
  fi
73
75
 
74
- $GEM install solvebio 2>&1 >> $LOG
76
+ $GEM_SUDO install solvebio 2>&1 >> $LOG
75
77
 
76
78
  if [ $? -eq 0 ]; then
77
79
  VERSION=`ruby -e "require 'solvebio'; print SolveBio::VERSION"`
@@ -35,13 +35,14 @@ require 'solvebio/errors'
35
35
 
36
36
  module SolveBio
37
37
  class << self
38
- attr_accessor :api_key, :api_host, :logger
38
+ attr_accessor :access_token, :api_key, :api_host, :logger
39
39
  end
40
40
 
41
- @api_key = ENV['SOLVEBIO_API_KEY']
42
- @api_host = ENV['SOLVEBIO_API_HOST'] || 'https://api.solvebio.com'
41
+ @api_key = ENV['SOLVEBIO_API_KEY']
42
+ @access_token = ENV['SOLVEBIO_ACCESS_TOKEN']
43
+ @api_host = ENV['SOLVEBIO_API_HOST'] || 'https://api.solvebio.com'
43
44
 
44
- logfile =
45
+ logfile =
45
46
  if ENV['SOLVEBIO_LOGFILE']
46
47
  ENV['SOLVEBIO_LOGFILE']
47
48
  else
@@ -1,7 +1,7 @@
1
1
  module SolveBio
2
2
  class Client
3
3
  attr_reader :headers
4
- attr_accessor :api_host, :api_key
4
+ attr_accessor :api_host, :token
5
5
 
6
6
  # Add our own kind of Authorization tokens. This has to be
7
7
  # done this way, late, because the rest-client gem looks for
@@ -12,8 +12,9 @@ module SolveBio
12
12
  end
13
13
  end
14
14
 
15
- def initialize(api_key=nil, api_host=nil)
16
- @api_key = api_key
15
+ def initialize(api_host=nil, token=nil, token_type='Token')
16
+ @token = token
17
+ @token_type = token_type
17
18
  @api_host = api_host
18
19
 
19
20
  # Mirroring comments from:
@@ -62,7 +63,6 @@ module SolveBio
62
63
 
63
64
  # Expand URL with API host if none was given
64
65
  api_host = @api_host || SolveBio.api_host
65
- api_key = opts[:auth] ? (@api_key || SolveBio.api_key) : nil
66
66
 
67
67
  if not api_host
68
68
  raise SolveError.new('No SolveBio API host is set')
@@ -72,7 +72,19 @@ module SolveBio
72
72
 
73
73
  # Handle some default options and add authorization header
74
74
  headers = opts[:default_headers] ? @headers.merge(opts[:headers] || {}) : nil
75
- authorization = api_key ? "Token #{api_key}" : nil
75
+
76
+ if opts[:auth]
77
+ if token.nil?
78
+ if SolveBio.access_token
79
+ token = SolveBio.access_token
80
+ token_type = 'Bearer'
81
+ elsif SolveBio.api_key
82
+ token = SolveBio.api_key
83
+ token_type = 'Token'
84
+ end
85
+ end
86
+ authorization = token ? "#{token_type} #{token}" : nil
87
+ end
76
88
 
77
89
  # In Rest-Client, GET params are parsed from headers[:params]
78
90
  if opts[:params]
@@ -1,3 +1,3 @@
1
1
  module SolveBio
2
- VERSION = '1.7.3'
2
+ VERSION = '1.7.4'
3
3
  end
@@ -3,7 +3,7 @@ require File.expand_path('../../helper', __FILE__)
3
3
  module SolveBio
4
4
  class TestClient < Test::Unit::TestCase
5
5
  def test_get
6
- client = Client.new(nil, 'http://google.com')
6
+ client = Client.new('http://google.com')
7
7
  assert client, 'Should be able to create a client'
8
8
 
9
9
  # Can we get something from google?
@@ -45,8 +45,7 @@ module SolveBio
45
45
  facets = dataset_field.facets()
46
46
 
47
47
  # We can get small or large numbers like 0 or 4902851621.0
48
- assert(facets['total'] >= 0,
49
- 'facets should have a numeric total field >= 0')
48
+ assert(facets['values'].length >= 0)
50
49
  end
51
50
  end
52
51
  end
@@ -7,19 +7,11 @@ module SolveBio
7
7
  end
8
8
 
9
9
  def test_invalid_batch_query
10
- assert_raise SolveBio::SolveError do
11
- SolveBio::BatchQuery
12
- .new([
13
- @dataset.query(:limit => 1, :fields => [:bogus_field]),
14
- @dataset.query(:limit => 10).filter(:bogus_id__gt => 100000)
15
- ]).execute
16
- end
17
-
18
- results = SolveBio::BatchQuery
19
- .new([
20
- @dataset.query(:limit => 10).filter(:hgnc_id__lt => 100),
21
- @dataset.query(:limit => 10).filter(:hgnc_id__gt => 100)
22
- ]).execute
10
+ queries = [
11
+ @dataset.query(:limit => 1, :fields => [:bogus_field]),
12
+ @dataset.query(:limit => 10).filter(:bogus_id__gt => 100000)
13
+ ]
14
+ results = SolveBio::BatchQuery.new(queries).execute
23
15
  assert_equal(2, results.length)
24
16
 
25
17
  end
metadata CHANGED
@@ -1,118 +1,137 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solvebio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.3
4
+ version: 1.7.4
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - SolveBio
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
12
+ date: 2015-01-29 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: netrc
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '0.7'
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.7'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rest_client
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '1.8'
34
- - - ">="
38
+ - - ! '>='
35
39
  - !ruby/object:Gem::Version
36
40
  version: 1.8.1
37
41
  type: :runtime
38
42
  prerelease: false
39
43
  version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
40
45
  requirements:
41
- - - "~>"
46
+ - - ~>
42
47
  - !ruby/object:Gem::Version
43
48
  version: '1.8'
44
- - - ">="
49
+ - - ! '>='
45
50
  - !ruby/object:Gem::Version
46
51
  version: 1.8.1
47
52
  - !ruby/object:Gem::Dependency
48
53
  name: addressable
49
54
  requirement: !ruby/object:Gem::Requirement
55
+ none: false
50
56
  requirements:
51
- - - "~>"
57
+ - - ~>
52
58
  - !ruby/object:Gem::Version
53
59
  version: '2.3'
54
- - - ">="
60
+ - - ! '>='
55
61
  - !ruby/object:Gem::Version
56
62
  version: 2.3.6
57
63
  type: :runtime
58
64
  prerelease: false
59
65
  version_requirements: !ruby/object:Gem::Requirement
66
+ none: false
60
67
  requirements:
61
- - - "~>"
68
+ - - ~>
62
69
  - !ruby/object:Gem::Version
63
70
  version: '2.3'
64
- - - ">="
71
+ - - ! '>='
65
72
  - !ruby/object:Gem::Version
66
73
  version: 2.3.6
67
74
  - !ruby/object:Gem::Dependency
68
75
  name: rake
69
76
  requirement: !ruby/object:Gem::Requirement
77
+ none: false
70
78
  requirements:
71
- - - ">="
79
+ - - ! '>='
72
80
  - !ruby/object:Gem::Version
73
81
  version: '0'
74
82
  type: :development
75
83
  prerelease: false
76
84
  version_requirements: !ruby/object:Gem::Requirement
85
+ none: false
77
86
  requirements:
78
- - - ">="
87
+ - - ! '>='
79
88
  - !ruby/object:Gem::Version
80
89
  version: '0'
81
90
  - !ruby/object:Gem::Dependency
82
91
  name: rdoc
83
92
  requirement: !ruby/object:Gem::Requirement
93
+ none: false
84
94
  requirements:
85
- - - ">="
95
+ - - ! '>='
86
96
  - !ruby/object:Gem::Version
87
97
  version: '0'
88
98
  type: :development
89
99
  prerelease: false
90
100
  version_requirements: !ruby/object:Gem::Requirement
101
+ none: false
91
102
  requirements:
92
- - - ">="
103
+ - - ! '>='
93
104
  - !ruby/object:Gem::Version
94
105
  version: '0'
95
106
  - !ruby/object:Gem::Dependency
96
107
  name: webmock
97
108
  requirement: !ruby/object:Gem::Requirement
109
+ none: false
98
110
  requirements:
99
- - - ">="
111
+ - - ! '>='
100
112
  - !ruby/object:Gem::Version
101
113
  version: '0'
102
114
  type: :development
103
115
  prerelease: false
104
116
  version_requirements: !ruby/object:Gem::Requirement
117
+ none: false
105
118
  requirements:
106
- - - ">="
119
+ - - ! '>='
107
120
  - !ruby/object:Gem::Version
108
121
  version: '0'
109
- description: |
110
- SolveBio is a platform for biomedical datasets. With SolveBio you can
122
+ description: ! 'SolveBio is a platform for biomedical datasets. With SolveBio you
123
+ can
124
+
111
125
  forget about parsing complex flat files and sifting through cryptic
126
+
112
127
  datasets. Just use the Ruby Client and API to explore massive
128
+
113
129
  datasets and automate just about any bioinformatics workflow.
114
130
 
131
+
115
132
  See https://www.solvebio.com/ for more information.
133
+
134
+ '
116
135
  email: contact@solvebio.com
117
136
  executables:
118
137
  - solvebio.rb
@@ -120,9 +139,9 @@ extensions: []
120
139
  extra_rdoc_files:
121
140
  - LICENSE
122
141
  files:
123
- - ".bumpversion.cfg"
124
- - ".gitignore"
125
- - ".travis.yml"
142
+ - .bumpversion.cfg
143
+ - .gitignore
144
+ - .travis.yml
126
145
  - Gemfile
127
146
  - Gemspec
128
147
  - LICENSE
@@ -188,25 +207,26 @@ files:
188
207
  homepage: https://www.solvebio.com
189
208
  licenses:
190
209
  - MIT
191
- metadata: {}
192
210
  post_install_message:
193
211
  rdoc_options:
194
- - "--charset=UTF-8"
212
+ - --charset=UTF-8
195
213
  require_paths:
196
214
  - lib
197
215
  required_ruby_version: !ruby/object:Gem::Requirement
216
+ none: false
198
217
  requirements:
199
- - - ">="
218
+ - - ! '>='
200
219
  - !ruby/object:Gem::Version
201
220
  version: 1.9.0
202
221
  required_rubygems_version: !ruby/object:Gem::Requirement
222
+ none: false
203
223
  requirements:
204
- - - ">="
224
+ - - ! '>='
205
225
  - !ruby/object:Gem::Version
206
226
  version: '0'
207
227
  requirements: []
208
228
  rubyforge_project:
209
- rubygems_version: 2.4.5
229
+ rubygems_version: 1.8.23
210
230
  signing_key:
211
231
  specification_version: 2
212
232
  summary: Ruby bindings for the SolveBio API
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: fe11b480aa4ded4563e8615f5aff700e65d79d28
4
- data.tar.gz: 951035287b583008e5351229aa3c46f7ab3e4d7d
5
- SHA512:
6
- metadata.gz: c2533fc844714b62149bf76086dc5945d77a0db209ddd9afbb029d530e31476133e0bb6d38dde2e174e5b7347054c8d92e51a5a7a9b7f8a9b5148789902a7b6f
7
- data.tar.gz: 4f56c1719d719818b2cecbe90923832edf0831eb9bfb9acbcaf61289553b2b91e910d8cea2640b191ba93531d96e39ece7c64cf02a96e470473fae0a5652929b