Sha256: 2592d41bb30582a1af8e025310bbe3739736c8619e15e334a4eab2b1d120727a
Contents?: true
Size: 761 Bytes
Versions: 58
Compression:
Stored size: 761 Bytes
Contents
require "thor/group" class KillbillGenerator < Thor::Group include Thor::Actions argument :name argument :dir class_option :destroy, :type => :boolean, :desc => 'Destroys rather than generates the template' def initialize(*args) super rescue Thor::InvocationError at_exit { print self.class.help(shell) } raise end protected def template(source, dest) if options[:destroy] remove_file dest else super end end def output_path @output_path ||= File.expand_path(dir) end def identifier @identifier ||= class_name.gsub(%r{([A-Z])}) { |m| "_#{$1.downcase}" }.sub(%r{^_}, '') end def class_name @class_name ||= name.gsub(%r{(^[a-z])|_([a-zA-Z])}) { |m| ($1||$2).upcase } end end
Version data entries
58 entries across 58 versions & 1 rubygems