t1k 2.0.4 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/T1000 +25 -0
- data/lib/t1k/command.rb +6 -1
- data/lib/t1k/commands/hack.rb +3 -3
- data/lib/t1k/trackers/none.rb +2 -2
- data/lib/t1k/trackers/trello.rb +6 -4
- data/lib/t1k/version.rb +1 -1
- data/lib/t1k.rb +2 -2
- data/t1k-2.1.0.gem +0 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b2e07a23e43b7e1fcc356ee9072a5375a8034a1
|
4
|
+
data.tar.gz: f6748165b70ae6e4f12356f0dedaf05e0f104b51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9900284a431c46e1fac3aeebda92f969632915dc1c467b6e79bb792696e69299118c313f32669809fe31f1b28ee2869446e9b5319db26550515fdcc60d4751a
|
7
|
+
data.tar.gz: ed2bca3ab43b6d5824da46615fdd037f283889ed23a3cd6e6b745b4684f63635fb6d90cdc22e279ba5c87fb5dbb1c308e5dfce5d7414743ed0c82033573486ef
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
t1k (2.0
|
4
|
+
t1k (2.1.0)
|
5
5
|
activesupport (~> 4.2)
|
6
|
-
clive
|
6
|
+
clive (~> 1.2.1)
|
7
7
|
github_api (~> 0.12)
|
8
8
|
ruby-trello (~> 1.2.1)
|
9
9
|
|
@@ -20,8 +20,8 @@ GEM
|
|
20
20
|
thread_safe (~> 0.3, >= 0.3.4)
|
21
21
|
tzinfo (~> 1.1)
|
22
22
|
addressable (2.3.8)
|
23
|
-
builder (3.
|
24
|
-
clive (1.2.
|
23
|
+
builder (3.2.2)
|
24
|
+
clive (1.2.1)
|
25
25
|
descendants_tracker (0.0.4)
|
26
26
|
thread_safe (~> 0.3, >= 0.3.1)
|
27
27
|
faraday (0.9.1)
|
@@ -36,9 +36,9 @@ GEM
|
|
36
36
|
oauth2
|
37
37
|
hashie (3.4.1)
|
38
38
|
i18n (0.7.0)
|
39
|
-
json (1.8.
|
39
|
+
json (1.8.3)
|
40
40
|
jwt (1.5.0)
|
41
|
-
mime-types (
|
41
|
+
mime-types (2.6.1)
|
42
42
|
mini_portile (0.6.2)
|
43
43
|
minitest (5.7.0)
|
44
44
|
multi_json (1.11.1)
|
@@ -54,7 +54,7 @@ GEM
|
|
54
54
|
multi_json (~> 1.3)
|
55
55
|
multi_xml (~> 0.5)
|
56
56
|
rack (~> 1.2)
|
57
|
-
rack (1.
|
57
|
+
rack (1.6.1)
|
58
58
|
rake (10.4.2)
|
59
59
|
rest-client (1.7.3)
|
60
60
|
mime-types (>= 1.16, < 3.0)
|
data/T1000
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
T1k.setup do |config|
|
2
|
+
|
3
|
+
# Setup Github repository credentials
|
4
|
+
# Create an auth_token here: https://github.com/settings/applications
|
5
|
+
#
|
6
|
+
config.repository.adapter = :github
|
7
|
+
config.repository.setup do |c|
|
8
|
+
c.user = "rodrigomaia"
|
9
|
+
c.repo = "matanza2"
|
10
|
+
c.oauth_token = "422c8f00d80a7f3e679a0cf5542e22896bec8ba6"
|
11
|
+
end
|
12
|
+
|
13
|
+
# Setup Trello board credentials
|
14
|
+
#
|
15
|
+
# Trello APP_DEVELOPER_KEY: https://trello.com/app-key
|
16
|
+
# Trello App permission key: https://trello.com/1/connect?key=YOUR_KEY&name=BOARD_NAME&expiration=never&response_type=token&scope=read,write
|
17
|
+
#
|
18
|
+
config.tracker.adapter = :trello
|
19
|
+
config.tracker.setup do |c|
|
20
|
+
c.user_name = "rudrige"
|
21
|
+
c.board_name = "Maromba"
|
22
|
+
c.member_token = "58a7067ef29083d327ecb5d7c5d71b9eca1a0b40a9c5c7f9291cf04dbf41e10f"
|
23
|
+
c.developer_public_key = "1a74ff76544bb0e5d9123e609478fb9a"
|
24
|
+
end
|
25
|
+
end
|
data/lib/t1k/command.rb
CHANGED
@@ -23,8 +23,13 @@ module T1k
|
|
23
23
|
|
24
24
|
desc 'Checkout to a new branch or existing branch associated with tracked card (issue)'
|
25
25
|
command :hack, :hck, arg: '<card_url>' do
|
26
|
+
|
27
|
+
opt :board, :b, 'Define the specified board to search the card', arg: '<board_name>' do
|
28
|
+
@board = board_name
|
29
|
+
end
|
30
|
+
|
26
31
|
action do
|
27
|
-
Commands::Hack.run card_url
|
32
|
+
Commands::Hack.run card_url, @board
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
data/lib/t1k/commands/hack.rb
CHANGED
@@ -2,9 +2,9 @@ module T1k
|
|
2
2
|
module Commands
|
3
3
|
class Hack
|
4
4
|
|
5
|
-
def self.run(path_card_part)
|
5
|
+
def self.run(path_card_part, board=nil)
|
6
6
|
T1k.setup_credentials
|
7
|
-
code_card = T1k::hack path_card_part
|
7
|
+
code_card = T1k::hack path_card_part, board
|
8
8
|
|
9
9
|
system 'git checkout master'
|
10
10
|
system 'git pull --rebase origin master'
|
@@ -18,4 +18,4 @@ module T1k
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
-
end
|
21
|
+
end
|
data/lib/t1k/trackers/none.rb
CHANGED
data/lib/t1k/trackers/trello.rb
CHANGED
@@ -45,12 +45,14 @@ module T1k
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
-
def self.get_card url_card
|
49
|
-
|
48
|
+
def self.get_card url_card, board=nil
|
49
|
+
my_board = board || self.board_name
|
50
|
+
|
51
|
+
puts "Fetching card from #{my_board}"
|
50
52
|
begin
|
51
53
|
me = ::Trello::Member.find(self.user_name)
|
52
54
|
raise "User not found" if me.nil?
|
53
|
-
board = me.boards.select{|x| x.name.upcase ==
|
55
|
+
board = me.boards.select{|x| x.name.upcase == my_board.upcase}.first
|
54
56
|
raise "Board not found.\nBoards available: #{me.boards.map(&:name)}" if board.nil?
|
55
57
|
card = board.cards.select{|x| x.url.index(url_card)}.first
|
56
58
|
raise "Card not found" if card.nil?
|
@@ -69,4 +71,4 @@ module T1k
|
|
69
71
|
end
|
70
72
|
end
|
71
73
|
end
|
72
|
-
end
|
74
|
+
end
|
data/lib/t1k/version.rb
CHANGED
data/lib/t1k.rb
CHANGED
@@ -38,8 +38,8 @@ module T1k
|
|
38
38
|
yield(self) if block_given?
|
39
39
|
end
|
40
40
|
|
41
|
-
def self.hack url_card
|
42
|
-
card = tracker.get_card(url_card)
|
41
|
+
def self.hack url_card, board=nil
|
42
|
+
card = tracker.get_card(url_card, board)
|
43
43
|
|
44
44
|
existent_issue_match = card.name.match /^\[#([0-9]*)\]/
|
45
45
|
existent_issue_number = existent_issue_match[1] if existent_issue_match.present?
|
data/t1k-2.1.0.gem
ADDED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: t1k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Maia
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-
|
13
|
+
date: 2015-09-01 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- ./LICENSE.txt
|
114
114
|
- ./README.md
|
115
115
|
- ./Rakefile
|
116
|
+
- ./T1000
|
116
117
|
- ./bin/t1k
|
117
118
|
- ./lib/t1k.rb
|
118
119
|
- ./lib/t1k/command.rb
|
@@ -134,6 +135,7 @@ files:
|
|
134
135
|
- ./resources/T1000
|
135
136
|
- ./spec/spec_helper.rb
|
136
137
|
- ./spec/t1k_spec.rb
|
138
|
+
- ./t1k-2.1.0.gem
|
137
139
|
- ./t1k.gemspec
|
138
140
|
- README.md
|
139
141
|
- Rakefile
|