Class: Flustered::Core

Inherits:
Object show all
Includes:
Innate::Node
Defined in:
lib/flustered/core.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



28
29
30
31
32
33
34
35
# File 'lib/flustered/core.rb', line 28

def self.run
  root=File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'app'))
  Innate.options[:roots] << root
  Innate.middleware! :dev do |m|
    m.innate
  end
  Innate.start :root => root, :mode => :dev
end

Instance Method Details

#css(name, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/flustered/core.rb', line 9

def css(name, options={})
  options[:rel]   ||= 'stylesheet'
  options[:type]  ||= 'text/css'
  options[:media] ||= 'screen'

  tag = %Q{<link rel="%s" type="%s" media="%s" href="style/css/%s.css"/>}
  tag = %Q{<!--[if #{options[:where]}]>#{tag}<![endif]-->} if options[:where]

  tag % [options[:rel],  options[:type], options[:media], name]
end

#indexObject



25
26
# File 'lib/flustered/core.rb', line 25

def index
end

#js(name, type = 'text/javascript') ⇒ Object



20
21
22
23
# File 'lib/flustered/core.rb', line 20

def js(name, type='text/javascript')
  tag = %Q{<script type="%s" src="style/js/%s.js"></script>}
  tag % [type, name]
end