edb 0.3.1 → 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: 1c17587e82eea29d85e10f1ee7e8d722e7c52c7a
4
- data.tar.gz: 78a03ea9c95f35e579d668c67db0938420e99763
3
+ metadata.gz: 4e0630915b9cbcf27eb26aa9a0241385baaecb9b
4
+ data.tar.gz: 93d4d26e3b036f9e6f01d05a60da4bd10008369c
5
5
  SHA512:
6
- metadata.gz: 8242eea5c0cea8d5dd7b0144a1792ac9f117998df9e09aa2f23ff7435dcfe41009de157f4062a0ab3ea3b24f3d0a2c9a6d5b8d04acff3066075f7505fc92b04e
7
- data.tar.gz: 1fd71b15028a02b0eb217899bb74d0f44d8bb52ef9410a1b079cb45c8f79a47a7da52cb26483075753cf7af6162092cfad362269d3e14d385b0fb722b37a626b
6
+ metadata.gz: 7c041eb17661a237f83afaf7f8ccb281df3edace073932e7684cd1320d8e3d54f69443692cab2f9365b3d61604692f5a8e570bb41ba67cef23bf03b7d02fe1a3
7
+ data.tar.gz: 813b73f6ffd9ea1b1dd4cfb75ee82a75391b8ed928c8883fc65617cb312dc24719514af899c74917e92d41f1d5c62bcf5690a4965328786f989a7abcd34e0fc0
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- edb (0.3.1)
4
+ edb (0.4)
5
5
  aws-sdk (= 1.59.1)
6
+ ftp_sync (~> 0.4)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
@@ -13,8 +14,11 @@ GEM
13
14
  json (~> 1.4)
14
15
  nokogiri (>= 1.4.4)
15
16
  diff-lcs (1.2.5)
17
+ ftp_sync (0.4.3)
18
+ net-ftp-list (>= 2.1.1)
16
19
  json (1.8.3)
17
20
  mini_portile (0.6.2)
21
+ net-ftp-list (3.2.8)
18
22
  nokogiri (1.6.6.2)
19
23
  mini_portile (~> 0.6.0)
20
24
  rake (10.4.2)
data/edb.gemspec CHANGED
@@ -16,4 +16,5 @@ Gem::Specification.new { |s|
16
16
  s.require_paths = ['lib']
17
17
 
18
18
  s.add_dependency 'aws-sdk', '1.59.1'
19
+ s.add_dependency 'ftp_sync', '~> 0.4'
19
20
  }
data/example/edb.yml CHANGED
@@ -30,3 +30,9 @@
30
30
 
31
31
  :Filesystem:
32
32
  :path: ~/Downloads
33
+
34
+ :FTP:
35
+ :host: ftp.example.xyz
36
+ :username: username
37
+ :password: password
38
+ :path: /home/username/
data/lib/edb/dumper.rb CHANGED
@@ -46,7 +46,7 @@ module EDB
46
46
 
47
47
  files = EDB::DBMS.backup(dbms_name, dir_name)
48
48
 
49
- if ::EDB.opts[:CRYPTOGRAPHY]
49
+ if ::EDB.opts[:CRYPTOGRAPHY] != nil
50
50
  ::EDB.opts[:CRYPTOGRAPHY].each do |cryptography|
51
51
  algorithm = cryptography[0]
52
52
 
@@ -58,11 +58,11 @@ module EDB
58
58
  end
59
59
  end
60
60
 
61
- if ::EDB.opts[:STORAGE]
61
+ if ::EDB.opts[:STORAGE] != nil
62
62
  ::EDB.opts[:STORAGE].each do |storage|
63
63
  service = storage[0]
64
64
 
65
- if ::EDB::Cryptography.supports?(crypto)
65
+ if ::EDB::Storage.supports?(service)
66
66
  files.each { |file| ::EDB::Storage.upload(service, file) }
67
67
  else
68
68
  module_not_supported(service)
@@ -79,7 +79,7 @@ module EDB
79
79
  end
80
80
 
81
81
  def module_not_supported(module_name)
82
- ::EDB::Logger.log(:error, "No support for #{algorithm}.")
82
+ ::EDB::Logger.log(:error, "No support for #{module_name}.")
83
83
  end
84
84
  end
85
85
  end
@@ -0,0 +1,40 @@
1
+ #--
2
+ # Copyright(C) 2015 Giovanni Capuano <webmaster@giovannicapuano.net>
3
+ #
4
+ # Redistribution and use in source and binary forms, with or without modification, are
5
+ # permitted provided that the following conditions are met:
6
+ #
7
+ # 1. Redistributions of source code must retain the above copyright notice, this list of
8
+ # conditions and the following disclaimer.
9
+ #
10
+ # THIS SOFTWARE IS PROVIDED BY Giovanni Capuano ''AS IS'' AND ANY EXPRESS OR IMPLIED
11
+ # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
12
+ # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Giovanni Capuano OR
13
+ # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
14
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
15
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
16
+ # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
17
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
18
+ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
19
+ #
20
+ # The views and conclusions contained in the software and documentation are those of the
21
+ # authors and should not be interpreted as representing official policies, either expressed
22
+ # or implied, of Giovanni Capuano.
23
+ #++
24
+ require 'ftp_sync'
25
+
26
+ module EDB
27
+ module Storage
28
+ module FTP
29
+ class << self
30
+ def upload(source)
31
+ data = ::EDB.opts[:STORAGE][:FTP]
32
+ ::EDB::Logger.log(:info, "Uploading #{source} to #{data[:username]}@#{data[:host]} via FTP...")
33
+
34
+ ftp = FtpSync.new(data[:host], data[:username], data[:password])
35
+ ftp.push_files('.', data[:path], [source])
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
data/lib/edb/version.rb CHANGED
@@ -23,5 +23,5 @@
23
23
  #++
24
24
 
25
25
  module EDB
26
- VERSION = '0.3.1'
26
+ VERSION = '0.4'
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: edb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giovanni Capuano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-08 00:00:00.000000000 Z
11
+ date: 2015-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.59.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: ftp_sync
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.4'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.4'
27
41
  description: EDB aims to be a framework to make and manage backups of your database.
28
42
  email: webmaster@giovannicapuano.net
29
43
  executables:
@@ -52,6 +66,7 @@ files:
52
66
  - lib/edb/logger.rb
53
67
  - lib/edb/storage.rb
54
68
  - lib/edb/storage/filesystem.rb
69
+ - lib/edb/storage/ftp.rb
55
70
  - lib/edb/storage/s3.rb
56
71
  - lib/edb/version.rb
57
72
  - specs/cryptography_spec.rb