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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4352b0c24da71ed1886cce9a72e0a81a54b401e9
4
- data.tar.gz: 100b0d5bdeb9bb956bc7d2b99d68048d27a2a00a
3
+ metadata.gz: 6ffc0c5f2516a815a6e25fdac1e79f0c446462da
4
+ data.tar.gz: e27d242f0d6d3eb15e7f5dd5a99ceaa2ffb0f5cd
5
5
  SHA512:
6
- metadata.gz: a76e3a6d48d2625d7606279300a1e3728f72f71ffd30ec03ee34e6f1c8de6530dd1c3c7e57c6cede18d2de20892859fa9b95913a9bc72bdf5cb18b4c8ce01b11
7
- data.tar.gz: 892addae5df559e8fabf8a7ac10ea48757356262c3692f2682a47e88431b5b336175155e58cccad7aa6299be1075ac1db72314c463fbd6bf62b8cc0731d7b0e2
6
+ metadata.gz: e81801375ce8eafa87ef69b5817923c621f5e330c00c5976a52fdd62a3b8e4a7f32588f70c706f946e19824c6d55a66682c938c35ccc9d478c564785ca7f141f
7
+ data.tar.gz: c6034d33f7803901c3dead1400262d9acd8f49608f4263848226db34afa4eab799e25e850784573d2dc2e951f2028538c6327e3fca8cbf510ce2974037c01b1b
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ tmp
16
16
  .yardoc
17
17
  _yardoc
18
18
  doc/
19
+ _site
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitjira (0.1.0)
4
+ gitjira (0.1.1)
5
5
  highline
6
6
  rest-client (~> 1.6)
7
7
 
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
1
  # gitjira
2
2
 
3
- Git JIRA is an extension that combines feature, or all other type of branches,
4
- with JIRA issues. It shows the current status and the summary of the issue.
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 combine branches the branch name must include the following
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 with global via rvm
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 list all features.
65
+ Add a page that lists all features.
65
66
 
66
67
  ## Tips & Tricks
67
68
 
68
- Use aliases to be even more efficient, e.g. add 'alias jl = jira list' to your global ~/.gitconfig
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 = Gitjira::InformationFetching.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 = Gitjira::InformationFetching.current_branch if branch_name.nil?
101
- project_key = Gitjira::InformationFetching.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 = "#{Gitjira::InformationFetching.host}rest/api/2/issue/"
120
- credentials = Gitjira::InformationFetching.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}" }
@@ -1,3 +1,3 @@
1
1
  module Gitjira
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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.0
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