red-api 0.2.3 → 0.2.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/README.md +4 -3
- data/lib/generators/endpoint/USAGE +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34b9e346a9f677ad543137b0d60b1fc5d4719bb159b445671195b85751f2876e
|
4
|
+
data.tar.gz: 01d83f096388b122f96359dd9507cc3d0804be3cbe513240444625f1948b9f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81805645c940c74a0458597b7d8727dd03c32e5442c4e59858756ac138ff35043d3b90187d44507a9cac8f901b0bcac8807cc74832ec6aa7533cb45258f91702
|
7
|
+
data.tar.gz: 97571792c684c43b80d772ff24e1f18656155a0045bd132a5d44224add2ffd134f41bfce0c7cf3f45389e7efdd248ff1959cecce4169c454195e336b72647710
|
data/README.md
CHANGED
@@ -7,11 +7,11 @@ This simple gem has two generators to support creating a basic API consumer fram
|
|
7
7
|
|
8
8
|
#### Usage
|
9
9
|
```sh
|
10
|
-
rails generate service ApiName https://service/endpoint/ --key api_key service_api_key_env_name
|
11
|
-
rails generate endpoint ServiceName EndpointName /endpoint/#{param1}/#{param2} --
|
10
|
+
rails generate service ApiName Version --endpoint https://service/endpoint/ --key api_key service_api_key_env_name
|
11
|
+
rails generate endpoint ServiceName Version EndpointName --endpoint /endpoint/#{param1}/#{param2} --method-params param1 param2 --include-helper-params
|
12
12
|
```
|
13
13
|
The service generator will setup the framework which uses Faraday for your http calls and Oj gem for faster json parsing.
|
14
|
-
The endpoint generator will setup an endpoint with an endpoint helper method for easier testing.
|
14
|
+
The endpoint generator will setup an endpoint with an endpoint helper method for easier testing and adds a spec file.
|
15
15
|
|
16
16
|
#### Installation
|
17
17
|
```ruby
|
@@ -21,6 +21,7 @@ gem 'red-api'
|
|
21
21
|
```ruby
|
22
22
|
gem 'faraday'
|
23
23
|
gem 'oj'
|
24
|
+
gem 'rspec-rails
|
24
25
|
```
|
25
26
|
|
26
27
|
#### Testing
|
@@ -8,10 +8,11 @@ Example:
|
|
8
8
|
rails generate endpoint ServiceName version EndpointName --endpoint /endpoint/#{param1}/#{param2} --endpoint-params param1 param2 --include-helper-params
|
9
9
|
|
10
10
|
Simple Form:
|
11
|
-
rails generate endpoint ServiceName V1 EndpointName
|
11
|
+
rails generate endpoint ServiceName V1 EndpointName
|
12
12
|
|
13
13
|
This will create:
|
14
14
|
app/services/ServiceName/version/api_call/endpoint_name.rb
|
15
|
+
with the endpoint being /v1/ if no endpoint is given
|
15
16
|
|
16
17
|
This will modify:
|
17
18
|
app/services/ServiceName/version/api_endpoints.rb
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: red-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard DeSilvey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|