shaddox 0.0.6 → 0.0.7
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.
- checksums.yaml +4 -4
- data/bin/shaddox +41 -2
- data/lib/shaddox/config.rb +5 -2
- data/lib/shaddox/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 097f3c19422f16841c205ebcf8bb76edc942cac0
|
4
|
+
data.tar.gz: a2f083ebc2f357af97313c1d14dfc26cafa1d573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 669a9c59c491663797337731e8507744f4c67f6003899b9adb7f79100ecc3e18f3efe73b4eda9a5d704e68242abc7f918a230594f052488db333665f38abb4d3
|
7
|
+
data.tar.gz: 18681c874d14e3fe65a8566513726ae3599b20836444d4dfbb40c7bc7e69ce66b4ecb04261ee44dad401f1dba7e715542885d2fa665758cd656066cd6a16f78b
|
data/bin/shaddox
CHANGED
@@ -1,7 +1,46 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'shaddox'
|
4
|
+
require 'optparse'
|
5
|
+
|
6
|
+
@doxfile = './Doxfile'
|
7
|
+
options = {
|
8
|
+
:verbose => true
|
9
|
+
}
|
10
|
+
|
11
|
+
OptionParser.new do |opts|
|
12
|
+
|
13
|
+
opts.banner = "Usage: shaddox [task] [target] [options]"
|
14
|
+
|
15
|
+
opts.on("-v", "--[no]-verbose", "Run verbosely") do |v|
|
16
|
+
options[:verbose] = v
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("--force", "Override lock on target") do |force|
|
20
|
+
options[:force] = force
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("--keep-tmp-dir", "Don't remove the tmpdir after deployment") do |force|
|
24
|
+
options[:force] = force
|
25
|
+
end
|
26
|
+
|
27
|
+
opts.on("--tmpdir PATH", "Specify the tmp directory to use (default '/tmp/shaddox')") do |dir|
|
28
|
+
options[:tmpdir] = dir
|
29
|
+
end
|
30
|
+
|
31
|
+
opts.on('-f PATH', '--doxfile', "Specify doxfile") do |f|
|
32
|
+
@doxfile = f
|
33
|
+
end
|
34
|
+
|
35
|
+
opts.on_tail("-h", "--help", "Show help text") do
|
36
|
+
puts opts
|
37
|
+
exit
|
38
|
+
end
|
39
|
+
|
40
|
+
end.parse!
|
41
|
+
|
4
42
|
task = ARGV[0]
|
5
43
|
target = ARGV[1] || 'localhost'
|
6
|
-
|
7
|
-
config.
|
44
|
+
|
45
|
+
config = Shaddox::Config.new(@doxfile)
|
46
|
+
config.invoke(task.to_sym, target.to_sym, options)
|
data/lib/shaddox/config.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
module Shaddox
|
2
2
|
class Config
|
3
3
|
attr_accessor :servers, :targets, :repos, :tasks
|
4
|
-
def initialize(
|
4
|
+
def initialize(doxfile)
|
5
|
+
doxfile = './Doxfile' unless doxfile
|
5
6
|
if !File.exists?(doxfilename)
|
6
7
|
puts "Doxfile could not be found.".red
|
7
8
|
exit(1)
|
@@ -12,9 +13,11 @@ module Shaddox
|
|
12
13
|
@tasks = Hash.new
|
13
14
|
@repos = Hash.new
|
14
15
|
|
16
|
+
# :local and :localhost point to local by default
|
15
17
|
@targets[:localhost] = Localhost.new
|
18
|
+
@targets[:local] = :localhost
|
16
19
|
|
17
|
-
instance_eval(File.read(
|
20
|
+
instance_eval(File.read(doxfile), doxfile)
|
18
21
|
end
|
19
22
|
|
20
23
|
def explode_target(target_key)
|
data/lib/shaddox/version.rb
CHANGED