blossom_api 0.0.1
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.
- checksums.yaml +7 -0
- data/.gitignore +14 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +42 -0
- data/Rakefile +2 -0
- data/blossom_api.gemspec +25 -0
- data/lib/blossom_api.rb +7 -0
- data/lib/blossom_api/project.rb +14 -0
- data/lib/blossom_api/project/card.rb +51 -0
- data/lib/blossom_api/version.rb +3 -0
- metadata +97 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9bacbd57c0e7030e7853c7310fc77ae6535dde47
|
4
|
+
data.tar.gz: 5e06834dd9e4fe2427abb16fe54cb6fdb4cba760
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ccdc95866db77dd5a65191ce9b5bef3f00c26f48f39ea83e5b4d4be6d7b411f4428ddd690cddad24079c18107c2d17cc4c2139b30093c6e5dcc2ac9b27fdede5
|
7
|
+
data.tar.gz: 23702b23eba21a9f8d54d5b0742f57d1c22078cf19479b653338c7cd1ed6cae353c15dce559cc02b8a3f6996f44bc3ae3fc69f6d2b8c31ee47d91042c4ea9512
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2015 John Pinkerton
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# BlossomApi
|
2
|
+
|
3
|
+
Ruby wrapper for the [Blossom](http://blossom.io) API.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'blossom_api'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install blossom_api
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
my_project = BlossomApi::Project.new(
|
25
|
+
organization_id: 'xxx',
|
26
|
+
project_id: 'xxx',
|
27
|
+
access_token: 'xxx'
|
28
|
+
)
|
29
|
+
|
30
|
+
my_project.create_card 'New feature', 'Description of the feature'
|
31
|
+
```
|
32
|
+
|
33
|
+
More features to come...
|
34
|
+
|
35
|
+
|
36
|
+
## Contributing
|
37
|
+
|
38
|
+
1. Fork it ( https://github.com/[my-github-username]/blossom_api/fork )
|
39
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
40
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
41
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
42
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
data/blossom_api.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'blossom_api/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "blossom_api"
|
8
|
+
spec.version = BlossomApi::VERSION
|
9
|
+
spec.authors = ["John Pinkerton"]
|
10
|
+
spec.email = ["jpinkerton88@gmail.com"]
|
11
|
+
spec.summary = %q{Ruby wrapper for Blossom API.}
|
12
|
+
spec.description = %q{}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
+
|
24
|
+
spec.add_dependency "httparty", "~> 0.13.3"
|
25
|
+
end
|
data/lib/blossom_api.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module BlossomApi
|
2
|
+
class Project
|
3
|
+
require "blossom_api/project/card"
|
4
|
+
|
5
|
+
def initialize(options = {})
|
6
|
+
@organization_id = options[:organization_id]
|
7
|
+
@project_id = options[:project_id]
|
8
|
+
@access_token = options[:access_token]
|
9
|
+
end
|
10
|
+
|
11
|
+
include BlossomApi::Project::Card
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module BlossomApi
|
2
|
+
class Project
|
3
|
+
module Card
|
4
|
+
|
5
|
+
def create_card(title, description)
|
6
|
+
title_response = post_card_title(title)
|
7
|
+
if title_response.code == 200
|
8
|
+
description_response = patch_card_description(title_response['id'], description)
|
9
|
+
if description_response.code == 200
|
10
|
+
return true
|
11
|
+
else
|
12
|
+
return false
|
13
|
+
end
|
14
|
+
else
|
15
|
+
return false
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def post_card_title(title)
|
22
|
+
HTTParty.post(create_card_url, body: create_card_options(title), headers: json_headers)
|
23
|
+
end
|
24
|
+
|
25
|
+
def patch_card_description(card_id, description)
|
26
|
+
HTTParty.patch(update_description_url(card_id), body: update_description_options(description), headers: json_headers)
|
27
|
+
end
|
28
|
+
|
29
|
+
def create_card_url
|
30
|
+
"#{BASE_URL}/cards/create_card?id=#{@organization_id}&accessToken=#{@access_token}"
|
31
|
+
end
|
32
|
+
|
33
|
+
def update_description_url(card_id)
|
34
|
+
"#{BASE_URL}/cards/#{card_id}?accessToken=#{@access_token}"
|
35
|
+
end
|
36
|
+
|
37
|
+
def create_card_options(title)
|
38
|
+
{ projectId: @project_id, title: title}.to_json
|
39
|
+
end
|
40
|
+
|
41
|
+
def update_description_options(description)
|
42
|
+
{ description: description }.to_json
|
43
|
+
end
|
44
|
+
|
45
|
+
def json_headers
|
46
|
+
{ 'Content-Type' => 'application/json' }
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
metadata
ADDED
@@ -0,0 +1,97 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: blossom_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Pinkerton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-02-14 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.13.3
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.13.3
|
55
|
+
description: ''
|
56
|
+
email:
|
57
|
+
- jpinkerton88@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- blossom_api.gemspec
|
68
|
+
- lib/blossom_api.rb
|
69
|
+
- lib/blossom_api/project.rb
|
70
|
+
- lib/blossom_api/project/card.rb
|
71
|
+
- lib/blossom_api/version.rb
|
72
|
+
homepage: ''
|
73
|
+
licenses:
|
74
|
+
- MIT
|
75
|
+
metadata: {}
|
76
|
+
post_install_message:
|
77
|
+
rdoc_options: []
|
78
|
+
require_paths:
|
79
|
+
- lib
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
81
|
+
requirements:
|
82
|
+
- - ">="
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '0'
|
85
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
requirements: []
|
91
|
+
rubyforge_project:
|
92
|
+
rubygems_version: 2.4.5
|
93
|
+
signing_key:
|
94
|
+
specification_version: 4
|
95
|
+
summary: Ruby wrapper for Blossom API.
|
96
|
+
test_files: []
|
97
|
+
has_rdoc:
|