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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75d31c196c9ce12d447f1bdf6ec3ce69cbc579e573d20d993175a0217d10e941
4
- data.tar.gz: 556aceff1f2be393173c0f82a964663f589f5efcd6f974cfda5961d57d9128a0
3
+ metadata.gz: 950b69518e62b88beabe2c43517cfcba289b6ba9005a415203685f5aefbb153f
4
+ data.tar.gz: cdc76ba61623367c731390092e35e93bb1fd6b47b1aa9128e1b570efbf2ae0ac
5
5
  SHA512:
6
- metadata.gz: 0fe4c55775f59f0dac5e42439fe6123d1152fd4a6fefef974d946e3b265cc3899cd4605eda606ea072fb95706d494febaa08bff3be16beb694ef41f083338ad9
7
- data.tar.gz: bcd4bffc541d2796db03464647d68a43d513a851b2a85f30e5fa57acd473d72c7c8295a80ea0ced84a9adc6a12610044fe3d3a1f1e493ca14b239778d53a12e8
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 + "\n"
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
@@ -1,8 +1,11 @@
1
1
  require "senju/version"
2
2
  require "senju/credentials"
3
3
  require "senju/repository"
4
+
4
5
  require "senju/github"
5
6
  require "senju/gitlab"
7
+ require "senju/trello"
8
+
6
9
  require "senju/issue"
7
10
  require "senju/comment"
8
11
  require "senju/change"
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
 
@@ -39,6 +39,7 @@ class Senju::Repository
39
39
  case type
40
40
  when "github" then Senju::Github.new(credential)
41
41
  when "gitlab" then Senju::Gitlab.new(credential)
42
+ when "trello" then Senju::Trello.new(credential)
42
43
  end
43
44
  end
44
45
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Senju
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.3"
3
3
  end
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.0"
35
- spec.add_dependency "gitlab", "~> 4.5.0"
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.1
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.0
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.0
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.0
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.0
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