Sha256: db3032b4146f2b4200b2522948a5d85c7fa94d611e4f536471dad2fc334a8fab
Contents?: true
Size: 579 Bytes
Versions: 7
Compression:
Stored size: 579 Bytes
Contents
module Curupira module Generators class ViewsGenerator < Rails::Generators::Base source_root File.expand_path("../" * 5, __FILE__) def create_views views.each do |view| copy_file view end end private def views files_within_root('.', 'app/views/**/*.*') end def files_within_root(prefix, glob) root = "#{self.class.source_root}/#{prefix}" Dir["#{root}/#{glob}"].sort.map do |full_path| full_path.sub(root, '.').gsub('/./', '/') end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems