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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad10618353ebf5c8b2d816503fca361c9b071d77
4
- data.tar.gz: 79f59ddaf486890639d7e3c8b0dcd62cd545ae37
3
+ metadata.gz: 097f3c19422f16841c205ebcf8bb76edc942cac0
4
+ data.tar.gz: a2f083ebc2f357af97313c1d14dfc26cafa1d573
5
5
  SHA512:
6
- metadata.gz: 9679130fb2b02ce4031b805d25f15f23c2bcf217285c879dcb472c7ea360178b80dba70049b0efb96c875b8eaba39eaf2efc15ed0a745fe72625cd247246c3cc
7
- data.tar.gz: c78922762f9878d342232e74dbb575f7703e90c0eaacd6393338b8331ac014105714a76cf6612c220d4bea8eb1672f731b865654b1dbe3a5717560ec91303ace
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
- config = Shaddox::Config.new
7
- config.invoke(task.to_sym, target.to_sym)
44
+
45
+ config = Shaddox::Config.new(@doxfile)
46
+ config.invoke(task.to_sym, target.to_sym, options)
@@ -1,7 +1,8 @@
1
1
  module Shaddox
2
2
  class Config
3
3
  attr_accessor :servers, :targets, :repos, :tasks
4
- def initialize(doxfilename = "./Doxfile")
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(doxfilename), doxfilename)
20
+ instance_eval(File.read(doxfile), doxfile)
18
21
  end
19
22
 
20
23
  def explode_target(target_key)
@@ -1,3 +1,3 @@
1
1
  module Shaddox
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shaddox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - joshglendenning