git_tools 0.3.3 → 0.3.4

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: 3d30825406fc8a411689aa5cda1e57ef7ffed29b
4
- data.tar.gz: 1b557251ae763367f7fe60aeab01c8d842afbd03
3
+ metadata.gz: ae48bc933ba646e1b9d815536045cf7d5177d5af
4
+ data.tar.gz: 9e81516a89a6934dfb865ac9d51a7a2a9db0f2ac
5
5
  SHA512:
6
- metadata.gz: 311ab97eae9528e7ec46782950bbe1c7c00ba608aa2884d5ac3c6cb2d2295013af7c79c038fdf4516cf6e54091bcd9bce5ceee65df223877bed65eca6fa67903
7
- data.tar.gz: bfd8214bc882ead2b2ea1f2b6ddf7efeedd01b365a6a7a730a42bf50032e29153b3e9c537d62c3709baa269757cd14beaf950c02eb6eca5e4746612fcd7d6a2d
6
+ metadata.gz: 371645b4777f194bf98d9162ea4c5dffb9849d4ae2c9d23f8f9ecb808b9afe1b1d36fc17bfc641ba345c6377f7bf9fdc640b66b094d747c085dc8c40e2a5c6a1
7
+ data.tar.gz: edc78dff61ea7122671136aa79cee33cea9aca13dffc4b3287aded998c502676596a46777546972fe4db65259fc97b702a5cf90a90b43ccb78383677a82742ca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -56,6 +56,9 @@ module GitTools
56
56
  @remote = remote
57
57
  @protected_branches = protected_branches || Branches.default_keep_list
58
58
  @master_branch = master_branch || get_remote_head || MASTER_BRANCH
59
+
60
+ git_remote_prune # Prune before collecting branch names.
61
+
59
62
  @branches = branches
60
63
 
61
64
  if @master_branch.empty?
@@ -66,7 +69,6 @@ module GitTools
66
69
 
67
70
  puts "Merged branch threshold is #{@@age_threshold_for_deleting_remote_branches_in_master/Time::SECONDS_IN_DAY} days." if $VERBOSE
68
71
  puts "Unmerged branch threshold is #{@@age_threshold_for_deleting_any_unmerged_branches/Time::SECONDS_IN_DAY} days." if $VERBOSE
69
-
70
72
  end
71
73
 
72
74
  def local?
@@ -78,8 +80,6 @@ module GitTools
78
80
  end
79
81
 
80
82
  def run!
81
- git_remote_prune
82
-
83
83
  puts "Skipping prompts" if $VERBOSE && ActionExecutor.skip_prompted
84
84
  (@branches - protected_branches - [master_branch] ).each do |branch|
85
85
  branch = Branch.new(branch, remote)
@@ -185,9 +185,10 @@ module GitTools
185
185
  DATE_REGEXP = /^Date:\s+(.*)$/
186
186
 
187
187
  def self.age(branch)
188
- time = DATE_REGEXP.match(`git log --shortstat --date=iso -n 1 #{branch}`)
188
+ cmd = "git log --shortstat --date=iso -n 1 #{branch}"
189
+ time = DATE_REGEXP.match(`#{cmd}`)
189
190
  if time.nil?
190
- raise "Error due to unexpected git output."
191
+ raise "Error due to unexpected git output on command: #{cmd}."
191
192
  else
192
193
  Time.parse(time[1])
193
194
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Birkir A. Barkarson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docopt