Sha256: 0ce86e7beac96fec68b2f4c9435f20e381cd0317f2007da54b1919c043b9af5f
Contents?: true
Size: 889 Bytes
Versions: 9
Compression:
Stored size: 889 Bytes
Contents
# frozen_string_literal: true module Blacklight class Assets < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) def assets copy_file "blacklight.scss", "app/assets/stylesheets/blacklight.scss" return if has_blacklight_assets? marker = if turbolinks? '//= require turbolinks' else '//= require jquery_ujs' end insert_into_file "app/assets/javascripts/application.js", :after => marker do <<-EOF // // Required by Blacklight //= require blacklight/blacklight EOF end end private def turbolinks? @turbolinks ||= IO.read("app/assets/javascripts/application.js").include?('turbolinks') end def has_blacklight_assets? IO.read("app/assets/javascripts/application.js").include?('blacklight/blacklight') end end end
Version data entries
9 entries across 9 versions & 1 rubygems