-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Began implementing filters using Tilt, WIP
Note that this is a work in progress on issue haml#469 and will be rebased before it's merged into master.
- Loading branch information
Showing
8 changed files
with
60 additions
and
233 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 |
---|---|---|
|
@@ -10,4 +10,5 @@ | |
Gemfile.lock | ||
.rvmrc | ||
.rbx | ||
tmp | ||
.sass-cache |
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 |
---|---|---|
|
@@ -4,3 +4,8 @@ gemspec | |
platform :mri do | ||
gem "ruby-prof" | ||
end | ||
|
||
gem "therubyracer" | ||
gem "less" | ||
gem "coffee-script" | ||
gem "RedCloth" |
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
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
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,34 @@ | ||
# -*- coding: utf-8 -*- | ||
require 'test_helper' | ||
|
||
class FiltersTest < MiniTest::Unit::TestCase | ||
|
||
def render(text, options = {}, &block) | ||
scope = options.delete(:scope) || Object.new | ||
locals = options.delete(:locals) || {} | ||
Haml::Engine.new(text, options).to_html(scope, locals, &block) | ||
end | ||
|
||
TESTS = { | ||
:sass => ["sass", /width: 100;/, ":sass\n p\n width: 100"], | ||
:scss => ["sass", /width: 100;/, ":scss\n $width: 100;\n p {\n width: $width;\n }"], | ||
:less => ["less", /width: 100;/, ":less\n @width: 100;\n p {\n width: @width;\n }"], | ||
:coffeescript => ["coffee_script", /var foo;/, ":coffeescript\n foo = 'bar'"], | ||
:maruku => ["maruku", /h1/, ":maruku\n # foo"], | ||
} | ||
|
||
TESTS.each do |key, value| | ||
library, pattern, haml = value | ||
|
||
define_method("test_#{key}_filter") do | ||
begin | ||
Haml::Util.silence_warnings do | ||
require library | ||
assert_match(pattern, render(haml)) | ||
end | ||
rescue LoadError | ||
warn "Could not load #{key} filter's dependencies" | ||
end | ||
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
This file was deleted.
Oops, something went wrong.