local_ci 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 408a3e34c26196b5f280ffb77aa68162ea4118a13309d29365bb4e064ccc940f
4
- data.tar.gz: 893f1167a5a294e58f9f8d27452c2e85879263cbc4e9cbe934ef555a760eb257
3
+ metadata.gz: 325240cf896966e5fe98d945c9485e3f4b30a32db4762d77f5c3e97664e3f7b1
4
+ data.tar.gz: dc2630284356e1ba3a7f22f97107d7c429f423daf2a0e64835b6803e7c935aef
5
5
  SHA512:
6
- metadata.gz: d5e5b78327fa679adf3b29a7b658a7134713d07dd20abb19dde41130d373b490bb00c1241987886beafaa8dbb4c47abf64b0ab07a513f412dcbb3495f09eaef4
7
- data.tar.gz: c36f886be0c3ddd7f98d24d850c89dabc2962cdf286baa8fde1fd927deab952ea5bc39b174609882e80992f8742546e62cb5f79b129b87ae3b85e399a7c48f5d
6
+ metadata.gz: bcbcbe5912235021b56063ebe5b94bf09af69d82aaba2da3b378af1c7c98bf779d684db9eb301c99e231a0af7bf38f5fef69c359bfd82d9aa4b7dc90858851eb
7
+ data.tar.gz: b23429e6de91524c432b99951a1e060cfaaa0de32be800591f1020a44f4d1c7aca7db5fd317b2cf6aaccb4517eb59a24c37c73a85a28f6f5e846a88a4fc73443
@@ -116,7 +116,7 @@ module LocalCI
116
116
 
117
117
  def duration
118
118
  seconds = Time.now - @start
119
- minutes = seconds / 60
119
+ minutes = (seconds / 60).to_i
120
120
  hours = minutes / 60
121
121
 
122
122
  seconds %= 60
@@ -126,10 +126,10 @@ module LocalCI
126
126
  "#{hours}h #{minutes}m"
127
127
 
128
128
  elsif minutes >= 1
129
- "#{minutes}m #{seconds}s"
129
+ "#{minutes}m #{seconds.floor}s"
130
130
 
131
131
  else
132
- "#{seconds.round(2)}s"
132
+ "%.2fs" % seconds
133
133
  end
134
134
  end
135
135
 
data/local_ci.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "local_ci"
3
- s.version = "0.0.4"
3
+ s.version = "0.0.5"
4
4
  s.summary = "Run CI locally"
5
5
  s.description = "A way to run CI locally but also able to run easily on your hosted CI"
6
6
  s.authors = ["Sean Earle"]
@@ -362,12 +362,19 @@ describe LocalCI::Output do
362
362
 
363
363
  expect(@output.duration).to eq("39.43s")
364
364
  end
365
+
366
+ it "shows seconds with two decimal places even if it's exactly a second" do
367
+ @output.instance_variable_set(:@start, 5.0)
368
+ allow(Time).to receive(:now).and_return(45)
369
+
370
+ expect(@output.duration).to eq("40.00s")
371
+ end
365
372
  end
366
373
 
367
374
  context "when less than 60 minutes" do
368
375
  it "shows the minutes and seconds" do
369
376
  @output.instance_variable_set(:@start, 10)
370
- allow(Time).to receive(:now).and_return(1240)
377
+ allow(Time).to receive(:now).and_return(1240.1)
371
378
 
372
379
  expect(@output.duration).to eq("20m 30s")
373
380
  end
@@ -376,7 +383,7 @@ describe LocalCI::Output do
376
383
  context "when greater than 60 minutes" do
377
384
  it "shows the hours and minutes" do
378
385
  @output.instance_variable_set(:@start, 10)
379
- allow(Time).to receive(:now).and_return(3800)
386
+ allow(Time).to receive(:now).and_return(3800.1)
380
387
 
381
388
  expect(@output.duration).to eq("1h 3m")
382
389
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: local_ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Earle