Sha256: 043147ebe966e5e3d359fbc958af0cf8c99a65b0232db073ba382226006dc881
Contents?: true
Size: 462 Bytes
Versions: 7
Compression:
Stored size: 462 Bytes
Contents
require 'erb' class GenController < 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 controller_name = name content = ERB.new File.read("#{GenController.source_root}/controller.js.erb") create_file "js/controller/#{controller_name}_controller.js", content.result(binding) end end
Version data entries
7 entries across 7 versions & 2 rubygems