Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,3 @@
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

# Bootstrap and TinyMCE expect their files to live in a specific place, so copy them over
puts "Copying Bootstrap glyphicons to the public directory ..."
source_dir = Dir.glob(Rails.root.join('node_modules', 'bootstrap', 'fonts', 'glyphicons-halflings-regular.*'))
destination_dir = Rails.root.join('public', 'fonts', 'bootstrap')
FileUtils.mkdir_p(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)

puts "Copying TinyMCE skins to the public directory ..."
source_dir = Dir.glob(Rails.root.join('node_modules', 'tinymce', 'skins', 'ui', 'oxide'))
destination_dir = Rails.root.join('public', 'tinymce', 'skins')
FileUtils.mkdir_p(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)
22 changes: 22 additions & 0 deletions lib/tasks/assets.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# frozen_string_literal: true

namespace :assets do
desc 'Copy Bootstrap glyphicons and TinyMCE skins to the public directory'
task :copy do
# Bootstrap and TinyMCE expect their files to live in a specific place, so copy them over
puts 'Copying Bootstrap glyphicons to the public directory ...'
source_dir = Dir.glob(Rails.root.join('node_modules', 'bootstrap', 'fonts', 'glyphicons-halflings-regular.*'))
destination_dir = Rails.root.join('public', 'fonts', 'bootstrap')
FileUtils.mkdir_p(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)

puts 'Copying TinyMCE skins to the public directory ...'
source_dir = Dir.glob(Rails.root.join('node_modules', 'tinymce', 'skins', 'ui', 'oxide'))
destination_dir = Rails.root.join('public', 'tinymce', 'skins')
FileUtils.mkdir_p(destination_dir)
FileUtils.cp_r(source_dir, destination_dir)
end

# Run the copy task before precompiling assets
task precompile: :copy
end
Loading