camper 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.editorconfig +8 -0
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/ci.yml +43 -0
- data/.github/workflows/ci_changelog.yml +29 -0
- data/.github/workflows/release.yml +91 -0
- data/.gitignore +60 -0
- data/.rspec +3 -0
- data/.rubocop.yml +47 -0
- data/.rubocop_todo.yml +249 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +69 -0
- data/CONTRIBUTING.md +183 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +103 -0
- data/LICENSE +21 -0
- data/README.md +113 -0
- data/Rakefile +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/camper.gemspec +34 -0
- data/examples/comments.rb +35 -0
- data/examples/messages.rb +24 -0
- data/examples/oauth.rb +22 -0
- data/examples/obtain_acces_token.rb +13 -0
- data/examples/todos.rb +27 -0
- data/lib/camper.rb +32 -0
- data/lib/camper/api/comment.rb +13 -0
- data/lib/camper/api/message.rb +9 -0
- data/lib/camper/api/project.rb +20 -0
- data/lib/camper/api/resource.rb +11 -0
- data/lib/camper/api/todo.rb +14 -0
- data/lib/camper/authorization.rb +64 -0
- data/lib/camper/client.rb +86 -0
- data/lib/camper/configuration.rb +75 -0
- data/lib/camper/error.rb +146 -0
- data/lib/camper/logging.rb +28 -0
- data/lib/camper/paginated_response.rb +67 -0
- data/lib/camper/pagination_data.rb +47 -0
- data/lib/camper/request.rb +116 -0
- data/lib/camper/resource.rb +83 -0
- data/lib/camper/resources/project.rb +14 -0
- data/lib/camper/version.rb +5 -0
- metadata +143 -0
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## [Unreleased](https://github.com/renehernandez/camper/tree/HEAD)
|
4
|
+
|
5
|
+
**Implemented enhancements:**
|
6
|
+
|
7
|
+
- Enable dependabot [\#22](https://github.com/renehernandez/camper/pull/22)
|
8
|
+
- Retry for new access token [\#16](https://github.com/renehernandez/camper/pull/16)
|
9
|
+
|
10
|
+
**Fixed bugs:**
|
11
|
+
|
12
|
+
- Implement pagination according to basecamp 3 API [\#20](https://github.com/renehernandez/camper/issues/20)
|
13
|
+
- Implement pagination according to Basecamp 3 API [\#26](https://github.com/renehernandez/camper/pull/26)
|
14
|
+
|
15
|
+
**Merged pull requests:**
|
16
|
+
|
17
|
+
- Update actions to point to main branch [\#34](https://github.com/renehernandez/camper/pull/34)
|
18
|
+
- Apply renames for camper [\#33](https://github.com/renehernandez/camper/pull/33)
|
19
|
+
- Bump rubocop-performance from 1.7.1 to 1.8.1 [\#32](https://github.com/renehernandez/camper/pull/32)
|
20
|
+
- Bump rubocop from 0.89.1 to 0.91.0 [\#31](https://github.com/renehernandez/camper/pull/31)
|
21
|
+
- Bump rubocop from 0.89.0 to 0.89.1 [\#28](https://github.com/renehernandez/camper/pull/28)
|
22
|
+
- Bump rubocop from 0.88.0 to 0.89.0 [\#27](https://github.com/renehernandez/camper/pull/27)
|
23
|
+
- Bump rubocop-performance from 1.6.1 to 1.7.1 [\#25](https://github.com/renehernandez/camper/pull/25)
|
24
|
+
- Bump rack-oauth2 from 1.14.0 to 1.16.0 [\#24](https://github.com/renehernandez/camper/pull/24)
|
25
|
+
- Bump rubocop from 0.86.0 to 0.88.0 [\#23](https://github.com/renehernandez/camper/pull/23)
|
26
|
+
|
27
|
+
## [v0.0.4](https://github.com/renehernandez/camper/tree/v0.0.4) (2020-08-02)
|
28
|
+
|
29
|
+
**Implemented enhancements:**
|
30
|
+
|
31
|
+
- Add Comments API module [\#11](https://github.com/renehernandez/camper/issues/11)
|
32
|
+
- Add Comment API Module [\#19](https://github.com/renehernandez/camper/pull/19)
|
33
|
+
- Refactor usage around the client object [\#18](https://github.com/renehernandez/camper/pull/18)
|
34
|
+
|
35
|
+
## [v0.0.3](https://github.com/renehernandez/camper/tree/v0.0.3) (2020-07-26)
|
36
|
+
|
37
|
+
**Implemented enhancements:**
|
38
|
+
|
39
|
+
- Request a new access token once it expires [\#13](https://github.com/renehernandez/camper/issues/13)
|
40
|
+
|
41
|
+
**Fixed bugs:**
|
42
|
+
|
43
|
+
- Remove unreleasedLabel field [\#15](https://github.com/renehernandez/camper/pull/15)
|
44
|
+
|
45
|
+
**Documentation:**
|
46
|
+
|
47
|
+
- Initial documentation [\#5](https://github.com/renehernandez/camper/issues/5)
|
48
|
+
- Update docs for retry [\#17](https://github.com/renehernandez/camper/pull/17)
|
49
|
+
- Add section to categorize documentation changes [\#14](https://github.com/renehernandez/camper/pull/14)
|
50
|
+
- Docs [\#10](https://github.com/renehernandez/camper/pull/10)
|
51
|
+
|
52
|
+
## [v0.0.2](https://github.com/renehernandez/camper/tree/v0.0.2) (2020-07-07)
|
53
|
+
|
54
|
+
**Implemented enhancements:**
|
55
|
+
|
56
|
+
- Manage release metadata [\#4](https://github.com/renehernandez/camper/issues/4)
|
57
|
+
- Implement release metadata management [\#9](https://github.com/renehernandez/camper/pull/9)
|
58
|
+
- Unify Resource and ObjectifiedHash classes [\#3](https://github.com/renehernandez/camper/pull/3)
|
59
|
+
- Added utility method to transform web URLs [\#2](https://github.com/renehernandez/camper/pull/2)
|
60
|
+
|
61
|
+
**Fixed bugs:**
|
62
|
+
|
63
|
+
- Added missing import [\#1](https://github.com/renehernandez/camper/pull/1)
|
64
|
+
|
65
|
+
## [v0.0.1](https://github.com/renehernandez/camper/tree/v0.0.1) (2020-06-29)
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,183 @@
|
|
1
|
+
# Contributing to Camper
|
2
|
+
|
3
|
+
Please take a moment to review this document in order to make the contribution
|
4
|
+
process easy and effective for everyone involved!
|
5
|
+
|
6
|
+
## Using the issue tracker
|
7
|
+
|
8
|
+
You can use the issues tracker for:
|
9
|
+
|
10
|
+
* [bug reports](#bug-reports)
|
11
|
+
* [feature requests](#feature-requests)
|
12
|
+
* [submitting pull requests](#pull-requests)
|
13
|
+
|
14
|
+
Use [Stackoverflow](http://stackoverflow.com/) for questions and personal support requests.
|
15
|
+
|
16
|
+
## Bug reports
|
17
|
+
|
18
|
+
A bug is a _demonstrable problem_ that is caused by the code in the repository.
|
19
|
+
Good bug reports are extremely helpful - thank you!
|
20
|
+
|
21
|
+
Guidelines for bug reports:
|
22
|
+
|
23
|
+
1. **Use the GitHub issue search** — check if the issue has already been
|
24
|
+
reported.
|
25
|
+
|
26
|
+
2. **Check if the issue has been fixed** — try to reproduce it using the
|
27
|
+
`main` branch in the repository.
|
28
|
+
|
29
|
+
3. **Isolate and report the problem** — ideally create a reduced test
|
30
|
+
case.
|
31
|
+
|
32
|
+
Please try to be as detailed as possible in your report. Include information about
|
33
|
+
your Ruby and Camper client. Please provide steps to
|
34
|
+
reproduce the issue as well as the outcome you were expecting! All these details
|
35
|
+
will help developers to fix any potential bugs.
|
36
|
+
|
37
|
+
Example:
|
38
|
+
|
39
|
+
> Short and descriptive example bug report title
|
40
|
+
>
|
41
|
+
> A summary of the issue and the environment in which it occurs. If suitable,
|
42
|
+
> include the steps required to reproduce the bug.
|
43
|
+
>
|
44
|
+
> 1. This is the first step
|
45
|
+
> 2. This is the second step
|
46
|
+
> 3. Further steps, etc.
|
47
|
+
>
|
48
|
+
> Any other information you want to share that is relevant to the issue being
|
49
|
+
> reported. This might include the lines of code that you have identified as
|
50
|
+
> causing the bug, and potential solutions (and your opinions on their
|
51
|
+
> merits).
|
52
|
+
|
53
|
+
## Feature requests
|
54
|
+
|
55
|
+
Feature requests are welcome. But take a moment to find out whether your idea
|
56
|
+
fits with the scope and aims of the project. It's up to *you* to make a strong
|
57
|
+
case to convince the community of the merits of this feature.
|
58
|
+
Please provide as much detail and context as possible.
|
59
|
+
|
60
|
+
## Contributing Documentation
|
61
|
+
|
62
|
+
Code documentation has a special convention: it uses [YARD](http://yardoc.org/)
|
63
|
+
formatting and the first paragraph is considered to be a short summary.
|
64
|
+
|
65
|
+
For methods say what it will do. For example write something like:
|
66
|
+
|
67
|
+
```ruby
|
68
|
+
# Reverses the contents of a String or IO object.
|
69
|
+
#
|
70
|
+
# @param [String, #read] contents the contents to reverse
|
71
|
+
# @return [String] the contents reversed lexically
|
72
|
+
def reverse(contents)
|
73
|
+
contents = contents.read if contents.respond_to? :read
|
74
|
+
contents.reverse
|
75
|
+
end
|
76
|
+
```
|
77
|
+
|
78
|
+
For classes, modules say what it is. For example write something like:
|
79
|
+
|
80
|
+
```ruby
|
81
|
+
# Defines methods related to groups.
|
82
|
+
module Groups
|
83
|
+
```
|
84
|
+
|
85
|
+
Keep in mind that the documentation notes might show up in a summary somewhere,
|
86
|
+
long texts in the documentation notes create very ugly summaries. As a rule of thumb
|
87
|
+
anything longer than 80 characters is too long.
|
88
|
+
|
89
|
+
Try to keep unnecessary details out of the first paragraph, it's only there to
|
90
|
+
give a user a quick idea of what the documented "thing" does/is. The rest of the
|
91
|
+
documentation notes can contain the details, for example parameters and what
|
92
|
+
is returned.
|
93
|
+
|
94
|
+
If possible include examples
|
95
|
+
|
96
|
+
This makes it easy to test the examples so that they don't go stale and examples
|
97
|
+
are often a great help in explaining what a method does.
|
98
|
+
|
99
|
+
## Pull requests
|
100
|
+
|
101
|
+
Good pull requests - patches, improvements, new features - are a fantastic
|
102
|
+
help. They should remain focused in scope and avoid containing unrelated
|
103
|
+
commits.
|
104
|
+
|
105
|
+
**IMPORTANT**: By submitting a patch, you agree that your work will be
|
106
|
+
licensed under the license used by the project.
|
107
|
+
|
108
|
+
If you have any large pull request in mind (e.g. implementing features,
|
109
|
+
refactoring code, etc), **please ask first** otherwise you risk spending
|
110
|
+
a lot of time working on something that the project's developers might
|
111
|
+
not want to merge into the project.
|
112
|
+
|
113
|
+
Please adhere to the coding conventions in the project (indentation,
|
114
|
+
accurate comments, etc.) and don't forget to add your own tests and
|
115
|
+
documentation. When working with git, we recommend the following process
|
116
|
+
in order to craft an excellent pull request:
|
117
|
+
|
118
|
+
1. [Fork](https://help.github.com/articles/fork-a-repo/) the project, clone your fork,
|
119
|
+
and configure the remotes:
|
120
|
+
|
121
|
+
```sh
|
122
|
+
# Clone your fork of the repo into the current directory
|
123
|
+
git clone https://github.com/<your-username>/Camper
|
124
|
+
# Navigate to the newly cloned directory
|
125
|
+
cd Camper
|
126
|
+
# Assign the original repo to a remote called "upstream"
|
127
|
+
git remote add upstream https://github.com/renehernandez/Camper
|
128
|
+
```
|
129
|
+
|
130
|
+
2. If you cloned a while ago, get the latest changes from upstream:
|
131
|
+
|
132
|
+
```bash
|
133
|
+
git checkout main
|
134
|
+
git pull upstream main
|
135
|
+
```
|
136
|
+
|
137
|
+
3. Create a new topic branch (off of `main`) to contain your feature, change,
|
138
|
+
or fix.
|
139
|
+
|
140
|
+
**IMPORTANT**: Making changes in `main` is discouraged. You should always
|
141
|
+
keep your local `main` in sync with upstream `main` and make your
|
142
|
+
changes in topic branches.
|
143
|
+
|
144
|
+
```sh
|
145
|
+
git checkout -b <topic-branch-name>
|
146
|
+
```
|
147
|
+
|
148
|
+
4. Commit your changes in logical chunks. Keep your commit messages organized,
|
149
|
+
with a short description in the first line and more detailed information on
|
150
|
+
the following lines. Feel free to use Git's
|
151
|
+
[interactive rebase](https://help.github.com/articles/about-git-rebase/)
|
152
|
+
feature to tidy up your commits before making them public.
|
153
|
+
|
154
|
+
5. Make sure all the tests are still passing.
|
155
|
+
|
156
|
+
```sh
|
157
|
+
rake
|
158
|
+
```
|
159
|
+
|
160
|
+
6. Push your topic branch up to your fork:
|
161
|
+
|
162
|
+
```sh
|
163
|
+
git push origin <topic-branch-name>
|
164
|
+
```
|
165
|
+
|
166
|
+
7. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/)
|
167
|
+
with a clear title and description.
|
168
|
+
|
169
|
+
8. If you haven't updated your pull request for a while, you should consider
|
170
|
+
rebasing on main and resolving any conflicts.
|
171
|
+
|
172
|
+
**IMPORTANT**: _Never ever_ merge upstream `main` into your branches. You
|
173
|
+
should always `git rebase` on `main` to bring your changes up to date when
|
174
|
+
necessary.
|
175
|
+
|
176
|
+
```sh
|
177
|
+
git checkout main
|
178
|
+
git pull upstream main
|
179
|
+
git checkout <your-topic-branch>
|
180
|
+
git rebase main
|
181
|
+
```
|
182
|
+
|
183
|
+
Thank you for your contributions!
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
camper (0.0.4)
|
5
|
+
httparty (~> 0.18)
|
6
|
+
rack-oauth2 (~> 1.14)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (6.0.3.3)
|
12
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
|
+
i18n (>= 0.7, < 2)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
tzinfo (~> 1.1)
|
16
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
17
|
+
aes_key_wrap (1.1.0)
|
18
|
+
ast (2.4.1)
|
19
|
+
attr_required (1.0.1)
|
20
|
+
bindata (2.4.8)
|
21
|
+
coderay (1.1.3)
|
22
|
+
concurrent-ruby (1.1.7)
|
23
|
+
diff-lcs (1.3)
|
24
|
+
httparty (0.18.1)
|
25
|
+
mime-types (~> 3.0)
|
26
|
+
multi_xml (>= 0.5.2)
|
27
|
+
httpclient (2.8.3)
|
28
|
+
i18n (1.8.5)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
json-jwt (1.13.0)
|
31
|
+
activesupport (>= 4.2)
|
32
|
+
aes_key_wrap
|
33
|
+
bindata
|
34
|
+
method_source (1.0.0)
|
35
|
+
mime-types (3.3.1)
|
36
|
+
mime-types-data (~> 3.2015)
|
37
|
+
mime-types-data (3.2020.0512)
|
38
|
+
minitest (5.14.2)
|
39
|
+
multi_xml (0.6.0)
|
40
|
+
parallel (1.19.2)
|
41
|
+
parser (2.7.1.4)
|
42
|
+
ast (~> 2.4.1)
|
43
|
+
pry (0.13.1)
|
44
|
+
coderay (~> 1.1)
|
45
|
+
method_source (~> 1.0)
|
46
|
+
rack (2.2.3)
|
47
|
+
rack-oauth2 (1.16.0)
|
48
|
+
activesupport
|
49
|
+
attr_required
|
50
|
+
httpclient
|
51
|
+
json-jwt (>= 1.11.0)
|
52
|
+
rack (>= 2.1.0)
|
53
|
+
rainbow (3.0.0)
|
54
|
+
rake (13.0.1)
|
55
|
+
regexp_parser (1.8.0)
|
56
|
+
rexml (3.2.4)
|
57
|
+
rspec (3.9.0)
|
58
|
+
rspec-core (~> 3.9.0)
|
59
|
+
rspec-expectations (~> 3.9.0)
|
60
|
+
rspec-mocks (~> 3.9.0)
|
61
|
+
rspec-core (3.9.2)
|
62
|
+
rspec-support (~> 3.9.3)
|
63
|
+
rspec-expectations (3.9.2)
|
64
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
+
rspec-support (~> 3.9.0)
|
66
|
+
rspec-mocks (3.9.1)
|
67
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
+
rspec-support (~> 3.9.0)
|
69
|
+
rspec-support (3.9.3)
|
70
|
+
rubocop (0.91.0)
|
71
|
+
parallel (~> 1.10)
|
72
|
+
parser (>= 2.7.1.1)
|
73
|
+
rainbow (>= 2.2.2, < 4.0)
|
74
|
+
regexp_parser (>= 1.7)
|
75
|
+
rexml
|
76
|
+
rubocop-ast (>= 0.4.0, < 1.0)
|
77
|
+
ruby-progressbar (~> 1.7)
|
78
|
+
unicode-display_width (>= 1.4.0, < 2.0)
|
79
|
+
rubocop-ast (0.4.2)
|
80
|
+
parser (>= 2.7.1.4)
|
81
|
+
rubocop-performance (1.8.1)
|
82
|
+
rubocop (>= 0.87.0)
|
83
|
+
rubocop-ast (>= 0.4.0)
|
84
|
+
ruby-progressbar (1.10.1)
|
85
|
+
thread_safe (0.3.6)
|
86
|
+
tzinfo (1.2.7)
|
87
|
+
thread_safe (~> 0.1)
|
88
|
+
unicode-display_width (1.7.0)
|
89
|
+
zeitwerk (2.4.0)
|
90
|
+
|
91
|
+
PLATFORMS
|
92
|
+
ruby
|
93
|
+
|
94
|
+
DEPENDENCIES
|
95
|
+
camper!
|
96
|
+
pry
|
97
|
+
rake (~> 13.0)
|
98
|
+
rspec (~> 3.9)
|
99
|
+
rubocop
|
100
|
+
rubocop-performance
|
101
|
+
|
102
|
+
BUNDLED WITH
|
103
|
+
2.1.4
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2020 Rene Hernandez
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
# camper ![CI](https://github.com/renehernandez/camper/workflows/CI/badge.svg) [![Gem Version](https://badge.fury.io/rb/Camper.svg)](https://badge.fury.io/rb/camper)
|
2
|
+
|
3
|
+
Camper is a Ruby wrapper for the [Basecamp 3 API](https://github.com/basecamp/bc3-api).
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'camper'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```bash
|
16
|
+
$ bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
```bash
|
22
|
+
$ gem install camper
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage
|
26
|
+
|
27
|
+
Getting a client and configuring it:
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'camper'
|
31
|
+
|
32
|
+
client = Camper.client
|
33
|
+
|
34
|
+
client.configure do |config|
|
35
|
+
config.client_id = ENV['BASEcamper_CLIENT_ID']
|
36
|
+
config.client_secret = ENV['BASEcamper_CLIENT_SECRET']
|
37
|
+
config.account_number = ENV['BASEcamper_ACCOUNT_NUMBER']
|
38
|
+
config.refresh_token = ENV['BASEcamper_REFRESH_TOKEN']
|
39
|
+
config.access_token = ENV['BASEcamper_ACCESS_TOKEN']
|
40
|
+
end
|
41
|
+
|
42
|
+
projects = client.projects
|
43
|
+
```
|
44
|
+
|
45
|
+
Alternatively, it is possible to invoke the top-level `#configure` method to get a client:
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
require 'camper'
|
49
|
+
|
50
|
+
client = Camper.configure do |config|
|
51
|
+
config.client_id = ENV['BASEcamper_CLIENT_ID']
|
52
|
+
config.client_secret = ENV['BASEcamper_CLIENT_SECRET']
|
53
|
+
config.account_number = ENV['BASEcamper_ACCOUNT_NUMBER']
|
54
|
+
config.refresh_token = ENV['BASEcamper_REFRESH_TOKEN']
|
55
|
+
config.access_token = ENV['BASEcamper_ACCESS_TOKEN']
|
56
|
+
end
|
57
|
+
|
58
|
+
# gets a paginated response
|
59
|
+
projects = client.projects
|
60
|
+
```
|
61
|
+
|
62
|
+
Example getting list of TODOs:
|
63
|
+
|
64
|
+
```ruby
|
65
|
+
require 'camper'
|
66
|
+
|
67
|
+
client = Camper.configure do |config|
|
68
|
+
config.client_id = ENV['BASEcamper_CLIENT_ID']
|
69
|
+
config.client_secret = ENV['BASEcamper_CLIENT_SECRET']
|
70
|
+
config.account_number = ENV['BASEcamper_ACCOUNT_NUMBER']
|
71
|
+
config.refresh_token = ENV['BASEcamper_REFRESH_TOKEN']
|
72
|
+
config.access_token = ENV['BASEcamper_ACCESS_TOKEN']
|
73
|
+
end
|
74
|
+
|
75
|
+
# gets a paginated response
|
76
|
+
projects = client.projects
|
77
|
+
|
78
|
+
# iterate all projects
|
79
|
+
projects.auto_paginate do |p|
|
80
|
+
puts "Project: #{p.inspect}"
|
81
|
+
|
82
|
+
puts "Todo set: #{p.todoset.inspect}"
|
83
|
+
|
84
|
+
todoset = client.todoset(p)
|
85
|
+
|
86
|
+
# iterate over the first 5 todo lists
|
87
|
+
client.todolists(todoset).auto_paginate(5) do |list|
|
88
|
+
puts "Todolist: #{list.title}"
|
89
|
+
|
90
|
+
client.todos(list).auto_paginate do |todo|
|
91
|
+
puts todo.inspect
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
```
|
96
|
+
|
97
|
+
For more examples, check out the [examples](examples/) folder
|
98
|
+
|
99
|
+
## Contributing
|
100
|
+
|
101
|
+
Check out the [Contributing](CONTRIBUTING.md) page.
|
102
|
+
|
103
|
+
## Changelog
|
104
|
+
|
105
|
+
For inspecting the changes and tag releases, check the [Changelog](CHANGELOG.md) page
|
106
|
+
|
107
|
+
## Appreciation
|
108
|
+
|
109
|
+
The gem code structure and documentation is based on the awesome [NARKOZ/gitlab gem](https://github.com/narkoz/gitlab)
|
110
|
+
|
111
|
+
## License
|
112
|
+
|
113
|
+
Checkout the [LICENSE](LICENSE) for details
|