postmodern 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/postmodern +21 -3
- data/lib/postmodern/errors.rb +4 -0
- data/lib/postmodern/version.rb +1 -1
- data/lib/postmodern/wal.rb +10 -2
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65c24efcd6053881f84ed0084efe2442c0a78d82
|
4
|
+
data.tar.gz: ec44170dedc5a7c2f59f34f91cfb16896bb4d830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89e96ef4176c6e887e9ff106033e63d78a0287cae0b0c7908767651de6c19a863eabadf65da699bb2f483be3906696f96662638d668670e4f676a27abeb73119
|
7
|
+
data.tar.gz: ccd1a255715acd723db55c0619fc49574565a9d8efe2814ca97b9cb82fb75d87197875b14223150d4982c9abdc5fdcef87d516ba726d20eeb861fcb4b2b292f5
|
data/bin/postmodern
CHANGED
@@ -2,11 +2,12 @@
|
|
2
2
|
|
3
3
|
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
|
4
4
|
|
5
|
+
require 'postmodern/errors'
|
5
6
|
require 'postmodern/wal'
|
6
7
|
require 'optparse'
|
7
8
|
|
8
9
|
options = {}
|
9
|
-
OptionParser.new do |opts|
|
10
|
+
parser = OptionParser.new do |opts|
|
10
11
|
opts.banner = "Usage: postmodern (archive|restore) <options>"
|
11
12
|
|
12
13
|
opts.on('-f', '--filename FILE', 'File name to archive') do |o|
|
@@ -16,6 +17,23 @@ OptionParser.new do |opts|
|
|
16
17
|
opts.on('-p', '--path PATH', 'Path name of file to archive') do |o|
|
17
18
|
options[:path] = o
|
18
19
|
end
|
19
|
-
end.parse!
|
20
20
|
|
21
|
-
|
21
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
22
|
+
puts opts
|
23
|
+
exit
|
24
|
+
end
|
25
|
+
|
26
|
+
opts.on_tail("--version", "Show version") do
|
27
|
+
require 'postmodern/version'
|
28
|
+
puts Postmodern::VERSION
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
end
|
32
|
+
parser.parse!
|
33
|
+
|
34
|
+
begin
|
35
|
+
Postmodern::WAL.run(ARGV.first, options)
|
36
|
+
rescue Postmodern::Error => e
|
37
|
+
puts e.message
|
38
|
+
puts parser.to_s
|
39
|
+
end
|
data/lib/postmodern/version.rb
CHANGED
data/lib/postmodern/wal.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'postmodern/wal/archive'
|
2
2
|
require 'postmodern/wal/restore'
|
3
|
+
require 'postmodern/errors'
|
3
4
|
|
4
5
|
module Postmodern
|
5
6
|
module WAL
|
@@ -8,8 +9,15 @@ module Postmodern
|
|
8
9
|
'restore' => Postmodern::WAL::Restore
|
9
10
|
}
|
10
11
|
|
11
|
-
def self.run(command,
|
12
|
-
|
12
|
+
def self.run(command, options)
|
13
|
+
validate!(options)
|
14
|
+
COMMANDS[command].new(options[:file], options[:path]).run
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.validate!(options)
|
18
|
+
unless options[:file] and options[:path]
|
19
|
+
raise Postmodern::Error.new('Missing required options')
|
20
|
+
end
|
13
21
|
end
|
14
22
|
end
|
15
23
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postmodern
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Saxby
|
@@ -56,6 +56,7 @@ files:
|
|
56
56
|
- Rakefile
|
57
57
|
- bin/postmodern
|
58
58
|
- lib/postmodern.rb
|
59
|
+
- lib/postmodern/errors.rb
|
59
60
|
- lib/postmodern/version.rb
|
60
61
|
- lib/postmodern/wal.rb
|
61
62
|
- lib/postmodern/wal/archive.rb
|