Sha256: 39c68f134d16081abdd117a7fc3e7315f0d1677478b4e3d777f59a2b1d9f4a48

Contents?: true

Size: 938 Bytes

Versions: 18

Compression:

Stored size: 938 Bytes

Contents

module Refinery
  class PagesGenerator < Rails::Generators::Base
    class_option :skip_migrations, :type => :boolean, :default => false, :aliases => nil, :group => :runtime,
                           :desc => "Skip over installing or running migrations."

    source_root File.expand_path('../templates', __FILE__)

    def rake_db
      rake "refinery_pages:install:migrations" unless self.options[:skip_migrations]
    end

    def generate_pages_initializer
      template "config/initializers/refinery/pages.rb.erb",
               File.join(destination_root, "config", "initializers", "refinery", "pages.rb")
    end

    def append_load_seed_data
      create_file "db/seeds.rb" unless File.exists?(File.join(destination_root, 'db', 'seeds.rb'))
      append_file 'db/seeds.rb', :verbose => true do
        <<-EOH

# Added by Refinery CMS Pages extension
Refinery::Pages::Engine.load_seed
        EOH
      end
    end

  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
refinerycms-pages-4.0.3 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-4.0.2 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-4.0.1 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.6 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-4.0.0 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.5 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.4 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.3 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.2 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.1 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-3.0.0 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.5 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.4 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.3 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.2 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.1 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.1.0 lib/generators/refinery/pages/pages_generator.rb
refinerycms-pages-2.0.10 lib/generators/refinery/pages/pages_generator.rb