solvebio 1.8.0 → 1.8.1

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.8.0
2
+ current_version = 1.8.1
3
3
  files = lib/solvebio/version.rb
4
4
  commit = True
5
5
  tag = True
@@ -20,7 +20,7 @@ module SolveBio
20
20
  def fields(name=nil, params={})
21
21
  unless self.fields_url
22
22
  raise Exception,
23
- 'Please use Dataset.retrieve({ID}) before doing looking ' +
23
+ 'Please use Dataset.retrieve({ID}) before looking ' +
24
24
  'up fields'
25
25
  end
26
26
 
@@ -44,7 +44,7 @@ module SolveBio
44
44
  results
45
45
  end
46
46
 
47
- def query(params={})
47
+ def query(query=nil, params={})
48
48
  unless self.respond_to?(:data_url)
49
49
  unless self.respond_to?(:id)
50
50
  raise Exception,
@@ -53,7 +53,15 @@ module SolveBio
53
53
  'object with an ID or full_name.'
54
54
  end
55
55
  # automatically construct the data_url from the ID
56
- self.data_url = url + '/data'
56
+ self.data_url = self.id.to_s + '/data'
57
+ end
58
+
59
+ # If no query string is passed, assume it is params
60
+ if query.is_a?(Hash)
61
+ params = query
62
+ query = nil
63
+ else
64
+ params.merge!(:query => query)
57
65
  end
58
66
 
59
67
  params.merge!(:data_url => self.data_url)
@@ -1,3 +1,3 @@
1
1
  module SolveBio
2
- VERSION = '1.8.0'
2
+ VERSION = '1.8.1'
3
3
  end
@@ -116,6 +116,14 @@ module SolveBio
116
116
  assert_equal(results[0...results.size].to_a, [])
117
117
  assert_equal(results[0], nil)
118
118
  end
119
+
120
+ def test_query_string
121
+ results = @dataset.query('omim_ids:123631')
122
+ assert_equal(results.size, 1)
123
+
124
+ results = @dataset.query(:query => 'omim_ids:123631')
125
+ assert_equal(results.size, 1)
126
+ end
119
127
 
120
128
  # test Filtered Query in which limit is specified but is GREATER THAN
121
129
  # the number of total available results
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solvebio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-07-23 00:00:00.000000000 Z
12
+ date: 2015-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: netrc