Class: Susanoo::Controller

Inherits:
Object
  • Object
show all
Includes:
Sprockets::Helpers
Defined in:
lib/susanoo/controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeController

Returns a new instance of Controller.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/susanoo/controller.rb', line 13

def initialize
  @project_root = Susanoo::Project.path

  @environment = Sprockets::Environment.new(@project_root) do |env|
    env.logger = Logger.new(STDOUT)
  end

  #@environment.append_path(@project_root)
  @environment.append_path(File.join(@project_root, 'src', 'assets'))
  @environment.append_path(File.join(@project_root, 'src', 'assets', 'javascripts'))
  @environment.append_path(File.join(@project_root, 'src', 'assets', 'stylesheets'))
  @environment.append_path(File.join(@project_root, 'src', 'assets', 'images'))
  @environment.append_path(File.join(@project_root, 'src', 'assets', 'fonts'))

  Susanoo::StaticGenerator.register self.class
end

Instance Attribute Details

#debugObject

Returns the value of attribute debug.



10
11
12
# File 'lib/susanoo/controller.rb', line 10

def debug
  @debug
end

#environmentObject

Returns the value of attribute environment.



9
10
11
# File 'lib/susanoo/controller.rb', line 9

def environment
  @environment
end

#project_rootObject

Returns the value of attribute project_root.



11
12
13
# File 'lib/susanoo/controller.rb', line 11

def project_root
  @project_root
end

Instance Method Details

#static_compile?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/susanoo/controller.rb', line 30

def static_compile?
  @static_compile
end