bibliotech 0.2.2 → 0.2.3

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
  SHA1:
3
- metadata.gz: baf643d74df4ae3246259e010a5ec4bcbac3ae96
4
- data.tar.gz: 0906c68dbda1ec2e7ef14e300cb1ce9ca88665bb
3
+ metadata.gz: 0d3db00ae690a5cadb9e6ba8f82c57880ac90ae7
4
+ data.tar.gz: 3bfaba7cd66defa3099e1fa1b368652c0e31f8ec
5
5
  SHA512:
6
- metadata.gz: 66002dc0d4e455d86d7441ec737a4666f411bc96434befe6c9d0b077eb6131f82ae6b2a9c4a3348b73f7c902ffd87daa08a9b0465efacb9b779e2376e5da0b28
7
- data.tar.gz: 4cc25d81f1d5639c99d6d6ff739f35b04aef4200b0ce17adae597665b5398f6013879cba206a47131427105f832d080e9741c06503c208e32cbd94131cefe897
6
+ metadata.gz: db6a21821e71a1669902aa2d08ddaa91f876e74b04508da8ea725504c604c4dc07b724b92791141b2dae6ca2166500e5278ad719ec51f2bf40fbd47bfe9a3fcb
7
+ data.tar.gz: a9bb0ed38331a9c0221de3c6a3a09569c8a2d1a2b157612fe3ab5f0ba44f843e0fa78f567e67cb369095b74da8c4481a536fa1e203b02e40270c6612381fa193
@@ -11,11 +11,13 @@ module BiblioTech
11
11
  end
12
12
 
13
13
  def end_time(file_list)
14
+ return Time.at(0) if file_list.empty?
14
15
  file_list.map{|record| record.timestamp}.max
15
16
  end
16
17
 
17
18
  def compute_start_time(file_list)
18
19
  limit_time = Time.at(0)
20
+ return limit_time if file_list.empty?
19
21
  unless limit.nil?
20
22
  limit_time = end_time(file_list) - limit * freq_seconds
21
23
  end
@@ -66,6 +66,14 @@ module BiblioTech::Backups
66
66
  end
67
67
  end
68
68
 
69
+ context "when there are no backups yet" do
70
+ let(:unfiltered_files){ [] }
71
+
72
+ it "should return 0 kept files" do
73
+ expect(kept_files.count).to eql 0
74
+ end
75
+ end
76
+
69
77
  context "when there's more than enough backups" do
70
78
  let(:interval){ 60*60*12 }
71
79
  let(:frequency) { 15 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliotech
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Dorn
@@ -128,7 +128,7 @@ rdoc_options:
128
128
  - --main
129
129
  - doc/README
130
130
  - --title
131
- - bibliotech-0.2.2 Documentation
131
+ - bibliotech-0.2.3 Documentation
132
132
  require_paths:
133
133
  - lib/
134
134
  required_ruby_version: !ruby/object:Gem::Requirement