Sha256: 4a536aeeadd14f6dadf15d387f5dc0819631b6bae462308e514ed0b874041c46

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

#!/usr/bin/env rake
require 'bundler'
Bundler::GemHelper.install_tasks

desc "Bundle the gem"
task :bundle  => [:bundle_install, :build_static_stylesheets] do
  sh 'gem build *.gemspec'
  sh 'gem install *.gem'
  sh 'rm *.gem'
end

desc "Runs bundle install"
task :bundle_install do
  sh('bundle install')
end

desc "Build the static precompiled stylesheets from Less sources"
task :build_static_stylesheets do
  require 'less'

  toolkit_path = File.join('vendor', 'toolkit')

  parser = Less::Parser.new :paths => [toolkit_path]

  target_directory = File.expand_path('vendor/assets/stylesheets/groundworkcss-static')

  sh "rm -rf #{target_directory}"
  sh "mkdir -p #{target_directory}"
  Dir['vendor/static-source/*.scss'].each do |source_file|
    puts "Compiling #{source_file}"
    target_file = File.join(target_directory, File.basename(source_file, '.scss')+'.css.erb')
    tree = parser.parse(File.read(source_file))
    File.open(target_file, 'w') {|f| f.puts tree.to_css(:compress => true) }
  end
end

task(:default).clear
task :default => :bundle

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
groundworkcss-rails-0.2.12 Rakefile
groundworkcss-rails-0.2.11 Rakefile
groundworkcss-rails-0.2.10 Rakefile
groundworkcss-rails-0.2.9 Rakefile
groundworkcss-rails-0.2.8 Rakefile
groundworkcss-rails-0.2.7 Rakefile
groundworkcss-rails-0.2.6 Rakefile
groundworkcss-rails-0.2.5 Rakefile
groundworkcss-rails-0.2.4 Rakefile
groundworkcss-rails-0.2.3 Rakefile
groundworkcss-rails-0.2.2 Rakefile
groundworkcss-rails-0.2.1 Rakefile
groundworkcss-rails-0.2 Rakefile
groundworkcss-rails-0.1 Rakefile