git-lead-time 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +6 -0
- data/git-lead-time.gemspec +1 -1
- data/lib/git_lead_time.rb +1 -1
- data/lib/git_lead_time/git.rb +1 -1
- data/lib/git_lead_time/lead_time_command.rb +8 -3
- data/lib/git_lead_time/merge_enumerator.rb +1 -1
- data/lib/git_lead_time/version.rb +1 -1
- data/spec/lib/git_lead_time/calculator_spec.rb +9 -0
- data/spec/support/dates.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcfb5c614ffcd5563a78959b809db7d8f2a5eecc
|
4
|
+
data.tar.gz: e4828df586ef5745d824c6ca70068de7d17708de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 846df02ae574988b48e9381481aae89d18998f207e3adc43a81018514790e1b3e3355ca0e6d9a2112885c7558ff394608b54a0802c5013356257719a01719a97
|
7
|
+
data.tar.gz: aa6ed022f7396a273bf2b410b86805ce4f4f0a3bda76b8cee9db5adf8a72835fa468620c6aa98b0cca41b977b68ea9989d45c42e03b6b9136ddde3a000051c17
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.0.3
|
2
|
+
|
3
|
+
* Print all lines, one at a time, deal with being piped to `head`.
|
4
|
+
* Relax `business_time` version requirement.
|
5
|
+
* Deal with multiple timezones, everything is converted to local.
|
6
|
+
|
1
7
|
## 0.0.2
|
2
8
|
|
3
9
|
* Take nights and weekends into account when calculating lead time.
|
data/git-lead-time.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "business_time", "
|
21
|
+
spec.add_dependency "business_time", ">= 0.6.0"
|
22
22
|
|
23
23
|
spec.add_development_dependency "bundler", "~> 1.5"
|
24
24
|
spec.add_development_dependency "rake"
|
data/lib/git_lead_time.rb
CHANGED
data/lib/git_lead_time/git.rb
CHANGED
@@ -4,13 +4,18 @@ require_relative 'lead_time_format'
|
|
4
4
|
|
5
5
|
module GitLeadTime
|
6
6
|
class LeadTimeCommand
|
7
|
-
attr_reader :branch, :
|
8
|
-
def initialize(ref="HEAD")
|
7
|
+
attr_reader :branch, :output
|
8
|
+
def initialize(ref="HEAD", output: $stdout)
|
9
9
|
@branch = Branch.new(ref)
|
10
|
+
@output = output
|
10
11
|
end
|
11
12
|
|
12
13
|
def run
|
13
|
-
branch.each_merge
|
14
|
+
branch.each_merge do |merge|
|
15
|
+
output.puts format_merge(merge)
|
16
|
+
end
|
17
|
+
rescue Errno::EPIPE
|
18
|
+
# Our buffer got closed by `head` or the like.
|
14
19
|
end
|
15
20
|
|
16
21
|
def format_merge(merge)
|
@@ -31,5 +31,14 @@ module GitLeadTime
|
|
31
31
|
|
32
32
|
expect(lead_time).to eq 1.0 / 8.0
|
33
33
|
end
|
34
|
+
|
35
|
+
it "should deal with time zones" do
|
36
|
+
start_date = Time.parse "2014-03-20 17:36:27 -0400"
|
37
|
+
end_date = Time.parse "2014-03-20 16:18:37 -0700"
|
38
|
+
|
39
|
+
lead_time = calculator.lead_time(start_date: start_date, end_date: end_date)
|
40
|
+
|
41
|
+
expect(lead_time).to be > 0.2
|
42
|
+
end
|
34
43
|
end
|
35
44
|
end
|
data/spec/support/dates.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-lead-time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Jensen
|
@@ -14,16 +14,16 @@ dependencies:
|
|
14
14
|
name: business_time
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|