require 'bundler/gem_tasks' require 'jasmine' load 'jasmine/tasks/jasmine.rake' begin require 'cucumber' require 'cucumber/rake/task' Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = '--format pretty' end Cucumber::Rake::Task.new('features:wip') do |t| t.cucumber_opts = '--format pretty --tags @wip' end rescue LoadError desc 'Cucumber rake task not available' task :features do abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' end end namespace :deps do desc 'Installs non-ruby dependencies like gulp, bower and nodejs packages' task :install do sh 'sudo npm install -g gulp bower' sh 'npm install' sh 'bower install' end desc 'Updates npm and bower packages' task :update do sh 'npm update' sh 'bower update' end desc 'Removes npm and bower packages from filesystem' task :clean do sh 'rm -rf node_modules' sh 'rm -rf bower_components' end end namespace :assets do desc 'Build js and css' task :build do sh 'gulp build' end desc 'Watch the assets files and rebuild when one of them changes' task :watch => :build do sh 'gulp watch' end desc 'Clean builded assets' task :clean do sh 'gulp clean' end end task :build => %w(deps:install assets:build) namespace :git do desc 'Executes git clean' task :clean do sh 'git clean -dfX' end end