Class: Muwu::RenderInspector

Inherits:
Object
  • Object
show all
Includes:
Muwu
Defined in:
lib/muwu/render_inspector/render_inspector.rb

Constant Summary collapse

COLUMN_LEFT =
12
SEPARATOR =
'  '

Constants included from Muwu

GEM_HOME_LIB, GEM_HOME_LIB_MUWU, VERSION

Instance Method Summary collapse

Methods included from Muwu

debug, read

Constructor Details

#initialize(project) ⇒ RenderInspector

Returns a new instance of RenderInspector.



12
13
14
# File 'lib/muwu/render_inspector/render_inspector.rb', line 12

def initialize(project)
  @project = project
end

Instance Method Details

#render_inspectorObject



21
22
23
24
25
26
# File 'lib/muwu/render_inspector/render_inspector.rb', line 21

def render_inspector
  render_inspector_project
  render_inspector_options
  render_inspector_manifest
  render_inspector_errors
end

#render_inspector_errorsObject



29
30
31
32
33
34
35
36
# File 'lib/muwu/render_inspector/render_inspector.rb', line 29

def render_inspector_errors
  if @project.exceptions.any?
    @project.exceptions.each do |error|
      render_inspector_error_report(error)
    end
    puts
  end
end

#render_inspector_manifestObject



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/muwu/render_inspector/render_inspector.rb', line 39

def render_inspector_manifest
  @project.manifest.documents.each do |document|
    case document
    when ManifestTask::DocumentCss
      render_inspector_document_css(document)
    when ManifestTask::DocumentHtml
      render_inspector_document_html(document)
    when ManifestTask::DocumentJs
      render_inspector_document_js(document)
    end
  end
end

#render_inspector_optionsObject



53
54
55
56
57
58
59
60
61
# File 'lib/muwu/render_inspector/render_inspector.rb', line 53

def render_inspector_options  
  puts @project.options
  @project.options.instance_variables.each do |option|
    key = option.to_s.gsub(/\A@/,'')
    value = @project.options.instance_variable_get(option)
    puts indent("#{key}: #{value}")
  end
  puts
end

#render_inspector_projectObject



64
65
66
67
68
69
70
# File 'lib/muwu/render_inspector/render_inspector.rb', line 64

def render_inspector_project
  puts @project
  puts indent("slug: #{@project.slug}")
  puts indent("working_directory: #{@project.working_directory}")
  puts indent("js_libraries: #{@project.javascript_libraries_requested}")
  puts
end