octopando 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/octopando/cli.rb +44 -7
- data/lib/octopando/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a64b745f16743b39b63b3af966e79019629d543f
|
4
|
+
data.tar.gz: 2b7f2c9041d50ca5f9c03adf7201e0b3199f22e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c823d960b3fe7c6d44f66fd57718befbaf14b41742dc7a21c836b85ba3e7dbdd10580b9cc68355966dfa4edcbe407d0b4e7e582a90da1c563fcddcddb06d03a
|
7
|
+
data.tar.gz: 4006306b9b25a0a0500cb57057f6502009b037f5c8b4f9f185bb2c77a8198171d330d21365246507ab496c0fbaac36b4f364474f88dc8234458bf697c489a58d
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## [0.2.3] - 2015-07-01
|
6
|
+
### Added
|
7
|
+
- list action to list all your uncompleted jira issues
|
8
|
+
- prune action to clean up old issue branches
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
- Patch version bump
|
12
|
+
|
5
13
|
## [0.2.2] - 2015-06-29
|
6
14
|
### Added
|
7
15
|
- Added colors
|
data/lib/octopando/cli.rb
CHANGED
@@ -5,6 +5,22 @@ module Octopando
|
|
5
5
|
map ["switch", "s"] => "start"
|
6
6
|
desc "start", "Start some work"
|
7
7
|
def start
|
8
|
+
list
|
9
|
+
ticket_item = ask ("Select a ticket") { |q| q.echo = true }
|
10
|
+
|
11
|
+
issue = Octopando.jira.my_issues[ticket_item.to_i - 1]
|
12
|
+
issue.checkout
|
13
|
+
if issue.status.statusCategory['name'] != "In Progress"
|
14
|
+
issue.move_to_in_progress if yes?("Would you like to move this issue to 'In Progress'? ")
|
15
|
+
end
|
16
|
+
# Octopando.jira.my_issues[ticket_item.to_i - 1].start
|
17
|
+
rescue Interrupt
|
18
|
+
puts "\nInterrupt detected... terminating.".colorize(:yellow)
|
19
|
+
end
|
20
|
+
|
21
|
+
map ['l', 'ls'] => 'list'
|
22
|
+
desc "list", "list open issues assigned to you"
|
23
|
+
def list
|
8
24
|
issues_by_status = {}
|
9
25
|
Octopando.jira.my_issues.each_with_index do |issue, index|
|
10
26
|
status = issue.status.statusCategory['name']
|
@@ -30,18 +46,39 @@ module Octopando
|
|
30
46
|
puts %Q{ #{my_issues_index} #{key} #{issue.summary}\n <https://instructure.atlassian.net/browse/#{issue.key}>}.colorize(color)
|
31
47
|
end
|
32
48
|
end
|
49
|
+
end
|
50
|
+
|
51
|
+
desc 'prune', 'remove old branches'
|
52
|
+
def prune
|
53
|
+
issue_keys = Octopando.jira.my_issues.map do |issue|
|
54
|
+
issue.key
|
55
|
+
end
|
33
56
|
|
34
|
-
|
57
|
+
issue_branches = Octopando.git.branches.local.map do |branch|
|
58
|
+
branch_name = nil
|
59
|
+
parsed_branch = branch.name.match(/(?<type>[^\/]+)\/?(?<ticket>[A-Z]+-[0-9]+)/)
|
60
|
+
if parsed_branch
|
61
|
+
ticket_number = parsed_branch[:ticket]
|
62
|
+
branch_name = branch.name unless issue_keys.include? ticket_number
|
63
|
+
end
|
64
|
+
branch_name
|
65
|
+
end.compact
|
35
66
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
67
|
+
issue_branches.each do |branch|
|
68
|
+
puts branch
|
69
|
+
end
|
70
|
+
|
71
|
+
if issue_branches.empty?
|
72
|
+
puts "Nothing to prune".colorize(:yellow)
|
73
|
+
elsif yes?("Continue? The above branches will be removed")
|
74
|
+
Octopando.git.branch('master').checkout
|
75
|
+
issue_branches.each do |branch|
|
76
|
+
puts branch
|
77
|
+
Octopando.git.branch(branch).delete
|
78
|
+
end
|
40
79
|
end
|
41
|
-
# Octopando.jira.my_issues[ticket_item.to_i - 1].start
|
42
80
|
rescue Interrupt
|
43
81
|
puts "\nInterrupt detected... terminating.".colorize(:yellow)
|
44
|
-
|
45
82
|
end
|
46
83
|
|
47
84
|
desc "prepare_commit_msg", "used for git hook"
|
data/lib/octopando/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octopando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- defektive
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: git
|
@@ -167,7 +167,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
169
|
rubyforge_project:
|
170
|
-
rubygems_version: 2.4.
|
170
|
+
rubygems_version: 2.4.5
|
171
171
|
signing_key:
|
172
172
|
specification_version: 4
|
173
173
|
summary: Makes your life easier
|