Sha256: 71bd8c92d5d582e1b7c2c1fd89ae8be73a3488f1aba7300d55ad30357dae0209

Contents?: true

Size: 1.04 KB

Versions: 4

Compression:

Stored size: 1.04 KB

Contents

module Stationed
  module Generators
    module Plugins
      module Styles
        def self.prepended(base)
          base.class_option :styles,
            type: :boolean,
            default: true,
            desc: 'Include Bourbon, Neat, Bitters and Normalize.css'
        end

        def finish_template
          return super unless options[:styles]
          gem 'bourbon'
          gem 'neat'
          gem 'bitters'
          remove_file 'app/assets/stylesheets/application.css'
          copy_file 'application.scss', 'app/assets/stylesheets/application.scss'
          copy_file 'layout.scss', 'app/assets/stylesheets/_layout.scss'
          copy_file 'normalize.css', 'vendor/assets/stylesheets/normalize.css'
          super
        end

        def run_bundle
          super
          return unless options[:styles]
          run 'bitters install'
          FileUtils.mv 'bitters', 'app/assets/stylesheets/bitters'
          gsub_file 'app/assets/stylesheets/bitters/_bitters.scss', %r{// @import}, '@import'
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stationed-0.4.0 lib/stationed/generators/plugins/styles.rb
stationed-0.3.0 lib/stationed/generators/plugins/styles.rb
stationed-0.2.0 lib/stationed/generators/plugins/styles.rb
stationed-0.1.0 lib/stationed/generators/plugins/styles.rb