Skip to content
Browse files

reorganize gem and upgrade to rails 3.1.0.rc5

  • Loading branch information...
1 parent fc5653b commit 0f56ef40dbe93a9f23bf40ecee53da5c02b7d137 @rdy rdy committed
View
4 lib/sprockets-jquery-tmpl.rb
@@ -1,2 +1,2 @@
-require 'sprockets/version'
-require 'sprockets/tmpl'
+require 'sprockets/jquery/tmpl/version'
+require 'sprockets/jquery/tmpl/tmpl_processor'
View
30 lib/sprockets/jquery/tmpl/tmpl_processor.rb
@@ -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
View
2 lib/sprockets/version.rb → lib/sprockets/jquery/tmpl/version.rb
@@ -1,7 +1,7 @@
module Sprockets
module Jquery
module Tmpl
- VERSION = "0.0.2"
+ VERSION = '0.0.3'
end
end
end
View
27 lib/sprockets/tmpl.rb
@@ -1,27 +0,0 @@
-require 'tilt'
-require 'action_view'
-require 'action_view/helpers'
-require 'action_view/helpers/javascript_helper'
-
-module Sprockets
- class Tmpl < 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
-
- register_engine '.tmpl', Tmpl
-end
View
4 sprockets-jquery-tmpl.gemspec
@@ -1,6 +1,6 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path('../lib', __FILE__)
-require 'sprockets/version'
+require 'sprockets/jquery/tmpl/version'
Gem::Specification.new do |s|
s.name = 'sprockets-jquery-tmpl'
@@ -18,5 +18,5 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_dependency 'actionpack', '3.1.0.rc4'
+ s.add_dependency 'actionpack', '~> 3.1.0.rc5'
end

0 comments on commit 0f56ef4

Please sign in to comment.
Something went wrong with that request. Please try again.