march-audit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/march +2 -2
- data/lib/march/audit.rb +2 -1
- data/lib/march/repo.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c5a98096be4a1aa8fc35ca0c04fd0982b0057cd
|
4
|
+
data.tar.gz: b7d8ff617c92cc7655cb702efed387d8211539c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94314327decbd3f9678015fe4232f77db19b3e64d8bf5935b9b0279aabc1b5af68334a4e38180aab0acac917170af46c3b031be33dfb4deabcf116c3d94d6a67
|
7
|
+
data.tar.gz: f5f0265a1290a101b048f0127895dedb27f2c1eff957b85cdb94a2b8bf4db8fef4624286400bee904797f44b94a000c53a40486b0562c9aaac04cf5d771387af
|
data/bin/march
CHANGED
@@ -20,10 +20,10 @@ module March
|
|
20
20
|
March::Audit.merged(repo, options[:interactive], options[:destructive])
|
21
21
|
end
|
22
22
|
|
23
|
-
option :max_age, default:
|
23
|
+
option :max_age, default: 14, type: :numeric
|
24
24
|
desc 'audit_age NAMESPACE REPO', 'only audit branches for age'
|
25
25
|
def audit_age(namespace, repo)
|
26
|
-
ENV.store('MAX_AGE', options[:max_age])
|
26
|
+
ENV.store('MAX_AGE', options[:max_age].to_s)
|
27
27
|
repo = March::Repo.new(namespace, repo)
|
28
28
|
March::Audit.age(repo, options[:interactive], options[:destructive])
|
29
29
|
end
|
data/lib/march/audit.rb
CHANGED
@@ -39,7 +39,8 @@ module March
|
|
39
39
|
msgs = repo.branch_age.each_with_object({}) do |(name, dates), acc|
|
40
40
|
created = ChronicDuration.output(Time.now - dates[:oldest], weeks: true, units: 2)
|
41
41
|
updated = ChronicDuration.output(Time.now - dates[:newest], weeks: true, units: 2)
|
42
|
-
|
42
|
+
time_diff = (ENV['MAX_AGE'].to_i * 3600 * 24 || 3600 * 24 * 14)
|
43
|
+
if (Time.now - dates[:newest]) > time_diff
|
43
44
|
acc[name] = "Branch #{name} was created #{created} ago and updated #{updated} ago and is probably owned by #{repo.branch_owners[name].join(', ')}"
|
44
45
|
end
|
45
46
|
end
|
data/lib/march/repo.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: march-audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Gwilliam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
@@ -127,7 +127,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
127
127
|
version: '0'
|
128
128
|
requirements: []
|
129
129
|
rubyforge_project:
|
130
|
-
rubygems_version: 2.
|
130
|
+
rubygems_version: 2.6.7
|
131
131
|
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: automate audit of repository branches
|