Skip to content

Instantly share code, notes, and snippets.

View xxx's full-sized avatar

Michael Dungan xxx

View GitHub Profile
- def fum; haml_concat 'HELLO!'; end
#header
%script{:src => 'foo.js'}
%script{:type => 'application/processing', 'data-canvas_name' => 'login'}
=fum
%canvas#login{:width => "100px", :height => "100px"}
Stacktrace:
Fixture::FormatError in 'PublishedGallery Methods#thumbnail should delegate to its lead asset'
a YAML error occurred parsing /Users/mpd/timber/spec/fixtures/galleries.yml. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html
The exact error was:
NoMethodError: undefined method `abstract_class?' for Object:Class
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/fixtures.rb:745:in `parse_yaml_string'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/fixtures.rb:697:in `read_yaml_fixture_files'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/fixtures.rb:684:in `read_fixture_files'
/opt/local/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/fixtures.rb:545:in `initialize'
from /lib/active_record/fixtures.rb (code is the same in 2.3.2 and 2.3.3)
def parse_yaml_string(fixture_content)
YAML::load(erb_render(fixture_content))
rescue => error
raise Fixture::FormatError, "a YAML error occurred parsing #{yaml_file_path}. Please note that YAML must be consistently indented using spaces. Tabs are not allowed. Please have a look at http://www.yaml.org/faq.html\nThe exact error was:\n #{error.class}: #{error}"
end
def erb_render(fixture_content)
ERB.new(fixture_content).result
template:
.foo
= partial 'my_header'
.bar
= form_for(@user, :action => '/users') do
fields and stuff here...
***** what is expected:
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id='header'>
<script data-canvas_name='login' type='application/processing'>
int x_axis = 755;
</script>
***** what is expected:
<!DOCTYPE html>
<html>
<head></head>
<body>
<div id='header'>
<script data-canvas_name='login' type='application/processing'>
int x_axis = 755;
</script>
***** the layout:
!!! Strict
%html
%head
%body
= catch_content :for_layout
***** the template:
layout:
!!! Strict
%html
%head
%body
%script
= partial "logos/logo_3"
= form_for(@user, :action => url(:users) ) do
= submit "Create user"
expected output:
<!DOCTYPE html>
<html>
<head>
<title>
relife
</title>
<meta content='text/html; charset=utf-8' http-equiv='content-type'>
<link charset="utf-8" rel="Stylesheet" type="text/css" href="/stylesheets/01reset.css?072609451781" media="all" /><link charset="utf-8" rel="Stylesheet" type="text/css" href="/stylesheets/front.css?072609451796" media="all" /><link charset="utf-8" rel="Stylesheet" type="text/css" href="/stylesheets/ui.all.css?072609451733" media="all" />
expected:
<!DOCTYPE html>
<html>
<head></head>
<body>
<script>
int x_axis = 755;
</script>
<form method="post" action="/users">