t1k 1.0.1 → 1.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/t1k.rb +11 -4
- data/lib/t1k/repositories/github.rb +12 -1
- data/lib/t1k/repository.rb +1 -1
- data/lib/t1k/version.rb +1 -1
- data/lib/tasks/hack.rake +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fd44cf6d6cfbb3a0c4c6a165465859d7952fbdf
|
4
|
+
data.tar.gz: 46f89bbf15ce26413c47e1263123f5b6602ee706
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79dbbb5194ee2a45c411b603d3d2c784cc0416327b10a1bbd30858a6b234be497bdd113e34f444b51bc7a0c402f44fb3815d06c6a01731418b7b7aa741566942
|
7
|
+
data.tar.gz: 847bb324d970a5fc9cc1297a43cd2bc8f7849539006ca1e2ed11e6fd23d4779f47d85af62bc0119cfb0f151e2dc226cb051e41cbe82ffd4db6d1bce95182aa18
|
data/lib/t1k.rb
CHANGED
@@ -27,9 +27,16 @@ module T1k
|
|
27
27
|
|
28
28
|
def self.hack url_card
|
29
29
|
card = tracker.get_card(url_card)
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
30
|
+
|
31
|
+
existent_issue_match = card.name.match /^\[#([0-9]*)\]/
|
32
|
+
existent_issue_number = existent_issue_match[1] if existent_issue_match.present?
|
33
|
+
|
34
|
+
issue = existent_issue_number.present? ? repository.get_issue(existent_issue_number).html_url : repository.create_issue(card.name).html_url
|
35
|
+
|
36
|
+
issue_number = repository.get_issue_number(issue)
|
37
|
+
tracker.update_card(card, issue_number) if existent_issue_number.nil?
|
38
|
+
|
39
|
+
puts "Card ##{issue_number.code} created and tracked"
|
40
|
+
issue_number.code
|
34
41
|
end
|
35
42
|
end
|
@@ -37,7 +37,18 @@ module T1k
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
def self.get_issue
|
40
|
+
def self.get_issue issue_number
|
41
|
+
begin
|
42
|
+
puts "Recovering existent issue"
|
43
|
+
github_auth = ::Github.new(oauth_token: self.oauth_token)
|
44
|
+
issue = github_auth.issues.get user: self.user, repo: self.repo, number: issue_number
|
45
|
+
issue
|
46
|
+
rescue
|
47
|
+
raise 'Issue not recovered'
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def self.get_issue_number html_url
|
41
52
|
code = html_url[html_url.rindex('/')+1..html_url.size]
|
42
53
|
Issue.new(code, "Link to code: [#{code}](#{html_url})")
|
43
54
|
end
|
data/lib/t1k/repository.rb
CHANGED
data/lib/t1k/version.rb
CHANGED
data/lib/tasks/hack.rake
CHANGED
@@ -9,6 +9,12 @@ namespace :t1k do
|
|
9
9
|
|
10
10
|
system 'git checkout master'
|
11
11
|
system 'git pull --rebase origin master'
|
12
|
-
|
12
|
+
existent_branch = `git branch --list #{code_card}`
|
13
|
+
|
14
|
+
if existent_branch.present?
|
15
|
+
system "git checkout #{code_card}"
|
16
|
+
else
|
17
|
+
system "git checkout -b #{code_card}"
|
18
|
+
end
|
13
19
|
end
|
14
20
|
end
|