clubhouse.io-ruby 0.1.0

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f93cf2edd6cf7b164f2b67db7bb944d802a22ac4
4
+ data.tar.gz: 1fe18db6783c105df17cf32af22eeb36307bb5f3
5
+ SHA512:
6
+ metadata.gz: f6ad599058906edba43cbeeba98051d23fb79dfbe584e302041530d1b9b5da5e662c9ac2ef4646fd4feab8887f9c794655f2f45d6452e4b367f7fa8d719c53a2
7
+ data.tar.gz: eb840ce27bd493357226b2c152e5dab0d86fd3f7a78423b08f90b012afd04e6523f7c99abeb5163089315ea3d7ee1cfa6a91def57a3c9f1a0c44f52251b003c6
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ vendor/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in clubhouse.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Jon Normington
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
13
+ all 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
21
+ THE SOFTWARE.
@@ -0,0 +1,70 @@
1
+ [![CircleCI](https://circleci.com/gh/jnormington/clubhouse.io-ruby.svg?style=svg)](https://circleci.com/gh/jnormington/clubhouse.io-ruby)
2
+
3
+ # Clubhouse
4
+
5
+ This gem provides a basic representation of the Clubhouse.io API.
6
+
7
+ If you don't know what [Clubhouse](https://clubhouse.io) is, I recommend you check it out, its an awesome project management system in its early days and can only get better.
8
+
9
+ Their API documentation is at the following address [https://clubhouse.io/api/v1/](https://clubhouse.io/api/v1/) as you will need it for reference.
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'clubhouse.io-ruby'
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ $ bundle
22
+
23
+ Or install it yourself as:
24
+
25
+ $ gem install clubhouse.io-ruby
26
+
27
+ ## Usage
28
+
29
+ ### Setting up a client
30
+
31
+ Before we start its best to setup a default client if you are just using it with only one token.
32
+
33
+ You can generate a token for clubhouse by going to the account section and generating a new token
34
+
35
+ ```ruby
36
+ Clubhouse.default_client = Clubhouse::Client.new('YOUR_TOKEN_HERE')
37
+ ```
38
+
39
+ Now we are ready to start creating stories. In its basic form this is how you create a story
40
+
41
+ This will create a new story in the first project that is returned from the API in the all projects request.
42
+
43
+ ```ruby
44
+ story = Clubhouse::Story.new(name:'My Story', project_id: Clubhouse::Project.all.first.id)
45
+ story.save
46
+ ```
47
+
48
+ You can check out all the other docs on other resources with examples [here](doc)
49
+
50
+ * [Epics](docs/epics.md)
51
+ * [Files](docs/files.md)
52
+ * [Labels](docs/labels.md)
53
+ * [Linked-Files](docs/linked_files.md)
54
+ * [Projects](docs/projects.md)
55
+ * [Story-Links](docs/story_links.md)
56
+ * [Stories](docs/stories.md)
57
+ * [Comments](docs/comments.md)
58
+ * [Tasks](docs/tasks.md)
59
+ * [Users](docs/users.md)
60
+ * [Workflows](docs/workflows.md)
61
+
62
+
63
+ ## Contributing
64
+
65
+ Bug reports and/or pull requests are welcome
66
+
67
+
68
+ ## License
69
+
70
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT)
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "clubhouse"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'clubhouse/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "clubhouse.io-ruby"
8
+ spec.version = Clubhouse::VERSION
9
+ spec.authors = ["Jon Normington"]
10
+ spec.email = ["jnormington@users.noreply.github.com"]
11
+
12
+ spec.summary = %q{Clubhouse.io ruby gem for the API}
13
+ spec.description = "A basic ruby gem for interacting with the Clubhouse.io API"
14
+ spec.homepage = "https://github.com/jnormington/clubhouse.io-ruby"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+ spec.require_paths = ["lib"]
21
+
22
+ spec.add_development_dependency "bundler", "~> 1.12"
23
+ spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "rspec", "~> 3.0"
25
+ spec.add_development_dependency "webmock", "~>2.1"
26
+ end
@@ -0,0 +1,64 @@
1
+ # Comments
2
+
3
+ This assumes that you have setup the default client, or will inject your own client.
4
+
5
+ It is recommended to create comments from a story object as described [here](stories.md)
6
+
7
+ ## Creating
8
+
9
+ ```ruby
10
+ comment = Clubhouse::Comment.new(
11
+ story_id: 34,
12
+ text: 'My comment'
13
+ )
14
+
15
+ comment.save
16
+ ```
17
+
18
+ Once saved the comment object will be reloaded with the response from clubhouse so now your new
19
+ object will have the created_at and updated_at time that is returned from the API.
20
+
21
+ ### Required Fields
22
+ * story_id
23
+ * text
24
+
25
+
26
+ ## Updating
27
+
28
+ ```ruby
29
+ comment = Clubhouse::Comment.find(34, 8)
30
+
31
+ comment.text = "Updated comment"
32
+ comment.save # Save works for both creating and updating
33
+
34
+ => <#Clubhouse::Comment... >
35
+
36
+ ```
37
+
38
+ ## Finding by id
39
+
40
+ Finding a comment is different to all other resources the find method takes two arguments
41
+
42
+ * story_id
43
+ * comment_id
44
+
45
+ ```ruby
46
+ comment = Clubhouse::Comment.find(34, 8)
47
+
48
+ => #<Clubhouse::Comment:0x007ffcd58002d0 @text="Updated comment", @id=8 ... >
49
+ ```
50
+
51
+ ## Deleting by id
52
+
53
+ Deleting a comment is different to all other resources the delete method takes two arguments
54
+
55
+ * story_id
56
+ * comment_id
57
+
58
+ When an empty hash is returned this means it was successfull otherwise it will raise an exception
59
+
60
+ ```ruby
61
+ Clubhouse::Comment.delete(34, 8)
62
+
63
+ => {}
64
+ ```
@@ -0,0 +1,64 @@
1
+ # Epics
2
+
3
+ This assumes that you have setup the default client, or will inject your own client.
4
+
5
+ ## Creating
6
+
7
+ ```ruby
8
+ epic = Clubhouse::Epic.new(
9
+ name: "Epic One",
10
+ description: 'Epic description',
11
+ state: 'in progress'
12
+ )
13
+
14
+ epic.save
15
+ ```
16
+
17
+ Once saved the epic object will be reloaded with the response from clubhouse so now your new
18
+ object will have the created_at and updated_at time that is returned from the API.
19
+
20
+ ### Required Fields
21
+ * name
22
+
23
+
24
+ ## Updating
25
+
26
+ ```ruby
27
+ epic = Clubhouse::Epic.new(name: "Epic One").save
28
+
29
+ epic.state = 'in progress'
30
+ epic.save # Save works for both creating and updating
31
+
32
+ => <#Clubhouse::Epic... >
33
+
34
+ ```
35
+
36
+ ## Finding by id
37
+
38
+ ```ruby
39
+ epic = Clubhouse::Epic.find(3)
40
+
41
+ => #<Clubhouse::Epic:0x007ffcd58002d0 @state='to do', @id=3 ... >
42
+ ```
43
+
44
+ ## Deleting by id
45
+
46
+ When an empty hash is returned this means it was successfull otherwise it will raise an exception
47
+
48
+ ```ruby
49
+ Clubhouse::Epic.delete(3)
50
+
51
+ => {}
52
+ ```
53
+
54
+ ## Listing
55
+
56
+ Returns a list of all epics
57
+
58
+ ```ruby
59
+ Clubhouse::Epic.all
60
+
61
+ => [#<Clubhouse::Epic:0x007fb1422da640 @archived=false, @created_at="2016-08-31T22:53:47Z",
62
+ @deadline=nil, @description="", @external_id=nil, @follower_ids=[], @name="Epic One", @owner_ids=[],
63
+ @state="to do", @updated_at="2016-09-24T16:31:50Z", @id=11, @comments=[], @position=0>]
64
+ ```
@@ -0,0 +1,48 @@
1
+ # Files
2
+
3
+ This assumes that you have setup the default client, or will inject your own client.
4
+
5
+ ## Creating
6
+
7
+ You are unable to create files but can create linked files [here](linked_files.md)
8
+
9
+ ## Updating
10
+
11
+ ```ruby
12
+ file = Clubhouse::File.find(12)
13
+
14
+ file.name = 'New file name'
15
+ file.description = 'File description'
16
+ file.save
17
+
18
+ => <#Clubhouse::File... >
19
+
20
+ ```
21
+
22
+ ## Finding by id
23
+
24
+ ```ruby
25
+ file = Clubhouse::File.find(12)
26
+
27
+ => #<Clubhouse::File:0x007ffcd58002d0 @name='Screenshot 1', @id=12 ... >
28
+ ```
29
+
30
+ ## Deleting by id
31
+
32
+ When an empty hash is returned this means it was successfull otherwise it will raise an exception
33
+
34
+ ```ruby
35
+ Clubhouse::File.delete(12)
36
+
37
+ => {}
38
+ ```
39
+
40
+ ## Listing
41
+
42
+ Returns a list of all files uploaded via cllubhouse web
43
+
44
+ ```ruby
45
+ Clubhouse::File.all
46
+
47
+ => [#<Clubhouse::File:0x007fb1422b0a98 @created_at="2016-09-24T16:38:04Z", @description=nil, @external_id=nil, @name="Screenshot 1"...>]
48
+ ```
@@ -0,0 +1,49 @@
1
+ # Labels
2
+
3
+ This assumes that you have setup the default client, or will inject your own client.
4
+
5
+ ## Creating
6
+
7
+ ```ruby
8
+ label = Clubhouse::Label.new(name: "Label One")
9
+ label.save
10
+ ```
11
+
12
+ Once saved the label object will be reloaded with the response from clubhouse so now your new
13
+ object will have the created_at and updated_at time that is returned from the API.
14
+
15
+ ### Required Fields
16
+ * name
17
+
18
+
19
+ ## Updating
20
+
21
+ ```ruby
22
+ label = Clubhouse::Label.find(8)
23
+
24
+ label.name = "Label updated"
25
+ label.save # Save works for both creating and updating
26
+
27
+ => <#Clubhouse::Label:0x007fb161230438 @name="Label updated" ... >
28
+
29
+ ```
30
+
31
+ ## Deleting by id
32
+
33
+ When an empty hash is returned this means it was successfull otherwise it will raise an exception
34
+
35
+ ```ruby
36
+ Clubhouse::Label.delete(8)
37
+
38
+ => {}
39
+ ```
40
+
41
+ ## Listing
42
+
43
+ Returns a list of all labels
44
+
45
+ ```ruby
46
+ Clubhouse::Label.all
47
+
48
+ => [#<Clubhouse::Label:0x007fb142440458 @name="PT"...>]
49
+ ```
@@ -0,0 +1,64 @@
1
+ # LinkedFiles
2
+
3
+ This assumes that you have setup the default client, or will inject your own client.
4
+
5
+ ## Creating
6
+
7
+ ```ruby
8
+ linked_file = Clubhouse::LinkedFile.new(
9
+ name: "LinkedFile One",
10
+ type: 'url',
11
+ url: 'https://dropbox.com/1/files/image.png'
12
+ )
13
+
14
+ linked_file.save
15
+ ```
16
+
17
+ Once saved the linked file object will be reloaded with the response from clubhouse so now your new
18
+ object will have the created_at and updated_at time that is returned from the API.
19
+
20
+ ### Required Fields
21
+ * name
22
+ * type (google, url, dropbox, box, onedrive)
23
+ * url
24
+
25
+
26
+ ## Updating
27
+
28
+ ```ruby
29
+ linked_file = Clubhouse::LinkedFile.find(23)
30
+
31
+ linked_file.thumbnail_url = 'https://dropbox.com/1/files/image.png?size=thumbnail'
32
+ linked_file.save # Save works for both creating and updating
33
+
34
+ => <#Clubhouse::LinkedFile... >
35
+
36
+ ```
37
+
38
+ ## Finding by id
39
+
40
+ ```ruby
41
+ linked_file = Clubhouse::LinkedFile.find(23)
42
+
43
+ => #<Clubhouse::LinkedFile:0x007ffcd58002d0 @url='https://dropbox.com/1/file/image.png', @id=23 ... >
44
+ ```
45
+
46
+ ## Deleting by id
47
+
48
+ When an empty hash is returned this means it was successfull otherwise it will raise an exception
49
+
50
+ ```ruby
51
+ Clubhouse::LinkedFile.delete(23)
52
+
53
+ => {}
54
+ ```
55
+
56
+ ## Listing
57
+
58
+ Returns a list of all linked files uploaded by the API
59
+
60
+ ```ruby
61
+ Clubhouse::LinkedFile.all
62
+
63
+ => [#<Clubhouse::LinkedFile:0x007fb142223508 @content_type="", @description="", @name="attachment0", @size=230, @story_id=nil, @thumbnail_u...>]
64
+ ```