gitjira 0.0.1 → 0.0.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: 0147528c9d34712e1c91f84925d60eb10b9a00d4
4
- data.tar.gz: 97221c58ff272776c58300aeb98be2d3b04938bd
3
+ metadata.gz: d277b83f7b4c7e19dd4c37981ed4bf2dd17ba9b4
4
+ data.tar.gz: 6eaa7a36b90a0326dfb782c3142d8dc6d6366d48
5
5
  SHA512:
6
- metadata.gz: baa75186006988fe01740403778b8b46c71ca066cb23eef9dca279860af435295cac372305100aeb52c51afd83f995b98ced03aa0c0d47ecf5323cae2266caec
7
- data.tar.gz: c8540bd0696b36a0f749fba1c37c6e3b8a242c4954621d9099e5eaeb23aea460fe31c7f415ce73453c756e104889729c1a23b5e939f59f1f5a38d3fb0983f898
6
+ metadata.gz: 0dbc4c743ff1cc5823340739f9af45bbfc971441adc232c64124d8bba8fc7323c25663dd08ac129770c6dc52a02d3d5d49c5faf563fd60a2da5305706c00896b
7
+ data.tar.gz: 1699a939ba23a9826ea6c97a4d3706dc38abf756984b6e0f4fa0993232e23ceb4733921c86eba54a6d02b8753417eebbc922d5bf5086cad0a24b545ca9953cd2
data/Gemfile.lock CHANGED
@@ -1,9 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitjira (0.0.1)
4
+ gitjira (0.0.2)
5
5
  highline
6
- parseconfig
7
6
  rest-client (~> 1.6)
8
7
 
9
8
  GEM
@@ -11,7 +10,6 @@ GEM
11
10
  specs:
12
11
  highline (1.6.19)
13
12
  mime-types (1.23)
14
- parseconfig (1.0.2)
15
13
  rake (10.0.4)
16
14
  rest-client (1.6.7)
17
15
  mime-types (>= 1.16)
data/README.md CHANGED
@@ -13,7 +13,15 @@ Examples if the project key is _PROJ_ and the issue number _123_
13
13
  PROJ-123
14
14
  PROJ-123_description
15
15
 
16
- ### Setup:
16
+ ## Installation
17
+
18
+ Install via rubygems.org:
19
+
20
+ $ gem install gitjira
21
+ or with rvm
22
+ $ rvm @global do gem install gitjira
23
+
24
+ ## Setup:
17
25
 
18
26
  $ git jira init
19
27
  JIRA host (e.g. https://jira.example.org): http://www.example.org/jira
@@ -22,19 +30,18 @@ Examples if the project key is _PROJ_ and the issue number _123_
22
30
  Related JIRA project key (e.g. PROJ) : PROJ
23
31
 
24
32
 
25
- ### Example Scenario - Feature Branches:
33
+ ## Example Scenario - Feature Branches:
26
34
 
27
35
  $ git jira list
28
36
  Open 0% done PROJ-123 - Implement some new feature
29
37
  Resolved 100% done PROJ-20 - And yet another feature
30
38
  Resolved 42% done PROJ-16 - Add /features page
31
39
 
40
+ ## Tips & Tricks
32
41
 
33
- ## Installation
42
+ Use aliases to be even more efficient, e.g. add 'alias jl = jira list' to your global ~/.gitconfig
34
43
 
35
- Install via rubygems.org:
36
-
37
- $ gem install gitjira
44
+ $ git jl # same as git jira list
38
45
 
39
46
  ## Usage
40
47
 
data/bin/git-jira CHANGED
@@ -14,7 +14,7 @@ rescue LoadError => e
14
14
  exit
15
15
  end
16
16
 
17
- options = {}
17
+ options = { :force => false }
18
18
 
19
19
  opt_parser = OptionParser.new do |opt|
20
20
  opt.banner = "Usage: git-jira [COMMANDS] [OPTIONS]"
@@ -30,16 +30,20 @@ opt_parser = OptionParser.new do |opt|
30
30
  end
31
31
 
32
32
  opt.on("-v", "--version", "print out current Version number") do
33
- STDOUT.puts "sigtools-#{Gitjira::VERSION}"
33
+ STDOUT.puts "gitjira-#{Gitjira::VERSION}"
34
34
  exit
35
35
  end
36
+
37
+ opt.on("-f", "--force", "force overwrite of .git/config [gitjira] block") do
38
+ options[:force] = true
39
+ end
36
40
  end
37
41
 
38
42
  opt_parser.parse!
39
43
 
40
44
  case ARGV[0]
41
45
  when "init"
42
- Gitjira::Setup.init
46
+ Gitjira::Setup.init(options[:force])
43
47
  when "list"
44
48
  unless Gitjira::Setup.setup?
45
49
  STDERR.puts "[SETUP] This repository is not setup correcly, please execute: `git-jira init`"
data/gitjira.gemspec CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.add_dependency "rest-client", "~> 1.6"
22
22
  spec.add_dependency "highline"
23
- spec.add_dependency "parseconfig"
24
23
 
25
24
  spec.add_development_dependency "bundler", "~> 1.3"
26
25
  spec.add_development_dependency "rake"
@@ -10,11 +10,9 @@ class Gitjira::InformationFetching
10
10
 
11
11
  branches.each do |current_branch|
12
12
  branch = current_branch[/#{project_key}-\d+/]
13
- if branch
14
- unless issues_printed.include?(branch)
13
+ if branch and not issues_printed.include?(branch)
15
14
  issues_printed << branch
16
15
  fetch = true
17
- end
18
16
  end
19
17
 
20
18
  if fetch
@@ -23,9 +21,14 @@ class Gitjira::InformationFetching
23
21
  }).get
24
22
  json = JSON.parse(response)
25
23
  if json['fields']['progress']['percent']
26
- puts sprintf "%-12s %3.0f%s\t%-14s - %s", json['fields']['status']['name'], json['fields']['progress']['percent'], "% done", branch, json['fields']['summary']
24
+ puts sprintf "%-12s %3.0f%s\t%-14s - %s",
25
+ json['fields']['status']['name'],
26
+ json['fields']['progress']['percent'],
27
+ "% done", branch, json['fields']['summary']
27
28
  else
28
- puts sprintf "%-12s\t\t%-14s - %s", json['fields']['status']['name'], branch, json['fields']['summary']
29
+ puts sprintf "%-12s\t\t%-14s - %s",
30
+ json['fields']['status']['name'],
31
+ branch, json['fields']['summary']
29
32
  end
30
33
 
31
34
  fetch = false
data/lib/gitjira/setup.rb CHANGED
@@ -1,7 +1,12 @@
1
1
  require "base64"
2
2
 
3
3
  class Gitjira::Setup
4
- def self.init
4
+ def self.init(force = false)
5
+ if self.setup? and not force
6
+ STDERR.puts "Repository is configured. Overwrite with:"
7
+ STDERR.puts "\t$ git-jira init -f # or git-jira init --force."
8
+ return
9
+ end
5
10
  host = nil
6
11
  username = nil
7
12
  password = nil
@@ -1,3 +1,3 @@
1
1
  module Gitjira
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
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.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Oberhauser
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: parseconfig
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - '>='
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: bundler
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -126,4 +112,3 @@ signing_key:
126
112
  specification_version: 4
127
113
  summary: A git extension that combines feature branches with JIRA issues.
128
114
  test_files: []
129
- has_rdoc: