redox-engine 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -1
- data/CHANGELOG.md +6 -1
- data/README.md +17 -11
- data/lib/redox-engine/client.rb +3 -1
- data/lib/redox-engine/exceptions.rb +12 -1
- data/lib/redox-engine/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbf1723442626f96794b5ab2fc8ed408cde77aaf75696a03983a3a99424e7f7a
|
4
|
+
data.tar.gz: b1c7bf8bebbb5e7497b01ebd200b93acfe0ce5c7f303163cfacae837141f73e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4ad4310d97ded5b77f6b6d15752b4553590bfcd6d868556006217d9ec435bba9eb424f14b55dbc1af8ddbac1e0cd4746ffdf924676b2a7a67b4ae8004fe1e74
|
7
|
+
data.tar.gz: d6007f25aa329618c18261c8e53ce30c553f6d6f88ee17f0303a1d154336d5c5e2b9c12240141414a8246ee41823e3e59ac81e1f27b8a09c60c2e6cbc06b7742
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [1.0.
|
7
|
+
## [1.0.1] - 2018-04-04
|
8
|
+
- Refactor + linting
|
9
|
+
- Change to README
|
10
|
+
|
11
|
+
## [1.0.0] - 2018-04-04
|
12
|
+
- (Renamed 0.1.3)
|
8
13
|
- Change RedoxEngine::RedoxEngine to RedoxEngine::Client
|
9
14
|
- Refactor Module to accept configuration
|
10
15
|
- Refactor Client to pass Rubocop linting
|
data/README.md
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# RedoxEngine
|
2
|
-
Ruby API wrapper for [RedoxEngine
|
2
|
+
Ruby API wrapper for [RedoxEngine](https://www.redoxengine.com)
|
3
3
|
|
4
4
|
## Installation
|
5
5
|
|
6
6
|
Add this line to your application's Gemfile:
|
7
7
|
|
8
8
|
```ruby
|
9
|
-
gem 'redox'
|
9
|
+
gem 'redox-engine'
|
10
10
|
```
|
11
11
|
|
12
12
|
And then execute:
|
@@ -15,7 +15,7 @@ And then execute:
|
|
15
15
|
|
16
16
|
Or install it yourself as:
|
17
17
|
|
18
|
-
$ gem install redox
|
18
|
+
$ gem install redox-engine
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
@@ -29,16 +29,21 @@ end
|
|
29
29
|
|
30
30
|
```ruby
|
31
31
|
source = {
|
32
|
-
Name
|
33
|
-
ID
|
32
|
+
Name => Your Source Name,
|
33
|
+
ID => <REDOX_SRC_ID>
|
34
34
|
}
|
35
35
|
|
36
|
-
destinations =
|
37
|
-
{
|
38
|
-
Name
|
39
|
-
ID
|
40
|
-
}
|
41
|
-
|
36
|
+
destinations = {
|
37
|
+
PatientAdmin => {
|
38
|
+
Name => Destination Name,
|
39
|
+
ID => <REDOX_DEST_ID>
|
40
|
+
},
|
41
|
+
ClinicalSummary => {
|
42
|
+
Name => Destination Name,
|
43
|
+
ID => <REDOX_DEST_ID>
|
44
|
+
},
|
45
|
+
...
|
46
|
+
}
|
42
47
|
|
43
48
|
redox = RedoxEngine::Client.new(
|
44
49
|
source: source,
|
@@ -77,6 +82,7 @@ c.access_token # => returns new token
|
|
77
82
|
```
|
78
83
|
|
79
84
|
## Testing
|
85
|
+
|
80
86
|
To run the test suite, save the following in redox_keys.yml in the test/directory (already in the .gitignore for your convenience):
|
81
87
|
|
82
88
|
```yaml
|
data/lib/redox-engine/client.rb
CHANGED
@@ -28,7 +28,9 @@ module RedoxEngine
|
|
28
28
|
def initialize(
|
29
29
|
source:, destinations:, test_mode: true, token: nil, refresh_token: nil
|
30
30
|
)
|
31
|
-
|
31
|
+
if [RedoxEngine.api_key, RedoxEngine.secret].any?(&:nil?)
|
32
|
+
raise APIKeyError
|
33
|
+
end
|
32
34
|
@refresh_token = refresh_token
|
33
35
|
@access_token = token || fetch_access_token
|
34
36
|
|
@@ -5,5 +5,16 @@ module RedoxEngine
|
|
5
5
|
class TokenError < StandardError; end
|
6
6
|
|
7
7
|
# raise this on RedoxEngine::Client.new without setting api_key/secret
|
8
|
-
class APIKeyError < StandardError
|
8
|
+
class APIKeyError < StandardError
|
9
|
+
KEY_ERROR_MSG = "
|
10
|
+
Keys not found. Please set API Key/secret using RedoxEngine.configure:
|
11
|
+
RedoxEngine.configure do |redox|
|
12
|
+
redox.api_key = <API Key>
|
13
|
+
redox.secret = <Secret>
|
14
|
+
end
|
15
|
+
".freeze
|
16
|
+
def initialize(message = nil)
|
17
|
+
super(message || KEY_ERROR_MSG)
|
18
|
+
end
|
19
|
+
end
|
9
20
|
end
|
data/lib/redox-engine/version.rb
CHANGED