open_recycling 0.0.1 → 0.0.2
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 +14 -22
- data/lib/open_recycling/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: a9aeb270870058d43ca07e5f7101fc67d285c6a6f45c0975616daad99bae696c
|
4
|
+
data.tar.gz: 49d889f06db0eee34e7dac7d692a5e41b7a967bb3f46755a3ed1815becfdb93b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 25fabde8d4b4c5f478d5538394e85c6a0de503ccb5f6b6ac889b3351898df3454d4088bac1a7d0bdeb1a6e060007fd1fd9179f0a8badb1cfa0ed0917a1c0523e
|
7
|
+
data.tar.gz: 6471e085191ed2c7b533db0306b6f33d037a0b179f46de2c1bed49335340638e33970e308c5316b2f7db971f7f05ec44e9139b12eb2bb5d2ea3a5a30306fe7b7
|
data/README.md
CHANGED
@@ -1,31 +1,33 @@
|
|
1
|
-
#
|
1
|
+
# Open Recycling API Client
|
2
2
|
|
3
|
-
|
3
|
+
Ruby client for the Open Recycling API. You can use this gem to develop applications that interact with the Open Recycling Platform.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
|
8
|
-
|
9
7
|
Install the gem and add to the application's Gemfile by executing:
|
10
8
|
|
11
|
-
$ bundle add
|
9
|
+
$ bundle add open_recycling
|
10
|
+
|
11
|
+
Or add it manually to the Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'open_recycling'
|
15
|
+
```
|
12
16
|
|
13
17
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
14
18
|
|
15
|
-
$ gem install
|
19
|
+
$ gem install open_recycling
|
16
20
|
|
17
21
|
## Usage
|
18
22
|
|
19
|
-
Register a new application on
|
20
|
-
|
21
|
-
Furthermore, you need to have an application user id as the application always acts on behalf of a user.
|
23
|
+
Register a new application on the Open Recycling Platform and get the application id, api key and secret key. Furthermore, you need to have an application user id as the application always acts on behalf of a user.
|
22
24
|
|
23
25
|
With the above information, you can generate a JWT token using the `OpenRecycling.generate_token` method.
|
24
26
|
|
25
27
|
```
|
26
28
|
require 'open_recycling'
|
27
29
|
|
28
|
-
OpenRecycling.api_url = "
|
30
|
+
OpenRecycling.api_url = "<open recycling url>"
|
29
31
|
OpenRecycling.jwt_token = OpenRecycling.generate_token(
|
30
32
|
application_id: "<application id>",
|
31
33
|
api_key: "<api key>",
|
@@ -40,26 +42,16 @@ You can now create a new client instance.
|
|
40
42
|
client = OpenRecycling::Client.new
|
41
43
|
```
|
42
44
|
|
43
|
-
With the client setup, you can now make requests to the OpenRecycling API.
|
45
|
+
With the client setup, you can now make requests to the OpenRecycling API, e.g. to fetch all organizations.
|
44
46
|
|
45
47
|
```ruby
|
46
48
|
organizations = client.org.organizations.all
|
47
49
|
```
|
48
50
|
|
49
|
-
## Development
|
50
|
-
|
51
|
-
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
52
|
-
|
53
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
54
|
-
|
55
|
-
## Contributing
|
56
|
-
|
57
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/open_recycling. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/open_recycling/blob/main/CODE_OF_CONDUCT.md).
|
58
|
-
|
59
51
|
## License
|
60
52
|
|
61
53
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
62
54
|
|
63
55
|
## Code of Conduct
|
64
56
|
|
65
|
-
Everyone interacting in the
|
57
|
+
Everyone interacting in the Open Recycling project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/open_recycling/blob/main/CODE_OF_CONDUCT.md).
|