Sha256: 0f1ceb73adc7644419147af62002a1bd684e9f004328801a195d0206f549b99c

Contents?: true

Size: 812 Bytes

Versions: 15

Compression:

Stored size: 812 Bytes

Contents

# frozen_string_literal: true

require 'autoprefixer-rails'
require 'bootstrap'
require 'bundler/gem_tasks'
require 'fileutils'
require 'rspec/core/rake_task'
require 'sassc'
require 'structured_changelog/tasks'

RSpec::Core::RakeTask.new(:spec)

task default: :spec

task build: :assets

desc 'Preprocess assets'
task :assets do
  puts 'Preprocessing SCSS and JS files'

  puts 'Copying over bootstrap'

  FileUtils.cp_r Gem::Specification.find_by_name('bootstrap').gem_dir, 'tmp'

  sass = File.read(File.expand_path('./src/stylesheets/main.scss'))
  css = SassC::Engine.new(sass, style: :compressed).render
  prefixed = AutoprefixerRails.process(css)
  File.open(File.expand_path('./app/assets/stylesheets/main.css'), 'w') { |file| file.write(prefixed) }

  npm_output = `npm run build`
  puts npm_output
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
attractor-2.0.5 Rakefile
attractor-2.0.4 Rakefile
attractor-2.0.3 Rakefile
attractor-2.0.2 Rakefile
attractor-2.0.1 Rakefile
attractor-2.0.0 Rakefile
attractor-0.6.1 Rakefile
attractor-0.6.0 Rakefile
attractor-0.5.1 Rakefile
attractor-0.5.0 Rakefile
attractor-0.4.3 Rakefile
attractor-0.4.2 Rakefile
attractor-0.4.1 Rakefile
attractor-0.4.0 Rakefile
attractor-0.3.4 Rakefile