Module: Fezzik
- Defined in:
- lib/fezzik/dsl.rb,
lib/fezzik/base.rb,
lib/fezzik/util.rb,
lib/fezzik/version.rb,
lib/fezzik/environment.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.6.1"
Class Method Summary collapse
-
.destination(name, &block) ⇒ Object
TODO: add domain override (through environment variable?).
- .env(key, value, options = {}) ⇒ Object
- .environments ⇒ Object
- .init(options = {}) ⇒ Object
- .target_destination ⇒ Object
Class Method Details
.destination(name, &block) ⇒ Object
TODO: add domain override (through environment variable?)
12 13 14 |
# File 'lib/fezzik/base.rb', line 12 def self.destination(name, &block) block.call if name == @target_destination end |
.env(key, value, options = {}) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/fezzik/environment.rb', line 2 def self.env(key, value, ={}) = { :hosts => domain }.merge() [:hosts] = Array([:hosts]) @environments ||= Hash.new { |h, k| h[k] = {} } [:hosts].each { |host| @environments[host][key] = value } end |
.environments ⇒ Object
11 12 13 |
# File 'lib/fezzik/environment.rb', line 11 def self.environments @environments ||= Hash.new { |h, k| h[k] = {} } end |
.init(options = {}) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/fezzik/base.rb', line 2 def self.init(={}) @options = @target_destination = ENV["fezzik_destination"].to_sym rescue nil unless [:tasks].nil? puts "Loading Fezzik tasks from #{@options[:tasks]}" Dir[File.join(Dir.pwd, "#{@options[:tasks]}/**/*.rake")].sort.each { |lib| import lib } end end |
.target_destination ⇒ Object
16 17 18 |
# File 'lib/fezzik/base.rb', line 16 def self.target_destination @target_destination ||= nil end |