This repository has been archived by the owner on Nov 11, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 697f9d9
Showing
14 changed files
with
40,865 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
pkg/* |
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,4 @@ | ||
source "http://rubygems.org" | ||
|
||
# Specify your gem's dependencies in rasputin.gemspec | ||
gemspec |
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 @@ | ||
require 'bundler/gem_tasks' |
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,3 @@ | ||
require "rasputin/version" | ||
require "rasputin/engine" | ||
require "rasputin/handelbars_template" |
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,4 @@ | ||
module Rasputin | ||
class Engine < ::Rails::Engine | ||
end | ||
end |
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,32 @@ | ||
require 'tilt' | ||
|
||
module Rasputin | ||
class HandlebarsTemplate < Tilt::Template | ||
def self.default_mime_type | ||
'application/javascript' | ||
end | ||
|
||
def prepare | ||
end | ||
|
||
def evaluate(scope, locals, &block) | ||
<<-HANDLEBARS | ||
SC.TEMPLATES[#{template_path(scope.logical_path).inspect}] = SC.Handlebars.compile(#{indent(data).inspect}); | ||
HANDLEBARS | ||
end | ||
|
||
private | ||
def template_path(path) | ||
path = path.split('/') | ||
path.delete('templates') | ||
path.join('_') | ||
end | ||
|
||
def indent(string) | ||
string.gsub(/$(.)/m, "\\1 ").strip | ||
end | ||
end | ||
end | ||
|
||
Sprockets::Engines #invoke autoloading | ||
Sprockets.register_engine '.handlebars', Rasputin::HandlebarsTemplate |
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,3 @@ | ||
module Rasputin | ||
VERSION = "0.1.0" | ||
end |
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,23 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "rasputin/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "rasputin" | ||
s.version = Rasputin::VERSION | ||
s.authors = ["Paul Chavard"] | ||
s.email = ["paul@chavard.net"] | ||
s.homepage = "http://github.com/tchak/rasputin" | ||
s.summary = %q{Sproutcore 2.0 adapter for the Rails asset pipeline.} | ||
s.description = %q{Sproutcore 2.0 for the Rails asset pipeline.} | ||
|
||
s.rubyforge_project = "rasputin" | ||
s.add_runtime_dependency 'railties', '~> 3.1.0.rc4' | ||
s.add_runtime_dependency 'actionpack', '~> 3.1.0.rc4' | ||
s.add_runtime_dependency 'sprockets', '>= 2.0.0.beta.10' | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | ||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
s.require_paths = ["lib"] | ||
end |
Oops, something went wrong.