senju 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/senju +7 -1
- data/lib/senju.rb +3 -0
- data/lib/senju/issue.rb +18 -1
- data/lib/senju/repository.rb +1 -0
- data/lib/senju/trello.rb +34 -0
- data/lib/senju/version.rb +1 -1
- data/senju.gemspec +4 -2
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 950b69518e62b88beabe2c43517cfcba289b6ba9005a415203685f5aefbb153f
|
4
|
+
data.tar.gz: cdc76ba61623367c731390092e35e93bb1fd6b47b1aa9128e1b570efbf2ae0ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2a6fa9374729c555b90f3d5b8dcb060878de08e31b2612814d4b8e7d77927edf5f0aff5903d0c4bc805576e6faa0f619b99e57d802370413368dd28868d6cec
|
7
|
+
data.tar.gz: 5a5b12034cdb28c6ef5896662ef57609dd75957be1d1793df64a0c150bf60388454164fadbdce95f991d6a8a199e746f882d7275a5f70720eb0124f3f5082a64
|
data/exe/senju
CHANGED
@@ -13,7 +13,13 @@ def link_to(text, url)
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def print_issue(issue)
|
16
|
-
print link_to("##{issue.no} ".colorize(:blue).bold, issue.url) + issue.title
|
16
|
+
print link_to("##{issue.no} ".colorize(:blue).bold, issue.url) + issue.title
|
17
|
+
if issue.labels.length != 0
|
18
|
+
issue.labels.each do |label|
|
19
|
+
print " [#{label}]".colorize(:light_blue)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
print "\n"
|
17
23
|
end
|
18
24
|
|
19
25
|
def color_patch(patch)
|
data/lib/senju.rb
CHANGED
data/lib/senju/issue.rb
CHANGED
@@ -8,7 +8,23 @@ class Senju::Issue
|
|
8
8
|
def method_missing(method, *args, &block)
|
9
9
|
case type
|
10
10
|
when "github" then @raw[method]
|
11
|
-
when "gitlab" then @raw.send(method)
|
11
|
+
when "gitlab", "trello" then @raw.send(method)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def labels
|
16
|
+
case type
|
17
|
+
when "github" then super.map(&:name)
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def title
|
24
|
+
case type
|
25
|
+
when "trello" then name
|
26
|
+
else
|
27
|
+
super
|
12
28
|
end
|
13
29
|
end
|
14
30
|
|
@@ -16,6 +32,7 @@ class Senju::Issue
|
|
16
32
|
case type
|
17
33
|
when "github" then @raw["number"]
|
18
34
|
when "gitlab" then @raw.iid
|
35
|
+
when "trello" then @raw.short_id
|
19
36
|
end
|
20
37
|
end
|
21
38
|
|
data/lib/senju/repository.rb
CHANGED
data/lib/senju/trello.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'trello'
|
2
|
+
class Senju::Trello
|
3
|
+
attr_reader :client
|
4
|
+
|
5
|
+
def initialize(params)
|
6
|
+
@client = Trello::Client.new(
|
7
|
+
consumer_key: params["key"],
|
8
|
+
consumer_secret: params["secret"],
|
9
|
+
oauth_token: params["token"]
|
10
|
+
)
|
11
|
+
end
|
12
|
+
|
13
|
+
def method_missing(method, *args, &block)
|
14
|
+
client.send(method, *args, &block)
|
15
|
+
end
|
16
|
+
|
17
|
+
def board(repo)
|
18
|
+
client.find(:boards, repo)
|
19
|
+
end
|
20
|
+
|
21
|
+
def columns(repo)
|
22
|
+
board(repo).lists
|
23
|
+
end
|
24
|
+
|
25
|
+
def issues(repo)
|
26
|
+
cards = []
|
27
|
+
columns(repo).each do |column|
|
28
|
+
column.cards.each do |card|
|
29
|
+
cards << card
|
30
|
+
end
|
31
|
+
end
|
32
|
+
cards
|
33
|
+
end
|
34
|
+
end
|
data/lib/senju/version.rb
CHANGED
data/senju.gemspec
CHANGED
@@ -31,8 +31,10 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_dependency "octokit", "~> 4.9
|
35
|
-
spec.add_dependency "gitlab", "~> 4.5
|
34
|
+
spec.add_dependency "octokit", "~> 4.9"
|
35
|
+
spec.add_dependency "gitlab", "~> 4.5"
|
36
|
+
spec.add_dependency "ruby-trello", "~> 2.1"
|
37
|
+
|
36
38
|
spec.add_dependency "awesome_print"
|
37
39
|
spec.add_dependency "colorize"
|
38
40
|
spec.add_dependency "tty-markdown"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: senju
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira SUENAMI
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.9
|
19
|
+
version: '4.9'
|
20
20
|
type: :runtime
|
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: 4.9
|
26
|
+
version: '4.9'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gitlab
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 4.5
|
33
|
+
version: '4.5'
|
34
34
|
type: :runtime
|
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: 4.5
|
40
|
+
version: '4.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: ruby-trello
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.1'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.1'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: awesome_print
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -161,6 +175,7 @@ files:
|
|
161
175
|
- lib/senju/gitlab.rb
|
162
176
|
- lib/senju/issue.rb
|
163
177
|
- lib/senju/repository.rb
|
178
|
+
- lib/senju/trello.rb
|
164
179
|
- lib/senju/version.rb
|
165
180
|
- senju.gemspec
|
166
181
|
homepage: https://github.com/mi2zq/senju
|