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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 661c20167ace8b36008890eaee10ac93d662c591
4
- data.tar.gz: f85c7b2d8155cb91edff3795baec40438ff80cb0
3
+ metadata.gz: 74699d7b247848e13c8245ab7627b03d1f6d63f9
4
+ data.tar.gz: 726cff01517823e7cde2b09135c0c25120034079
5
5
  SHA512:
6
- metadata.gz: 6f8867b4f850c67601ab97ac1819b1491743a51b5e6186cecd1d2d9fcc615c46b0ca4efdb06c74b65c19e721c48155710f2a7c89334941f0e315746706a6dfc8
7
- data.tar.gz: df07738545e69a9203ec2d7254af5bfa4f8876f4c7c81df180f3c690d5c514661500aad7ac24ab64f218b9c1f4a7fd560b7bc01a5b1574ba869e2331dc3f57d7
6
+ metadata.gz: 51c3b771658bc41ab78f7a8fc68c692c3559807648ae42688c34607a673978e1d4acb910de7abccf2456ea998a286b79d9c3f189b18ab447008382a95301702c
7
+ data.tar.gz: bb56e28f54e041179172900a94a48ac7f227a384bd4d8ba39eab2cc4088f90cd0af38f316aaaa98d9e6b750c5d679007743c8d8bf87c888eef2b520b9aeaf278
data/.gitignore CHANGED
@@ -12,6 +12,7 @@ lib/bundler/man
12
12
  pkg
13
13
  rdoc
14
14
  spec/reports
15
+ spec/test_dir
15
16
  test/tmp
16
17
  test/version_tmp
17
18
  tmp
@@ -1,3 +1,3 @@
1
1
  module ThinOutBackups
2
- Version = "0.0.3"
2
+ Version = "0.0.4"
3
3
  end
@@ -8,7 +8,7 @@ require 'delegate'
8
8
 
9
9
  #require 'rubygems'
10
10
  require 'facets/time'
11
- require 'facets/time/hence'
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.hence(1, unit)
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.ago(1, bucket.unit)
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.ago(1, bucket.unit)}"
280
- time_min = time_min.ago(1, bucket.unit)
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
- #system $command
125
- # TODO: also capture output of command and check it against expected
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.3
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-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facets