Skip to content

Commit

Permalink
Move asset generating to the assets generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoyne committed Jun 4, 2018
1 parent f7ecb3f commit 77fef2f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
7 changes: 7 additions & 0 deletions lib/generators/blacklight/assets_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ module Blacklight
class Assets < Rails::Generators::Base
source_root File.expand_path('../templates', __FILE__)

# This could be skipped if you want to use webpacker
def add_javascript_dependencies
gem 'bootstrap', '~> 4.0'
gem 'popper_js'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
end

def assets
copy_file "blacklight.scss", "app/assets/stylesheets/blacklight.scss"

Expand Down
17 changes: 5 additions & 12 deletions lib/generators/blacklight/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ def add_solr_wrapper
generate 'blacklight:solr' unless options[:'skip-solr']
end

# This could be skipped if you want to use webpacker
def add_javascript_dependencies
gem 'bootstrap', '~> 4.0'
gem 'popper_js'
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
# Copy all files in templates/public/ directory to public/
# Call external generator in AssetsGenerator, so we can
# leave that callable seperately too.
def copy_public_assets
generate "blacklight:assets" unless options[:'skip-assets']
end

def bundle_install
Expand All @@ -43,13 +43,6 @@ def bundle_install
end
end

# Copy all files in templates/public/ directory to public/
# Call external generator in AssetsGenerator, so we can
# leave that callable seperately too.
def copy_public_assets
generate "blacklight:assets" unless options[:'skip-assets']
end

def generate_blacklight_document
generate 'blacklight:document', document_name
end
Expand Down

0 comments on commit 77fef2f

Please sign in to comment.