thin_out_backups 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/thin_out_backups/version.rb +1 -1
- data/lib/thin_out_backups.rb +5 -5
- data/spec/thin_out_backups_spec.rb +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74699d7b247848e13c8245ab7627b03d1f6d63f9
|
4
|
+
data.tar.gz: 726cff01517823e7cde2b09135c0c25120034079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51c3b771658bc41ab78f7a8fc68c692c3559807648ae42688c34607a673978e1d4acb910de7abccf2456ea998a286b79d9c3f189b18ab447008382a95301702c
|
7
|
+
data.tar.gz: bb56e28f54e041179172900a94a48ac7f227a384bd4d8ba39eab2cc4088f90cd0af38f316aaaa98d9e6b750c5d679007743c8d8bf87c888eef2b520b9aeaf278
|
data/.gitignore
CHANGED
data/lib/thin_out_backups.rb
CHANGED
@@ -8,7 +8,7 @@ require 'delegate'
|
|
8
8
|
|
9
9
|
#require 'rubygems'
|
10
10
|
require 'facets/time'
|
11
|
-
require 'facets/time/
|
11
|
+
require 'facets/time/shift'
|
12
12
|
require 'active_support/core_ext/time/calculations'
|
13
13
|
require 'active_support/core_ext/date/calculations'
|
14
14
|
require 'colored'
|
@@ -101,7 +101,7 @@ class ThinOutBackups::Command
|
|
101
101
|
raise "unexpected unit #{unit}"
|
102
102
|
end
|
103
103
|
# We actually want to use the *next* interval (in the future) as our start_time because we will be using this as our max and going backwards in time...
|
104
|
-
beginning_of_interval.
|
104
|
+
beginning_of_interval.shift(1, unit)
|
105
105
|
else
|
106
106
|
start_time
|
107
107
|
end
|
@@ -257,7 +257,7 @@ class ThinOutBackups::Command
|
|
257
257
|
puts "Trying to fill bucket '#{bucket.name}' (quota: #{bucket.quota})...".magenta
|
258
258
|
|
259
259
|
time_max = bucket.start_time
|
260
|
-
time_min = time_max.
|
260
|
+
time_min = time_max.shift(-1, bucket.unit)
|
261
261
|
|
262
262
|
#puts "Earliest_file_time: #{earliest_file_time}"
|
263
263
|
while time_max > earliest_file_time
|
@@ -276,8 +276,8 @@ class ThinOutBackups::Command
|
|
276
276
|
end
|
277
277
|
|
278
278
|
time_max = time_min
|
279
|
-
#puts "Stepping back from #{time_min} by 1 #{bucket.unit} => #{time_min.
|
280
|
-
time_min = time_min.
|
279
|
+
#puts "Stepping back from #{time_min} by 1 #{bucket.unit} => #{time_min.shift(-1, bucket.unit)}"
|
280
|
+
time_min = time_min.shift(-1, bucket.unit)
|
281
281
|
(puts 'Filled quota!'.green; break) if bucket.satisfied?
|
282
282
|
end
|
283
283
|
end
|
@@ -120,9 +120,9 @@ describe ThinOutBackups::Command, "when calling `#{$command}`" do
|
|
120
120
|
system "touch #{dir}/#{subdir}/some_other_folder"
|
121
121
|
end
|
122
122
|
|
123
|
-
puts %($command=#{($command).inspect})
|
124
|
-
|
125
|
-
# TODO: also
|
123
|
+
#puts %($command=#{($command).inspect})
|
124
|
+
output = `#{$command}`
|
125
|
+
# TODO: also check output against expected
|
126
126
|
end
|
127
127
|
|
128
128
|
it "keeps/removes the correct files" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thin_out_backups
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Rick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|