Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reorganize gem and upgrade to rails 3.1.0.rc5
- Loading branch information
Showing
5 changed files
with
35 additions
and
32 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 | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require 'sprockets/version' | ||
require 'sprockets/tmpl' | ||
require 'sprockets/jquery/tmpl/version' | ||
require 'sprockets/jquery/tmpl/tmpl_processor' |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
require 'tilt' | ||
require 'action_view' | ||
require 'action_view/helpers' | ||
require 'action_view/helpers/javascript_helper' | ||
|
||
module Sprockets | ||
module Jquery | ||
module Tmpl | ||
class TmplProcessor < Tilt::Template | ||
include ActionView::Helpers::JavaScriptHelper | ||
|
||
def self.default_mime_type | ||
'application/javascript' | ||
end | ||
|
||
def prepare | ||
end | ||
|
||
def evaluate(scope, locals, &block) | ||
<<-TMPL | ||
(function($) { | ||
$.template(#{scope.logical_path.gsub(/^tmpls\/(.*)$/i, "\\1").inspect}, "#{escape_javascript data}"); | ||
})(jQuery); | ||
TMPL | ||
end | ||
end | ||
end | ||
end | ||
register_engine '.tmpl', ::Sprockets::Jquery::Tmpl::TmplProcessor | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/sprockets/version.rb → lib/sprockets/jquery/tmpl/version.rb
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 | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module Sprockets | ||
module Jquery | ||
module Tmpl | ||
VERSION = "0.0.2" | ||
VERSION = '0.0.3' | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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