Sha256: 2ddf33e3e8652a5fce262ccf04522457280db49077a13a207e476945ee891e1f
Contents?: true
Size: 1.03 KB
Versions: 10
Compression:
Stored size: 1.03 KB
Contents
module DMGen class Is < Templater::Generator first_argument :name, :required => true desc <<-eos Generates an 'is' plugin for DataMapper, such as dm-is-list. Use like dm-gen is plugin This generates the full plugin structure with skeleton code and specs, as well as a Rakefile. All it needs is a README and some real functionality. eos def self.source_root File.join(File.dirname(__FILE__), '..', 'templates', 'is') end def gem_name "dm-is-#{snake_name}" end def snake_name name.snake_case end def class_name name.camel_case end def destination_root File.join(@destination_root, gem_name) end # glob the template dir for all templates. # since we want text files processed, we have to replace the default # extension list. glob!('', %w[rb txt Rakefile LICENSE TODO]) def manifest_files self.all_actions.map {|t| t.destination.gsub(/#{destination_root}\//,'') }.sort end end add :is, Is end
Version data entries
10 entries across 10 versions & 2 rubygems