yore 0.2.1 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/lib/yore/yore_core.rb +14 -5
- data/yore.gemspec +10 -9
- metadata +66 -26
data/Rakefile
CHANGED
@@ -12,7 +12,7 @@ begin
|
|
12
12
|
gem.authors = ["buzzware"]
|
13
13
|
gem.rubyforge_project = "buzzware"
|
14
14
|
gem.add_dependency('cmdparse', '>= 2.0.2')
|
15
|
-
gem.add_dependency('buzzcore', '>= 0.3.
|
15
|
+
gem.add_dependency('buzzcore', '>= 0.3.3')
|
16
16
|
gem.add_dependency('nokogiri', '>= 1.3.3')
|
17
17
|
gem.add_dependency('aws-s3', '>= 0.6.2')
|
18
18
|
gem.add_development_dependency "thoughtbot-shoulda"
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/lib/yore/yore_core.rb
CHANGED
@@ -6,6 +6,7 @@ require 'fileutils'
|
|
6
6
|
require 'net/smtp'
|
7
7
|
|
8
8
|
require 'yore/AWSS3Client'
|
9
|
+
require 'yaml'
|
9
10
|
|
10
11
|
|
11
12
|
THIS_FILE = File.expand_path(__FILE__)
|
@@ -25,6 +26,7 @@ module YoreCore
|
|
25
26
|
:first_hour => 4,
|
26
27
|
:prefix => 'backup',
|
27
28
|
:log_level => 'INFO',
|
29
|
+
:leave_temp_files => false,
|
28
30
|
:bucket => String,
|
29
31
|
:email_report => false,
|
30
32
|
:mail_host => String,
|
@@ -44,7 +46,6 @@ module YoreCore
|
|
44
46
|
attr_reader :config
|
45
47
|
attr_reader :logger
|
46
48
|
attr_reader :reporter
|
47
|
-
attr_reader :s3client
|
48
49
|
|
49
50
|
def initialize(aConfig=nil)
|
50
51
|
DEFAULT_CONFIG[:email_report] = false # fixes some bug where this was nil
|
@@ -68,6 +69,13 @@ module YoreCore
|
|
68
69
|
configure(aConfig)
|
69
70
|
end
|
70
71
|
|
72
|
+
def s3client
|
73
|
+
return @s3client if @s3client
|
74
|
+
@s3client = ::AWSS3Client.new()
|
75
|
+
logger.info "Using S3 key #{@s3client.credentials[:s3_access_key_id]}"
|
76
|
+
@s3client
|
77
|
+
end
|
78
|
+
|
71
79
|
#aOptions may require {:basepath => File.dirname(File.expand_path(job))}
|
72
80
|
def self.launch(aConfigXml,aCmdOptions=nil,aOptions=nil)
|
73
81
|
if !aConfigXml
|
@@ -183,9 +191,6 @@ module YoreCore
|
|
183
191
|
config[:basepath] = MiscUtils.canonize_path(config[:basepath],Dir.pwd)
|
184
192
|
|
185
193
|
expand_app_option()
|
186
|
-
|
187
|
-
@s3client = ::AWSS3Client.new()
|
188
|
-
logger.info "Using S3 key #{@s3client.credentials[:s3_access_key_id]}"
|
189
194
|
end
|
190
195
|
|
191
196
|
def do_action(aAction,aArgs)
|
@@ -252,9 +257,12 @@ module YoreCore
|
|
252
257
|
tarfile = MiscUtils.file_change_ext(aDestFile, 'tar')
|
253
258
|
|
254
259
|
shell("tar cv #{aParentDir ? '--directory='+aParentDir.to_s : ''} --file=#{tarfile} --files-from=#{listfile}")
|
260
|
+
shell("rm #{listfile}") unless config[:leave_temp_files]
|
255
261
|
logger.info "Compressing ..."
|
256
262
|
tarfile_size = File.size(tarfile)
|
257
263
|
shell("bzip2 #{tarfile}; mv #{tarfile}.bz2 #{aDestFile}")
|
264
|
+
shell("rm #{tarfile}") unless config[:leave_temp_files]
|
265
|
+
|
258
266
|
logger.info "Compressed #{'%.1f' % (tarfile_size*1.0/2**10)} KB to #{'%.1f' % (File.size(aDestFile)*1.0/2**10)} KB"
|
259
267
|
end
|
260
268
|
|
@@ -473,8 +481,9 @@ module YoreCore
|
|
473
481
|
save_internal(temp_file)
|
474
482
|
backup_file = File.expand_path(encode_file_name(),temp_path)
|
475
483
|
pack(temp_file,backup_file)
|
484
|
+
shell("rm #{temp_file}") unless config[:leave_temp_files]
|
476
485
|
upload(backup_file)
|
477
|
-
|
486
|
+
shell("rm #{backup_file}") unless config[:leave_temp_files]
|
478
487
|
end
|
479
488
|
|
480
489
|
def load(aArgs,aCmdOptions=nil)
|
data/yore.gemspec
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{yore}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["buzzware"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-09-27}
|
13
13
|
s.default_executable = %q{yore}
|
14
14
|
s.description = %q{yore (as in "days of yore") is a user data management utility for web applications.}
|
15
15
|
s.email = %q{contact@buzzware.com.au}
|
@@ -47,7 +47,7 @@ Gem::Specification.new do |s|
|
|
47
47
|
s.rdoc_options = ["--charset=UTF-8"]
|
48
48
|
s.require_paths = ["lib"]
|
49
49
|
s.rubyforge_project = %q{buzzware}
|
50
|
-
s.rubygems_version = %q{1.3.
|
50
|
+
s.rubygems_version = %q{1.3.7}
|
51
51
|
s.summary = %q{yore (as in "days of yore") is a user data management utility for web applications.}
|
52
52
|
s.test_files = [
|
53
53
|
"test/AWS_gem_test.rb",
|
@@ -62,24 +62,25 @@ Gem::Specification.new do |s|
|
|
62
62
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
63
63
|
s.specification_version = 3
|
64
64
|
|
65
|
-
if Gem::Version.new(Gem::
|
65
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
66
66
|
s.add_runtime_dependency(%q<cmdparse>, [">= 2.0.2"])
|
67
|
-
s.add_runtime_dependency(%q<buzzcore>, [">= 0.3.
|
67
|
+
s.add_runtime_dependency(%q<buzzcore>, [">= 0.3.3"])
|
68
68
|
s.add_runtime_dependency(%q<nokogiri>, [">= 1.3.3"])
|
69
69
|
s.add_runtime_dependency(%q<aws-s3>, [">= 0.6.2"])
|
70
70
|
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
71
71
|
else
|
72
72
|
s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
|
73
|
-
s.add_dependency(%q<buzzcore>, [">= 0.3.
|
73
|
+
s.add_dependency(%q<buzzcore>, [">= 0.3.3"])
|
74
74
|
s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
|
75
75
|
s.add_dependency(%q<aws-s3>, [">= 0.6.2"])
|
76
76
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
77
77
|
end
|
78
78
|
else
|
79
79
|
s.add_dependency(%q<cmdparse>, [">= 2.0.2"])
|
80
|
-
s.add_dependency(%q<buzzcore>, [">= 0.3.
|
80
|
+
s.add_dependency(%q<buzzcore>, [">= 0.3.3"])
|
81
81
|
s.add_dependency(%q<nokogiri>, [">= 1.3.3"])
|
82
82
|
s.add_dependency(%q<aws-s3>, [">= 0.6.2"])
|
83
83
|
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yore
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 17
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- buzzware
|
@@ -9,59 +15,87 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-09-27 00:00:00 +08:00
|
13
19
|
default_executable: yore
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: cmdparse
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 11
|
30
|
+
segments:
|
31
|
+
- 2
|
32
|
+
- 0
|
33
|
+
- 2
|
23
34
|
version: 2.0.2
|
24
|
-
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
25
37
|
- !ruby/object:Gem::Dependency
|
26
38
|
name: buzzcore
|
27
|
-
|
28
|
-
|
29
|
-
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
30
42
|
requirements:
|
31
43
|
- - ">="
|
32
44
|
- !ruby/object:Gem::Version
|
33
|
-
|
34
|
-
|
45
|
+
hash: 21
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
- 3
|
49
|
+
- 3
|
50
|
+
version: 0.3.3
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
35
53
|
- !ruby/object:Gem::Dependency
|
36
54
|
name: nokogiri
|
37
|
-
|
38
|
-
|
39
|
-
|
55
|
+
prerelease: false
|
56
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
40
58
|
requirements:
|
41
59
|
- - ">="
|
42
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 29
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 3
|
65
|
+
- 3
|
43
66
|
version: 1.3.3
|
44
|
-
|
67
|
+
type: :runtime
|
68
|
+
version_requirements: *id003
|
45
69
|
- !ruby/object:Gem::Dependency
|
46
70
|
name: aws-s3
|
47
|
-
|
48
|
-
|
49
|
-
|
71
|
+
prerelease: false
|
72
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
50
74
|
requirements:
|
51
75
|
- - ">="
|
52
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 3
|
78
|
+
segments:
|
79
|
+
- 0
|
80
|
+
- 6
|
81
|
+
- 2
|
53
82
|
version: 0.6.2
|
54
|
-
|
83
|
+
type: :runtime
|
84
|
+
version_requirements: *id004
|
55
85
|
- !ruby/object:Gem::Dependency
|
56
86
|
name: thoughtbot-shoulda
|
57
|
-
|
58
|
-
|
59
|
-
|
87
|
+
prerelease: false
|
88
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
60
90
|
requirements:
|
61
91
|
- - ">="
|
62
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 3
|
94
|
+
segments:
|
95
|
+
- 0
|
63
96
|
version: "0"
|
64
|
-
|
97
|
+
type: :development
|
98
|
+
version_requirements: *id005
|
65
99
|
description: yore (as in "days of yore") is a user data management utility for web applications.
|
66
100
|
email: contact@buzzware.com.au
|
67
101
|
executables:
|
@@ -105,21 +139,27 @@ rdoc_options:
|
|
105
139
|
require_paths:
|
106
140
|
- lib
|
107
141
|
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
108
143
|
requirements:
|
109
144
|
- - ">="
|
110
145
|
- !ruby/object:Gem::Version
|
146
|
+
hash: 3
|
147
|
+
segments:
|
148
|
+
- 0
|
111
149
|
version: "0"
|
112
|
-
version:
|
113
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
|
+
none: false
|
114
152
|
requirements:
|
115
153
|
- - ">="
|
116
154
|
- !ruby/object:Gem::Version
|
155
|
+
hash: 3
|
156
|
+
segments:
|
157
|
+
- 0
|
117
158
|
version: "0"
|
118
|
-
version:
|
119
159
|
requirements: []
|
120
160
|
|
121
161
|
rubyforge_project: buzzware
|
122
|
-
rubygems_version: 1.3.
|
162
|
+
rubygems_version: 1.3.7
|
123
163
|
signing_key:
|
124
164
|
specification_version: 3
|
125
165
|
summary: yore (as in "days of yore") is a user data management utility for web applications.
|