gitjira 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +22 -7
- data/lib/gitjira/information_fetching.rb +6 -5
- data/lib/gitjira/version.rb +1 -1
- data/tools/readme2ghpage.rb +40 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ffc0c5f2516a815a6e25fdac1e79f0c446462da
|
4
|
+
data.tar.gz: e27d242f0d6d3eb15e7f5dd5a99ceaa2ffb0f5cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e81801375ce8eafa87ef69b5817923c621f5e330c00c5976a52fdd62a3b8e4a7f32588f70c706f946e19824c6d55a66682c938c35ccc9d478c564785ca7f141f
|
7
|
+
data.tar.gz: c6034d33f7803901c3dead1400262d9acd8f49608f4263848226db34afa4eab799e25e850784573d2dc2e951f2028538c6327e3fca8cbf510ce2974037c01b1b
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
# gitjira
|
2
2
|
|
3
|
-
Git JIRA is an extension that combines
|
4
|
-
|
3
|
+
Git JIRA is an extension that combines branches with JIRA issues. It allows the
|
4
|
+
extraction of issue information directly from the console, without changing to
|
5
|
+
the JIRA website and interrupting the work process.
|
5
6
|
|
6
|
-
In order to be able to
|
7
|
-
string _PROJECTKEY-###_
|
7
|
+
In order to be able to enrich a branch with issue informaiton the name must
|
8
|
+
include the following string _PROJECTKEY-###_ aka. the issue name.
|
8
9
|
|
9
10
|
Examples if the project key is _PROJ_ and the issue number is _123_
|
10
11
|
|
@@ -18,7 +19,7 @@ Examples if the project key is _PROJ_ and the issue number is _123_
|
|
18
19
|
Install via rubygems.org:
|
19
20
|
|
20
21
|
$ gem install gitjira
|
21
|
-
or
|
22
|
+
or globally via rvm
|
22
23
|
$ rvm @global do gem install gitjira
|
23
24
|
|
24
25
|
## Setup:
|
@@ -61,19 +62,33 @@ update directly the .git/config file or via the following command:
|
|
61
62
|
Updated At..........: 2013-06-20 23:21:18 +0200
|
62
63
|
Fix Version.........: v1.2.0 (2013-06-30),
|
63
64
|
|
64
|
-
Add a page that
|
65
|
+
Add a page that lists all features.
|
65
66
|
|
66
67
|
## Tips & Tricks
|
67
68
|
|
68
|
-
Use aliases to be even more efficient
|
69
|
+
Use aliases to be even more efficient:
|
70
|
+
|
71
|
+
$ cat ~/.gitconfig
|
72
|
+
...
|
73
|
+
[alias]
|
74
|
+
jl = jira list
|
75
|
+
jd = jira describe
|
76
|
+
...
|
69
77
|
|
70
78
|
$ git jl # same as git jira list
|
79
|
+
$ git jd # same as git jira describe
|
71
80
|
|
72
81
|
## Usage
|
73
82
|
|
74
83
|
# See what commands are available.
|
75
84
|
$ git-jira --help # or git jira -h
|
76
85
|
|
86
|
+
## Resources
|
87
|
+
|
88
|
+
* [RubyGems.org](https://rubygems.org/gems/gitjira) - The gem lives here...
|
89
|
+
* [GitHub](https://github.com/Sigimera/gitjira) - The code lives here...
|
90
|
+
* [Documentation](http://sigimera.github.io/gitjira/) - The documentation lives here...
|
91
|
+
|
77
92
|
## Contributing
|
78
93
|
|
79
94
|
Please contribute and help to make this tool even better.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class Gitjira::InformationFetching
|
2
2
|
|
3
3
|
def self.branches
|
4
|
-
project_key =
|
4
|
+
project_key = self.project_key
|
5
5
|
branches = `git branch -a`.split("\n")
|
6
6
|
issues = Array.new
|
7
7
|
issues_printed = Array.new
|
@@ -14,6 +14,7 @@ class Gitjira::InformationFetching
|
|
14
14
|
end
|
15
15
|
|
16
16
|
if fetch
|
17
|
+
json = self.fetch_issue_json(branch)
|
17
18
|
if json['fields']['progress']['percent']
|
18
19
|
puts sprintf "%-12s %3.0f%s\t%-14s - %s",
|
19
20
|
json['fields']['status']['name'],
|
@@ -97,8 +98,8 @@ class Gitjira::InformationFetching
|
|
97
98
|
end
|
98
99
|
|
99
100
|
def self.extract_issue(branch_name = nil)
|
100
|
-
branch_name =
|
101
|
-
project_key =
|
101
|
+
branch_name = self.current_branch if branch_name.nil?
|
102
|
+
project_key = self.project_key
|
102
103
|
branch_name[/#{project_key}-\d+/]
|
103
104
|
end
|
104
105
|
|
@@ -116,8 +117,8 @@ class Gitjira::InformationFetching
|
|
116
117
|
|
117
118
|
private
|
118
119
|
def self.fetch_issue_json(issue_name)
|
119
|
-
jira_url = "#{
|
120
|
-
credentials =
|
120
|
+
jira_url = "#{self.host}rest/api/2/issue/"
|
121
|
+
credentials = self.credentials
|
121
122
|
|
122
123
|
response = RestClient::Resource.new("#{jira_url}#{issue_name}", {
|
123
124
|
:headers => { "Authorization" => "Basic #{credentials}" }
|
data/lib/gitjira/version.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# checkout the readme from the master branch
|
4
|
+
`git checkout gh-pages; git checkout master README.md`
|
5
|
+
|
6
|
+
path = `pwd`.gsub(/\n/, "")
|
7
|
+
readme_path = File.join(path, "README.md")
|
8
|
+
index_path = File.join(path, "index.md")
|
9
|
+
|
10
|
+
# write the index readme file
|
11
|
+
File.open readme_path, "r" do |readme|
|
12
|
+
File.open index_path, "w" do |index|
|
13
|
+
|
14
|
+
# write the jekyll front matter
|
15
|
+
index.puts "---"
|
16
|
+
index.puts "layout: main"
|
17
|
+
index.puts "---"
|
18
|
+
|
19
|
+
readme.readlines.each do |line|
|
20
|
+
|
21
|
+
# convert backticks to liquid
|
22
|
+
%w(bash ruby).each do |lang|
|
23
|
+
line.gsub!("```#{lang}", "{% highlight #{lang} %}")
|
24
|
+
end
|
25
|
+
line.gsub!("```", "{% endhighlight %}")
|
26
|
+
|
27
|
+
# convert headers so they are linkable
|
28
|
+
if line =~ /^#+/
|
29
|
+
leader = line[0, line.index(/\s/)]
|
30
|
+
text = line[line.index(/\s./)..-1].strip
|
31
|
+
line = "#{leader} #{text} {##{text.downcase.gsub(/\s/, "-")}}"
|
32
|
+
end
|
33
|
+
|
34
|
+
index.puts line
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
# remove the readme
|
40
|
+
`git reset HEAD README.md; rm README.md`
|
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.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Oberhauser
|
@@ -87,6 +87,7 @@ files:
|
|
87
87
|
- lib/gitjira/information_fetching.rb
|
88
88
|
- lib/gitjira/setup.rb
|
89
89
|
- lib/gitjira/version.rb
|
90
|
+
- tools/readme2ghpage.rb
|
90
91
|
homepage: https://github.com/Sigimera/gitjira
|
91
92
|
licenses:
|
92
93
|
- MIT
|