understudy 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/understudy/cli.rb +5 -4
- data/lib/understudy/version.rb +1 -1
- metadata +3 -4
- data/lib/understudy/stage.rb +0 -17
data/lib/understudy/cli.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'ostruct'
|
2
2
|
require 'fileutils'
|
3
|
+
require 'logger'
|
3
4
|
|
4
5
|
module Understudy
|
5
6
|
class CLI < Thor
|
@@ -79,8 +80,6 @@ module Understudy
|
|
79
80
|
command << config.dest
|
80
81
|
|
81
82
|
run command, log
|
82
|
-
|
83
|
-
log.info "Backup successful"
|
84
83
|
end
|
85
84
|
|
86
85
|
private
|
@@ -89,14 +88,16 @@ module Understudy
|
|
89
88
|
if command.is_a? Array
|
90
89
|
friendly = command.map { |i| i =~ /[^-=\/\.\w]/ ? "#{i}" : i }.join ' '
|
91
90
|
log.info "Running: #{friendly}"
|
92
|
-
RdiffSimple.execute( friendly ) or log.error "Could not run #{friendly}"
|
91
|
+
RdiffSimple::RdiffBackup.execute( friendly ) or log.error "Could not run #{friendly}"
|
93
92
|
else
|
94
93
|
friendly = command
|
95
94
|
log.info "Running: #{friendly}"
|
96
|
-
RdiffSimple.execute( friendly ) or log.error "Could not run #{friendly}"
|
95
|
+
RdiffSimple::RdiffBackup.execute( friendly ) or log.error "Could not run #{friendly}"
|
97
96
|
end
|
98
97
|
if $? != 0
|
99
98
|
log.error "Could not run #{friendly}"
|
99
|
+
else
|
100
|
+
log.info "Backup successful"
|
100
101
|
end
|
101
102
|
end
|
102
103
|
end
|
data/lib/understudy/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: understudy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.10
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Ryan Hansen
|
@@ -160,7 +160,6 @@ files:
|
|
160
160
|
- bin/understudy
|
161
161
|
- lib/understudy.rb
|
162
162
|
- lib/understudy/cli.rb
|
163
|
-
- lib/understudy/stage.rb
|
164
163
|
- lib/understudy/version.rb
|
165
164
|
- spec/spec_helper.rb
|
166
165
|
- understudy.gemspec
|
@@ -178,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
178
177
|
- !ruby/object:Gem::Version
|
179
178
|
segments:
|
180
179
|
- 0
|
181
|
-
hash:
|
180
|
+
hash: -1337194065559452469
|
182
181
|
version: '0'
|
183
182
|
none: false
|
184
183
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
@@ -187,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
186
|
- !ruby/object:Gem::Version
|
188
187
|
segments:
|
189
188
|
- 0
|
190
|
-
hash:
|
189
|
+
hash: -1337194065559452469
|
191
190
|
version: '0'
|
192
191
|
none: false
|
193
192
|
requirements: []
|
data/lib/understudy/stage.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Understudy
|
2
|
-
module Stage
|
3
|
-
DEFAULT_DIRECTORY = '/etc/understudy/'
|
4
|
-
|
5
|
-
class << self
|
6
|
-
def setup(directory = nil)
|
7
|
-
config_dir = directory ||= DEFAULT_DIRECTORY
|
8
|
-
|
9
|
-
hostname = `hostname`
|
10
|
-
config_file = File.join(config_dir, "#{hostname.chomp}.config")
|
11
|
-
|
12
|
-
FileUtils.mkdir_p(config_dir) unless File.exists?(config_dir)
|
13
|
-
FileUtils.touch(config_file)
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|