module Vop::ServiceSyntax
Public Instance Methods
binary_name(name)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 34 def binary_name(name) @service.data[:binary_name] ||= [] @service.data[:binary_name] << name end
deploy(what = {}, &block)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 39 def deploy(what = {}, &block) if block_given? @service.install_blocks << block end if what.include? :create files = @service.data[:install][:files] ||= {} files[:create] ||= [] files[:create] << what[:create] end if what.include? :files raise "deploy (:files) needs a 'to' option" unless what.include?(:to) files = @service.data[:install][:files] ||= {} files[:copy] ||= [] files[:copy] << { from: what[:files], to: what[:to] } end if what.include? :template raise "deploy (:template) needs a 'to' option" unless what.include?(:to) files = @service.data[:install][:files] ||= {} (files[:template] ||= []) << what end if what.include? :package @service.data[:install][:package] ||= [] if what[:package].is_a?(Array) @service.data[:install][:package] += what[:package] else @service.data[:install][:package] << what[:package] end end if what.include? :gem @service.data[:install][:gems] ||= [] gems = if what[:gem].is_a?(Array) what[:gem] else [ what[:gem] ] end @service.data[:install][:gems] += gems end if what.include? :repository @service.data[:install][:repo] ||= [] if what[:repository].is_a?(Array) @service.data[:install][:repo] += what[:repository] else @service.data[:install][:repo] << what[:repository] end end if what.include? :url @service.data[:install][:url] ||= [] @service.data[:install][:url] << what[:url] end end
icon(name)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 116 def icon(name) @service.data[:icon] = name end
known_binaries(list)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 104 def known_binaries(list) end
param(name, options = {})
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 14 def param(name, options = {}) options = resolve_options_string(options) @service.params << CommandParam.new(name, options) end
param!(name, options = {})
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 20 def param!(name, options = {}) options = resolve_options_string(options) options.merge! mandatory: true param(name, options) end
port(port)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 112 def port(port) end
process_regex(regex)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 29 def process_regex(regex) @service.data[:process_regex] ||= [] @service.data[:process_regex] << regex end
resolve_options_string(options)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 5 def resolve_options_string(options) if options.is_a? String options = { description: options } end options end
version_command(command)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 108 def version_command(command) end
vhost(vhost)
click to toggle source
# File standard/services/helpers/service_syntax.rb, line 120 def vhost(vhost) end