Class: WDK_Render
- Inherits:
-
Thor::Group
- Object
- Thor::Group
- WDK_Render
- Includes:
- Thor::Actions
- Defined in:
- lib/wdk/wdk_render.rb
Instance Method Summary collapse
- #copy_img ⇒ Object
- #copy_js ⇒ Object
- #copy_lib ⇒ Object
- #copy_res ⇒ Object
- #gen_view_to_static ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ WDK_Render
constructor
A new instance of WDK_Render.
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=[], ={}, config={}) super self.destination_root= "../dest" end |
Instance Method Details
#copy_img ⇒ Object
15 16 17 |
# File 'lib/wdk/wdk_render.rb', line 15 def copy_img directory :img end |
#copy_js ⇒ Object
11 12 13 |
# File 'lib/wdk/wdk_render.rb', line 11 def copy_js directory :js end |
#copy_lib ⇒ Object
23 24 25 |
# File 'lib/wdk/wdk_render.rb', line 23 def copy_lib directory :lib end |
#copy_res ⇒ Object
19 20 21 |
# File 'lib/wdk/wdk_render.rb', line 19 def copy_res directory :res end |
#gen_view_to_static ⇒ Object
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 |