Module: Jzip::Engine

Extended by:
Engine
Includes:
Support::Notifier
Included in:
Engine
Defined in:
lib/jzip/engine.rb,
lib/jzip/engine/template.rb,
lib/jzip/engine/requirement.rb,
lib/jzip/engine/support/minifier.rb,
lib/jzip/engine/support/notifier.rb

Defined Under Namespace

Modules: Support Classes: Requirement, Template

Constant Summary collapse

PREDEFINED_SETS =
{"defaults" => %w(prototype effects dragdrop controls application)}
REG_EXPS =
{:require_statement => /^\/\/\=\s*require\s*/, :partial => /^_/, :default_javascripts => /^\//}

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::Notifier

#notify

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



17
18
19
# File 'lib/jzip/engine.rb', line 17

def options
  @options
end

#root_dirObject

Returns the value of attribute root_dir.



17
18
19
# File 'lib/jzip/engine.rb', line 17

def root_dir
  @root_dir
end

Instance Method Details

#add_template_location(location) ⇒ Object



29
30
31
# File 'lib/jzip/engine.rb', line 29

def add_template_location(location)
  @template_locations << location
end

#compile_javascript_filesObject



33
34
35
36
37
38
39
# File 'lib/jzip/engine.rb', line 33

def compile_javascript_files
  return unless @options[:always_update] or @initial_compile

  init if @initial_compile
  parse_templates
  @initial_compile = false
end

#initObject



41
42
43
44
# File 'lib/jzip/engine.rb', line 41

def init
  @template_locations.unshift File.join(root_dir, "assets", "jzip")
  FileUtils.mkdir_p tmp_dir
end

#tmp_dirObject



50
51
52
# File 'lib/jzip/engine.rb', line 50

def tmp_dir
  File.join(root_dir, "tmp", "jzip")
end