git-cleanup 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/git-cleanup.rb +12 -0
  3. metadata +3 -4
  4. data/git-cleanup.gemspec +0 -53
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
data/lib/git-cleanup.rb CHANGED
@@ -9,6 +9,8 @@ class GitCleanup
9
9
 
10
10
  master = repo.heads.find { |h| h.name == 'master' }
11
11
 
12
+ self.prune(repo)
13
+
12
14
  local_branches = repo.branches.map { |b| b.name }
13
15
 
14
16
  remote_branches = Branch.remote(repo).select { |b| b.commit.lazy_source }
@@ -55,6 +57,16 @@ class GitCleanup
55
57
  end
56
58
  end
57
59
  end
60
+
61
+ # Prunes branches that have already been removed on origin
62
+ def self.prune(repo)
63
+ list = repo.git.native(:remote, {}, 'prune', '-n', "origin")
64
+ if list.any?
65
+ Helper.boolean "Planning to prune the following. Ok?\n#{list}" do
66
+ repo.git.native(:remote, {}, 'prune', "origin")
67
+ end
68
+ end
69
+ end
58
70
  end
59
71
 
60
72
  require 'git-cleanup/branch'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Martyn Loughran
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-22 00:00:00 +01:00
17
+ date: 2010-11-05 00:00:00 +00:00
18
18
  default_executable: git-cleanup
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -48,7 +48,6 @@ files:
48
48
  - Rakefile
49
49
  - VERSION
50
50
  - bin/git-cleanup
51
- - git-cleanup.gemspec
52
51
  - lib/git-cleanup.rb
53
52
  - lib/git-cleanup/branch.rb
54
53
  - lib/git-cleanup/helper.rb
data/git-cleanup.gemspec DELETED
@@ -1,53 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{git-cleanup}
8
- s.version = "0.1.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Martyn Loughran"]
12
- s.date = %q{2010-09-22}
13
- s.default_executable = %q{git-cleanup}
14
- s.description = %q{Simplify cleaning up old git branches}
15
- s.email = %q{me@mloughran.com}
16
- s.executables = ["git-cleanup"]
17
- s.extra_rdoc_files = [
18
- "LICENSE",
19
- "README.rdoc"
20
- ]
21
- s.files = [
22
- ".document",
23
- ".gitignore",
24
- "LICENSE",
25
- "README.rdoc",
26
- "Rakefile",
27
- "VERSION",
28
- "bin/git-cleanup",
29
- "git-cleanup.gemspec",
30
- "lib/git-cleanup.rb",
31
- "lib/git-cleanup/branch.rb",
32
- "lib/git-cleanup/helper.rb"
33
- ]
34
- s.homepage = %q{http://github.com/mloughran/git-cleanup}
35
- s.rdoc_options = ["--charset=UTF-8"]
36
- s.require_paths = ["lib"]
37
- s.rubygems_version = %q{1.3.6}
38
- s.summary = %q{Simplify cleaning up old git branches}
39
-
40
- if s.respond_to? :specification_version then
41
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
42
- s.specification_version = 3
43
-
44
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
45
- s.add_runtime_dependency(%q<grit>, ["~> 2.2.0"])
46
- else
47
- s.add_dependency(%q<grit>, ["~> 2.2.0"])
48
- end
49
- else
50
- s.add_dependency(%q<grit>, ["~> 2.2.0"])
51
- end
52
- end
53
-