gitmine 0.1.12 → 0.1.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +12 -11
- data/VERSION +1 -1
- data/gitmine.gemspec +2 -3
- data/lib/gitmine/branch.rb +1 -0
- data/lib/gitmine/cli.rb +1 -1
- data/lib/gitmine/config.rb +0 -12
- data/lib/gitmine/issue.rb +0 -11
- data/lib/gitmine.rb +1 -4
- metadata +4 -5
- data/lib/gitmine/hudson_job.rb +0 -41
data/Gemfile.lock
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
GEM
|
2
|
+
remote: http://rubygems.org/
|
2
3
|
specs:
|
3
4
|
crack (0.1.8)
|
4
5
|
diff-lcs (1.1.2)
|
@@ -8,19 +9,19 @@ GEM
|
|
8
9
|
httparty (0.6.1)
|
9
10
|
crack (= 0.1.8)
|
10
11
|
mime-types (1.16)
|
11
|
-
rspec (2.
|
12
|
-
rspec-core (
|
13
|
-
rspec-expectations (
|
14
|
-
rspec-mocks (
|
15
|
-
rspec-core (2.
|
16
|
-
rspec-expectations (2.
|
17
|
-
diff-lcs (
|
18
|
-
rspec-mocks (2.
|
12
|
+
rspec (2.5.0)
|
13
|
+
rspec-core (~> 2.5.0)
|
14
|
+
rspec-expectations (~> 2.5.0)
|
15
|
+
rspec-mocks (~> 2.5.0)
|
16
|
+
rspec-core (2.5.1)
|
17
|
+
rspec-expectations (2.5.0)
|
18
|
+
diff-lcs (~> 1.1.2)
|
19
|
+
rspec-mocks (2.5.0)
|
19
20
|
|
20
21
|
PLATFORMS
|
21
22
|
ruby
|
22
23
|
|
23
24
|
DEPENDENCIES
|
24
|
-
grit
|
25
|
-
httparty
|
26
|
-
rspec (
|
25
|
+
grit (= 2.0.0)
|
26
|
+
httparty (= 0.6.1)
|
27
|
+
rspec (>= 2.0.0)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.13
|
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.13"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Philippe Creux"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-03-22}
|
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}
|
@@ -37,7 +37,6 @@ Gem::Specification.new do |s|
|
|
37
37
|
"lib/gitmine/commit.rb",
|
38
38
|
"lib/gitmine/config.rb",
|
39
39
|
"lib/gitmine/git.rb",
|
40
|
-
"lib/gitmine/hudson_job.rb",
|
41
40
|
"lib/gitmine/issue.rb",
|
42
41
|
"spec/commit_msg_to_issue_id_spec.rb",
|
43
42
|
"spec/commit_spec.rb",
|
data/lib/gitmine/branch.rb
CHANGED
data/lib/gitmine/cli.rb
CHANGED
@@ -23,7 +23,7 @@ gitmine checkout ISSUE_ID
|
|
23
23
|
Example: gitmine checkout 1234
|
24
24
|
|
25
25
|
gitmine reviewed ISSUE_ID
|
26
|
-
Merge the branch to master, delete remote branch,
|
26
|
+
Merge the branch to master, delete remote branch, update redmine issue status
|
27
27
|
Example: gitmine reviewed 1234
|
28
28
|
|
29
29
|
gitmine delete ISSUE_ID
|
data/lib/gitmine/config.rb
CHANGED
@@ -19,18 +19,6 @@ class Gitmine
|
|
19
19
|
config['github']
|
20
20
|
end
|
21
21
|
|
22
|
-
def hudson_host
|
23
|
-
(config['hudson'] || {})['host']
|
24
|
-
end
|
25
|
-
|
26
|
-
def hudson_username
|
27
|
-
(config['hudson'] || {})['username']
|
28
|
-
end
|
29
|
-
|
30
|
-
def hudson_password
|
31
|
-
(config['hudson'] || {})['password']
|
32
|
-
end
|
33
|
-
|
34
22
|
def statuses
|
35
23
|
config['statuses']
|
36
24
|
end
|
data/lib/gitmine/issue.rb
CHANGED
@@ -35,12 +35,6 @@ class Gitmine
|
|
35
35
|
RemoteBranch.find(self.id)
|
36
36
|
end
|
37
37
|
|
38
|
-
def delete_hudson_jobs
|
39
|
-
if Config.hudson_host
|
40
|
-
hudson_jobs.map(&:delete!)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
38
|
# Get attributes from redmine and set them all
|
45
39
|
def build_via_issue_id(issue_id)
|
46
40
|
@id = issue_id
|
@@ -84,10 +78,5 @@ class Gitmine
|
|
84
78
|
def http_get(issue_id)
|
85
79
|
self.class.get(url(issue_id))
|
86
80
|
end
|
87
|
-
|
88
|
-
def hudson_jobs
|
89
|
-
HudsonJob.all_by_name_including(self.id)
|
90
|
-
end
|
91
|
-
|
92
81
|
end
|
93
82
|
end
|
data/lib/gitmine.rb
CHANGED
@@ -93,15 +93,12 @@ class Gitmine
|
|
93
93
|
puts yellow("Delete remote branch")
|
94
94
|
issue.remote_branch.delete
|
95
95
|
|
96
|
-
puts yellow("Delete hudson jobs")
|
97
|
-
issue.delete_hudson_jobs
|
98
|
-
|
99
96
|
puts yellow("Set Ticket status to 'reviewed'")
|
100
97
|
issue.update_status("reviewed")
|
101
98
|
end
|
102
99
|
end
|
103
100
|
|
104
101
|
|
105
|
-
%w(config issue commit cli colors branch git
|
102
|
+
%w(config issue commit cli colors branch git).each do |filename|
|
106
103
|
require File.dirname(__FILE__) + "/gitmine/#{filename}.rb"
|
107
104
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitmine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 13
|
10
|
+
version: 0.1.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Philippe Creux
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-03-22 00:00:00 -07:00
|
19
19
|
default_executable: gitmine
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -94,7 +94,6 @@ files:
|
|
94
94
|
- lib/gitmine/commit.rb
|
95
95
|
- lib/gitmine/config.rb
|
96
96
|
- lib/gitmine/git.rb
|
97
|
-
- lib/gitmine/hudson_job.rb
|
98
97
|
- lib/gitmine/issue.rb
|
99
98
|
- spec/commit_msg_to_issue_id_spec.rb
|
100
99
|
- spec/commit_spec.rb
|
data/lib/gitmine/hudson_job.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
class Gitmine
|
2
|
-
class HudsonJob
|
3
|
-
class Http
|
4
|
-
include HTTParty
|
5
|
-
|
6
|
-
base_uri Config.hudson_host
|
7
|
-
basic_auth(Config.hudson_username, Config.hudson_password) if Config.hudson_username
|
8
|
-
headers 'Content-type' => 'text/xml'
|
9
|
-
# I get timeout errors on heroku but not on local env. Is that because of REE-1.8.7 ?
|
10
|
-
# Workaround: Set the timeout to 10 seconds and rescue timeout errors.
|
11
|
-
default_timeout 8
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.all_by_name_including(pattern)
|
15
|
-
HudsonJob.all.select { |projects| projects.name[pattern] }
|
16
|
-
end
|
17
|
-
|
18
|
-
def self.all
|
19
|
-
r = Http.get('/api/xml')
|
20
|
-
return [] unless r.code == 200
|
21
|
-
r.parsed_response["hudson"]["job"].map do |jobs_data|
|
22
|
-
new(jobs_data["name"])
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
attr_accessor :name
|
27
|
-
|
28
|
-
def initialize(name)
|
29
|
-
@name = name
|
30
|
-
end
|
31
|
-
|
32
|
-
def delete!
|
33
|
-
r = Http.post("/job/#{name}/doDelete")
|
34
|
-
raise "Failed to delete job #{name}" unless r.code == 200
|
35
|
-
puts green(" - #{name} deleted!")
|
36
|
-
|
37
|
-
true
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|