backlog4r 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.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +86 -0
- data/Rakefile +1 -0
- data/backlog4r.gemspec +27 -0
- data/lib/backlog4r/version.rb +3 -0
- data/lib/backlog4r.rb +32 -0
- data/spec/backlog_spec.rb +11 -0
- data/spec/spec_helper.rb +2 -0
- metadata +154 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Keisuke Futonaka
|
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,86 @@
|
|
1
|
+
# Backlog4r
|
2
|
+
|
3
|
+
Under Development
|
4
|
+
|
5
|
+
This gem is the interface for WebAPI of Backlog.
|
6
|
+
* Backlog API
|
7
|
+
http://www.backlog.jp/api/
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'backlog4r'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install backlog4r
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
### Create api client
|
26
|
+
|
27
|
+
backlog = Backlog4r::Backlog.new("space_name", "user_id", "password")
|
28
|
+
|
29
|
+
### Get projects
|
30
|
+
|
31
|
+
backlog.get_projects
|
32
|
+
=> [{"use_parent_child_issue"=>false,
|
33
|
+
"id"=>100,
|
34
|
+
"text_formatting_rule"=>"backlog",
|
35
|
+
"archived"=>false,
|
36
|
+
"name"=>"Project Name",
|
37
|
+
"url"=>"https://space_name.backlog.jp/projects/PRJ",
|
38
|
+
"key"=>"PRJ"},
|
39
|
+
{"use_parent_child_issue"=>false,
|
40
|
+
"id"=>101,
|
41
|
+
"text_formatting_rule"=>"backlog",
|
42
|
+
"archived"=>false,
|
43
|
+
"name"=>"Project Name2",
|
44
|
+
"url"=>"https://space_name.backlog.jp/projects/PRJ2",
|
45
|
+
"key"=>"PRJ2"}]
|
46
|
+
|
47
|
+
### Get a project
|
48
|
+
|
49
|
+
backlog.get_project "project_key"
|
50
|
+
or
|
51
|
+
backlog.get_project 100 # project id
|
52
|
+
=> [{"use_parent_child_issue"=>false,
|
53
|
+
"id"=>100,
|
54
|
+
"text_formatting_rule"=>"backlog",
|
55
|
+
"archived"=>false,
|
56
|
+
"name"=>"Project Name",
|
57
|
+
"url"=>"https://space_name.backlog.jp/projects/PRJ",
|
58
|
+
"key"=>"PRJ"}]
|
59
|
+
|
60
|
+
### Get issue
|
61
|
+
|
62
|
+
It can be provided finding conditions by hash.
|
63
|
+
|
64
|
+
backlog.find_issue({ projectId: 100, statusId: 2 })
|
65
|
+
=> [{"custom_fields"=> {},
|
66
|
+
"summary"=>"Issue Summary",
|
67
|
+
"estimated_hours"=>3.0,
|
68
|
+
.
|
69
|
+
.
|
70
|
+
.
|
71
|
+
"key"=>"PRJ-10"}]
|
72
|
+
|
73
|
+
### Create issue
|
74
|
+
|
75
|
+
It can be provided create conditions by hash.
|
76
|
+
|
77
|
+
backlog.createIssue({projectId: 100, summary: "create issue"})
|
78
|
+
=> {"summary"=>"create test",
|
79
|
+
"id"=>1001,
|
80
|
+
"created_user"=>{"id"=>900, "name"=>"user name"},
|
81
|
+
"status"=>{"id"=>1, "name"=>"未対応"},
|
82
|
+
.
|
83
|
+
.
|
84
|
+
.
|
85
|
+
"key"=>"PRJ-1"}
|
86
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/backlog4r.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'backlog4r/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "backlog4r"
|
8
|
+
spec.version = Backlog4r::VERSION
|
9
|
+
spec.authors = ["Keisuke Futonaka"]
|
10
|
+
spec.email = ["futonaka@gmail.com"]
|
11
|
+
spec.description = %q{WebAPI interface for backlog.jp}
|
12
|
+
spec.summary = %q{WebAPI interface for backlog.jp}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
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_dependency "activesupport"
|
22
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
23
|
+
spec.add_development_dependency "rake"
|
24
|
+
spec.add_development_dependency "pry"
|
25
|
+
spec.add_development_dependency "rspec"
|
26
|
+
spec.add_development_dependency "webmock"
|
27
|
+
end
|
data/lib/backlog4r.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "backlog4r/version"
|
2
|
+
require "uri"
|
3
|
+
require "xmlrpc/client"
|
4
|
+
require "active_support/core_ext"
|
5
|
+
|
6
|
+
module Backlog4r
|
7
|
+
class Backlog < XMLRPC::Client::Proxy
|
8
|
+
def initialize(space_name, user_id, password)
|
9
|
+
space_uri = URI.parse("https://#{space_name}.backlog.jp/XML-RPC")
|
10
|
+
proxy_host = proxy_port = nil
|
11
|
+
use_ssl = true
|
12
|
+
timeout = 5
|
13
|
+
|
14
|
+
server = XMLRPC::Client.new(space_uri.host,
|
15
|
+
space_uri.path,
|
16
|
+
space_uri.port,
|
17
|
+
proxy_host,
|
18
|
+
proxy_port,
|
19
|
+
user_id,
|
20
|
+
password,
|
21
|
+
use_ssl,
|
22
|
+
timeout,
|
23
|
+
)
|
24
|
+
super(server, "backlog")
|
25
|
+
end
|
26
|
+
|
27
|
+
def method_missing(action, *args)
|
28
|
+
action = action.to_s.camelize(:lower).to_sym
|
29
|
+
super
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "backlog4r"
|
3
|
+
|
4
|
+
describe Backlog4r::Backlog do
|
5
|
+
context "when initialized valid conditions" do
|
6
|
+
subject { Backlog4r::Backlog.new("space", "user", "pass")}
|
7
|
+
|
8
|
+
it { should be_an_instance_of Backlog4r::Backlog }
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: backlog4r
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Keisuke Futonaka
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-06-20 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '1.3'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '1.3'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: pry
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: webmock
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
description: WebAPI interface for backlog.jp
|
111
|
+
email:
|
112
|
+
- futonaka@gmail.com
|
113
|
+
executables: []
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files: []
|
116
|
+
files:
|
117
|
+
- .gitignore
|
118
|
+
- Gemfile
|
119
|
+
- LICENSE.txt
|
120
|
+
- README.md
|
121
|
+
- Rakefile
|
122
|
+
- backlog4r.gemspec
|
123
|
+
- lib/backlog4r.rb
|
124
|
+
- lib/backlog4r/version.rb
|
125
|
+
- spec/backlog_spec.rb
|
126
|
+
- spec/spec_helper.rb
|
127
|
+
homepage: ''
|
128
|
+
licenses:
|
129
|
+
- MIT
|
130
|
+
post_install_message:
|
131
|
+
rdoc_options: []
|
132
|
+
require_paths:
|
133
|
+
- lib
|
134
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
135
|
+
none: false
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
141
|
+
none: false
|
142
|
+
requirements:
|
143
|
+
- - ! '>='
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
requirements: []
|
147
|
+
rubyforge_project:
|
148
|
+
rubygems_version: 1.8.23
|
149
|
+
signing_key:
|
150
|
+
specification_version: 3
|
151
|
+
summary: WebAPI interface for backlog.jp
|
152
|
+
test_files:
|
153
|
+
- spec/backlog_spec.rb
|
154
|
+
- spec/spec_helper.rb
|