asana 0.10.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +24 -0
- data/.github/workflows/pubilsh-to-rubygem.yml +18 -0
- data/.github/workflows/publish-to-github-releases.yml +16 -0
- data/.gitignore +0 -1
- data/.ruby-version +1 -1
- data/.swagger-codegen-ignore +0 -1
- data/Appraisals +2 -35
- data/Gemfile +2 -0
- data/Gemfile.lock +174 -0
- data/README.md +23 -58
- data/Rakefile +10 -14
- data/VERSION +1 -0
- data/asana.gemspec +5 -5
- data/examples/Gemfile.lock +10 -10
- data/lib/asana/client.rb +10 -10
- data/lib/asana/http_client/error_handling.rb +11 -4
- data/lib/asana/resource_includes/attachment_uploading.rb +14 -7
- data/lib/asana/resources/gen/attachments_base.rb +7 -6
- data/lib/asana/resources/gen/audit_log_api_base.rb +37 -0
- data/lib/asana/resources/gen/goals_base.rb +229 -0
- data/lib/asana/resources/gen/project_briefs_base.rb +68 -0
- data/lib/asana/resources/gen/project_templates_base.rb +73 -0
- data/lib/asana/resources/gen/projects_base.rb +14 -1
- data/lib/asana/resources/gen/status_updates_base.rb +72 -0
- data/lib/asana/resources/gen/tags_base.rb +16 -3
- data/lib/asana/resources/gen/tasks_base.rb +9 -10
- data/lib/asana/resources/gen/teams_base.rb +27 -13
- data/lib/asana/resources/gen/time_periods_base.rb +47 -0
- data/lib/asana/resources/gen/typeahead_base.rb +1 -1
- data/lib/asana/resources/gen/users_base.rb +3 -4
- data/lib/asana/resources/gen/webhooks_base.rb +13 -0
- data/lib/asana/resources/gen/workspaces_base.rb +1 -1
- data/lib/asana/resources/portfolio.rb +3 -3
- data/lib/asana/version.rb +1 -1
- data/package-lock.json +115 -0
- data/samples/attachments_sample.yaml +41 -0
- data/samples/audit_log_api_sample.yaml +11 -0
- data/samples/batch_api_sample.yaml +11 -0
- data/samples/custom_field_settings_sample.yaml +21 -0
- data/samples/custom_fields_sample.yaml +81 -0
- data/samples/events_sample.yaml +11 -0
- data/samples/goals_sample.yaml +161 -0
- data/samples/jobs_sample.yaml +11 -0
- data/samples/organization_exports_sample.yaml +21 -0
- data/samples/portfolio_memberships_sample.yaml +31 -0
- data/samples/portfolios_sample.yaml +121 -0
- data/samples/project_briefs_sample.yaml +41 -0
- data/samples/project_memberships_sample.yaml +21 -0
- data/samples/project_statuses_sample.yaml +41 -0
- data/samples/project_templates_sample.yaml +41 -0
- data/samples/projects_sample.yaml +191 -0
- data/samples/sections_sample.yaml +71 -0
- data/samples/status_updates_sample.yaml +41 -0
- data/samples/stories_sample.yaml +51 -0
- data/samples/tags_sample.yaml +81 -0
- data/samples/tasks_sample.yaml +261 -0
- data/samples/team_memberships_sample.yaml +41 -0
- data/samples/teams_sample.yaml +61 -0
- data/samples/time_periods_sample.yaml +21 -0
- data/samples/typeahead_sample.yaml +11 -0
- data/samples/user_task_lists_sample.yaml +21 -0
- data/samples/users_sample.yaml +51 -0
- data/samples/webhooks_sample.yaml +51 -0
- data/samples/workspace_memberships_sample.yaml +31 -0
- data/samples/workspaces_sample.yaml +51 -0
- data/swagger_templates/api.mustache +1 -1
- data/swagger_templates/api_doc.mustache +12 -0
- data/swagger_templates/ruby-config.json +1 -2
- metadata +62 -15
- data/.travis.yml +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a4e97c4ca97737835acf2af6cc261b767770ee3a16743e88aabe1bd86e81173
|
4
|
+
data.tar.gz: 5794d53e835b7c06820d0c0487820486c8a88338c4037302159560e4ea1c0cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37629874aeb92b99355aa0074aa010f8d7d98ebe208530c7d02e875676f291f733a915e7c972e0780e4f6f535d438c59f08f5df7b5bcc5296d5ead283ffff4d1
|
7
|
+
data.tar.gz: bbdbf4440eb4b10214e97a0db1e88ae8ac7eaa930d8c634efe4e7d63e71a66f0588f1fa4c3ce439b7647bae9d8eba61d17314a3dde2579005b5c7b2e125ddc17
|
@@ -0,0 +1,24 @@
|
|
1
|
+
name: Build
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches:
|
6
|
+
- master
|
7
|
+
pull_request:
|
8
|
+
branches:
|
9
|
+
- master
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
test:
|
13
|
+
name: Run
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
strategy:
|
16
|
+
matrix:
|
17
|
+
ruby: [2.5, 2.7, 3.0]
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v3
|
20
|
+
- uses: ruby/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: ${{ matrix.ruby }}
|
23
|
+
- run: bundle install
|
24
|
+
- run: bundle exec rake
|
@@ -0,0 +1,18 @@
|
|
1
|
+
name: Publish 📦 to RubyGems.org
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v*.*.*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
publish-to-rubygems:
|
10
|
+
name: Publish 📦 to RubyGems.org
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v3
|
15
|
+
- name: Release
|
16
|
+
uses: dawidd6/action-publish-gem@v1
|
17
|
+
with:
|
18
|
+
api_key: ${{secrets.RUBYGEMS_API_KEY}}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
name: Publish to GitHub Releases
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- "v*.*.*"
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
publish-to-github:
|
10
|
+
name: Publish to GitHub Releases
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
steps:
|
13
|
+
- name: Checkout
|
14
|
+
uses: actions/checkout@v3
|
15
|
+
- name: Release
|
16
|
+
uses: softprops/action-gh-release@v1
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.5.0
|
data/.swagger-codegen-ignore
CHANGED
data/Appraisals
CHANGED
@@ -1,37 +1,4 @@
|
|
1
1
|
|
2
|
-
appraise "faraday-0.
|
3
|
-
gem "faraday", "0.
|
2
|
+
appraise "faraday-1.0.0" do
|
3
|
+
gem "faraday", "1.0.0"
|
4
4
|
end
|
5
|
-
|
6
|
-
appraise "faraday-0.9.1" do
|
7
|
-
gem "faraday", "0.9.1"
|
8
|
-
end
|
9
|
-
|
10
|
-
appraise "faraday-0.9.2" do
|
11
|
-
gem "faraday", "0.9.2"
|
12
|
-
end
|
13
|
-
|
14
|
-
appraise "faraday-0.10.0" do
|
15
|
-
gem "faraday", "0.10.0"
|
16
|
-
end
|
17
|
-
appraise "faraday-0.10.1" do
|
18
|
-
gem "faraday", "0.10.1"
|
19
|
-
end
|
20
|
-
|
21
|
-
appraise "faraday-0.11.0" do
|
22
|
-
gem "faraday", "0.11.0"
|
23
|
-
end
|
24
|
-
|
25
|
-
# Oauth2 does not yet support 0.12
|
26
|
-
|
27
|
-
# appraise "faraday-0.12.0" do
|
28
|
-
# gem "faraday", "0.12.0"
|
29
|
-
# end
|
30
|
-
#
|
31
|
-
# appraise "faraday-0.12.0.1" do
|
32
|
-
# gem "faraday", "0.12.0.1"
|
33
|
-
# end
|
34
|
-
#
|
35
|
-
# appraise "faraday-0.12.1" do
|
36
|
-
# gem "faraday", "0.12.1"
|
37
|
-
# end
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,174 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
asana (1.0.0)
|
5
|
+
faraday (~> 1.0)
|
6
|
+
faraday_middleware (~> 1.0)
|
7
|
+
faraday_middleware-multi_json (~> 0.0)
|
8
|
+
oauth2 (>= 1.4, < 3)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
appraisal (2.4.1)
|
14
|
+
bundler
|
15
|
+
rake
|
16
|
+
thor (>= 0.14.0)
|
17
|
+
ast (2.4.2)
|
18
|
+
byebug (11.1.3)
|
19
|
+
coderay (1.1.3)
|
20
|
+
diff-lcs (1.5.0)
|
21
|
+
docile (1.4.0)
|
22
|
+
faraday (1.10.0)
|
23
|
+
faraday-em_http (~> 1.0)
|
24
|
+
faraday-em_synchrony (~> 1.0)
|
25
|
+
faraday-excon (~> 1.1)
|
26
|
+
faraday-httpclient (~> 1.0)
|
27
|
+
faraday-multipart (~> 1.0)
|
28
|
+
faraday-net_http (~> 1.0)
|
29
|
+
faraday-net_http_persistent (~> 1.0)
|
30
|
+
faraday-patron (~> 1.0)
|
31
|
+
faraday-rack (~> 1.0)
|
32
|
+
faraday-retry (~> 1.0)
|
33
|
+
ruby2_keywords (>= 0.0.4)
|
34
|
+
faraday-em_http (1.0.0)
|
35
|
+
faraday-em_synchrony (1.0.0)
|
36
|
+
faraday-excon (1.1.0)
|
37
|
+
faraday-httpclient (1.0.1)
|
38
|
+
faraday-multipart (1.0.4)
|
39
|
+
multipart-post (~> 2)
|
40
|
+
faraday-net_http (1.0.1)
|
41
|
+
faraday-net_http_persistent (1.2.0)
|
42
|
+
faraday-patron (1.0.0)
|
43
|
+
faraday-rack (1.0.0)
|
44
|
+
faraday-retry (1.0.3)
|
45
|
+
faraday_middleware (1.2.0)
|
46
|
+
faraday (~> 1.0)
|
47
|
+
faraday_middleware-multi_json (0.0.6)
|
48
|
+
faraday_middleware
|
49
|
+
multi_json
|
50
|
+
ffi (1.15.5)
|
51
|
+
formatador (1.1.0)
|
52
|
+
guard (2.18.0)
|
53
|
+
formatador (>= 0.2.4)
|
54
|
+
listen (>= 2.7, < 4.0)
|
55
|
+
lumberjack (>= 1.0.12, < 2.0)
|
56
|
+
nenv (~> 0.1)
|
57
|
+
notiffany (~> 0.0)
|
58
|
+
pry (>= 0.13.0)
|
59
|
+
shellany (~> 0.0)
|
60
|
+
thor (>= 0.18.1)
|
61
|
+
guard-compat (1.2.1)
|
62
|
+
guard-rspec (4.7.3)
|
63
|
+
guard (~> 2.1)
|
64
|
+
guard-compat (~> 1.1)
|
65
|
+
rspec (>= 2.99.0, < 4.0)
|
66
|
+
guard-rubocop (1.5.0)
|
67
|
+
guard (~> 2.0)
|
68
|
+
rubocop (< 2.0)
|
69
|
+
guard-yard (2.2.1)
|
70
|
+
guard (>= 1.1.0)
|
71
|
+
yard (>= 0.7.0)
|
72
|
+
hashie (5.0.0)
|
73
|
+
jwt (2.4.1)
|
74
|
+
listen (3.7.1)
|
75
|
+
rb-fsevent (~> 0.10, >= 0.10.3)
|
76
|
+
rb-inotify (~> 0.9, >= 0.9.10)
|
77
|
+
lumberjack (1.2.8)
|
78
|
+
method_source (1.0.0)
|
79
|
+
multi_json (1.15.0)
|
80
|
+
multi_xml (0.6.0)
|
81
|
+
multipart-post (2.2.3)
|
82
|
+
nenv (0.3.0)
|
83
|
+
notiffany (0.1.3)
|
84
|
+
nenv (~> 0.1)
|
85
|
+
shellany (~> 0.0)
|
86
|
+
oauth2 (2.0.3)
|
87
|
+
faraday (>= 0.17.3, < 3.0)
|
88
|
+
jwt (>= 1.0, < 3.0)
|
89
|
+
multi_xml (~> 0.5)
|
90
|
+
rack (>= 1.2, < 3)
|
91
|
+
rash_alt (>= 0.4, < 1)
|
92
|
+
version_gem (~> 1.0)
|
93
|
+
parallel (1.22.1)
|
94
|
+
parser (2.7.2.0)
|
95
|
+
ast (~> 2.4.1)
|
96
|
+
powerpack (0.1.3)
|
97
|
+
pry (0.14.1)
|
98
|
+
coderay (~> 1.1)
|
99
|
+
method_source (~> 1.0)
|
100
|
+
rack (2.2.3.1)
|
101
|
+
rack-protection (1.5.5)
|
102
|
+
rack
|
103
|
+
rainbow (3.1.1)
|
104
|
+
rake (13.0.6)
|
105
|
+
rash_alt (0.4.12)
|
106
|
+
hashie (>= 3.4)
|
107
|
+
rb-fsevent (0.11.1)
|
108
|
+
rb-inotify (0.10.1)
|
109
|
+
ffi (~> 1.0)
|
110
|
+
rspec (3.11.0)
|
111
|
+
rspec-core (~> 3.11.0)
|
112
|
+
rspec-expectations (~> 3.11.0)
|
113
|
+
rspec-mocks (~> 3.11.0)
|
114
|
+
rspec-core (3.11.0)
|
115
|
+
rspec-support (~> 3.11.0)
|
116
|
+
rspec-expectations (3.11.0)
|
117
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
118
|
+
rspec-support (~> 3.11.0)
|
119
|
+
rspec-mocks (3.11.1)
|
120
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
121
|
+
rspec-support (~> 3.11.0)
|
122
|
+
rspec-support (3.11.0)
|
123
|
+
rubocop (0.52.1)
|
124
|
+
parallel (~> 1.10)
|
125
|
+
parser (>= 2.4.0.2, < 3.0)
|
126
|
+
powerpack (~> 0.1)
|
127
|
+
rainbow (>= 2.2.2, < 4.0)
|
128
|
+
ruby-progressbar (~> 1.7)
|
129
|
+
unicode-display_width (~> 1.0, >= 1.0.1)
|
130
|
+
rubocop-rspec (1.22.2)
|
131
|
+
rubocop (>= 0.52.1)
|
132
|
+
ruby-progressbar (1.11.0)
|
133
|
+
ruby2_keywords (0.0.5)
|
134
|
+
shellany (0.0.1)
|
135
|
+
simplecov (0.21.2)
|
136
|
+
docile (~> 1.1)
|
137
|
+
simplecov-html (~> 0.11)
|
138
|
+
simplecov_json_formatter (~> 0.1)
|
139
|
+
simplecov-html (0.12.3)
|
140
|
+
simplecov_json_formatter (0.1.4)
|
141
|
+
thor (1.2.1)
|
142
|
+
tomparse (0.4.2)
|
143
|
+
unicode-display_width (1.8.0)
|
144
|
+
version_gem (1.1.0)
|
145
|
+
webrick (1.7.0)
|
146
|
+
yard (0.9.28)
|
147
|
+
webrick (~> 1.7.0)
|
148
|
+
yard-tomdoc (0.7.1)
|
149
|
+
tomparse (>= 0.4.0)
|
150
|
+
yard
|
151
|
+
|
152
|
+
PLATFORMS
|
153
|
+
universal-darwin-21
|
154
|
+
x86_64-linux
|
155
|
+
|
156
|
+
DEPENDENCIES
|
157
|
+
appraisal (~> 2.1, >= 2.1)
|
158
|
+
asana!
|
159
|
+
byebug
|
160
|
+
guard
|
161
|
+
guard-rspec
|
162
|
+
guard-rubocop
|
163
|
+
guard-yard
|
164
|
+
rack-protection (= 1.5.5)
|
165
|
+
rake (~> 13.0)
|
166
|
+
rspec (~> 3.2)
|
167
|
+
rubocop (~> 0.52.1)
|
168
|
+
rubocop-rspec (~> 1.22.2)
|
169
|
+
simplecov
|
170
|
+
yard
|
171
|
+
yard-tomdoc
|
172
|
+
|
173
|
+
BUNDLED WITH
|
174
|
+
2.3.13
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Asana
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/asana.svg)](http://badge.fury.io/rb/asana)
|
4
|
-
[![Build Status](https://
|
4
|
+
[![Build Status](https://github.com/Asana/ruby-asana/workflows/Build/badge.svg)](https://github.com/Asana/ruby-asana/actions)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/Asana/ruby-asana/badges/gpa.svg)](https://codeclimate.com/github/Asana/ruby-asana)
|
6
6
|
|
7
7
|
|
@@ -11,53 +11,6 @@ Supported rubies:
|
|
11
11
|
|
12
12
|
* MRI 2.0.0 up to 2.2.x stable
|
13
13
|
|
14
|
-
## Required: Security procedures for outdated OpenSSL versions
|
15
|
-
|
16
|
-
Older versions of OpenSSL can cause a problem when using `ruby-asana` In particular, at the time of this writing, at least **MacOS X 10.11 and below** ship with a very old version of OpenSSL:
|
17
|
-
|
18
|
-
$ openssl version
|
19
|
-
OpenSSL 0.9.8zh 14 Jan 2016
|
20
|
-
|
21
|
-
OpenSSL 0.9.8 was first released in 2005, and therefore only supports TLS (Transport Layer Security) version 1.0. Asana has deprecated and stopped accepting requests for clients which do not suport [TLS 1.0 and above](https://asa.na/tls), which unfortunately includes any software linked against this version of the library - this includes both the MacOS X provided Ruby interpreter and any homebrew installed Ruby that is not specifically configured to link against a newer version.
|
22
|
-
|
23
|
-
To see if your Ruby version is affected, run
|
24
|
-
|
25
|
-
$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
|
26
|
-
|
27
|
-
If the version printed at the command line is older than `1.0.1`, when, in 2012, OpenSSL first supported TLS 1.1 and 1.2, you will not be able to use `ruby-asana` to connect to Asana. Specifically, you will recieve `400 Bad Request` responses with an error message in the response body about the lack of support for TLS 1.1 and above.
|
28
|
-
|
29
|
-
Asana highly recommends using a Ruby installation manager, either RVM or `rbenv`. Instructions on how to install an up-to-date `ruby` for each of these are below.
|
30
|
-
|
31
|
-
### Solution when using RVM
|
32
|
-
|
33
|
-
RVM makes it easy to install both an updated OpenSSL and a Ruby interpreter that links to it. If you are using MacPorts or Homebrew, you're probably fine out of the box; RVM favors package management using either one of these to satisfy dependencies, and so can keep your ruby up to date automatically. If you are not using these, consider using them, as they're very simple to install and use.
|
34
|
-
|
35
|
-
If you don't use your package manager, you can use RVM's [package manager](https://rvm.io/packages) to install from source.
|
36
|
-
|
37
|
-
If you want to build OpenSSL from source yourself, you have to specify how to link to this OpenSSL installation:
|
38
|
-
|
39
|
-
$ rvm install ruby-{version} --with-openssl-dir={ssl_dir}
|
40
|
-
# Specify your openssl path prefix, wherever openssl dirs
|
41
|
-
# "bin", "include", and "lib" are installed; usually
|
42
|
-
# "/usr" for system installs, or $PREFIX for configure/make locally.
|
43
|
-
$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' # Verify inside Ruby
|
44
|
-
OpenSSL 1.0.2h 3 May 2016
|
45
|
-
|
46
|
-
If you see the version of OpenSSL greater than OpenSSL 1.0.1, then you're all set to start using `ruby-asana`
|
47
|
-
|
48
|
-
### Solution when using rbenv
|
49
|
-
|
50
|
-
Similar to RVM, rbenv compiles rubies with knowledge of MacPorts and Homebrew libraries. When a newer version of OpenSSL is installed via the method above, all rubies built (after that time of course) will link to the newer version of OpenSSL.
|
51
|
-
|
52
|
-
If you don't use a package manager, as above, you can build by explicitly supplying the directory in which to find OpenSSL:
|
53
|
-
|
54
|
-
$ RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/local rbenv install ruby-{version}
|
55
|
-
# Specify your openssl path prefix, wherever openssl dirs
|
56
|
-
# "bin", "include", and "lib" are installed; usually
|
57
|
-
# "/usr" for system installs, or $PREFIX for configure/make locally.
|
58
|
-
$ ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION' # Verify inside Ruby
|
59
|
-
OpenSSL 1.0.2h 3 May 2016
|
60
|
-
|
61
14
|
## Gem Installation
|
62
15
|
Add this line to your application's Gemfile:
|
63
16
|
|
@@ -179,7 +132,7 @@ get '/auth/:name/callback' do
|
|
179
132
|
$client = Asana::Client.new do |c|
|
180
133
|
c.authentication :oauth2, access_token
|
181
134
|
end
|
182
|
-
|
135
|
+
|
183
136
|
redirect '/'
|
184
137
|
end
|
185
138
|
```
|
@@ -261,8 +214,10 @@ In any request against the Asana API, there a number of errors that could
|
|
261
214
|
arise. Those are well documented in the [Asana API Documentation][apidocs], and
|
262
215
|
are represented as exceptions under the namespace `Asana::Errors`.
|
263
216
|
|
264
|
-
|
265
|
-
|
217
|
+
The Asana client automatically handles and retries requests upon receipt of
|
218
|
+
500 (Internal Server Error) responses from the Asana API. If you want to handle
|
219
|
+
any 4xx errors, you will have to do that yourself; you can do this by rescuing
|
220
|
+
`Asana::Errors::APIError`, the parent class of all Asana API errors.
|
266
221
|
|
267
222
|
### I/O options
|
268
223
|
|
@@ -352,7 +307,7 @@ If you receive one of these warnings, you should:
|
|
352
307
|
You can add global headers, by setting default_headers
|
353
308
|
|
354
309
|
c.default_headers "asana-enable" => "string_ids"
|
355
|
-
|
310
|
+
|
356
311
|
Or you can add a header field to the options of each request.
|
357
312
|
|
358
313
|
If you would rather suppress these warnings, you can set
|
@@ -361,7 +316,7 @@ If you would rather suppress these warnings, you can set
|
|
361
316
|
|
362
317
|
## Development
|
363
318
|
|
364
|
-
You'll need Ruby 2.
|
319
|
+
You'll need Ruby 2.5+ and Node v0.10.26+ / NPM 1.4.3+ installed.
|
365
320
|
|
366
321
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
367
322
|
`bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -380,11 +335,22 @@ To release a new version, run either of these commands:
|
|
380
335
|
rake bump:minor
|
381
336
|
rake bump:major
|
382
337
|
|
383
|
-
This will: update `lib/asana/version.rb`, commit and tag the commit. Then you
|
384
|
-
just need to `push --tags` to let
|
338
|
+
This will: update `lib/asana/version.rb` and `VERSION`, commit and tag the commit. Then you
|
339
|
+
just need to `push --tags` to let GitHub Actions build and release the new version to
|
385
340
|
Rubygems:
|
386
341
|
|
387
|
-
git push --tags
|
342
|
+
git push --tags origin master:master
|
343
|
+
|
344
|
+
### Manual Deployment
|
345
|
+
|
346
|
+
1. Merge in the desired changes into the `master` branch and commit them.
|
347
|
+
2. Clone the repo, work on master.
|
348
|
+
3. Edit package version in `lib/asana/version.rb` and `VERSION` to indicate the [semantic version](http://semver.org/) change.
|
349
|
+
4. Commit the change
|
350
|
+
5. Tag the commit with `v` plus the same version number you set in the file.
|
351
|
+
`git tag v1.2.3`
|
352
|
+
6. Push changes to origin, including tags:
|
353
|
+
`git push --tags origin master:master`
|
388
354
|
|
389
355
|
### Code generation
|
390
356
|
|
@@ -402,8 +368,7 @@ If you wish to make changes on the code generation script:
|
|
402
368
|
spec/templates/unicorn_spec.rb`
|
403
369
|
|
404
370
|
Once you're sure your code works, submit a pull request and ask the maintainer
|
405
|
-
to make a release, as they'll need to run a release script
|
406
|
-
[asana-api-meta][meta] repository.
|
371
|
+
to make a release, as they'll need to run a release script.
|
407
372
|
|
408
373
|
## Contributing
|
409
374
|
|
data/Rakefile
CHANGED
@@ -29,6 +29,11 @@ namespace :bump do
|
|
29
29
|
|
30
30
|
# rubocop:disable Metrics/MethodLength
|
31
31
|
def write_version(major, minor, patch)
|
32
|
+
|
33
|
+
File.open('VERSION', 'w') do |f|
|
34
|
+
f.write "#{major}.#{minor}.#{patch}"
|
35
|
+
end
|
36
|
+
|
32
37
|
str = <<-EOS
|
33
38
|
#:nodoc:
|
34
39
|
module Asana
|
@@ -41,10 +46,13 @@ EOS
|
|
41
46
|
end
|
42
47
|
|
43
48
|
new_version = "#{major}.#{minor}.#{patch}"
|
49
|
+
system('bundle lock --update')
|
50
|
+
system('git add Gemfile.lock')
|
51
|
+
system('git add VERSION')
|
44
52
|
system('git add lib/asana/version.rb')
|
45
53
|
system(%(git commit -m "Bumped to #{new_version}" && ) +
|
46
54
|
%(git tag -a v#{new_version} -m "Version #{new_version}"))
|
47
|
-
puts "\nRun git push --tags to release."
|
55
|
+
puts "\nRun git push --tags origin master:master to release."
|
48
56
|
end
|
49
57
|
|
50
58
|
desc 'Bumps a patch version'
|
@@ -72,17 +80,5 @@ task default: [:all, :rubocop, :yard]
|
|
72
80
|
|
73
81
|
desc 'Test the plugin under all supported Rails versions.'
|
74
82
|
task :all do |_t|
|
75
|
-
|
76
|
-
# require 'json'
|
77
|
-
# puts JSON.pretty_generate(ENV.to_hash)
|
78
|
-
if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
|
79
|
-
appraisal_name = ENV['BUNDLE_GEMFILE'].scan(/faraday\_(.*)\.gemfile/).flatten.first
|
80
|
-
command_prefix = "appraisal faraday-#{appraisal_name}"
|
81
|
-
exec("#{command_prefix} bundle install && #{command_prefix} bundle exec rspec")
|
82
|
-
else
|
83
|
-
exec(' bundle exec appraisal install && bundle exec rake appraisal spec')
|
84
|
-
end
|
85
|
-
else
|
86
|
-
exec('bundle exec appraisal install && bundle exec rake appraisal spec')
|
87
|
-
end
|
83
|
+
exec('bundle exec appraisal install && bundle exec rake appraisal spec')
|
88
84
|
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.0.0
|
data/asana.gemspec
CHANGED
@@ -19,14 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.required_ruby_version = '
|
22
|
+
spec.required_ruby_version = '>= 2.5'
|
23
23
|
|
24
|
-
spec.add_dependency "oauth2", "
|
25
|
-
spec.add_dependency "faraday", "~> 0
|
26
|
-
spec.add_dependency "faraday_middleware", "~> 0
|
24
|
+
spec.add_dependency "oauth2", ">= 1.4", '< 3'
|
25
|
+
spec.add_dependency "faraday", "~> 1.0"
|
26
|
+
spec.add_dependency "faraday_middleware", "~> 1.0"
|
27
27
|
spec.add_dependency "faraday_middleware-multi_json", "~> 0.0"
|
28
28
|
|
29
|
-
spec.add_development_dependency "rake", "~>
|
29
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
30
30
|
spec.add_development_dependency "rspec", "~> 3.2"
|
31
31
|
spec.add_development_dependency 'appraisal', '~> 2.1', '>= 2.1'
|
32
32
|
end
|
data/examples/Gemfile.lock
CHANGED
@@ -1,33 +1,33 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
asana (0.
|
5
|
-
faraday (~> 0
|
6
|
-
faraday_middleware (~> 0
|
4
|
+
asana (0.10.5)
|
5
|
+
faraday (~> 1.0)
|
6
|
+
faraday_middleware (~> 1.0)
|
7
7
|
faraday_middleware-multi_json (~> 0.0)
|
8
8
|
oauth2 (~> 1.4)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
faraday (0.
|
13
|
+
faraday (1.0.1)
|
14
14
|
multipart-post (>= 1.2, < 3)
|
15
|
-
faraday_middleware (0.
|
16
|
-
faraday (
|
15
|
+
faraday_middleware (1.0.0)
|
16
|
+
faraday (~> 1.0)
|
17
17
|
faraday_middleware-multi_json (0.0.6)
|
18
18
|
faraday_middleware
|
19
19
|
multi_json
|
20
20
|
jwt (2.2.1)
|
21
|
-
multi_json (1.
|
21
|
+
multi_json (1.15.0)
|
22
22
|
multi_xml (0.6.0)
|
23
23
|
multipart-post (2.1.1)
|
24
|
-
oauth2 (1.4.
|
25
|
-
faraday (>= 0.8, <
|
24
|
+
oauth2 (1.4.4)
|
25
|
+
faraday (>= 0.8, < 2.0)
|
26
26
|
jwt (>= 1.0, < 3.0)
|
27
27
|
multi_json (~> 1.3)
|
28
28
|
multi_xml (~> 0.5)
|
29
29
|
rack (>= 1.2, < 3)
|
30
|
-
rack (2.
|
30
|
+
rack (2.2.3.1)
|
31
31
|
|
32
32
|
PLATFORMS
|
33
33
|
ruby
|
data/lib/asana/client.rb
CHANGED
@@ -59,8 +59,8 @@ module Asana
|
|
59
59
|
@resource = resource
|
60
60
|
end
|
61
61
|
|
62
|
-
def method_missing(m, *args, &block)
|
63
|
-
@resource.public_send(m, *([@client] + args), &block)
|
62
|
+
def method_missing(m, *args, **kwargs, &block)
|
63
|
+
@resource.public_send(m, *([@client] + args), **kwargs, &block)
|
64
64
|
end
|
65
65
|
|
66
66
|
def respond_to_missing?(m, *)
|
@@ -87,29 +87,29 @@ module Asana
|
|
87
87
|
# Public: Performs a GET request against an arbitrary Asana URL. Allows for
|
88
88
|
# the user to interact with the API in ways that haven't been
|
89
89
|
# reflected/foreseen in this library.
|
90
|
-
def get(url,
|
91
|
-
@http_client.get(url,
|
90
|
+
def get(url, **args)
|
91
|
+
@http_client.get(url, **args)
|
92
92
|
end
|
93
93
|
|
94
94
|
# Public: Performs a POST request against an arbitrary Asana URL. Allows for
|
95
95
|
# the user to interact with the API in ways that haven't been
|
96
96
|
# reflected/foreseen in this library.
|
97
|
-
def post(url,
|
98
|
-
@http_client.post(url,
|
97
|
+
def post(url, **args)
|
98
|
+
@http_client.post(url, **args)
|
99
99
|
end
|
100
100
|
|
101
101
|
# Public: Performs a PUT request against an arbitrary Asana URL. Allows for
|
102
102
|
# the user to interact with the API in ways that haven't been
|
103
103
|
# reflected/foreseen in this library.
|
104
|
-
def put(url,
|
105
|
-
@http_client.put(url,
|
104
|
+
def put(url, **args)
|
105
|
+
@http_client.put(url, **args)
|
106
106
|
end
|
107
107
|
|
108
108
|
# Public: Performs a DELETE request against an arbitrary Asana URL. Allows
|
109
109
|
# for the user to interact with the API in ways that haven't been
|
110
110
|
# reflected/foreseen in this library.
|
111
|
-
def delete(url,
|
112
|
-
@http_client.delete(url,
|
111
|
+
def delete(url, **args)
|
112
|
+
@http_client.delete(url, **args)
|
113
113
|
end
|
114
114
|
|
115
115
|
# Public: Exposes queries for all top-evel endpoints.
|
@@ -11,7 +11,7 @@ module Asana
|
|
11
11
|
|
12
12
|
module_function
|
13
13
|
|
14
|
-
|
14
|
+
MAX_RETRIES = 5
|
15
15
|
|
16
16
|
# Public: Perform a request handling any API errors correspondingly.
|
17
17
|
#
|
@@ -28,7 +28,7 @@ module Asana
|
|
28
28
|
# Raises [Asana::Errors::APIError] when the API returns an unknown error.
|
29
29
|
#
|
30
30
|
# rubocop:disable all
|
31
|
-
def handle(
|
31
|
+
def handle(num_retries=0, &request)
|
32
32
|
request.call
|
33
33
|
rescue Faraday::ClientError => e
|
34
34
|
raise e unless e.response
|
@@ -43,9 +43,16 @@ module Asana
|
|
43
43
|
when 500 then raise server_error(e.response)
|
44
44
|
else raise api_error(e.response)
|
45
45
|
end
|
46
|
+
# Retry for timeouts or 500s from Asana
|
47
|
+
rescue Faraday::ServerError => e
|
48
|
+
if num_retries < MAX_RETRIES
|
49
|
+
handle(num_retries + 1, &request)
|
50
|
+
else
|
51
|
+
raise server_error(e.response)
|
52
|
+
end
|
46
53
|
rescue Net::ReadTimeout => e
|
47
|
-
if
|
48
|
-
handle(
|
54
|
+
if num_retries < MAX_RETRIES
|
55
|
+
handle(num_retries + 1, &request)
|
49
56
|
else
|
50
57
|
raise e
|
51
58
|
end
|