assaydepot 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assaydepot/model.rb +20 -19
- data/lib/assaydepot/version.rb +1 -1
- data/spec/assaydepot_spec.rb +7 -10
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39ad77b2ffb93d4a0eff9df69ac02e59cffa5eb9
|
4
|
+
data.tar.gz: 91ab5909a3fca9c366142566ea39415b99321019
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8912c78dba929eec5d318e39d0537393624ed81dbe90a18aff1f6fabd9de95cd8fa9c75492b611af0f0d688b5e7cc52cf17dd56c473810fe5a1a56051c602c3d
|
7
|
+
data.tar.gz: 7dd49cf9fbae07e6eef7e1be8696c30a60b6edfb5266bd7b8cb98f458af78084085607e99d04ff0ebc805bc7c6d23e439c4c3b1435677c453aee2b1188f73afd
|
data/lib/assaydepot/model.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'forwardable'
|
1
2
|
module AssayDepot
|
2
3
|
module Model
|
3
4
|
module ClassMethods
|
@@ -15,24 +16,24 @@ module AssayDepot
|
|
15
16
|
def self.included(base)
|
16
17
|
base.extend ClassMethods
|
17
18
|
base.extend Forwardable
|
18
|
-
base.def_delegators :private_results,
|
19
|
-
:each,
|
20
|
-
:[],
|
21
|
-
:count,
|
22
|
-
:collect,
|
19
|
+
base.def_delegators :private_results,
|
20
|
+
:each,
|
21
|
+
:[],
|
22
|
+
:count,
|
23
|
+
:collect,
|
23
24
|
:map,
|
24
|
-
:tap,
|
25
|
-
:<=>,
|
26
|
-
:compact,
|
27
|
-
:each_index,
|
28
|
-
:each_with_index,
|
29
|
-
:empty?,
|
30
|
-
:flatten,
|
31
|
-
:include?,
|
32
|
-
:index,
|
33
|
-
:length,
|
34
|
-
:first,
|
35
|
-
:last,
|
25
|
+
:tap,
|
26
|
+
:<=>,
|
27
|
+
:compact,
|
28
|
+
:each_index,
|
29
|
+
:each_with_index,
|
30
|
+
:empty?,
|
31
|
+
:flatten,
|
32
|
+
:include?,
|
33
|
+
:index,
|
34
|
+
:length,
|
35
|
+
:first,
|
36
|
+
:last,
|
36
37
|
:keep_if,
|
37
38
|
:reject,
|
38
39
|
:reverse
|
@@ -47,7 +48,7 @@ module AssayDepot
|
|
47
48
|
@search_options = options[:search_options] || {:page => 1}
|
48
49
|
end
|
49
50
|
|
50
|
-
def initialize_copy(source)
|
51
|
+
def initialize_copy(source)
|
51
52
|
super
|
52
53
|
@search_query = @search_query.dup
|
53
54
|
@search_facets = @search_facets.dup
|
@@ -106,4 +107,4 @@ module AssayDepot
|
|
106
107
|
end
|
107
108
|
end
|
108
109
|
end
|
109
|
-
end
|
110
|
+
end
|
data/lib/assaydepot/version.rb
CHANGED
data/spec/assaydepot_spec.rb
CHANGED
@@ -2,16 +2,13 @@ require 'oauth2'
|
|
2
2
|
require 'assaydepot'
|
3
3
|
|
4
4
|
describe AssayDepot do
|
5
|
-
let(:site) { "https://staging.assaydepot.com" }
|
6
|
-
|
7
5
|
context "when accessing the api via oauth2 client credentials" do
|
8
|
-
let(:client) {
|
9
|
-
OAuth2::Client.new( ENV["ASSAYDEPOT_APP_ID"],
|
10
|
-
ENV["ASSAYDEPOT_APP_SECRET"],
|
11
|
-
:site => site)
|
12
|
-
}
|
13
|
-
let(:access_token) { client.client_credentials.get_token(:redirect_uri => 'http://localhost:4567/oauth2/callback') }
|
14
6
|
before(:all) do
|
7
|
+
site = "https://staging.assaydepot.com"
|
8
|
+
client = OAuth2::Client.new( ENV["ASSAYDEPOT_APP_ID"],
|
9
|
+
ENV["ASSAYDEPOT_APP_SECRET"],
|
10
|
+
site: site)
|
11
|
+
access_token = client.client_credentials.get_token(:redirect_uri => 'http://localhost:4567/oauth2/callback')
|
15
12
|
AssayDepot.configure do |config|
|
16
13
|
config.access_token = access_token.token
|
17
14
|
config.url = "#{site}/api"
|
@@ -90,10 +87,10 @@ describe AssayDepot do
|
|
90
87
|
end
|
91
88
|
|
92
89
|
context "when searching for wares using a chained query" do
|
93
|
-
let(:wares) { AssayDepot::Ware.where(:ware_type => "CustomService").where(:available_provider_names => "
|
90
|
+
let(:wares) { AssayDepot::Ware.where(:ware_type => "CustomService").where(:available_provider_names => "Blue Sky Biotech") }
|
94
91
|
|
95
92
|
it "should return wares" do
|
96
|
-
wares.total.should >
|
93
|
+
wares.total.should > 0
|
97
94
|
end
|
98
95
|
|
99
96
|
it "the ware's name should be available" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assaydepot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Petersen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
version: '0'
|
110
110
|
requirements: []
|
111
111
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
112
|
+
rubygems_version: 2.0.14.1
|
113
113
|
signing_key:
|
114
114
|
specification_version: 4
|
115
115
|
summary: Provides read access to Assay Depot's Services and Vendors.
|