Class: WDK_Render

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/wdk/wdk_render.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = [], options = {}, config = {}) ⇒ WDK_Render

Returns a new instance of WDK_Render.



6
7
8
9
# File 'lib/wdk/wdk_render.rb', line 6

def initialize(args=[], options={}, config={})
  super
  self.destination_root= "../dest"
end

Instance Method Details

#copy_imgObject



15
16
17
# File 'lib/wdk/wdk_render.rb', line 15

def copy_img
  directory :img
end

#copy_jsObject



11
12
13
# File 'lib/wdk/wdk_render.rb', line 11

def copy_js
  directory :js
end

#copy_libObject



23
24
25
# File 'lib/wdk/wdk_render.rb', line 23

def copy_lib
  directory :lib
end

#copy_resObject



19
20
21
# File 'lib/wdk/wdk_render.rb', line 19

def copy_res
  directory :res
end

#gen_view_to_staticObject



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/wdk/wdk_render.rb', line 27

def gen_view_to_static
  haml_pages = File.join("view","**", "*.*")
  Dir.glob haml_pages do |file|
    output_path = File.dirname(file)
    output_path = output_path.sub("view", ".")
    output_file_name = File.basename(file, File.extname(file))
    output = Tilt.new(file).render ViewRenderScope.new
    create_file "#{output_path}/#{output_file_name}.html", output
  end

end