clubhouse_ruby 0.2.0 → 0.7.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
- SHA1:
3
- metadata.gz: 99130661e8bef360cc89dc809b212764a013ed45
4
- data.tar.gz: 398600d53686e920fb38f95cd54955b000af0006
2
+ SHA256:
3
+ metadata.gz: 9d693312a99038c0ef59878c1eb02bac7357823f741f1b6fd19219352bcff92b
4
+ data.tar.gz: 0b608b34ae934a6e82ed82321f99ce9f56132b42e4f6392f686dc84a55c95dc5
5
5
  SHA512:
6
- metadata.gz: 2dcdc681c343e90ecebc0def690f3307d607ecf1ca38806aa696b2e4882a6801e869021682fde9ce656bacec5097dda58069ec63ef803c659a642751508afb0d
7
- data.tar.gz: 5502abcfcd208946601679d9125e2789b0645b22c104c688936d90aacb3a00cabb7c1558a82207a335cd38debcf048bf5330b22ac6ec82694f76add07d4e5eff
6
+ metadata.gz: 7b96dcef0e588c302bc889792e630671a65f24508e98e975a07ee9c5e58c4d82a2174b0f2ac15c55119ebe1fc76317d26ff0a710068e42e6ec095ad2c2d44935
7
+ data.tar.gz: a1713087da50913a4e8eb414b39d68590673ca594bffeb029172638d804a3fdd2f9a665e71db6ff6e91f5e691e86c10b01fa5f3165a88a1c36f0654857303a60
@@ -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/v3/).
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,10 +41,10 @@ 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/v3/) to figure out what resources
45
45
  and actions exist.
46
46
 
47
- On the plus side, once you know what you want to do, using this gem should be
47
+ On the plus side, once you know what you want to do, using this gem should be
48
48
  simple.
49
49
 
50
50
  Instantiate an object to interface with the API:
@@ -61,7 +61,7 @@ clubhouse = ClubhouseRuby::Clubhouse.new(<YOUR CLUBHOUSE API TOKEN>, response_fo
61
61
 
62
62
  Then, call methods on the object matching the resource(s) and action you are
63
63
  interested in. For example, if you want to list all available epics, you need to
64
- access the endpoint at https://api.clubhouse.io/api/v1/epics. The
64
+ access the endpoint at https://api.clubhouse.io/api/v1/epics. The
65
65
  clubhouse_ruby gem uses an explicit action:
66
66
 
67
67
  ```ruby
@@ -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,42 +131,44 @@ 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
  ```
163
149
 
150
+ You can search stories, using standard Clubhouse [search operators](https://help.clubhouse.io/hc/en-us/articles/360000046646-Search-Operators):
151
+
152
+ ```ruby
153
+ clubhouse.search_stories(page_size: 25, query: 'state:500000016')
154
+ # => {
155
+ # code: "200",
156
+ # status: "OK",
157
+ # content: {
158
+ # "next" => "/api/v3/search/stories?query=state%3A500000016&page_size=25&next=a8acc6577548df7a213272f7f9f617bcb1f8a831~24",
159
+ # "data" => [
160
+ # {
161
+ # "entity_type" => "story",
162
+ # "archived" => false,
163
+ # "created_at" => "...",
164
+ # "updated_at" => "...",
165
+ # ...
166
+ # }, ...
167
+ # ]
168
+ # }
169
+ # }
170
+ ```
171
+
164
172
  You can build a path in steps rather than all at once, and execution is deferred
165
173
  until the action call:
166
174
 
@@ -209,21 +217,21 @@ clubhouse.epics.list
209
217
  ```
210
218
 
211
219
  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:
220
+ API knows about will fail.
214
221
 
215
222
  ```ruby
216
223
  clubhouse.epics(epic_id).stories.list
217
224
  # => {
218
- # code: "403",
219
- # status: "Forbidden",
225
+ # code: "404",
226
+ # status: "Not Found",
220
227
  # content: {
221
- # "message" => "Sorry, you do not have access to this resource.",
222
- # "tag" => "user_denied_access"
228
+ # "message" => "Page not Found"
223
229
  # }
224
230
  # }
225
231
  ```
226
232
 
233
+ Note: the v1 API returns forbidden rather than not found.
234
+
227
235
  Attempting to access a nested resource without providing the parent id as an
228
236
  argument is a bad request:
229
237
 
@@ -246,6 +254,16 @@ clubhouse.projects.stories.list
246
254
  # }
247
255
  ```
248
256
 
257
+ ## Version
258
+
259
+ The current version of the clubhouse_ruby gem supports the current version of
260
+ the API, version 3.
261
+
262
+ If you want something that definitely works with:
263
+
264
+ * v1, use version 0.2.0 of clubhouse_ruby
265
+ * v2, use version 0.3.0 of clubhouse_ruby
266
+
249
267
  ## Development
250
268
 
251
269
  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
 
@@ -18,10 +18,10 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.12"
22
- spec.add_development_dependency "rake", "~> 10.0"
21
+ spec.add_development_dependency "bundler", "~> 2.1"
22
+ spec.add_development_dependency "rake", "~> 13.0"
23
23
  spec.add_development_dependency "rspec", "~> 3.0"
24
24
  spec.add_development_dependency "dotenv", "~> 2.1"
25
- spec.add_development_dependency "webmock", "~> 2.1"
26
- spec.add_development_dependency "vcr", "~> 3.0"
25
+ spec.add_development_dependency "webmock", "~> 3.7"
26
+ spec.add_development_dependency "vcr", "~> 6.0"
27
27
  end
@@ -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/v3/".freeze
6
6
 
7
7
  # Response formats the clubhouse api knows about
8
8
  FORMATS = {
@@ -27,25 +27,26 @@ 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,
33
+ :iterations,
32
34
  :labels,
33
35
  :linked_files,
36
+ :members,
37
+ :milestones,
34
38
  :projects,
35
- :story_links,
39
+ :repositories,
36
40
  :stories,
41
+ :story_links,
42
+ :teams,
43
+ :workflows,
37
44
  :tasks,
38
- :comments,
39
- :users,
40
- :workflows
45
+ :comments
41
46
  ].freeze
42
47
 
43
48
  # These are the annoying edge cases in the clubhouse api that are don't fit
44
49
  EXCEPTIONS = {
45
- search: {
46
- path: :search,
47
- action: :Post
48
- },
49
50
  bulk_create: {
50
51
  path: :bulk,
51
52
  action: :Post
@@ -53,6 +54,10 @@ module ClubhouseRuby
53
54
  bulk_update: {
54
55
  path: :bulk,
55
56
  action: :Put
57
+ },
58
+ search_stories: {
59
+ path: 'search/stories',
60
+ action: :Get
56
61
  }
57
62
  }.freeze
58
63
  end
@@ -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/v3/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.7.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.7.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: 2020-10-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.12'
19
+ version: '2.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.12'
26
+ version: '2.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '2.1'
75
+ version: '3.7'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '2.1'
82
+ version: '3.7'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: vcr
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '3.0'
89
+ version: '6.0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '3.0'
96
+ version: '6.0'
97
97
  description:
98
98
  email:
99
99
  - philipcastiglione@gmail.com
@@ -135,9 +135,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.6.4
138
+ rubygems_version: 3.0.3
140
139
  signing_key:
141
140
  specification_version: 4
142
- summary: 'A lightweight ruby wrapper for the Clubhouse API: https://clubhouse.io/api/v1'
141
+ summary: A lightweight Ruby wrapper for the Clubhouse REST API.
143
142
  test_files: []