Skip to content

Commit

Permalink
reorganize gem and upgrade to rails 3.1.0.rc5
Browse files Browse the repository at this point in the history
  • Loading branch information
rdy committed Jul 31, 2011
1 parent fc5653b commit 0f56ef4
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 32 deletions.
4 changes: 2 additions & 2 deletions 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'
30 changes: 30 additions & 0 deletions 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
@@ -1,7 +1,7 @@
module Sprockets
module Jquery
module Tmpl
VERSION = "0.0.2"
VERSION = '0.0.3'
end
end
end
27 changes: 0 additions & 27 deletions lib/sprockets/tmpl.rb

This file was deleted.

4 changes: 2 additions & 2 deletions 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'
Expand All @@ -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.