refocus 0.1.8 → 0.1.9

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8298b6adec2f37a8c4f5dd4687b4227c68950799
4
- data.tar.gz: 849df15fc23f490217ae6ad66bc7e48f49cd89d0
3
+ metadata.gz: 946379185b21f476c5246b9a1bb7bd7537c6e4af
4
+ data.tar.gz: ebdd0acfc99ba03e1a40d8c597009a9690684d87
5
5
  SHA512:
6
- metadata.gz: 69ba71aa0147164135e14362facdc42a4dbac92e4fe8a441cd62d4566e21cc869764098f85e52a139525970cf79d14595c547c148dae02e886fdb2b05985c936
7
- data.tar.gz: 768ebd0266975c1b7e12cf95e37b711c5f1cdd5df15f856de1f8ec03680baa01c0a2169dbcd64d00dfe441f5714ef65d4035088321b1a6762189329e11103ddd
6
+ metadata.gz: ada1ffb35b8dac42d6f77af4493b7fb6ce6e3a94525dd48dada525e5fdacdd029d984ba0bd4a67b16f95e7da5542be8f245fb96c537ae6d3a2a47efb87224fcb
7
+ data.tar.gz: 9b5d1e67849c18cd504bae7e2eddab5f5cad0915a7858fe217e45d6b1108af634c91f58285417501c2616cac15b5bdd059d82f94dfc9e7584e1c3e88623525c6
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  /.idea/
10
+ Gemfile.lock
10
11
 
11
12
  # rspec failure tracking
12
13
  .rspec_status
data/README.md CHANGED
@@ -108,7 +108,12 @@ samples_client.list(limit: 50)
108
108
  samples_collector = samples_client.collector
109
109
  samples_collector.add(name: "my-subject.child-subject", aspect: "my-aspect-1", value: '100')
110
110
  samples_collector.add(name: "my-subject.child-subject", aspect: "my-aspect-2", message_code: '100%')
111
- samples_collector.upsert_bulk
111
+ upsert_bulk_response = samples_collector.upsert_bulk
112
+
113
+ # Check the status of the previous upsert_bulk call
114
+ # job_id needs to be parsed from the initial bulk upsert response. e.g.,
115
+ job_id = upsert_bulk_response["jobId"]
116
+ upsert_bulk_status = samples_collector.check_status(job_id)
112
117
  ```
113
118
 
114
119
  #### Lenses
@@ -19,19 +19,19 @@ module Refocus
19
19
  end
20
20
 
21
21
  def subjects
22
- Refocus::Subjects.new(url: "#{url}/v1/subjects", token: token)
22
+ @subjects ||= Refocus::Subjects.new(url: "#{url}/v1/subjects", token: token)
23
23
  end
24
24
 
25
25
  def aspects
26
- Refocus::Aspects.new(url: "#{url}/v1/aspects", token: token)
26
+ @aspects ||= Refocus::Aspects.new(url: "#{url}/v1/aspects", token: token)
27
27
  end
28
28
 
29
29
  def samples
30
- Refocus::Samples.new(url: "#{url}/v1/samples", token: token)
30
+ @samples ||= Refocus::Samples.new(url: "#{url}/v1/samples", token: token)
31
31
  end
32
32
 
33
33
  def perspectives
34
- Refocus::Perspectives.new(url: "#{url}/v1/perspectives", token: token)
34
+ @perspectives ||= Refocus::Perspectives.new(url: "#{url}/v1/perspectives", token: token)
35
35
  end
36
36
 
37
37
  end
@@ -24,6 +24,11 @@ module Refocus
24
24
  end
25
25
  alias_method :submit, :upsert_bulk
26
26
 
27
+ def check_status(job_id)
28
+ (raise ArgumentError, "job_id cannot be nil.") unless job_id
29
+ json(http.get("upsert/bulk/#{job_id}/status"))
30
+ end
31
+
27
32
  def self.format_sample(name:, aspect:, value:nil, message_body:nil, message_code:nil, related_links:nil)
28
33
  sample = {name: "#{name}|#{aspect}"}
29
34
  sample[:value] = value.to_s if value
@@ -1,3 +1,3 @@
1
1
  module Refocus
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refocus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Shea
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-18 00:00:00.000000000 Z
11
+ date: 2018-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -107,7 +107,6 @@ files:
107
107
  - ".rspec"
108
108
  - ".travis.yml"
109
109
  - Gemfile
110
- - Gemfile.lock
111
110
  - README.md
112
111
  - Rakefile
113
112
  - bin/console
@@ -1,45 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- refocus (0.1.8)
5
- clamp (~> 1.1)
6
- excon (~> 0.60)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- clamp (1.2.1)
12
- coderay (1.1.2)
13
- diff-lcs (1.3)
14
- excon (0.60.0)
15
- method_source (0.9.0)
16
- pry (0.11.3)
17
- coderay (~> 1.1.0)
18
- method_source (~> 0.9.0)
19
- rake (10.5.0)
20
- rspec (3.7.0)
21
- rspec-core (~> 3.7.0)
22
- rspec-expectations (~> 3.7.0)
23
- rspec-mocks (~> 3.7.0)
24
- rspec-core (3.7.1)
25
- rspec-support (~> 3.7.0)
26
- rspec-expectations (3.7.0)
27
- diff-lcs (>= 1.2.0, < 2.0)
28
- rspec-support (~> 3.7.0)
29
- rspec-mocks (3.7.0)
30
- diff-lcs (>= 1.2.0, < 2.0)
31
- rspec-support (~> 3.7.0)
32
- rspec-support (3.7.0)
33
-
34
- PLATFORMS
35
- ruby
36
-
37
- DEPENDENCIES
38
- bundler (~> 1.16)
39
- pry (~> 0.11)
40
- rake (~> 10.0)
41
- refocus!
42
- rspec (~> 3.0)
43
-
44
- BUNDLED WITH
45
- 1.16.2