-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
17 lines (15 loc) · 1013 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
desc "Concats the src code"
task :sprocketize do
`sprocketize src/bookmarklets.js > release/bookmarklets.js`
`sprocketize src/bookmarklets_with_sizzle.js > release/bookmarklets_with_sizzle.js`
end
desc "minifies the code with packr"
task :min do
`packr -s release/bookmarklets.js > release/bookmarklets.min.js`
`packr -s release/bookmarklets_with_sizzle.js > release/bookmarklets_with_sizzle.min.js`
end
desc "Creates a bookmarklet that calls the provided function"
task :create_bookmarklet do
puts "The bookmarklet has been copied to your pasteboard. Create a new bookmark and hit paste!"
`echo "javascript:(function(){var%20script=document.createElement('script'),src=typeof(Sizzle)!='undefined'?'http://github.com/RyanS/Bookmarklets/raw/master/release/bookmarklets.min.js':'http://github.com/RyanS/Bookmarklets/raw/master/release/bookmarklets_with_sizzle.min.js';window.__bf__='#{ENV['function']}';script.src=src+'?'+(new%20Date().getTime());document.body.appendChild(script);})();" | pbcopy`
end