Sha256: 29651f21d5e0af3d46bb74b73249a2f57a6d6f6fe39311b5e697bffe708f84a2

Contents?: true

Size: 755 Bytes

Versions: 10

Compression:

Stored size: 755 Bytes

Contents

require "rails/generators/named_base"

class CssZero::InstallGenerator < Rails::Generators::Base
  include Rails::Generators::AppName

  source_root File.expand_path("templates", __dir__)

  def copy_base_css
    copy_file "app/assets/stylesheets/base.css"
  end

  def copy_application_css
    copy_file "app/assets/stylesheets/application.css", force: true if sprockets?
  end

  def copy_application_layout
    template "app/views/layouts/application.html.erb", force: true
  end

  def add_basic_components
    invoke "css_zero:add", %w(layouts flash alert input button)
  end

  private

  def importmaps?
    Rails.root.join("config/importmap.rb").exist?
  end

  def sprockets?
    Rails.root.join("app/assets/config/manifest.js").exist?
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
css-zero-1.0.4 lib/generators/css_zero/install/install_generator.rb
css-zero-1.0.3 lib/generators/css_zero/install/install_generator.rb
css-zero-1.0.2 lib/generators/css_zero/install/install_generator.rb
css-zero-1.0.1 lib/generators/css_zero/install/install_generator.rb
css-zero-1.0.0 lib/generators/css_zero/install/install_generator.rb
css-zero-0.0.98 lib/generators/css_zero/install/install_generator.rb
css-zero-0.0.97 lib/generators/css_zero/install/install_generator.rb
css-zero-0.0.96 lib/generators/css_zero/install/install_generator.rb
css-zero-0.0.95 lib/generators/css_zero/install/install_generator.rb
css-zero-0.0.94 lib/generators/css_zero/install/install_generator.rb