Created
July 22, 2011 12:03
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- 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