Sha256: c32751f09d19b668da72a5c0d4d6387211f943e34e3ebaef00edd05227fbc3d8

Contents?: true

Size: 1.86 KB

Versions: 18

Compression:

Stored size: 1.86 KB

Contents

lib_path = File.join(File.dirname(__FILE__), 'lib')
$:.unshift(lib_path) unless $:.include?(lib_path)

require 'rake/testtask'
task :test do |t|
  $: << File.expand_path('test/')
  Dir.glob('./test/**/*_test.rb').each { |file| require file }
end

desc 'Dumps output to a CSS file for testing'
task :debug do
  require 'sass'
  path = Bootstrap.stylesheets_path
  %w(helio).each do |file|
    engine = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
    File.open("./#{file}.css", 'w') { |f| f.write(engine.render) }
  end
end

desc 'Convert helio to helio-sass'
task :convert, :branch do |t, args|
  require './tasks/converter'
  Converter.new(branch: args[:branch]).process_helio
end

desc 'LESS to stdin -> Sass to stdout'
task :less_to_scss, :branch do |t, args|
  require './tasks/converter'
  puts Converter.new(branch: args[:branch]).convert_less(STDIN.read)
end

desc 'Compile helio-sass to tmp/ (or first arg)'
task :compile, :css_path do |t, args|
  require 'sass'
  require 'term/ansicolor'

  path = 'assets/stylesheets'
  css_path = args.with_defaults(css_path: 'tmp')[:css_path]
  puts Term::ANSIColor.bold "Compiling SCSS in #{path}"
  Dir.mkdir(css_path) unless File.directory?(css_path)
  %w(_helio).each do |file|
    save_path = "#{css_path}/#{file.sub(/(^|\/)?_+/, '\1').sub('/', '-')}.css"
    puts Term::ANSIColor.cyan("  #{save_path}") + '...'
    engine    = Sass::Engine.for_file("#{path}/#{file}.scss", syntax: :scss, load_paths: [path])
    css       = engine.render
    File.open(save_path, 'w') { |f| f.write css }
  end
end

desc 'Start a dummy (test) Rails app server'
task :dummy_rails do
  require 'rack'
  require 'term/ansicolor'
  port = ENV['PORT'] || 9292
  puts %Q(Starting on #{Term::ANSIColor.cyan "http://localhost:#{port}"})
  Rack::Server.start(
    config: 'test/dummy_rails/config.ru',
    Port: port)
end

task default: :test

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
helio-0.1.12 Rakefile
helio-0.1.11 Rakefile
helio-0.1.10 Rakefile
helio-0.1.9 Rakefile
helio-0.1.8 Rakefile
helio-0.1.7 Rakefile
helio-0.1.6 Rakefile
helio-0.0.1.5 Rakefile
helio-0.0.1.4 Rakefile
helio-0.0.1.3 Rakefile
helio-0.0.1.2 Rakefile
helio-0.0.1.1 Rakefile
helio-0.0.1.0 Rakefile
helio-0.0.0.9 Rakefile
helio-0.0.0.8 Rakefile
helio-0.0.0.7 Rakefile
helio-0.0.0.6 Rakefile
helio-0.0.0.5 Rakefile