Method: Collins::Asset::Update.get_param_value

Defined in:
lib/collins/asset_update.rb

.get_param_value(key, value) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/collins/asset_update.rb', line 20

def get_param_value key, value
  if is_file_param?(key) then
    if value.start_with?('@') then
      filename = File.expand_path(value[1..-1])
      if !File.readable?(filename) then
        msg = "Could not read file '#{filename}' for key '#{key}'"
        raise ::Collins::ExpectationFailedError.new msg
      else
        File.read(filename)
      end
    else
      value
    end
  else
    value
  end
end