Sha256: 3b773c73aba8b01e063ba89ed5e867b4a33fd7490a8b3a212dec92a235c09a29
Contents?: true
Size: 1.43 KB
Versions: 8
Compression:
Stored size: 1.43 KB
Contents
# desc "Explaining what the task does" # task :rails_modular_admin do # # Task goes here # end namespace :rails_modular_admin do desc "Copy over all javascripts from the Modular Admin src directory to the assets directory." task :copy_javascripts do Dir.glob("#{modular_admin_src_path}/**/*\.js") {|filename| fname = File.basename filename relpath = Pathname.new(filename).relative_path_from(Pathname.new("#{modular_admin_src_path}")) dest = File.dirname(File.join(Pathname.new(javascripts_path), relpath)) FileUtils.mkdir_p(dest) cp filename, "#{dest}/#{fname}" } end desc "Copy over all stylesheets from the Modular Admin src directory to the assets directory." task :copy_stylesheets do Dir.glob("#{modular_admin_src_path}/**/*\.scss") {|filename| fname = File.basename filename relpath = Pathname.new(filename).relative_path_from(Pathname.new("#{modular_admin_src_path}")) dest = File.dirname(File.join(Pathname.new(stylesheets_path), relpath)) FileUtils.mkdir_p(dest) cp filename, "#{dest}/#{fname}" } end private # Get relative root path def root_path File.expand_path '../../..', __FILE__ end def modular_admin_src_path File.join root_path, "modular-admin-html/src" end def javascripts_path File.join root_path, "app/assets/javascripts/rails_modular_admin/" end def stylesheets_path File.join root_path, "app/assets/stylesheets/rails_modular_admin/" end end
Version data entries
8 entries across 8 versions & 1 rubygems