Sha256: 481624664b3e73e7f0433fe58e485ab7f518481d336651111dfc82013b14151f
Contents?: true
Size: 869 Bytes
Versions: 1
Compression:
Stored size: 869 Bytes
Contents
require 'rails/generators' module Kube module Generators class InstallGenerator < ::Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) desc 'This generator installs Kube to Asset Pipeline' def add_assets if File.exist?('app/assets/stylesheets/application.css') content = File.read('app/assets/stylesheets/application.css') unless content.match(/require_tree\s+\.\s*$/) style_require_block = " *= require kube\n" insert_into_file 'app/assets/stylesheets/application.css', style_require_block, after: "require_self\n" end else copy_file 'application.css', 'app/assets/stylesheets/application.css' end end def add_kube copy_file 'kube.less', 'app/assets/stylesheets/kube.css.less' end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kube-rails-0.4.0 | lib/generators/kube/install/install_generator.rb |