lib/poolparty/modules/resourcing_dsl.rb in auser-poolparty-1.2.2 vs lib/poolparty/modules/resourcing_dsl.rb in auser-poolparty-1.2.3
- old
+ new
@@ -1,15 +1,7 @@
module PoolParty
module ResourcingDsl
- # Overrides for syntax
- # Allows us to send require to require a resource
- def requires(str=nil)
- str ? dsl_options.merge!(:require => send_if_method(str)) : dsl_options[:require]
- end
- def on_change(str=nil)
- str ? dsl_options.merge!(:notify => send_if_method(str)) : dsl_options[:notify]
- end
def ensures(str = :present)
if [:absent, :present].include?(str)
str == :absent ? is_absent : is_present
else
str
@@ -29,32 +21,12 @@
# Ensures that what we are sending is absent
def is_absent(*args)
dsl_options.merge!(:ensures => absent)
absent
end
- # Alias for unless
- def ifnot(str="")
- dsl_options.merge!(:unless => str)
- end
- def cancel(*args)
- dsl_options[:cancelled] = args.empty? ? true : args[0]
- end
- def cancelled?
- dsl_options[:cancelled] || false
- end
- def printed(*args)
- dsl_options[:printed] = true
- end
- def printed?
- dsl_options[:printed] || false
- end
#TODO: Diet
- def render_template
- # @templates.
- end
-
def get_client_or_gem_template(file)
if ::File.file?(file) && ::File.readable?(file)
file
elsif client_templates_directory_exists? && client_template_exists?(file)
vputs "using custom template #{::File.join(Dir.pwd, "templates/#{file}")}"
@@ -73,6 +45,6 @@
return true if ::File.file?(filename) && ::File.readable?(filename)
file = ::File.join("#{Dir.pwd}/templates", filename)
::File.file?(file) && ::File.readable?(file)
end
end
-end
\ No newline at end of file
+end