gitjira 0.1.1 → 0.2.0

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: 6ffc0c5f2516a815a6e25fdac1e79f0c446462da
4
- data.tar.gz: e27d242f0d6d3eb15e7f5dd5a99ceaa2ffb0f5cd
3
+ metadata.gz: 6df10c782e1e083a1e4b765f5ba5151e6487ea25
4
+ data.tar.gz: dba31206fe7605e1c7987c87faccc03bcf52f85f
5
5
  SHA512:
6
- metadata.gz: e81801375ce8eafa87ef69b5817923c621f5e330c00c5976a52fdd62a3b8e4a7f32588f70c706f946e19824c6d55a66682c938c35ccc9d478c564785ca7f141f
7
- data.tar.gz: c6034d33f7803901c3dead1400262d9acd8f49608f4263848226db34afa4eab799e25e850784573d2dc2e951f2028538c6327e3fca8cbf510ce2974037c01b1b
6
+ metadata.gz: 2071da8a3b4178f6f2ea18aa201f4ee8913a976314de85fd5671821c92eda4efdbd06913d2f37b5983c0e0840b2f8ac9697a4ca42a4da33325990e987d02635f
7
+ data.tar.gz: 8094dc7d078a3c692e9744ca1d4340e8f904b02f511128d71cf55e8dadbf82b604351f2b5d3d094f0a4fe6324c7ec314ee111fb73515ecf1eb491da2bc51dab2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitjira (0.1.1)
4
+ gitjira (0.2.0)
5
5
  highline
6
6
  rest-client (~> 1.6)
7
7
 
data/README.md CHANGED
@@ -64,6 +64,29 @@ update directly the .git/config file or via the following command:
64
64
 
65
65
  Add a page that lists all features.
66
66
 
67
+ ## Exampel Scenario #3 - Get information about a specific issue
68
+
69
+ Get information about a specific issue that must not be available as branch.
70
+
71
+ $ git-jira describe -i 123 # or git-jira describe -i PROJ-123
72
+ => Add /features page <=
73
+
74
+ Issue Key...........: PROJ-123
75
+ Type................: New Feature
76
+ Status..............: Resolved
77
+ Progress............: 42.0 %
78
+ Estimated Work......: 1d
79
+ Remaining Work......: 4h 35m
80
+ Resolution..........: Fixed
81
+ Priority............: Major
82
+ Assignee............: Me
83
+ Reporter............: Me
84
+ Created At..........: 2013-05-26 13:09:17 +0200
85
+ Updated At..........: 2013-06-20 23:21:18 +0200
86
+ Fix Version.........: v1.2.0 (2013-06-30),
87
+
88
+ Add a page that lists all features.
89
+
67
90
  ## Tips & Tricks
68
91
 
69
92
  Use aliases to be even more efficient:
@@ -20,9 +20,9 @@ opt_parser = OptionParser.new do |opt|
20
20
  opt.banner = "Usage: git-jira [COMMANDS] [OPTIONS]"
21
21
  opt.separator ""
22
22
  opt.separator "Commands"
23
- opt.separator " init: setup the current repository to be able to connect to a JIRA project"
24
- opt.separator " list: returns a list of branches with related issue information"
25
- opt.separator " describe: verbose issue information related to the current branch"
23
+ opt.separator " init [-f | --force]: setup the current repository to be able to connect to a JIRA project"
24
+ opt.separator " list: returns a list of branches with related issue information"
25
+ opt.separator " describe [-i | --issue]: verbose issue information related to the current branch or specified issue"
26
26
  opt.separator ""
27
27
 
28
28
  opt.on("-h", "--help", "help") do
@@ -38,6 +38,10 @@ opt_parser = OptionParser.new do |opt|
38
38
  opt.on("-f", "--force", "force overwrite of .git/config [gitjira] block") do
39
39
  options[:force] = true
40
40
  end
41
+
42
+ opt.on("-i", "--issue [ISSUE]", "specify an issue number, e.g. PROJ-123 or 123") do |i|
43
+ options[:issue] = i if i
44
+ end
41
45
  end
42
46
 
43
47
  opt_parser.parse!
@@ -53,10 +57,14 @@ when "list"
53
57
  begin
54
58
  Gitjira::InformationFetching.branches
55
59
  rescue => e
56
- STDERR.puts "[ERROR] Not able to fetch feature branch information from JIRA, through exception: #{e}"
60
+ STDERR.puts "[ERROR] Not able to fetch issue information from JIRA, through exception: #{e}"
57
61
  end
58
62
  when "describe"
59
- Gitjira::InformationFetching.describe
63
+ begin
64
+ Gitjira::InformationFetching.describe(options[:issue])
65
+ rescue => e
66
+ STDERR.puts "[ERROR] Not able to fetch issue information from JIRA, through exception: #{e}"
67
+ end
60
68
  else
61
69
  STDOUT.puts opt_parser
62
70
  end
@@ -33,8 +33,10 @@ class Gitjira::InformationFetching
33
33
  return nil
34
34
  end
35
35
 
36
- def self.describe
37
- issue = self.extract_issue
36
+ def self.describe(issue = nil)
37
+ issue = "#{self.project_key}-#{issue}" if issue and not issue.start_with?(self.project_key)
38
+ issue = self.extract_issue unless issue
39
+
38
40
  if issue
39
41
  issue_info = self.fetch_issue_json(issue)
40
42
  if issue_info
@@ -1,3 +1,3 @@
1
1
  module Gitjira
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitjira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Oberhauser