duplicati 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NTRmYTk2NjJmZTM5NGE2NDI0YTYzNWM5YjJkOGU0NTg5MzNmMThiZA==
5
- data.tar.gz: !binary |-
6
- NGQyNDg2YWJmNDUwMzg5ODc2NjBlZWY2YWNhZjM3MmNjY2Q4OGM1MQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YWZmY2UyMzNhYjJlZTBmYTcxZDcwMTg4YWVhZDhiYjE1YTY4NmUzYjU0YTM1
10
- MDQ2NzdkNjdiYjY3MzE0MWQwNzQ0YTM1NGViZTc2ZmU4ZDJiZTI2MzM0Yjkw
11
- MDVjNzc1YzE4YTUxNzQ0MDg2NzU2YzllNzRjOGU0MzFlMjA5NDU=
12
- data.tar.gz: !binary |-
13
- MWQxZWI4YWEyYTEzOTQzMTkzMDNhZjJjN2ZiZTBiMGUzNTZmYjJjM2Y2NWMz
14
- NGFiNmJkMjczOGVkYzE0NTkyODFiOTBlYzhiYjA1OGQzNmJmNDA1M2MwYjc0
15
- YTMyNDllMGMyMGRiMWJmNGJmY2Q4ZDZjMWM1ZGFhMmFhNjhkMGU=
2
+ SHA1:
3
+ metadata.gz: 05f0064dbe23b42eddf3a543291b4d770345082c
4
+ data.tar.gz: 6709d971936358a3dc03b3d477fbd9ab0e93a617
5
+ SHA512:
6
+ metadata.gz: 1a065d2297fd8264061df535025fa79cf7003cc9543f939f45d0bf7f6a002adc157b6dfd6fbb8039ea02b6d39b4c3d86d97e7b919f759dfa5c9f8252778e38e6
7
+ data.tar.gz: 71afee240bf511c2f8f9d630c30bf9728360ed3214bb5c605e8ad01c6bdc57834e196f38d6b7e71576d602152da0157f78ecab266c5419d00368c1dd6b90a83f
@@ -1,13 +1,10 @@
1
1
  class Duplicati
2
- class Backup
2
+ class Backup < Command
3
3
  def initialize(opts)
4
- @duplicati_path = opts[:duplicati_path]
4
+ super
5
5
  @backup_paths = opts[:backup_paths] or raise ":backup_paths option is missing for backup!"
6
- @backup_store_path = opts[:backup_store_path] or raise ":backup_store_path option is missing for backup!"
7
- @backup_encryption_key = opts[:backup_encryption_key]
8
6
  @inclusion_filters = opts[:inclusion_filters] || []
9
7
  @exclusion_filters = opts[:exclusion_filters] || []
10
- @log_path = opts[:log_path]
11
8
  end
12
9
 
13
10
  def command
@@ -27,12 +24,6 @@ class Duplicati
27
24
 
28
25
  private
29
26
 
30
- def encryption_option
31
- @backup_encryption_key ?
32
- %Q[--passphrase="#{@backup_encryption_key}"] :
33
- %Q[--no-encryption]
34
- end
35
-
36
27
  def backup_paths
37
28
  @backup_paths.map do |path|
38
29
  path = path.strip.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
@@ -1,12 +1,5 @@
1
1
  class Duplicati
2
- class Clean
3
- def initialize(opts)
4
- @duplicati_path = opts[:duplicati_path]
5
- @backup_store_path = opts[:backup_store_path] or raise ":backup_store_path option is missing for clean!"
6
- @backup_encryption_key = opts[:backup_encryption_key]
7
- @log_path = opts[:log_path]
8
- end
9
-
2
+ class Clean < Command
10
3
  def command
11
4
  %Q["#{@duplicati_path}" delete-all-but-n 5 "#{@backup_store_path}"
12
5
  #{encryption_option}
@@ -14,12 +7,5 @@ class Duplicati
14
7
  1>>"#{@log_path}"
15
8
  2>&1]
16
9
  end
17
-
18
- private
19
-
20
- def encryption_option
21
- %Q[--passphrase="#{@backup_encryption_key}"] if @backup_encryption_key
22
- end
23
-
24
10
  end
25
11
  end
@@ -0,0 +1,19 @@
1
+ class Duplicati
2
+ class Command
3
+
4
+ def initialize(opts)
5
+ @duplicati_path = opts[:duplicati_path]
6
+ @backup_store_path = opts[:backup_store_path] or raise ":backup_store_path option is missing!"
7
+ @backup_encryption_key = opts[:backup_encryption_key]
8
+ @log_path = opts[:log_path]
9
+ end
10
+
11
+ private
12
+
13
+ def encryption_option
14
+ @backup_encryption_key ?
15
+ %Q[--passphrase="#{@backup_encryption_key}"] :
16
+ %Q[--no-encryption]
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  class Duplicati
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
data/lib/duplicati.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require File.expand_path("duplicati/version", File.dirname(__FILE__))
2
+ require File.expand_path("duplicati/command", File.dirname(__FILE__))
2
3
  require File.expand_path("duplicati/backup", File.dirname(__FILE__))
3
4
  require File.expand_path("duplicati/clean", File.dirname(__FILE__))
4
5
  require File.expand_path("duplicati/notification/base", File.dirname(__FILE__))
@@ -13,7 +13,7 @@ describe Duplicati::Backup do
13
13
  it "raises an Exception if backup store path is not provided" do
14
14
  expect {
15
15
  Duplicati::Backup.new(:backup_paths => [])
16
- }.to raise_error(RuntimeError, ":backup_store_path option is missing for backup!")
16
+ }.to raise_error(RuntimeError, ":backup_store_path option is missing!")
17
17
  end
18
18
  end
19
19
 
@@ -6,7 +6,7 @@ describe Duplicati::Clean do
6
6
  it "raises an Exception if backup store path is not provided" do
7
7
  expect {
8
8
  Duplicati::Clean.new(:backup_paths => [])
9
- }.to raise_error(RuntimeError, ":backup_store_path option is missing for clean!")
9
+ }.to raise_error(RuntimeError, ":backup_store_path option is missing!")
10
10
  end
11
11
  end
12
12
 
@@ -18,7 +18,7 @@ describe Duplicati::Clean do
18
18
  :backup_store_path => "file:///foo/backup",
19
19
  :log_path => "/zzz/output.log"
20
20
  ).command.should == %Q["/bin/duplicati-commandline" delete-all-but-n 5 "file:///foo/backup"
21
-
21
+ --no-encryption
22
22
  --force
23
23
  1>>"/zzz/output.log"
24
24
  2>&1]
metadata CHANGED
@@ -1,41 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duplicati
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarmo Pertman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-02 00:00:00.000000000 Z
11
+ date: 2013-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  description: Duplicati backup utility wrapper in Ruby with easier API and sensible
@@ -57,6 +57,7 @@ files:
57
57
  - lib/duplicati.rb
58
58
  - lib/duplicati/backup.rb
59
59
  - lib/duplicati/clean.rb
60
+ - lib/duplicati/command.rb
60
61
  - lib/duplicati/notification/base.rb
61
62
  - lib/duplicati/notification/failed.png
62
63
  - lib/duplicati/notification/growl.rb
@@ -78,17 +79,17 @@ require_paths:
78
79
  - lib
79
80
  required_ruby_version: !ruby/object:Gem::Requirement
80
81
  requirements:
81
- - - ! '>='
82
+ - - '>='
82
83
  - !ruby/object:Gem::Version
83
84
  version: '0'
84
85
  required_rubygems_version: !ruby/object:Gem::Requirement
85
86
  requirements:
86
- - - ! '>='
87
+ - - '>='
87
88
  - !ruby/object:Gem::Version
88
89
  version: '0'
89
90
  requirements: []
90
91
  rubyforge_project:
91
- rubygems_version: 2.0.0
92
+ rubygems_version: 2.0.3
92
93
  signing_key:
93
94
  specification_version: 4
94
95
  summary: Duplicati backup utility wrapper in Ruby with easier API and sensible configuration