gitmine 0.1.3 → 0.1.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.gitmine.yml +1 -1
- data/Gemfile +3 -3
- data/Gemfile.lock +26 -0
- data/README.rdoc +15 -1
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/bin/gitmine +1 -1
- data/gitmine.gemspec +17 -12
- data/lib/gitmine/cli.rb +26 -0
- data/lib/gitmine/commit.rb +28 -0
- data/lib/gitmine/gitmine.rb +51 -0
- data/lib/gitmine/issue.rb +68 -0
- data/lib/gitmine.rb +2 -105
- data/spec/commit_spec.rb +3 -2
- data/spec/gitmine_spec.rb +3 -3
- data/spec/issue_spec.rb +9 -18
- metadata +34 -15
data/.gitignore
CHANGED
data/.gitmine.yml
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
host: 'http://redmine-gitmine.heroku.com'
|
2
|
-
|
2
|
+
github: 'pcreux/gitmine'
|
data/Gemfile
CHANGED
data/Gemfile.lock
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
GEM
|
2
|
+
specs:
|
3
|
+
crack (0.1.8)
|
4
|
+
diff-lcs (1.1.2)
|
5
|
+
grit (2.0.0)
|
6
|
+
diff-lcs (>= 1.1.2)
|
7
|
+
mime-types (>= 1.15)
|
8
|
+
httparty (0.6.1)
|
9
|
+
crack (= 0.1.8)
|
10
|
+
mime-types (1.16)
|
11
|
+
rspec (2.0.0.beta.17)
|
12
|
+
rspec-core (= 2.0.0.beta.17)
|
13
|
+
rspec-expectations (= 2.0.0.beta.17)
|
14
|
+
rspec-mocks (= 2.0.0.beta.17)
|
15
|
+
rspec-core (2.0.0.beta.17)
|
16
|
+
rspec-expectations (2.0.0.beta.17)
|
17
|
+
diff-lcs (>= 1.1.2)
|
18
|
+
rspec-mocks (2.0.0.beta.17)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
grit
|
25
|
+
httparty
|
26
|
+
rspec (= 2.0.0.beta.17)
|
data/README.rdoc
CHANGED
@@ -14,7 +14,21 @@ Put the config file '.gitmine.yml' at the root of your project. Here is a sample
|
|
14
14
|
# Api key is required for private projects only.
|
15
15
|
api_key: 'your_api_key'
|
16
16
|
|
17
|
-
|
17
|
+
== Usage
|
18
|
+
|
19
|
+
* Display the latest 10 commits and there ticket status:
|
20
|
+
|
21
|
+
$> gitmine
|
22
|
+
8497d68 In Progress Philippe Creux Add branch command. Need refactoring.Issue #10
|
23
|
+
b0132d2 Closed Philippe Creux Gitmine now works on case sensitive FS. Issue #8
|
24
|
+
b77fb0c N/A Philippe Creux Add Greg Bell as an awesome contributor.
|
25
|
+
9f3e464 N/A Greg Bell Moved CommitMsgToIssueId module into the Gitmine::I
|
26
|
+
|
27
|
+
* Create a new remote branch + a tracking branch + add a note to the associated ticket:
|
28
|
+
|
29
|
+
$> gitmine branch 10-add-branch
|
30
|
+
|
31
|
+
See here: http://redmine-gitmine.heroku.com/issues/10#note-1
|
18
32
|
|
19
33
|
== Note on Issues
|
20
34
|
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ begin
|
|
14
14
|
gem.executables = ["gitmine"]
|
15
15
|
gem.add_dependency "httparty"
|
16
16
|
gem.add_dependency "grit"
|
17
|
-
gem.add_development_dependency "rspec", "
|
17
|
+
gem.add_development_dependency "rspec", "2.0.0"
|
18
18
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
19
19
|
end
|
20
20
|
Jeweler::GemcutterTasks.new
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4.pre
|
data/bin/gitmine
CHANGED
data/gitmine.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gitmine}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4.pre"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Philippe Creux"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-11-11}
|
13
13
|
s.default_executable = %q{gitmine}
|
14
14
|
s.description = %q{Git log with status of associated redmine tickets}
|
15
15
|
s.email = %q{pcreux@gmail.com}
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
".gitignore",
|
24
24
|
".gitmine.yml",
|
25
25
|
"Gemfile",
|
26
|
+
"Gemfile.lock",
|
26
27
|
"LICENSE",
|
27
28
|
"README.rdoc",
|
28
29
|
"Rakefile",
|
@@ -31,6 +32,10 @@ Gem::Specification.new do |s|
|
|
31
32
|
"bin/gitmine",
|
32
33
|
"gitmine.gemspec",
|
33
34
|
"lib/gitmine.rb",
|
35
|
+
"lib/gitmine/cli.rb",
|
36
|
+
"lib/gitmine/commit.rb",
|
37
|
+
"lib/gitmine/gitmine.rb",
|
38
|
+
"lib/gitmine/issue.rb",
|
34
39
|
"spec/commit_msg_to_issue_id_spec.rb",
|
35
40
|
"spec/commit_spec.rb",
|
36
41
|
"spec/config.yml",
|
@@ -41,33 +46,33 @@ Gem::Specification.new do |s|
|
|
41
46
|
s.homepage = %q{http://github.com/pcreux/gitmine}
|
42
47
|
s.rdoc_options = ["--charset=UTF-8"]
|
43
48
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = %q{1.3.
|
49
|
+
s.rubygems_version = %q{1.3.7}
|
45
50
|
s.summary = %q{Git log with status of associated redmine tickets}
|
46
51
|
s.test_files = [
|
47
|
-
"spec/
|
48
|
-
"spec/
|
49
|
-
"spec/gitmine_spec.rb",
|
52
|
+
"spec/gitmine_spec.rb",
|
53
|
+
"spec/spec_helper.rb",
|
50
54
|
"spec/issue_spec.rb",
|
51
|
-
"spec/
|
55
|
+
"spec/commit_msg_to_issue_id_spec.rb",
|
56
|
+
"spec/commit_spec.rb"
|
52
57
|
]
|
53
58
|
|
54
59
|
if s.respond_to? :specification_version then
|
55
60
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
56
61
|
s.specification_version = 3
|
57
62
|
|
58
|
-
if Gem::Version.new(Gem::
|
63
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
59
64
|
s.add_runtime_dependency(%q<httparty>, [">= 0"])
|
60
65
|
s.add_runtime_dependency(%q<grit>, [">= 0"])
|
61
|
-
s.add_development_dependency(%q<rspec>, ["
|
66
|
+
s.add_development_dependency(%q<rspec>, ["= 2.0.0"])
|
62
67
|
else
|
63
68
|
s.add_dependency(%q<httparty>, [">= 0"])
|
64
69
|
s.add_dependency(%q<grit>, [">= 0"])
|
65
|
-
s.add_dependency(%q<rspec>, ["
|
70
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0"])
|
66
71
|
end
|
67
72
|
else
|
68
73
|
s.add_dependency(%q<httparty>, [">= 0"])
|
69
74
|
s.add_dependency(%q<grit>, [">= 0"])
|
70
|
-
s.add_dependency(%q<rspec>, ["
|
75
|
+
s.add_dependency(%q<rspec>, ["= 2.0.0"])
|
71
76
|
end
|
72
77
|
end
|
73
78
|
|
data/lib/gitmine/cli.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Gitmine
|
2
|
+
class CLI
|
3
|
+
def self.run
|
4
|
+
case ARGV[0]
|
5
|
+
when nil
|
6
|
+
list
|
7
|
+
when "branch"
|
8
|
+
branch
|
9
|
+
else
|
10
|
+
puts <<-EOS
|
11
|
+
Usage:
|
12
|
+
gitmine: show the 10 latest commits and their associated issue status
|
13
|
+
gitmine branch [BRANCH_NAME]: create a new branch
|
14
|
+
EOS
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.list
|
19
|
+
Gitmine.list
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.branch
|
23
|
+
Gitmine.branch(ARGV[1])
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Gitmine
|
2
|
+
class Commit
|
3
|
+
attr_reader :grit_commit
|
4
|
+
|
5
|
+
# Initialize a new Commit objects that delegates methods to the Grit::Commit object passed in
|
6
|
+
def initialize(grit_commit)
|
7
|
+
@grit_commit = grit_commit
|
8
|
+
end
|
9
|
+
|
10
|
+
# Issue associated with this commit
|
11
|
+
# Return nil if their is no associated issue
|
12
|
+
def issue
|
13
|
+
@issue ||= Issue.get_for_commit(message)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Delegate #id to Grit::Commit
|
17
|
+
def id
|
18
|
+
@grit_commit.id
|
19
|
+
end
|
20
|
+
|
21
|
+
protected
|
22
|
+
# Delegate methods to Grit::Commit
|
23
|
+
def method_missing(m, *args, &block)
|
24
|
+
return @grit_commit.send(m, args, block) if @grit_commit.respond_to? m
|
25
|
+
super
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module Gitmine
|
2
|
+
class Gitmine
|
3
|
+
def self.list
|
4
|
+
gm = Gitmine.new
|
5
|
+
gm.commits.each do |commit|
|
6
|
+
status = commit.issue ? commit.issue.status : 'N/A'
|
7
|
+
puts "#{commit.id[0..6]} #{status.ljust(12)} #{commit.committer.name.ljust(15)} #{commit.message[0..50].gsub("\n", '')}"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def initialize
|
12
|
+
@repo = Grit::Repo.new(ENV['PWD'])
|
13
|
+
@branch = File.read('./.git/HEAD').match(/^ref: refs\/heads\/(.+)/)[1]
|
14
|
+
end
|
15
|
+
|
16
|
+
def commits
|
17
|
+
@repo.commits(@branch).map do |c|
|
18
|
+
Commit.new(c)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
def self.branch(branch_name)
|
24
|
+
issue_id = branch_name[/^\d+/]
|
25
|
+
original_branch = File.read('./.git/HEAD').match(/^ref: refs\/heads\/(.+)/)[1]
|
26
|
+
config = Issue.config
|
27
|
+
|
28
|
+
raise "Invalid branch name. It should start with the issue number" unless issue_id
|
29
|
+
|
30
|
+
puts "Creating the remote branch #{branch_name}"
|
31
|
+
|
32
|
+
run_cmd("git push origin origin:refs/heads/#{branch_name}")
|
33
|
+
run_cmd("git checkout --track -b #{branch_name} origin/#{branch_name}")
|
34
|
+
|
35
|
+
|
36
|
+
puts "Adding a note to the Issue ##{issue_id}"
|
37
|
+
note = "Branch *#{branch_name}* created from #{original_branch}"
|
38
|
+
if config['github']
|
39
|
+
note << %{ - "See on Github":https://github.com/#{config['github']}/tree/#{branch_name}}
|
40
|
+
note << %{ - "Compare on Github":https://github.com/#{config['github']}/compare/#{original_branch}...#{branch_name}}
|
41
|
+
end
|
42
|
+
|
43
|
+
Issue.find(issue_id).add_note(note)
|
44
|
+
end
|
45
|
+
|
46
|
+
def self.run_cmd(cmd)
|
47
|
+
puts cmd
|
48
|
+
system cmd
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Gitmine
|
2
|
+
class Issue
|
3
|
+
CONFIG_FILE = './.gitmine.yml'
|
4
|
+
|
5
|
+
attr_reader :id, :subject, :status
|
6
|
+
|
7
|
+
# Config from .gitmine.yml
|
8
|
+
def self.config
|
9
|
+
@@config ||= YAML.load_file(CONFIG_FILE)
|
10
|
+
end
|
11
|
+
|
12
|
+
# Extract the issue_id from a commit message.
|
13
|
+
# Examples:
|
14
|
+
# CommitMsgToIssueId.parse("Message for Issue #123.")
|
15
|
+
# => 123
|
16
|
+
# CommitMsgToIssueId.parse("#123.")
|
17
|
+
# => nil
|
18
|
+
#
|
19
|
+
def self.parse_for_issue_id(msg)
|
20
|
+
match = msg.match(/Issue #(\d+)/)
|
21
|
+
match ? match[1] : nil
|
22
|
+
end
|
23
|
+
|
24
|
+
# Parse the commit_message and get the associated issue if any.
|
25
|
+
def self.get_for_commit(commit_message)
|
26
|
+
issue_id = parse_for_issue_id(commit_message)
|
27
|
+
issue_id ? Issue.find(issue_id) : nil
|
28
|
+
end
|
29
|
+
|
30
|
+
# Get the issue from redmine
|
31
|
+
def self.find(issue_id)
|
32
|
+
Issue.new.tap { |issue|
|
33
|
+
issue.build_via_issue_id(issue_id)
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Get attributes from redmine and set them all
|
38
|
+
def build_via_issue_id(issue_id)
|
39
|
+
@id = issue_id
|
40
|
+
data = http_get(issue_id).parsed_response['issue']
|
41
|
+
@subject = data['subject']
|
42
|
+
@status = data['status']['name']
|
43
|
+
end
|
44
|
+
|
45
|
+
# Add a note to the Issue
|
46
|
+
def add_note(note)
|
47
|
+
p self.class.put(url(self.id),
|
48
|
+
:query => {:notes => note},
|
49
|
+
:body => "") # nginx reject requests without body
|
50
|
+
end
|
51
|
+
|
52
|
+
include HTTParty
|
53
|
+
base_uri "#{config['host']}/issues/"
|
54
|
+
basic_auth config['api_key'], '' # username is api_key, password is empty
|
55
|
+
headers 'Content-type' => 'text/xml' # by-pass rails authenticity token mechanism
|
56
|
+
|
57
|
+
protected
|
58
|
+
|
59
|
+
# Url to redmine/issues
|
60
|
+
def url(id)
|
61
|
+
"/#{id}.xml"
|
62
|
+
end
|
63
|
+
|
64
|
+
def http_get(issue_id)
|
65
|
+
self.class.get(url(issue_id))
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
data/lib/gitmine.rb
CHANGED
@@ -4,109 +4,6 @@ require 'grit'
|
|
4
4
|
require 'yaml'
|
5
5
|
require 'httparty'
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
def self.run
|
10
|
-
gm = Gitmine.new
|
11
|
-
gm.commits.each do |commit|
|
12
|
-
status = commit.issue ? commit.issue.status : 'N/A'
|
13
|
-
puts "#{commit.id[0..6]} #{status.ljust(12)} #{commit.committer.name.ljust(15)} #{commit.message[0..50].gsub("\n", '')}"
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
def initialize
|
18
|
-
@repo = Grit::Repo.new(ENV['PWD'])
|
19
|
-
@branch = File.read('./.git/HEAD').match(/^ref: refs\/heads\/(.+)/)[1]
|
20
|
-
end
|
21
|
-
|
22
|
-
def commits
|
23
|
-
@repo.commits(@branch).map do |c|
|
24
|
-
Commit.new(c)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
class Commit
|
30
|
-
attr_reader :grit_commit
|
31
|
-
|
32
|
-
# Initialize a new Commit objects that delegates methods to the Grit::Commit object passed in
|
33
|
-
def initialize(grit_commit)
|
34
|
-
@grit_commit = grit_commit
|
35
|
-
end
|
36
|
-
|
37
|
-
# Issue associated with this commit
|
38
|
-
# Return nil if their is no associated issue
|
39
|
-
def issue
|
40
|
-
@issue ||= Issue.get_for_commit(message)
|
41
|
-
end
|
42
|
-
|
43
|
-
# Delegate #id to Grit::Commit
|
44
|
-
def id
|
45
|
-
@grit_commit.id
|
46
|
-
end
|
47
|
-
|
48
|
-
protected
|
49
|
-
# Delegate methods to Grit::Commit
|
50
|
-
def method_missing(m, *args, &block)
|
51
|
-
return @grit_commit.send(m, args, block) if @grit_commit.respond_to? m
|
52
|
-
super
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
class Issue
|
57
|
-
CONFIG_FILE = './.gitmine.yml'
|
58
|
-
|
59
|
-
attr_reader :id, :subject, :status
|
60
|
-
|
61
|
-
# Extract the issue_id from a commit message.
|
62
|
-
# Examples:
|
63
|
-
# CommitMsgToIssueId.parse("Message for Issue #123.")
|
64
|
-
# => 123
|
65
|
-
# CommitMsgToIssueId.parse("#123.")
|
66
|
-
# => nil
|
67
|
-
#
|
68
|
-
def self.parse_for_issue_id(msg)
|
69
|
-
match = msg.match(/Issue #(\d+)/)
|
70
|
-
match ? match[1] : nil
|
71
|
-
end
|
72
|
-
|
73
|
-
# Parse the commit_message and get the associated issue if any.
|
74
|
-
def self.get_for_commit(commit_message)
|
75
|
-
issue_id = parse_for_issue_id(commit_message)
|
76
|
-
issue_id ? Issue.get(issue_id) : nil
|
77
|
-
end
|
78
|
-
|
79
|
-
# Get the issue from redmine
|
80
|
-
def self.get(issue_id)
|
81
|
-
Issue.new.tap { |issue|
|
82
|
-
issue.build_via_issue_id(issue_id)
|
83
|
-
}
|
84
|
-
end
|
85
|
-
|
86
|
-
# Config from .gitmine.yml
|
87
|
-
def config
|
88
|
-
@config ||= YAML.load_file(CONFIG_FILE)
|
89
|
-
end
|
90
|
-
|
91
|
-
# Get attributes from redmine and set them all
|
92
|
-
def build_via_issue_id(issue_id)
|
93
|
-
@id = issue_id
|
94
|
-
data = get(issue_id).parsed_response['issue']
|
95
|
-
@subject = data['subject']
|
96
|
-
@status = data['status']['name']
|
97
|
-
end
|
98
|
-
|
99
|
-
protected
|
100
|
-
|
101
|
-
# Url to redmine/issues
|
102
|
-
def url(id)
|
103
|
-
"#{config['host']}/issues/#{id}.xml?key=#{config['api_key']}"
|
104
|
-
end
|
105
|
-
|
106
|
-
# http_get the issue using HTTParty
|
107
|
-
def get(issue_id)
|
108
|
-
HTTParty.get(url(issue_id))
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
7
|
+
%w(gitmine issue commit cli).each do |filename|
|
8
|
+
require File.dirname(__FILE__) + "/gitmine/#{filename}.rb"
|
112
9
|
end
|
data/spec/commit_spec.rb
CHANGED
@@ -30,7 +30,8 @@ describe Gitmine::Commit do
|
|
30
30
|
|
31
31
|
it "should memoize issue" do
|
32
32
|
Gitmine::Issue.should_receive(:get_for_commit).with("Commit message") { issue }.once
|
33
|
-
|
34
|
-
|
33
|
+
2.times do
|
34
|
+
commit.issue.should == issue
|
35
|
+
end
|
35
36
|
end
|
36
37
|
end
|
data/spec/gitmine_spec.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Gitmine do
|
3
|
+
describe Gitmine::Gitmine do
|
4
4
|
before do
|
5
5
|
File.stub!(:read) { "ref: refs/heads/wip" }
|
6
6
|
end
|
7
7
|
|
8
|
-
let(:gitmine) { Gitmine.new }
|
8
|
+
let(:gitmine) { Gitmine::Gitmine.new }
|
9
9
|
|
10
10
|
let(:commit_1) do
|
11
11
|
mock(
|
@@ -41,7 +41,7 @@ describe Gitmine do
|
|
41
41
|
|
42
42
|
it "should check out to the current branch" do
|
43
43
|
Grit::Repo.should_receive(:new).with(ENV['PWD']) { grit_repo }
|
44
|
-
Gitmine.new
|
44
|
+
Gitmine::Gitmine.new
|
45
45
|
end
|
46
46
|
end
|
47
47
|
end
|
data/spec/issue_spec.rb
CHANGED
@@ -10,18 +10,10 @@ describe Gitmine::Issue do
|
|
10
10
|
|
11
11
|
describe "#config" do
|
12
12
|
it "should load the config from config.yml" do
|
13
|
-
|
13
|
+
Gitmine::Issue.config.should == {"host"=>"http://redmine-gitmine.heroku.com", "github" => "pcreux/gitmine"}
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe "#url (protected)" do
|
18
|
-
it "should build up URL based on the config" do
|
19
|
-
issue.send(:url, '123').should == 'http://localhost:3000/issues/123.xml?key=api_key'
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
|
25
17
|
describe "#get_for_commit" do
|
26
18
|
it "should parse the commit message to find a commit_id and call #get" do
|
27
19
|
commit_msg = 'A commit msg Issue #123'
|
@@ -30,19 +22,19 @@ describe Gitmine::Issue do
|
|
30
22
|
end
|
31
23
|
end
|
32
24
|
|
33
|
-
describe "#
|
25
|
+
describe "#find (class method)" do
|
34
26
|
it "should build_via_issue_id" do
|
35
27
|
issue = Gitmine::Issue.new
|
36
28
|
Gitmine::Issue.should_receive(:new) { issue }
|
37
29
|
issue.should_receive(:build_via_issue_id)
|
38
|
-
Gitmine::Issue.
|
30
|
+
Gitmine::Issue.find(123)
|
39
31
|
end
|
40
32
|
end
|
41
33
|
|
42
34
|
describe "#build_via_issue_id" do
|
43
35
|
before do
|
44
36
|
@httparty = mock(:http_party_response, :parsed_response => {'issue' => { 'subject' => 'A subject', 'status' => {'name' => 'Completed'}}})
|
45
|
-
issue.stub!(:
|
37
|
+
issue.stub!(:http_get) { @httparty }
|
46
38
|
end
|
47
39
|
|
48
40
|
it "should get issue data and load attributes" do
|
@@ -58,12 +50,11 @@ describe Gitmine::Issue do
|
|
58
50
|
end
|
59
51
|
end
|
60
52
|
|
61
|
-
describe "#
|
62
|
-
it "should
|
63
|
-
issue.stub!(:
|
64
|
-
|
65
|
-
issue.
|
53
|
+
describe "#add_note" do
|
54
|
+
it "should PUT a note" do
|
55
|
+
issue.stub!(:id) { 1 }
|
56
|
+
issue.class.should_receive(:put).with('/1.xml', :query => {:notes => "Hello"}, :body => "")
|
57
|
+
issue.add_note("Hello")
|
66
58
|
end
|
67
59
|
end
|
68
|
-
|
69
60
|
end
|
metadata
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 961915996
|
5
|
+
prerelease: true
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 1
|
8
|
-
-
|
9
|
-
|
9
|
+
- 4
|
10
|
+
- pre
|
11
|
+
version: 0.1.4.pre
|
10
12
|
platform: ruby
|
11
13
|
authors:
|
12
14
|
- Philippe Creux
|
@@ -14,16 +16,18 @@ autorequire:
|
|
14
16
|
bindir: bin
|
15
17
|
cert_chain: []
|
16
18
|
|
17
|
-
date: 2010-
|
19
|
+
date: 2010-11-11 00:00:00 -08:00
|
18
20
|
default_executable: gitmine
|
19
21
|
dependencies:
|
20
22
|
- !ruby/object:Gem::Dependency
|
21
23
|
name: httparty
|
22
24
|
prerelease: false
|
23
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
24
27
|
requirements:
|
25
28
|
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
30
|
+
hash: 3
|
27
31
|
segments:
|
28
32
|
- 0
|
29
33
|
version: "0"
|
@@ -33,9 +37,11 @@ dependencies:
|
|
33
37
|
name: grit
|
34
38
|
prerelease: false
|
35
39
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
36
41
|
requirements:
|
37
42
|
- - ">="
|
38
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
39
45
|
segments:
|
40
46
|
- 0
|
41
47
|
version: "0"
|
@@ -45,14 +51,16 @@ dependencies:
|
|
45
51
|
name: rspec
|
46
52
|
prerelease: false
|
47
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
48
55
|
requirements:
|
49
|
-
- - "
|
56
|
+
- - "="
|
50
57
|
- !ruby/object:Gem::Version
|
58
|
+
hash: 15
|
51
59
|
segments:
|
52
|
-
- 1
|
53
60
|
- 2
|
54
|
-
-
|
55
|
-
|
61
|
+
- 0
|
62
|
+
- 0
|
63
|
+
version: 2.0.0
|
56
64
|
type: :development
|
57
65
|
version_requirements: *id003
|
58
66
|
description: Git log with status of associated redmine tickets
|
@@ -69,6 +77,7 @@ files:
|
|
69
77
|
- .gitignore
|
70
78
|
- .gitmine.yml
|
71
79
|
- Gemfile
|
80
|
+
- Gemfile.lock
|
72
81
|
- LICENSE
|
73
82
|
- README.rdoc
|
74
83
|
- Rakefile
|
@@ -77,6 +86,10 @@ files:
|
|
77
86
|
- bin/gitmine
|
78
87
|
- gitmine.gemspec
|
79
88
|
- lib/gitmine.rb
|
89
|
+
- lib/gitmine/cli.rb
|
90
|
+
- lib/gitmine/commit.rb
|
91
|
+
- lib/gitmine/gitmine.rb
|
92
|
+
- lib/gitmine/issue.rb
|
80
93
|
- spec/commit_msg_to_issue_id_spec.rb
|
81
94
|
- spec/commit_spec.rb
|
82
95
|
- spec/config.yml
|
@@ -93,29 +106,35 @@ rdoc_options:
|
|
93
106
|
require_paths:
|
94
107
|
- lib
|
95
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
96
110
|
requirements:
|
97
111
|
- - ">="
|
98
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
99
114
|
segments:
|
100
115
|
- 0
|
101
116
|
version: "0"
|
102
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
103
119
|
requirements:
|
104
|
-
- - "
|
120
|
+
- - ">"
|
105
121
|
- !ruby/object:Gem::Version
|
122
|
+
hash: 25
|
106
123
|
segments:
|
107
|
-
-
|
108
|
-
|
124
|
+
- 1
|
125
|
+
- 3
|
126
|
+
- 1
|
127
|
+
version: 1.3.1
|
109
128
|
requirements: []
|
110
129
|
|
111
130
|
rubyforge_project:
|
112
|
-
rubygems_version: 1.3.
|
131
|
+
rubygems_version: 1.3.7
|
113
132
|
signing_key:
|
114
133
|
specification_version: 3
|
115
134
|
summary: Git log with status of associated redmine tickets
|
116
135
|
test_files:
|
117
|
-
- spec/commit_msg_to_issue_id_spec.rb
|
118
|
-
- spec/commit_spec.rb
|
119
136
|
- spec/gitmine_spec.rb
|
120
|
-
- spec/issue_spec.rb
|
121
137
|
- spec/spec_helper.rb
|
138
|
+
- spec/issue_spec.rb
|
139
|
+
- spec/commit_msg_to_issue_id_spec.rb
|
140
|
+
- spec/commit_spec.rb
|