clubhouse_ruby 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99130661e8bef360cc89dc809b212764a013ed45
4
- data.tar.gz: 398600d53686e920fb38f95cd54955b000af0006
3
+ metadata.gz: fd8a31fc213799a4c32148450916cff148edac46
4
+ data.tar.gz: 2371dce1a6e09504a6880b6fb41f1f87825c28fc
5
5
  SHA512:
6
- metadata.gz: 2dcdc681c343e90ecebc0def690f3307d607ecf1ca38806aa696b2e4882a6801e869021682fde9ce656bacec5097dda58069ec63ef803c659a642751508afb0d
7
- data.tar.gz: 5502abcfcd208946601679d9125e2789b0645b22c104c688936d90aacb3a00cabb7c1558a82207a335cd38debcf048bf5330b22ac6ec82694f76add07d4e5eff
6
+ metadata.gz: dfbd67e65e330094531a4c7652e42e774557126b7bf486de3e37d285d4d75d6147c88ea725736030dd7cc8c73a2caa4ee23cd036022a3fcd6e3453ea426acd6e
7
+ data.tar.gz: 6666f1370c5b9491a172cf60fd8760dbd53658e7f4613b7fd2b6309a7b6f5809235a489c94f10161342f0f40f204d9f5d202b2ce596986aa566701463f5d586c
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Philip Castiglione
3
+ Copyright (c) 2017 Philip Castiglione
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # ClubhouseRuby
2
2
 
3
3
  ClubhouseRuby is a lightweight Ruby wrapper of the
4
- [Clubhouse API](https://clubhouse.io/api/v1/).
4
+ [Clubhouse REST API](https://clubhouse.io/api/rest/v2/).
5
5
 
6
6
  [Clubhouse](https://clubhouse.io) is a radical project management tool
7
7
  particularly well suited to software development. If you're not familiar with
@@ -30,7 +30,7 @@ And then execute:
30
30
 
31
31
  $ bundle
32
32
 
33
- Or install it yourself as:
33
+ Or install it globally:
34
34
 
35
35
  $ gem install clubhouse_ruby
36
36
 
@@ -41,7 +41,7 @@ operates as an effective turing machine when lubricated with oil.
41
41
  ## Usage
42
42
 
43
43
  This gem is a lightweight API wrapper. That means you'll need to refer to the
44
- [API documentation](https://clubhouse.io/api/v1/) to figure out what resources
44
+ [API documentation](https://clubhouse.io/api/rest/v2/) to figure out what resources
45
45
  and actions exist.
46
46
 
47
47
  On the plus side, once you know what you want to do, using this gem should be
@@ -70,21 +70,33 @@ clubhouse.epics.list
70
70
  # code: "200",
71
71
  # status: "OK",
72
72
  # content: [
73
- # {
74
- # "id" => 1,
75
- # "name" => "An Odyssian Epic",
76
- # "description" => "Outrageously epic.",
77
- # "created_at" => "...",
78
- # "updated_at" => "...",
79
- # "deadline "=> nil,
80
- # "state" => "to do",
81
- # "position" => 1,
82
- # "archived" => false,
83
- # "follower_ids" => [...],
84
- # "owner_ids" => [...],
85
- # "comments" => [...]
86
- # }
87
- # ]
73
+ # {
74
+ # "entity_type" => "epic",
75
+ # "id" => 1,
76
+ # "external_id" => nil,
77
+ # "name" => "An Odyssian Epic",
78
+ # "description" => "Outrageously epic.",
79
+ # "created_at" => "...",
80
+ # "updated_at" => "...",
81
+ # "deadline "=> nil,
82
+ # "state" => "to do",
83
+ # "position" => 1,
84
+ # "started" => false,
85
+ # "started_at" => nil,
86
+ # "started_at_override" => nil,
87
+ # "completed" => false,
88
+ # "completed_at" => nil,
89
+ # "completed_at_override" => nil,
90
+ # "archived" => false,
91
+ # "labels" => [...],
92
+ # "milestone_id" => nil,
93
+ # "follower_ids" => [...],
94
+ # "owner_ids" => [...],
95
+ # "project_ids" => [...],
96
+ # "comments" => [...],
97
+ # "stats" => {...},
98
+ # }, ...
99
+ # ]
88
100
  # }
89
101
  ```
90
102
 
@@ -97,18 +109,12 @@ clubhouse.epics.create(name: "My New Epic", state: "to do")
97
109
  # code: "201",
98
110
  # status: "Created",
99
111
  # content: {
112
+ # "entity_type" => "epic",
100
113
  # "id" => 2,
114
+ # "extenal_id" => nil,
101
115
  # "name" => "My New Epic",
102
116
  # "description" => "",
103
- # "created_at" => "...",
104
- # "updated_at" => "...",
105
- # "deadline" => nil,
106
- # "state" => "to do",
107
- # "position" => 2,
108
- # "archived" => false,
109
- # "follower_ids" => [],
110
- # "owner_ids" => [],
111
- # "comments" => []
117
+ # ...
112
118
  # }
113
119
  # }
114
120
  ```
@@ -125,38 +131,18 @@ clubhouse.projects(<project_id>).stories.list
125
131
  # status: "OK",
126
132
  # content: [
127
133
  # {
134
+ # "entity_type" => "story",
128
135
  # "archived" => false,
129
136
  # "created_at" => "...",
137
+ # "updated_at" => "...",
130
138
  # "id" => 1,
139
+ # "external_id" => nil,
131
140
  # "name" => "Rescue Prince",
132
141
  # "story_type" => "feature",
133
142
  # "description" => "The prince is trapped in a tower and needs freeing.",
134
143
  # "position" => 1,
135
- # "workflow_state_id" => "...",
136
- # "estimate" => 0,
137
- # "updated_at" => "...",
138
- # "deadline" => nil,
139
- # "project_id" => <project_id>,
140
- # "labels" => [
141
- # {
142
- # "id" => "...",
143
- # "name" => "Urgent",
144
- # "created_at" => "...",
145
- # "updated_at" => "..."
146
- # }
147
- # ],
148
- # "requested_by_id" => "...",
149
- # "owner_ids" => [...],
150
- # "follower_ids" => [...],
151
- # "epic_id" => "...",
152
- # "file_ids" => [...],
153
- # "linked_file_ids" => [...],
154
- # "comments" => [...],
155
- # "tasks" => [...],
156
- # "story_links" => [...]
157
- # },
158
- # {...},
159
- # {...}
144
+ # ...
145
+ # }, ...
160
146
  # ]
161
147
  # }
162
148
  ```
@@ -209,21 +195,21 @@ clubhouse.epics.list
209
195
  ```
210
196
 
211
197
  Arbitrary combinations of resources not building a path that matches a url the
212
- API knows about will fail. Note the clubhouse API gives little away, returning
213
- forbidden:
198
+ API knows about will fail.
214
199
 
215
200
  ```ruby
216
201
  clubhouse.epics(epic_id).stories.list
217
202
  # => {
218
- # code: "403",
219
- # status: "Forbidden",
203
+ # code: "404",
204
+ # status: "Not Found",
220
205
  # content: {
221
- # "message" => "Sorry, you do not have access to this resource.",
222
- # "tag" => "user_denied_access"
206
+ # "message" => "Page not Found"
223
207
  # }
224
208
  # }
225
209
  ```
226
210
 
211
+ Note: the v1 API returns forbidden rather than not found.
212
+
227
213
  Attempting to access a nested resource without providing the parent id as an
228
214
  argument is a bad request:
229
215
 
@@ -246,6 +232,12 @@ clubhouse.projects.stories.list
246
232
  # }
247
233
  ```
248
234
 
235
+ ## Version
236
+
237
+ The currenet version of the clubhouse_ruby gem supports the current version of
238
+ the API, version 2. If you want something that definitely works with v1, use
239
+ version 0.2.0 of clubhouse_ruby.
240
+
249
241
  ## Development
250
242
 
251
243
  After checking out the repo, run `bin/setup` to install dependencies and
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Philip Castiglione"]
10
10
  spec.email = ["philipcastiglione@gmail.com"]
11
11
 
12
- spec.summary = %q{A lightweight ruby wrapper for the Clubhouse API: https://clubhouse.io/api/v1}
12
+ spec.summary = %q{A lightweight Ruby wrapper for the Clubhouse REST API.}
13
13
  spec.homepage = "https://github.com/PhilipCastiglione/clubhouse_ruby"
14
14
  spec.license = "MIT"
15
15
 
@@ -2,7 +2,7 @@ require 'json'
2
2
  require 'csv'
3
3
 
4
4
  module ClubhouseRuby
5
- API_URL = "https://api.clubhouse.io/api/v1/".freeze
5
+ API_URL = "https://api.clubhouse.io/api/v2/".freeze
6
6
 
7
7
  # Response formats the clubhouse api knows about
8
8
  FORMATS = {
@@ -27,25 +27,23 @@ module ClubhouseRuby
27
27
 
28
28
  # These are the resource for the clubhouse api and can form part of the path
29
29
  RESOURCES = [
30
+ :categories,
30
31
  :epics,
31
32
  :files,
32
33
  :labels,
33
34
  :linked_files,
35
+ :members,
36
+ :milestones,
34
37
  :projects,
35
- :story_links,
38
+ :repositories,
36
39
  :stories,
37
- :tasks,
38
- :comments,
39
- :users,
40
+ :story_links,
41
+ :teams,
40
42
  :workflows
41
43
  ].freeze
42
44
 
43
45
  # These are the annoying edge cases in the clubhouse api that are don't fit
44
46
  EXCEPTIONS = {
45
- search: {
46
- path: :search,
47
- action: :Post
48
- },
49
47
  bulk_create: {
50
48
  path: :bulk,
51
49
  action: :Post
@@ -16,7 +16,7 @@ module ClubhouseRuby
16
16
  #
17
17
  # This example will execute a call to:
18
18
  #
19
- # `https://api.clubhouse.io/api/v1/stories/{story-id}/comments/{comment-id}`
19
+ # `https://api.clubhouse.io/api/v2/stories/{story-id}/comments/{comment-id}`
20
20
  #
21
21
  # with arguments:
22
22
  #
@@ -50,9 +50,9 @@ module ClubhouseRuby
50
50
  # We'd better not lie when asked.
51
51
  #
52
52
  def respond_to_missing?(name, include_private = false)
53
- ACTIONS.keys.include?(name) ||
54
- RESOURCES.include?(name) ||
55
- EXCEPTIONS.keys.include?(name) ||
53
+ known_action?(name) ||
54
+ known_resource?(name) ||
55
+ known_exception?(name) ||
56
56
  super
57
57
  end
58
58
 
@@ -1,3 +1,3 @@
1
1
  module ClubhouseRuby
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clubhouse_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Castiglione
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-25 00:00:00.000000000 Z
11
+ date: 2017-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,8 +136,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
136
  version: '0'
137
137
  requirements: []
138
138
  rubyforge_project:
139
- rubygems_version: 2.6.4
139
+ rubygems_version: 2.6.8
140
140
  signing_key:
141
141
  specification_version: 4
142
- summary: 'A lightweight ruby wrapper for the Clubhouse API: https://clubhouse.io/api/v1'
142
+ summary: A lightweight Ruby wrapper for the Clubhouse REST API.
143
143
  test_files: []