require 'thor/group' require 'active_support/inflector' module Testg module Generators class Template < Thor::Group argument :name, type: :string include Thor::Actions def self.source_root File.dirname(__FILE__) end def create_group empty_directory(name) end def create_lib_file folder_name = name.dasherize file_name = name.underscore copy_file('templates/Guardfile', "#{folder_name}/Guardfile") template('templates/test/test_class_name.txt', "#{folder_name}/test/test_#{file_name}.rb") template('templates/lib/class_name.txt', "#{folder_name}/lib/#{file_name}.rb") end end end end