octopando 0.2.1 → 0.2.2

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
  SHA1:
3
- metadata.gz: 82c8d0465410af7935745379781174ee9c550681
4
- data.tar.gz: 9ce07a05ed370480a8663ea94399cd17f270134f
3
+ metadata.gz: 58f1a8357eb6e0c8c1fb4c7932c52e35ab1f4fdc
4
+ data.tar.gz: 0274a0c6e8e61b27320e0ac89871abf472110f91
5
5
  SHA512:
6
- metadata.gz: 88d4ec227c379f484d6be50e98eb5cbeca6b2c7fcaaa04a14b3310abb94a7abef81cb2d76d30bb67ed55dd8c4ead610fc682c6fba29a2dccf90730bd8bc6235d
7
- data.tar.gz: 37bef10e4ddf3e8e6410b94d223be6f1195837c3c33d2457e92801ff3637cd3918db530ccd0b84c71f79a32c23b80988d86af23e2826a9d434e8de4e25cbfcaa
6
+ metadata.gz: acb58c17806e298c94e00a553b901f198686686d21c7bc80169cbb91f997e47d35879faa7b9345379aa38d16ff45f27106754c1b61d2fb364410efc6588fbc4c
7
+ data.tar.gz: 5d913137c5bc159967075d5f18a72ad08dbb8e667dd44fc7f7f919a285364cb7211966501261393ab7ae7ecc8a28e9ad8800d2723429c7f3323934aa2b1fbed9
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.2] - 2015-06-29
6
+ ### Added
7
+ - Added colors
8
+ - Added move to in progress
9
+
10
+ ### Changed
11
+ - Patch version bump
12
+
5
13
  ## [0.2.1] - 2015-06-26
6
14
  ### Added
7
15
  - Added link to jira in start action
data/lib/octopando/cli.rb CHANGED
@@ -5,12 +5,43 @@ module Octopando
5
5
  map ["switch", "s"] => "start"
6
6
  desc "start", "Start some work"
7
7
  def start
8
+ issues_by_status = {}
8
9
  Octopando.jira.my_issues.each_with_index do |issue, index|
9
- puts %Q{#{index+1} #{issue.key} - #{issue.summary}\n\t<https://instructure.atlassian.net/browse/#{issue.key}>}
10
+ status = issue.status.statusCategory['name']
11
+ issues_by_status[status] ||= []
12
+ issues_by_status[status].push my_issues_index: index, issue: issue
13
+ end
14
+
15
+ status_colors = {
16
+ :unknown => [:white, :light_white],
17
+ "To Do" => [:yellow, :light_yellow],
18
+ "In Progress" => [:blue, :light_blue]
19
+ }
20
+
21
+ issues_by_status.each do |status, issues|
22
+ colors = status_colors[status] || status_colors[:unknown]
23
+ puts "\n #{status}".colorize(colors[0]).bold
24
+ issues.each_with_index do |issue, local_index|
25
+ my_issues_index = issue[:my_issues_index] + 1
26
+ issue = issue[:issue]
27
+ color = colors[local_index % 2]
28
+
29
+ key = "#{issue.key}".colorize(color).underline
30
+ puts %Q{ #{my_issues_index} #{key} #{issue.summary}\n <https://instructure.atlassian.net/browse/#{issue.key}>}.colorize(color)
31
+ end
10
32
  end
11
33
 
12
34
  ticket_item = ask ("Select a ticket") { |q| q.echo = true }
13
- Octopando.jira.my_issues[ticket_item.to_i - 1].checkout
35
+
36
+ issue = Octopando.jira.my_issues[ticket_item.to_i - 1]
37
+ issue.checkout
38
+ if issue.status.statusCategory['name'] != "In Progress"
39
+ issue.move_to_in_progress if yes?("Would you like to move this issue to 'In Progress'? ")
40
+ end
41
+ # Octopando.jira.my_issues[ticket_item.to_i - 1].start
42
+ rescue Interrupt
43
+ puts "\nInterrupt detected... terminating.".colorize(:yellow)
44
+
14
45
  end
15
46
 
16
47
  desc "prepare_commit_msg", "used for git hook"
@@ -1,3 +1,3 @@
1
1
  module Octopando
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/octopando.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "octopando/version"
2
+ require 'colorize'
2
3
  require 'git'
3
4
  require 'jira'
4
5
  require 'keychain'
@@ -35,4 +36,10 @@ JIRA::Resource::Issue.class_eval do
35
36
  def checkout(type='issue')
36
37
  Octopando.git.branch("#{type}/#{self.key}").checkout
37
38
  end
39
+
40
+ def move_to_in_progress
41
+ transition = self.transitions.build
42
+ id = transitions.all.first {|e| puts e.name == "To In Progress" }.id
43
+ transition.save!("transition" => {"id" => id})
44
+ end
38
45
  end
data/octopando.gemspec CHANGED
@@ -23,6 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_runtime_dependency "ruby-keychain", "~> 0.2"
24
24
  spec.add_runtime_dependency "thor", "~> 0.19"
25
25
  spec.add_runtime_dependency "word_wrap", "~> 1.0"
26
+ spec.add_runtime_dependency "colorize", "~> 0.7"
26
27
 
27
28
  spec.add_development_dependency "bundler", "~> 1.10"
28
29
  spec.add_development_dependency "rake", "~> 10.0"
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.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - defektive
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-26 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: git
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: colorize
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.7'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.7'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: bundler
85
99
  requirement: !ruby/object:Gem::Requirement