zenhub_ruby 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/README.md +10 -4
- data/lib/zenhub_ruby.rb +5 -1
- data/lib/zenhub_ruby/client.rb +8 -5
- data/lib/zenhub_ruby/client/api.rb +6 -6
- data/lib/zenhub_ruby/connection.rb +1 -1
- data/lib/zenhub_ruby/github.rb +15 -0
- data/lib/zenhub_ruby/version.rb +3 -0
- data/zenhub_ruby.gemspec +2 -2
- metadata +16 -14
- data/.env.sample +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf5604f261a94ca08a4707fc261fce766a8c1d14
|
4
|
+
data.tar.gz: 8cd4002e430ca6350d73e058dc76da87425056b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee0aa1dabe2c5b08ba3e883857e05c298d1e588d6f83284ec05917d2186af0e606519b5db7ddfc4a85c6afcc047574830cce2ef5715b006b80b84b92fea9a401
|
7
|
+
data.tar.gz: 580b73608e8c6dfe933c6adfa794285b1b519e64dc3b642514665bccb2e02f4f9add1b6d7028898c4ed00bc4a241bac65e6dbc129e67231e5e26a79c61d3aa26
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -25,25 +25,31 @@ Or install it yourself as:
|
|
25
25
|
```ruby
|
26
26
|
require 'zenhub_ruby'
|
27
27
|
|
28
|
-
client = ZenhubRuby::Client.new('
|
28
|
+
client = ZenhubRuby::Client.new('ZENHUB_ACCESS_TOKEN', 'GITHUB_ACCESS_TOKEN')
|
29
|
+
```
|
30
|
+
|
31
|
+
or
|
32
|
+
|
33
|
+
```ruby
|
34
|
+
client = ZenhubRuby.new('ZENHUB_ACCESS_TOKEN', 'GITHUB_ACCESS_TOKEN')
|
29
35
|
```
|
30
36
|
|
31
37
|
### Get issue data
|
32
38
|
|
33
39
|
```ruby
|
34
|
-
client.issue_data(
|
40
|
+
client.issue_data('REPO_NAME(ex: "tkm-kj/zenhub_ruby")', ISSUE_NUMBER)
|
35
41
|
```
|
36
42
|
|
37
43
|
### Get issue events
|
38
44
|
|
39
45
|
```ruby
|
40
|
-
client.issue_events(
|
46
|
+
client.issue_events('REPO_NAME', ISSUE_NUMBER)
|
41
47
|
```
|
42
48
|
|
43
49
|
### Get the ZenHub Board data for a repository
|
44
50
|
|
45
51
|
```ruby
|
46
|
-
client.board_data(
|
52
|
+
client.board_data('REPO_NAME')
|
47
53
|
```
|
48
54
|
|
49
55
|
## Contributing
|
data/lib/zenhub_ruby.rb
CHANGED
data/lib/zenhub_ruby/client.rb
CHANGED
@@ -1,15 +1,18 @@
|
|
1
1
|
require 'zenhub_ruby/connection'
|
2
2
|
require 'zenhub_ruby/client/api'
|
3
|
+
require 'zenhub_ruby/github'
|
4
|
+
require 'zenhub_ruby/version'
|
3
5
|
|
4
6
|
module ZenhubRuby
|
5
7
|
class Client
|
6
|
-
include
|
7
|
-
include
|
8
|
+
include Connection
|
9
|
+
include Client::Api
|
8
10
|
|
9
|
-
attr_reader :
|
11
|
+
attr_reader :zenhub_access_token, :github
|
10
12
|
|
11
|
-
def initialize(
|
12
|
-
@
|
13
|
+
def initialize(zenhub_access_token, github_access_token)
|
14
|
+
@zenhub_access_token = zenhub_access_token
|
15
|
+
@github = ZenhubRuby::Github.new(github_access_token)
|
13
16
|
end
|
14
17
|
end
|
15
18
|
end
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module ZenhubRuby
|
2
2
|
class Client
|
3
3
|
module Api
|
4
|
-
def issue_data(
|
5
|
-
get "/p1/repositories/#{repo_id}/issues/#{issue_number}"
|
4
|
+
def issue_data(repo_name, issue_number)
|
5
|
+
get "/p1/repositories/#{github.repo_id(repo_name)}/issues/#{issue_number}"
|
6
6
|
end
|
7
7
|
|
8
|
-
def issue_events(
|
9
|
-
get "/p1/repositories/#{repo_id}/issues/#{issue_number}/events"
|
8
|
+
def issue_events(repo_name, issue_number)
|
9
|
+
get "/p1/repositories/#{github.repo_id(repo_name)}/issues/#{issue_number}/events"
|
10
10
|
end
|
11
11
|
|
12
|
-
def board_data(
|
13
|
-
get "/p1/repositories/#{repo_id}/board"
|
12
|
+
def board_data(repo_name)
|
13
|
+
get "/p1/repositories/#{github.repo_id(repo_name)}/board"
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
data/zenhub_ruby.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# coding: utf-8
|
2
2
|
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'zenhub_ruby'
|
4
|
+
require 'zenhub_ruby/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "zenhub_ruby"
|
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
|
|
21
21
|
|
22
22
|
spec.add_dependency "faraday"
|
23
23
|
spec.add_dependency "faraday_middleware"
|
24
|
+
spec.add_dependency 'octokit'
|
24
25
|
spec.add_development_dependency "bundler", "~> 1.11"
|
25
|
-
spec.add_development_dependency "dotenv"
|
26
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
27
27
|
spec.add_development_dependency "rspec"
|
28
28
|
spec.add_development_dependency "vcr"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zenhub_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takumi Kaji
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -39,33 +39,33 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: octokit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
48
|
-
type: :
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '1.11'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '1.11'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -129,7 +129,6 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
-
- ".env.sample"
|
133
132
|
- ".gitignore"
|
134
133
|
- ".rspec"
|
135
134
|
- Gemfile
|
@@ -139,6 +138,8 @@ files:
|
|
139
138
|
- lib/zenhub_ruby/client.rb
|
140
139
|
- lib/zenhub_ruby/client/api.rb
|
141
140
|
- lib/zenhub_ruby/connection.rb
|
141
|
+
- lib/zenhub_ruby/github.rb
|
142
|
+
- lib/zenhub_ruby/version.rb
|
142
143
|
- zenhub_ruby.gemspec
|
143
144
|
homepage: https://github.com/tkm-kj/zenhub_ruby
|
144
145
|
licenses:
|
@@ -165,3 +166,4 @@ signing_key:
|
|
165
166
|
specification_version: 4
|
166
167
|
summary: Ruby client of ZenHub API.
|
167
168
|
test_files: []
|
169
|
+
has_rdoc:
|
data/.env.sample
DELETED