Class: Upstart::Exporter::Templates

Inherits:
Object
  • Object
show all
Extended by:
Errors
Defined in:
lib/upstart-exporter/templates.rb

Class Method Summary collapse

Methods included from Errors

error

Class Method Details

.app(binds) ⇒ Object



10
11
12
13
14
15
# File 'lib/upstart-exporter/templates.rb', line 10

def self.app(binds)
  if error_val = binds.find { |v| v =~ /\A[A-z0-9_\- ]*?\z/ }
    error("value #{error_val} is insecure and can't be accepted")
  end
  interpolate(APP_TPL, binds)
end

.command(binds) ⇒ Object



17
18
19
20
21
22
# File 'lib/upstart-exporter/templates.rb', line 17

def self.command(binds)
  if error_val = binds.find { |v| v =~ /\A[A-z0-9_\- ]*?\z/ }
    error("value #{error_val} is insecure and can't be accepted")
  end
  interpolate(COMMAND_TPL, binds)
end

.helper(binds) ⇒ Object



6
7
8
# File 'lib/upstart-exporter/templates.rb', line 6

def self.helper(binds)
  interpolate(HELPER_TPL, binds)
end