Skip to content

Instantly share code, notes, and snippets.

@wtnabe
Created July 22, 2011 12:03
Show Gist options
  • Save wtnabe/1099311 to your computer and use it in GitHub Desktop.
Save wtnabe/1099311 to your computer and use it in GitHub Desktop.
rake task that install jasmine-jquery helper for Rails and pure jasmine inited env
# -*- mode: ruby -*-
#
# put this code #{Rails.root}/lib/tasks or jasmine Rakefile
#
namespace :jasmine do
desc "Install jasmine-jquery"
task "install-jquery" do
require "open-uri"
base_dir = Rails.root.nil? ? File.dirname(__FILE__) : Rails.root
File.open( File.join( base_dir,
'spec/javascripts/helpers/jasmine-jquery.js'), 'w' ) { |f|
f.puts URI('https://raw.github.com/velesin/jasmine-jquery/master/lib/jasmine-jquery.js').read
}
fixture_dir = File.join( base_dir, 'spec/javascripts/fixtures' )
FileUtils.mkdir( fixture_dir ) unless File.exist?( fixture_dir )
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment