Class: StackMaster::TemplateCompilers::Json

Inherits:
Object
  • Object
show all
Defined in:
lib/stack_master/template_compilers/json.rb

Class Method Summary collapse

Class Method Details

.compile(template_file_path) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/stack_master/template_compilers/json.rb', line 6

def self.compile(template_file_path)
  template_body = File.read(template_file_path)
  if template_body.size > MAX_TEMPLATE_SIZE
    # Parse the json and rewrite compressed
    JSON.dump(JSON.parse(template_body))
  else
    template_body
  end
end