Sha256: a979eb533892d36759ed1d28adededc14fd67f729145a0ead4664058d4d1362a

Contents?: true

Size: 663 Bytes

Versions: 3

Compression:

Stored size: 663 Bytes

Contents

require_relative "base"

module Suspenders
  class AutoprefixerGenerator < Generators::Base
    def add_autoprefixer_rails
      gem 'autoprefixer-rails'
      Bundler.with_clean_env { run "bundle install" }
    end

    def copy_browserslistrc
      if behavior == :invoke
        list = <<~TEXT
          last 1 version
          > 5%
          not IE 11
        TEXT
        in_root do
          File.open('.browserslistrc', 'w') do |file|
            file << list
          end
        end
      else
        in_root do
          File.open('.browserslistrc', 'w') do |file|
            file << 'defaults'
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
welaika-suspenders-3.0 lib/suspenders/generators/autoprefixer_generator.rb
welaika-suspenders-2.36 lib/suspenders/generators/autoprefixer_generator.rb
welaika-suspenders-2.35 lib/suspenders/generators/autoprefixer_generator.rb