Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace shrinksafe with sprockets (closes #3)
- Loading branch information
Michael Daines
committed
May 12, 2009
1 parent
d3ae5f1
commit 5496eb0
Showing
28 changed files
with
43 additions
and
4,974 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,2 @@ | |||
.DS_Store | .DS_Store | ||
/www/javascripts/* | www/plumb.js |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
[submodule "vendor/prototype"] | |||
path = vendor/prototype | |||
url = git://github.com/sstephenson/prototype.git |
This file contains 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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,49 +1,20 @@ | |||
require "tempfile" | require "rake/clean" | ||
|
|
||
task :build_javascripts => ["www/javascripts/prototype.js", "www/javascripts/letters.js", "www/javascripts/plumb.js"] | CLOBBER << ["www/plumb.js"] | ||
|
|
||
task :copy_javascripts do | desc "Use Sprockets to build www/plumb.js" | ||
mkdir_p "www/javascripts" | task :build_javascripts do | ||
|
require "rubygems" | ||
cp "vendor/prototype.js", "www/javascripts/prototype.js" | require "sprockets" | ||
|
|
||
cp "lib/letters.js", "www/javascripts/letters.js" | secretary = Sprockets::Secretary.new( | ||
|
:asset_root => "www", | ||
src = "" | :load_path => ["vendor/*/src"], | ||
|
:source_files => ["src/plumb.js"] | ||
FileList["lib/plumb.js", "lib/plumb/*.js"].each do |path| | ) | ||
src += File.read(path) + "\n\n" |
|
||
end | concatenation = secretary.concatenation | ||
|
concatenation.save_to("www/plumb.js") | ||
tmp = Tempfile.new("plumb") | |||
tmp << src | |||
tmp.close | |||
|
|||
cp tmp.path, "www/javascripts/plumb.js" | |||
end | |||
|
|||
task "www/javascripts/prototype.js" do | |||
mkdir_p "www/javascripts" | |||
`java -jar vendor/shrinksafe.jar vendor/prototype.js > www/javascripts/prototype.js` | |||
end | |||
|
|||
task "www/javascripts/letters.js" do | |||
mkdir_p "www/javascripts" | |||
cp "lib/letters.js", "www/javascripts/letters.js" | |||
end | end | ||
|
|
||
task "www/javascripts/plumb.js" do | task :default => :build_javascripts | ||
mkdir_p "www/javascripts" | |||
|
|||
src = "" | |||
|
|||
FileList["lib/plumb.js", "lib/plumb/*.js"].each do |path| | |||
src += File.read(path) + "\n\n" | |||
end | |||
|
|||
tmp = Tempfile.new("plumb") | |||
tmp << src | |||
tmp.close | |||
|
|||
`java -jar vendor/shrinksafe.jar #{tmp.path} > www/javascripts/plumb.js` | |||
end |
File renamed without changes.
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.