backup2qiniu 3.3.2 → 3.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,19 +1,85 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backup2qiniu (3.3.2)
5
- backup (~> 3.3.0)
4
+ backup2qiniu (3.5.0)
5
+ backup (>= 3.4.0)
6
6
  qiniu-rs (~> 3.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- backup (3.3.2)
12
- open4 (~> 1.3.0)
13
- thor (>= 0.15.4, < 2)
11
+ backup (3.5.0)
12
+ builder (= 3.2.0)
13
+ dropbox-sdk (= 1.5.1)
14
+ excon (= 0.20.1)
15
+ faraday (= 0.8.7)
16
+ fog (= 1.10.1)
17
+ formatador (= 0.2.4)
18
+ hipchat (= 0.8.0)
19
+ httparty (= 0.11.0)
20
+ i18n (= 0.6.4)
21
+ json (= 1.7.7)
22
+ mail (= 2.5.3)
23
+ mime-types (= 1.23)
24
+ multi_json (= 1.7.2)
25
+ multi_xml (= 0.5.3)
26
+ multipart-post (= 1.2.0)
27
+ net-scp (= 1.1.0)
28
+ net-sftp (= 2.1.1)
29
+ net-ssh (= 2.6.7)
30
+ nokogiri (= 1.5.9)
31
+ open4 (= 1.3.0)
32
+ parallel (= 0.6.4)
33
+ polyglot (= 0.3.3)
34
+ prowler (= 1.3.1)
35
+ ruby-hmac (= 0.4.0)
36
+ simple_oauth (= 0.2.0)
37
+ thor (= 0.18.1)
38
+ treetop (= 1.4.12)
39
+ twitter (= 4.6.2)
40
+ builder (3.2.0)
41
+ dropbox-sdk (1.5.1)
42
+ json
43
+ excon (0.20.1)
44
+ faraday (0.8.7)
45
+ multipart-post (~> 1.1)
46
+ fog (1.10.1)
47
+ builder
48
+ excon (~> 0.20)
49
+ formatador (~> 0.2.0)
50
+ mime-types
51
+ multi_json (~> 1.0)
52
+ net-scp (~> 1.1)
53
+ net-ssh (>= 2.1.3)
54
+ nokogiri (~> 1.5.0)
55
+ ruby-hmac
56
+ formatador (0.2.4)
57
+ hipchat (0.8.0)
58
+ httparty
59
+ httparty
60
+ httparty (0.11.0)
61
+ multi_json (~> 1.0)
62
+ multi_xml (>= 0.5.2)
63
+ i18n (0.6.4)
14
64
  json (1.7.7)
65
+ mail (2.5.3)
66
+ i18n (>= 0.4.0)
67
+ mime-types (~> 1.16)
68
+ treetop (~> 1.4.8)
15
69
  mime-types (1.23)
70
+ multi_json (1.7.2)
71
+ multi_xml (0.5.3)
72
+ multipart-post (1.2.0)
73
+ net-scp (1.1.0)
74
+ net-ssh (>= 2.6.5)
75
+ net-sftp (2.1.1)
76
+ net-ssh (>= 2.6.5)
77
+ net-ssh (2.6.7)
78
+ nokogiri (1.5.9)
16
79
  open4 (1.3.0)
80
+ parallel (0.6.4)
81
+ polyglot (0.3.3)
82
+ prowler (1.3.1)
17
83
  qiniu-rs (3.4.2)
18
84
  json (~> 1.7)
19
85
  mime-types (~> 1.19)
@@ -22,7 +88,15 @@ GEM
22
88
  rest-client (1.6.7)
23
89
  mime-types (>= 1.16)
24
90
  ruby-hmac (0.4.0)
91
+ simple_oauth (0.2.0)
25
92
  thor (0.18.1)
93
+ treetop (1.4.12)
94
+ polyglot
95
+ polyglot (>= 0.3.1)
96
+ twitter (4.6.2)
97
+ faraday (~> 0.8, < 0.10)
98
+ multi_json (~> 1.0)
99
+ simple_oauth (~> 0.2)
26
100
 
27
101
  PLATFORMS
28
102
  ruby
data/NEWS.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # NEWS
2
2
 
3
+ ## 3.5.0 (2013-05-08)
4
+
5
+ * works for backup 3.5.X
6
+ * bump minimum backup verison to 3.4.0
7
+
3
8
  ## 3.3.2 (2013-04-28)
4
9
 
5
10
  * support backup with upload_token
data/backup2qiniu.gemspec CHANGED
@@ -14,6 +14,6 @@ Gem::Specification.new do |gem|
14
14
  gem.name = "backup2qiniu"
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = Backup2qiniu::VERSION
17
- gem.add_dependency 'backup', '~> 3.3.0'
17
+ gem.add_dependency 'backup', '>= 3.4.0'
18
18
  gem.add_dependency 'qiniu-rs', '~> 3.1'
19
19
  end
@@ -16,6 +16,7 @@ module Backup
16
16
  super(model, storage_id)
17
17
 
18
18
  @bucket ||= 'backups'
19
+ @path ||= ''
19
20
 
20
21
  instance_eval(&block) if block_given?
21
22
  end
@@ -23,9 +24,9 @@ module Backup
23
24
  def remove!(pkg)
24
25
  remote_path = remote_path_for(pkg)
25
26
  establish_connection!
26
- transferred_files_for(pkg) do |local_file, remote_file|
27
+ package.filenames.each do |remote_file|
27
28
  Logger.info "#{storage_name} started removing " +
28
- "'#{ local_file }' from bucket '#{ bucket }'."
29
+ "'#{ remote_file }' from bucket '#{ bucket }'."
29
30
  key = File.join(remote_path, remote_file)
30
31
  unless ::Qiniu::RS.delete(bucket, key)
31
32
  raise "delete '#{key}' failed"
@@ -45,11 +46,12 @@ module Backup
45
46
 
46
47
  def transfer_by_upload_token!
47
48
  raise "upload_token is not set" if upload_token.nil?
48
- files_to_transfer_for(@package) do |local_file, remote_file|
49
+ package.filenames.each do |local_file|
50
+ remote_file = local_file
49
51
  Logger.info "[transfer_by_upload_token] #{storage_name} started transferring " +
50
52
  "'#{ local_file }'."
51
53
  key = File.join(remote_path, remote_file)
52
- upload_file(File.join(local_path, local_file), key)
54
+ upload_file(File.join(Config.tmp_path, local_file), key)
53
55
  Logger.info "file uploaded to bucket:#{bucket}, key:#{key}"
54
56
  end
55
57
  end
@@ -61,19 +63,16 @@ module Backup
61
63
  :file => File.open(local_file)
62
64
  end
63
65
 
64
- def remote_path
65
- remote_path_for(@package)
66
- end
67
-
68
66
  def transfer_by_secret!
69
67
  establish_connection!
70
- files_to_transfer_for(@package) do |local_file, remote_file|
68
+ package.filenames.each do |local_file|
69
+ remote_file = local_file
71
70
  Logger.info "[transfer_by_secret] #{storage_name} started transferring " +
72
71
  "'#{ local_file }'."
73
72
  upload_token = ::Qiniu::RS.generate_upload_token :scope => bucket
74
73
  key = File.join(remote_path, remote_file)
75
74
  res = ::Qiniu::RS.upload_file :uptoken => upload_token,
76
- :file => File.join(local_path, local_file),
75
+ :file => File.join(Config.tmp_path, local_file),
77
76
  :key => key,
78
77
  :bucket => bucket,
79
78
  :enable_crc32_check => true
@@ -1,3 +1,3 @@
1
1
  module Backup2qiniu
2
- VERSION = "3.3.2"
2
+ VERSION = "3.5.0"
3
3
  end
metadata CHANGED
@@ -1,32 +1,36 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backup2qiniu
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.5.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - LI Daobing
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-04-28 00:00:00.000000000 Z
12
+ date: 2013-05-08 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: backup
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ~>
19
+ - - ! '>='
18
20
  - !ruby/object:Gem::Version
19
- version: 3.3.0
21
+ version: 3.4.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - ~>
27
+ - - ! '>='
25
28
  - !ruby/object:Gem::Version
26
- version: 3.3.0
29
+ version: 3.4.0
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: qiniu-rs
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -62,26 +67,27 @@ files:
62
67
  - lib/backup2qiniu/version.rb
63
68
  homepage: https://github.com/lidaobing/backup2qiniu
64
69
  licenses: []
65
- metadata: {}
66
70
  post_install_message:
67
71
  rdoc_options: []
68
72
  require_paths:
69
73
  - lib
70
74
  required_ruby_version: !ruby/object:Gem::Requirement
75
+ none: false
71
76
  requirements:
72
- - - '>='
77
+ - - ! '>='
73
78
  - !ruby/object:Gem::Version
74
79
  version: '0'
75
80
  required_rubygems_version: !ruby/object:Gem::Requirement
81
+ none: false
76
82
  requirements:
77
- - - '>='
83
+ - - ! '>='
78
84
  - !ruby/object:Gem::Version
79
85
  version: '0'
80
86
  requirements: []
81
87
  rubyforge_project:
82
- rubygems_version: 2.0.3
88
+ rubygems_version: 1.8.25
83
89
  signing_key:
84
- specification_version: 4
90
+ specification_version: 3
85
91
  summary: backup to qiniutek.com
86
92
  test_files: []
87
93
  has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: ad8669fe044ac662b06fbeaa22a28eda68f0b1a8
4
- data.tar.gz: 2c1a2b5b39adb74c906309d492339e79e493ce88
5
- SHA512:
6
- metadata.gz: 53d66c2f74d51abf96aaa21eb1df81be529e5a548f7d4b64c9f97162936489f8f396a0c1e099f0017c1ce8647f2774ac78d61666ba2007388de72d30cee5dfa5
7
- data.tar.gz: df50b9d0e29d593b04deb63b3f9d81d2e237c8d0931e724032dcfcb5a369cd5e51770ec354c22119e5cdf39c55270469c64c026d2cbc79c67cb977f39091061d