Sha256: baa11b5e720574ed101ffa77feaae9cf09b94fe1aabfe89fd152d80173728258

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

require 'rails/generators'
module Partystreusel
  class StyleguideGenerator < ::Rails::Generators::Base
    source_root File.expand_path('../../../../', __FILE__)

    TARGET_DIR_FOR_STYLESHEETS = 'app/assets/stylesheets/'
    TARGET_DIR_FOR_STYLEGUIDE = 'app/views/styleguide'
    TARGET_DIR_FOR_PARTIALS = 'app/views/partials'


    def copy_stylesheets
      directory 'styleguide/source/stylesheets', TARGET_DIR_FOR_STYLESHEETS
    end

    def copy_views
      directory 'styleguide/source/styleguide', TARGET_DIR_FOR_STYLEGUIDE
      directory 'styleguide/source/partials', TARGET_DIR_FOR_PARTIALS
    end

    def add_route
      inject_into_file 'config/routes.rb', "  mount Partystreusel::Engine => '/'\n", before: /^end/
    end

    def copy_grunticon_files
      directory 'app/assets/images', 'app/assets/images'
      copy_file 'package.json', 'package.json'
      copy_file 'Gruntfile.coffee', 'Gruntfile.coffee'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
partystreusel-2.0.0 lib/generators/partystreusel/styleguide_generator.rb
partystreusel-1.2.0 lib/generators/partystreusel/styleguide_generator.rb