Sha256: 7fc450e00a73287caa30ea22d431db3261867772a27c15d63b83aa6af63862d9

Contents?: true

Size: 1.07 KB

Versions: 27

Compression:

Stored size: 1.07 KB

Contents

class CmsGenerator < Rails::Generators::Base
  
  include Rails::Generators::Migration
  include Thor::Actions
  
  source_root File.expand_path('../../..', __FILE__)
  
  def generate_migration
    migration_template 'db/migrate/01_create_cms.rb', 'db/migrate/create_cms.rb'
  end
  
  def generate_initialization
    copy_file 'config/initializers/comfortable_mexican_sofa.rb', 'config/initializers/comfortable_mexican_sofa.rb'
  end
  
  def generate_public_assets
    directory 'public/stylesheets/comfortable_mexican_sofa', 'public/stylesheets/comfortable_mexican_sofa'
    directory 'public/javascripts/comfortable_mexican_sofa', 'public/javascripts/comfortable_mexican_sofa'
    directory 'public/images/comfortable_mexican_sofa', 'public/images/comfortable_mexican_sofa'
  end
  
  def show_readme
    readme 'lib/generators/README'
  end
  
  def self.next_migration_number(dirname)
    orm = Rails.configuration.generators.options[:rails][:orm]
    require "rails/generators/#{orm}"
    "#{orm.to_s.camelize}::Generators::Base".constantize.next_migration_number(dirname)
  end
  
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.0.29 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.28 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.27 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.26 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.25 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.24 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.23 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.22 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.21 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.20 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.19 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.18 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.17 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.16 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.15 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.14 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.13 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.12 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.11 lib/generators/cms_generator.rb
comfortable_mexican_sofa-1.0.10 lib/generators/cms_generator.rb