Permalink
Browse files

Replace shrinksafe with sprockets (closes #3)

  • Loading branch information...
1 parent d3ae5f1 commit 5496eb07d8dc3b4c14c270c52cd60b617ea19637 @mdaines mdaines committed May 12, 2009
View
@@ -1,2 +1,2 @@
.DS_Store
-/www/javascripts/*
+www/plumb.js
View
@@ -0,0 +1,3 @@
+[submodule "vendor/prototype"]
+ path = vendor/prototype
+ url = git://github.com/sstephenson/prototype.git
View
@@ -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
- mkdir_p "www/javascripts"
-
- cp "vendor/prototype.js", "www/javascripts/prototype.js"
-
- cp "lib/letters.js", "www/javascripts/letters.js"
-
- 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
-
- 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"
+desc "Use Sprockets to build www/plumb.js"
+task :build_javascripts do
+ require "rubygems"
+ require "sprockets"
+
+ secretary = Sprockets::Secretary.new(
+ :asset_root => "www",
+ :load_path => ["vendor/*/src"],
+ :source_files => ["src/plumb.js"]
+ )
+
+ concatenation = secretary.concatenation
+ concatenation.save_to("www/plumb.js")
end
-task "www/javascripts/plumb.js" do
- 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
+task :default => :build_javascripts
File renamed without changes.
@@ -1,3 +1,8 @@
+//= require <prototype.js>
+
+/* Plumb (c) 2007-2009 Michael Daines
+ * Distributed under the terms of an MIT-style license */
+
var Plumb = {
DEFAULTS: {
layout: {
@@ -47,4 +52,19 @@ var Plumb = {
this[m.capitalize()].setup();
}.bind(this));
}
-}
+}
+
+//= require "plumb/column.js"
+//= require "plumb/creation.js"
+//= require "plumb/dragging.js"
+//= require "plumb/focus.js"
+//= require "plumb/handle.js"
+//= require "plumb/layout.js"
+//= require "plumb/modes.js"
+//= require "plumb/output.js"
+//= require "plumb/recognition.js"
+//= require "plumb/resizing.js"
+//= require "plumb/selection.js"
+//= require "plumb/shape.js"
+//= require "plumb/toolbar.js"
+//= require "letters.js"
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.

0 comments on commit 5496eb0

Please sign in to comment.