Sha256: 8a333530ca125dcdc9220db9a49a916757715ddefdc66533aa02b8534bb0cb9e

Contents?: true

Size: 512 Bytes

Versions: 11

Compression:

Stored size: 512 Bytes

Contents

class TinyCmsViewsGenerator < Rails::Generator::Base
  def initialize *args
    super
    @source_root = options[:source] || File.join(spec.path, '..', '..')
  end
  
  def manifest
    record do |m|
      m.directory "app/views"

      directory = nil
      Dir.glob("#{@source_root}/app/views/**/*.erb").each do |file|
        file = file.gsub("#{ @source_root }/", "")
        m.directory directory = File.dirname(file) if directory != File.dirname(file)
        m.file file, file
      end
    end
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
tiny_cms-0.2.10 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.8 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.6 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.5 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.4 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.3 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.2 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.1 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.2.0 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.1.1 generators/tiny_cms_views/tiny_cms_views_generator.rb
tiny_cms-0.1.0 generators/tiny_cms_views/tiny_cms_views_generator.rb