Class: Tres::App

Inherits:
Object
  • Object
show all
Defined in:
lib/tres/app.rb

Constant Summary collapse

SKELETON =
{
  'config.ru'     => '',
  'index.html'    => 'templates',
  'home.haml'     => 'templates',
  'all.coffee'    => 'assets'/'javascripts',
  'app.coffee'    => 'assets'/'javascripts',
  'home.coffee'   => 'assets'/'javascripts'/'screens',
  'all.scss'      => 'assets'/'stylesheets'
}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root, options = { :fresh => true }) ⇒ App

Returns a new instance of App.



22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/tres/app.rb', line 22

def initialize root, options = { :fresh => true }
  @root = expand(root)
  @logger = Tres::Logger.new(STDOUT)
  @listeners = OpenStruct.new
  if options[:fresh] == true
    create_all_dirs
    copy_templates_over
    copy_fonts_over
  end
  make_asset_manager
  make_template_manager
  make_packager
  make_templates_listener unless options[:deaf] == true
end

Instance Attribute Details

#asset_managerObject (readonly)

Returns the value of attribute asset_manager.



8
9
10
# File 'lib/tres/app.rb', line 8

def asset_manager
  @asset_manager
end

#listenersObject (readonly)

Returns the value of attribute listeners.



8
9
10
# File 'lib/tres/app.rb', line 8

def listeners
  @listeners
end

#packagerObject (readonly)

Returns the value of attribute packager.



8
9
10
# File 'lib/tres/app.rb', line 8

def packager
  @packager
end

#rootObject (readonly)

Returns the value of attribute root.



8
9
10
# File 'lib/tres/app.rb', line 8

def root
  @root
end

#template_managerObject (readonly)

Returns the value of attribute template_manager.



8
9
10
# File 'lib/tres/app.rb', line 8

def template_manager
  @template_manager
end

Class Method Details

.open(root, options = {}) ⇒ Object



37
38
39
# File 'lib/tres/app.rb', line 37

def self.open root, options = {}
  new root, options.merge(:fresh => false)
end