Skip to content

Commit

Permalink
prepare 0.9.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexch committed Aug 12, 2012
1 parent 52c6e28 commit 0537e17
Show file tree
Hide file tree
Showing 12 changed files with 656 additions and 1,032 deletions.
7 changes: 4 additions & 3 deletions History.txt
@@ -1,4 +1,4 @@
== 0.9.0
== 0.9.0 - 2012-08-12

* Finally merged bigfix/rails3 branch - Erector now works with either Rails 2 or Rails 3 (or neither)
* 'scss' external type [needs tests]
Expand All @@ -10,6 +10,7 @@
* remove dependency on rake gem
* rename 'render' method to 'emit' (to reduce confusion with Rails' "render" methods)
* Add missing favicon_link_tag and crsf_meta_tags helper methods
* Add #capture_content as an alias for #capture, so we can call it in a Rails 3.1 app

Deprecated or Removed:

Expand Down Expand Up @@ -47,7 +48,7 @@ Core:
* delegate method_missing to parent widget
* 'embed' and 'param' are now self-closing tags (as per browser warnings)
* Converted Widget#context to take a params hash.
* Exposed an Output object, with rather useful #placeholder method
* Exposed an Output object, with rather useful #placeholder method
* Defined Widget#output to delegate to #parent if @parent is not already set.
* Removed :parent param for Output#initialize in favor of a block.
* Page#extra_widgets
Expand Down Expand Up @@ -149,7 +150,7 @@ Erector tool:
and there should be an upgrade guide up on the website soon.
* 'render' renamed to 'content'
* widget constructor only takes one parameter, an 'assigns' hash (plus the optional default block)
* to render one widget from inside another, use the 'widget' method (not 'render_to'). This method
* to render one widget from inside another, use the 'widget' method (not 'render_to'). This method
accepts either a widget instance, or a widget class and an assigns hash.
* 'needs' macro to declare the variables your widget accepts via the 'assigns' constructor parameter
* Removed Widget#to_html caching, which fixed indentation issues.
Expand Down
3 changes: 1 addition & 2 deletions VERSION.yml
@@ -1,5 +1,4 @@
---
---
:major: 0
:minor: 9
:patch: 0
:build: pre2
2 changes: 1 addition & 1 deletion web/cheatsheet.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down
4 changes: 2 additions & 2 deletions web/community.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down Expand Up @@ -235,7 +235,7 @@ <h3>Obsolete:</h3>
<li class="clickable" onclick="document.location='http://rubyforge.org/projects/erector/'"><a href="http://rubyforge.org/projects/erector/">RubyForge Project</a></li>
<li class="clickable" onclick="document.location='http://rubyforge.org/pipermail/erector-devel/'"><a href="http://rubyforge.org/pipermail/erector-devel/">erector-devel archive</a></li>
<li class="clickable" onclick="document.location='http://rubyforge.org/frs/?group_id=4797'"><a href="http://rubyforge.org/frs/?group_id=4797">Download</a><br />
<span> (current version: 0.9.0.pre1)</span></li>
<span> (current version: 0.9.0)</span></li>
</ul>
</div>
<div class="footer"><a href="http://www.pivotallabs.com"><img alt="Pivotal Labs" height="57" src="pivotal.gif" style="float:right; padding: 8px;" width="158" /></a>
Expand Down
2 changes: 1 addition & 1 deletion web/developers.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down
2 changes: 1 addition & 1 deletion web/faq.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down
4 changes: 2 additions & 2 deletions web/index.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down Expand Up @@ -320,7 +320,7 @@ <h2 class="clear">Examples</h2>
<div class="clear"></div>
</div>
<hr />
<p>Current version: 0.9.0.pre1</p>
<p>Current version: 0.9.0</p>
</div>
<div class="footer"><a href="http://www.pivotallabs.com"><img alt="Pivotal Labs" height="57" src="pivotal.gif" style="float:right; padding: 8px;" width="158" /></a>
<center>Erector is an open source project released under the MIT license.<br />
Expand Down
12 changes: 8 additions & 4 deletions web/rails.html
Expand Up @@ -47,7 +47,7 @@
border: 1px solid gray;
padding: .5em 1em;
overflow: auto;
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }
font-family: Inconsolata, Consolas, "Andale Mono", "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L", Monaco, "Courier New", Courier, monospace; }

pre.sh_html {
background-color: #FFFADE; }
Expand Down Expand Up @@ -240,6 +240,7 @@ <h2>Table of Contents</h2>
<li><a href="#pagelayoutinheritance">Page Layout Inheritance</a></li>
<li><a href="#erectorlayoutsinrails">Erector Layouts in Rails</a></li>
<li><a href="#instancevariables">Instance Variables</a></li>
<li><a href="#moreaboutrails">More about Rails</a></li>
</ol>
</div>
<div class="clear"></div>
Expand Down Expand Up @@ -437,7 +438,7 @@ <h2>5. Erector Layouts in Rails</h2>

def footer
p &quot;Copyright (c) 2112, Rush Enterprises Inc.&quot;
content_for :footer if content_for? :footer
content_for :footer if content_for? :footer
end

end
Expand All @@ -459,7 +460,7 @@ <h2>5. Erector Layouts in Rails</h2>
</p>
<a name="instancevariables"></a>
<h2>6. Instance Variables</h2>
<p>Controller instance variables (sometimes called &quot;assigns&quot;) are available to
<p>Controller instance variables (sometimes called &quot;assigns&quot;) are available to
the view, and also to any partial
that gets rendered by the view, no matter how deeply-nested. This effectively
makes controller instance variables &quot;globals&quot;. In small view hierarchies this
Expand All @@ -470,7 +471,7 @@ <h2>6. Instance Variables</h2>
Sometimes these aren't used by a view: ApplicationController might assign
variables that are used by many, but not all, views; and various other things
may accumulate, especially if you've been using templating systems that are
more forgiving than Erector. Erector's &quot;needs&quot; mechanism helps enforce
more forgiving than Erector. Erector's &quot;needs&quot; mechanism helps enforce
stricter encapsulation. But if you migrate from a promiscuous Rails app
to Erector, you're stuck using
no &quot;needs&quot; declaration at all, because it needs to contain every assigned
Expand All @@ -493,6 +494,9 @@ <h3>ignore_extra_controller_assigns</h3>
something), but they won't cause widget instantiation to fail, either. This
can let a large Rails project transition to Erector more smoothly.
</p>
<a name="moreaboutrails"></a>
<h2>7. More about Rails</h2>
<p>#capture_content is now an alias for #capture, so we can call it in a Rails 3.1 app</p>
</div>
</div>
</div>
Expand Down
38 changes: 21 additions & 17 deletions web/rails.rb
Expand Up @@ -15,7 +15,7 @@ def initialize
def promo
"images/erectorhudson.jpeg"
end

def body_content
p do
text "This page describes integrating Erector into ",
Expand All @@ -31,8 +31,8 @@ def body_content
def article
Article.new(:name => "Erector On Rails").tap { |a|
a.add(:name => "Install") do
p {
text "To install as a gem, add ", code("gem 'erector'"), " to your ", code("Gemfile"),
p {
text "To install as a gem, add ", code("gem 'erector'"), " to your ", code("Gemfile"),
", then add ", code("require 'erector'"), " to ", code("environment.rb"), "."
}
p {
Expand All @@ -41,7 +41,7 @@ def article
"When installing this way, erector is automatically available to your Rails code (no require directive is needed)."
}
end

a.add(:name => "Using Erector from Ruby on Rails", :href => "rails") do
p do
text "Your views are just ruby classes. Your controller can either call Rails' "
Expand Down Expand Up @@ -223,7 +223,7 @@ def navbar
text " in the HEAD element."
}
end

a.add(:name => "Erector Layouts in Rails") do

p do
Expand Down Expand Up @@ -272,15 +272,15 @@ def navbar
def footer
p "Copyright (c) 2112, Rush Enterprises Inc."
content_for :footer if content_for? :footer
content_for :footer if content_for? :footer
end
end
RUBY

br
code "app/views/faq/index.rb:"

source_code :ruby, <<-RUBY
class Views::Faq::Index < Erector::Widget
def content
Expand All @@ -295,34 +295,34 @@ def content
RUBY

p "[TODO: more explanation]"

end
end

a.add(:name => "Instance Variables") do
p <<-TEXT
Controller instance variables (sometimes called "assigns") are available to
Controller instance variables (sometimes called "assigns") are available to
the view, and also to any partial
that gets rendered by the view, no matter how deeply-nested. This effectively
makes controller instance variables "globals". In small view hierarchies this
probably isn't an issue, but in large ones it can make debugging and
reasoning about the code very difficult.
TEXT

p <<-TEXT
Often, large Rails applications will assign many controller instance variables.
Sometimes these aren't used by a view: ApplicationController might assign
variables that are used by many, but not all, views; and various other things
may accumulate, especially if you've been using templating systems that are
more forgiving than Erector. Erector's "needs" mechanism helps enforce
more forgiving than Erector. Erector's "needs" mechanism helps enforce
stricter encapsulation. But if you migrate from a promiscuous Rails app
to Erector, you're stuck using
no "needs" declaration at all, because it needs to contain every assigned
variable, or Erector will raise an exception.
TEXT

p "Two widget-class-level settings can help you with these problems."

h3 "controller_assigns_propagate_to_partials"

p <<-TEXT
Expand All @@ -334,11 +334,11 @@ def content
as they must be passed everything they use and can't rely on controller
instance variables.
TEXT

# example

h3 "ignore_extra_controller_assigns"

p <<-TEXT
If you set this to true (and it's inherited through to subclasses), however,
then "needs" declarations on the widget will cause excess controller variables
Expand All @@ -348,6 +348,10 @@ def content
TEXT

end

a.add(:name => "More about Rails") do
p "#capture_content is now an alias for #capture, so we can call it in a Rails 3.1 app"
end
}
end
end

0 comments on commit 0537e17

Please sign in to comment.