Sha256: 1254bcf90b05447bc028d845aa098d48e2ddd7d1baf50070552b8c29ef2b3dad
Contents?: true
Size: 429 Bytes
Versions: 7
Compression:
Stored size: 429 Bytes
Contents
require 'erb' class GenView < Thor::Group include Thor::Actions source_root File.expand_path("../templates", __FILE__) def initialize(args=[], options={}, config={}) super self.destination_root= "" end argument :name def gen page_name = name content = ERB.new File.read("#{GenView.source_root}/view.haml.erb") create_file "hamls/pages/#{page_name}_page.haml", content.result(binding) end end
Version data entries
7 entries across 7 versions & 2 rubygems