Browse files

adding macruby website

git-svn-id: http://svn.macosforge.org/repository/ruby/trunk@850 23306eb0-4c56-4727-a40e-e92c0eb68959
  • Loading branch information...
0 parents commit 49422f35aa13bf67e9af0383cc85fac129f360b3 @richkilmer richkilmer committed Mar 9, 2009
Showing with 1,242 additions and 0 deletions.
  1. +10 −0 Sitefile
  2. +22 −0 content/blog/2008/02/index.txt
  3. +22 −0 content/blog/2008/03/index.txt
  4. +22 −0 content/blog/2008/04/index.txt
  5. +22 −0 content/blog/2008/05/index.txt
  6. +94 −0 content/blog/2008/06/06/macruby_0.2.txt
  7. +123 −0 content/blog/2008/06/16/new_build_system.txt
  8. +15 −0 content/blog/2008/06/30/ruby_changes.txt
  9. +22 −0 content/blog/2008/06/index.txt
  10. +35 −0 content/blog/2008/09/08/macruby_0.3.txt
  11. +22 −0 content/blog/2008/09/index.txt
  12. +15 −0 content/blog/2008/10/17/developing_cocoa.txt
  13. +22 −0 content/blog/2008/10/index.txt
  14. +23 −0 content/blog/2008/index.txt
  15. +27 −0 content/blog/index.txt
  16. +38 −0 content/css/coderay.css
  17. +210 −0 content/css/master.css
  18. +55 −0 content/css/reset.css
  19. +20 −0 content/documentation.txt
  20. +16 −0 content/downloads.txt
  21. BIN content/images/dmg.png
  22. BIN content/images/h3_macruby-events.png
  23. BIN content/images/h3_macruby_blog.png
  24. BIN content/images/h3_see-older-articles.png
  25. BIN content/images/macruby_logo.png
  26. BIN content/images/nav_background.png
  27. BIN content/images/nav_documentation.png
  28. BIN content/images/nav_downloads.png
  29. BIN content/images/nav_home.png
  30. BIN content/images/nav_source.png
  31. BIN content/images/nav_tickets.png
  32. BIN content/images/step1.png
  33. BIN content/images/step2.png
  34. BIN content/images/step3.png
  35. BIN content/images/tar.png
  36. BIN content/images/three_easy_steps.png
  37. BIN content/images/upper_right_equation.png
  38. BIN content/images/zip.png
  39. +43 −0 content/index.txt
  40. +41 −0 content/source.txt
  41. +65 −0 layouts/default.txt
  42. +15 −0 lib/blog_utils.rb
  43. +28 −0 lib/breadcrumbs.rb
  44. +14 −0 lib/events.rb
  45. +72 −0 tasks/blog.rake
  46. +10 −0 templates/_partial.erb
  47. +39 −0 templates/atom_feed.erb
  48. +22 −0 templates/blog/month.erb
  49. +18 −0 templates/blog/post.erb
  50. +22 −0 templates/blog/year.erb
  51. +18 −0 templates/page.erb
10 Sitefile
@@ -0,0 +1,10 @@
+SITE.user = 'rich'
+SITE.host = 'infoether.com'
+SITE.remote_dir = '/var/www/macruby.infoether.com'
+
+task :default => :build
+
+desc 'deploy the site to the webserver'
+task :deploy => [:build, 'deploy:ssh']
+
+# EOF
22 content/blog/2008/02/index.txt
@@ -0,0 +1,22 @@
+---
+title: 02
+created_at: 2009-02-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
22 content/blog/2008/03/index.txt
@@ -0,0 +1,22 @@
+---
+title: 03
+created_at: 2009-03-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
22 content/blog/2008/04/index.txt
@@ -0,0 +1,22 @@
+---
+title: 04
+created_at: 2009-04-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
22 content/blog/2008/05/index.txt
@@ -0,0 +1,22 @@
+---
+title: 05
+created_at: 2009-05-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
94 content/blog/2008/06/06/macruby_0.2.txt
@@ -0,0 +1,94 @@
+---
+title: MacRuby 0.2
+created_at: 2008-06-06 00:00:00 -04:00
+blog_post: true
+author: Laurent Sansonetti
+filter:
+ - erb
+ - textile
+---
+After 3 months of development, here comes the second release of MacRuby, 0.2! "Check it out while it's hot!":http://www.macruby.org/trac/wiki/InstallingMacRuby
+
+This is an important release which addresses many bugs but also re-implements parts of the runtime using the "CoreFoundation":http://developer.apple.com/corefoundation/ framework.
+
+In MacRuby 0.2, all strings, arrays and hashes are now native Cocoa types, represented by NSString, NSArray and NSDictionary objects, respectively.
+
+The entire String, Array and Hash interface was rewritten on top of the Cocoa equivalents using the powerful CoreFoundation framework.
+
+The previous implementation, inherited from MRI, is not used anymore. The rationale behind this change is simple:
+
+It is no longer necessary to convert Ruby primitive types to Cocoa or vice-versa. For example, a String created in MacRuby can be passed as is, without conversion, to an underlying C or Objective-C API that expects an NSString. Similarly, any method of the Ruby String class can be performed on an NSString that comes from Objective-C.
+
+Interestingly, the CoreFoundation implementation that MacRuby now uses has proven itself to be stable and performs quite well, even this early in the implementation process.
+
+We did not work on any performance improvements for MacRuby 0.2 (we will address performance in the next upcoming release), but we noticed some dramatic performance gains in some areas nonetheless.
+
+Inserting elements in an array is faster in MacRuby than the original 1.9 implementation, for example, mostly because CFArray switches on the fly its data structure to an implementation that performs well according to the current number of elements.
+
+<code><pre class="commands">
+a=[]; 100_000.times { |i| a.insert(0, i) }
+MacRuby version 0.2 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 0.326057
+ 0.318714
+ 0.314731
+ruby 1.9.0 (2008-06-03 revision 16762) [i686-darwin9.0.0]
+ 4.308484
+ 4.382623
+ 4.36368
+ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
+ 4.608796
+ 4.595334
+ 4.581045
+</pre></code>
+
+Regarding hashes, searching for a specific value (which isn't something that is typically done) is shown to be faster.
+
+<code><pre class="commands">
+h = Hash[*(1..10000).to_a]; 10000.times { |i| h.has_value?(i) }
+MacRuby version 0.2 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 0.965304
+ 0.955293
+ 0.950316
+ruby 1.9.0 (2008-06-03 revision 16762) [i686-darwin9.0.0]
+ 3.790461
+ 3.804271
+ 3.815217
+ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
+ 4.225632
+ 4.225457
+ 4.239244
+</pre></code>
+
+And to finish with strings, it turns out that manipulations on multi-byte strings are faster in MacRuby than 1.9.
+
+<code><pre class="commands">
+$ cat t3.rb
+# -*- coding: utf-8 -*-
+s = "わたしはロランです。" * 2000
+s.length.times { |i| s[i] }
+$ ruby b.rb t3.rb
+MacRuby version 0.2 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 0.180019
+ 0.180165
+ 0.177425
+ruby 1.9.0 (2008-06-03 revision 16762) [i686-darwin9.0.0]
+ 1.624943
+ 1.633502
+ 1.62767
+</pre></code>
+
+Speaking of strings, since every of them is now a CFString, they get for free features that weren't present in the original 1.9 implementation, such as ICU transformations for example:
+
+<code><pre class="commands">
+$ cat t3.rb
+puts "watashiha".transform('Latin-Hiragana') +
+ "lauren".transform('Latin-Katakana') +
+ "desu.".transform('Latin-Hiragana')
+$ macruby -v t3.rb
+MacRuby version 0.2 (ruby 1.9.0 2008-05-17) [universal-darwin9.0]
+わたしはラウレンです。
+</pre></code>
+
+MacRuby is still slower in many cases, including very important ones such as objects allocation and methods dispatch. There are also too many areas in String, Array and Hash where we perform much less well than we should.
+
+We plan to address this in the next release (0.3) as well as many other things, so stay tuned!
123 content/blog/2008/06/16/new_build_system.txt
@@ -0,0 +1,123 @@
+---
+title: New Build System, Faster Objective-C Dispatcher, Screencast
+created_at: 2008-06-16 00:00:00 -04:00
+blog_post: true
+author: Laurent Sansonetti
+filter:
+ - erb
+ - textile
+---
+MacRuby trunk got a new build system, entirely written with "Rake":http://rake.rubyforge.org/. We managed to replace the previous autotools-based build system with a 570 lines of code Rakefile (which can still be refactored). We didn't really need autotools since MacRuby aims to be installed on only one platform: Mac OS X. Maintaining the autotools files were really difficult, and we are very glad to now have a pure-Ruby build script.
+
+Building and installing MacRuby is now very simple:
+
+<code><pre class="commands">
+$ rake
+$ sudo rake install
+</pre></code>
+
+This will build and install MacRuby in /Library/Frameworks/MacRuby.framework, executable symbolic links in /usr/local/bin (with a "mac" prefix, for example "macruby"), Xcode templates and sample code.
+
+To see the list of all tasks;
+
+<code><pre class="commands">
+$ rake -T
+(in /Volumes/Data/src/MacRuby)
+rake all # Build MacRuby and extensions
+rake clean # Clean local and extension build files
+rake clean:ext # Clean extension build files
+rake clean:local # Clean local build files
+rake config_h # Create config.h
+rake default # Same as all
+rake extensions # Build extensions
+rake framework:info_plist # Create the plist file for the framework
+rake framework:install # Install the framework
+rake install # Same as framework:install
+rake macruby # Same as macruby:build
+rake macruby:build # Build MacRuby
+rake macruby:dylib # Build dynamic libraries for MacRuby
+rake macruby:static # Build static libraries for MacRuby
+rake miniruby # Create miniruby
+rake objects # Build known objects
+rake rbconfig # Create config file
+rake sample_test # Run the sample tests
+rake test # Same as sample_test
+</pre></code>
+
+Also, MacRuby trunk has a faster Objective-C dispatcher. Around 4 times faster that MacRuby 0.2 (and way faster than RubyCocoa). This was possible by fixing bugs in the dispatcher and also cache some of the runtime information.
+
+Let's consider the following Objective-C class.
+
+<code><pre class="commands">
+$ cat dummy.m
+#import <Foundation/Foundation.h>
+
+@interface Dummy : NSObject
+@end
+
+@implementation Dummy
+
+- (id)doSomething
+{
+ return @"";
+}
+
+- (id)doSomethingWith:(id)value
+{
+ return value;
+}
+
+@end
+
+void Init_dummy (void) {}
+</pre></code>
+
+We can build it as a Ruby extension.
+
+<code><pre class="commands">
+$ gcc dummy.m -o dummy.bundle -framework Foundation -dynamiclib -fobjc-gc"
+</pre></code>
+
+Then, test calling the methods. First, the doSomething method, which is a very simple case.
+
+<code><pre class="commands">
+$ ruby start.rb ruby -v -r osx/foundation -I. -r dummy -e "include OSX; o = Dummy.new; 1_000_000.times { o.doSomething }"
+ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
+ 5.295735
+ 5.290816
+ 5.28286
+$ ../miniruby02 -v -I. -r dummy -e "o = Dummy.new; 1_000_000.times { o.doSomething }"
+MacRuby version 0.2 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 2.977553
+ 2.98855
+ 2.984585
+$ ../miniruby -v -I. -r dummy -e "o = Dummy.new; 1_000_000.times { o.doSomething }"
+MacRuby version 0.3 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 0.639648
+ 0.65196
+ 0.644522
+</pre></code>
+
+Then, the doSomethingWith: method, a bit more complicated because one argument is passed, so both RubyCocoa and MacRuby are using libffi to call it.
+
+<code><pre class="commands">
+$ ruby -v -r osx/foundation -I. -r dummy -e "include OSX; o = Dummy.new; o2 = 'foo'; 1_000_000.times { o.doSomethingWith(o2) }"
+ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
+ 13.981403
+ 13.943761
+ 13.936082
+$ ../miniruby02 -v -I. -r dummy -e "o = Dummy.new; o2 = 'foo'; 1_000_000.times { o.doSomethingWith(o2) }"
+MacRuby version 0.2 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 7.267144
+ 7.210777
+ 7.267988
+$ ../miniruby -v -I. -r dummy -e "o = Dummy.new; o2 = 'foo'; 1_000_000.times { o.doSomethingWith(o2) }"
+MacRuby version 0.3 (ruby 1.9.0 2008-06-03) [universal-darwin9.0]
+ 1.239323
+ 1.259157
+ 1.246987
+</pre></code>
+
+These are very premature results, we expect to continue reducing the time spent in the dispatcher, in the near future, and hopefully to make it twice faster.
+
+On a side note, Konrad M. Lawson was kind enough to generate a "very nice screencast of MacRuby":http://foolsworkshop.com/rubycocoa/2008/06/macruby-tutorial demonstrating the Xcode/IB integration. Thanks Konrad!
15 content/blog/2008/06/30/ruby_changes.txt
@@ -0,0 +1,15 @@
+---
+title: Ruby Changes in 10.5.4 Update
+created_at: 2008-06-30 00:00:00 -04:00
+blog_post: true
+author: Laurent Sansonetti
+filter:
+ - erb
+ - textile
+---
+<% @page[:excerpt] = capture_erb do %>
+Mac OS X 10.5.4 has just been released, addressing the "latest Ruby security problems":http://www.ruby-lang.org/en/news/2008/06/20/arbitrary-code-execution-vulnerabilities/ discovered by Apple's product security team, and also fixing the "getaddrinfo regression":http://www.ruby-forum.com/topic/154556, that was introduced in 10.5.3 and breaking DRb.
+<% end %>
+<%= RedCloth.new(@page.excerpt).to_html %>
+
+Please enjoy and do not hesitate to "contact us":http://bugreporter.apple.com/ if you discover regressions, and we will try to fix them as soon as possible.
22 content/blog/2008/06/index.txt
@@ -0,0 +1,22 @@
+---
+title: 06
+created_at: 2009-06-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
35 content/blog/2008/09/08/macruby_0.3.txt
@@ -0,0 +1,35 @@
+---
+title: MacRuby 0.3
+created_at: 2008-09-08 00:00:00 -04:00
+blog_post: true
+author: Laurent Sansonetti
+filter:
+ - erb
+ - textile
+---
+<% @page[:excerpt] = capture_erb do %>
+It is a great pleasure to announce the immediate availability of MacRuby 0.3! We have been working very hard on this release for several months and, while it's still a developer release, we hope that you will give it a try. Get it while it's still hot!
+<% end %>
+<%= RedCloth.new(@page.excerpt).to_html %>
+
+First of all, MacRuby now ships with a core library called HotCocoa, something which greatly simplifies Cocoa programming while also using simple Ruby idioms. Rich Kilmer is the man behind this amazing work. You will find several examples in "/Developer/Examples/Ruby/MacRuby/HotCocoa":http://www.macruby.org/trac/browser/MacRuby/tags/0.3/sample-macruby/HotCocoa, and some initial bits of documentation in "http://www.macruby.org/trac/wiki/HotCocoa":http://www.macruby.org/trac/wiki/HotCocoa (which will be improved very soon).
+
+<% coderay :lang => 'ruby' do -%>
+require 'hotcocoa'
+include HotCocoa
+application do |app|
+ window :size => [100, 50] do |win|
+ b = button :title => 'Hello'
+ b.on_action { puts 'World!' }
+ win << b
+ end
+end
+<% end -%>
+
+Another big change in the method dispatcher, which is now entirely based on the Objective-C runtime. MacRuby is now using the Objective-C runtime to implement the Ruby class semantics and also to dispatch pure Ruby methods. This is an important change because it simplifies a lot the core implementation and also eliminates ambiguities between both worlds. Performance wise, we should be as performant as yarv: Faster in some cases, slower in others.
+
+We also support Interface Builder in this release. You can define classes, outlets and actions in a MacRuby Xcode project and they will automatically appear in Interface Builder. We have a new Ruby metadata parser that works for both RubyCocoa and MacRuby files. The parser is written in MacRuby and uses the amazing ripper extension that comes with it to extract the parser tokens.
+
+Finally, of course, lots of bugs were fixed. We now have a pretty good Cocoa support and can run most of the "LimeChat":http://limechat.net/ application (which is currently being ported from RubyCocoa). We also re-implemented the "PagePacker":http://weblog.bignerdranch.com/?p=23 application from Objective-C, which now ships "as an example":http://www.macruby.org/trac/browser/MacRuby/tags/0.3/sample-macruby/PagePacker in the MacRuby distribution. On the pure Ruby side of things, a lot of bugs have been fixed and we are now able to run some commands of RubyGems. Installing simple gems should work. Don't expect MacRuby to run Rails yet, though!
+
+MacRuby is progressively turning more stable with every release. Please give it a try and report any problem you find! If you want to join the project and help, volunteers are also greatly welcome!
22 content/blog/2008/09/index.txt
@@ -0,0 +1,22 @@
+---
+title: 09
+created_at: 2009-09-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
15 content/blog/2008/10/17/developing_cocoa.txt
@@ -0,0 +1,15 @@
+---
+title: Developing Cocoa Applications Using MacRuby
+created_at: 2008-10-17 00:00:00 -04:00
+blog_post: true
+author: Laurent Sansonetti
+filter:
+ - erb
+ - textile
+---
+<% @page[:excerpt] = capture_erb do %>
+ The Apple Developer Connection (ADC) website is now featuring an article about MacRuby, titled "Developing Cocoa Applications Using MacRuby":http://developer.apple.com/mac/articles/scriptingautomation/cocoaappswithmacruby.html. This article will introduce you to MacRuby and guide you through the process of writing a Cocoa application with it.
+<% end %>
+<%= RedCloth.new(@page.excerpt).to_html %>
+
+Enjoy, and do not hesitate to contact us if you have any question!
22 content/blog/2008/10/index.txt
@@ -0,0 +1,22 @@
+---
+title: 10
+created_at: 2009-10-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%= link_to_page(page) %><span class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
23 content/blog/2008/index.txt
@@ -0,0 +1,23 @@
+---
+title: 2008
+created_at: 2008-01-01 00:00:00 -04:00
+filter: erb
+dirty: true
+---
+<h2><%= h(@page.title) %></h2>
+
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <div class="date">(<%= page.created_at.strftime('%Y-%m-%d') %>)</div>
+ <h1><%= link_to_page(page) %></h1>
+
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
27 content/blog/index.txt
@@ -0,0 +1,27 @@
+---
+title: The MacRuby Blog
+created_at: 2008-08-02 14:06:40.000000 -06:00
+dirty: true
+filter:
+ - erb
+---
+<h1 class="title"> <%= h(@page.title) %> </h1>
+<%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <div class="header">
+ <div class="date"><%= page.created_at.strftime('%Y-%m-%d') %></div>
+ <div class="title"><%= link_to_page(page) %></div>
+ </div>
+ <div class="author">
+ By <%= page.author %>
+ </div>
+ <div class="body">
+ <%= render(page) %>
+ </div>
+</div>
+<% end -%>
38 content/css/coderay.css
@@ -0,0 +1,38 @@
+
+.CodeRay {
+ background-color: #232323;
+ border: 1px solid black;
+ font-family: 'Courier New', 'Terminal', monospace;
+ color: #E6E0DB;
+ padding: 3px 5px;
+ overflow: auto;
+ font-size: 12px;
+ margin: 12px 0;
+}
+.CodeRay pre {
+ padding: 0px;
+ margin: 0px;
+ overflow: auto;
+ background-color: transparent;
+ border: none;
+
+}
+
+.CodeRay .an { color:#E7BE69 } /* html attribute */
+.CodeRay .c { color:#BC9358; font-style: italic; } /* comment */
+.CodeRay .ch { color:#509E4F } /* escaped character */
+.CodeRay .cl { color:#FFF } /* class */
+.CodeRay .co { color:#FFF } /* constant */
+.CodeRay .fl { color:#A4C260 } /* float */
+.CodeRay .fu { color:#FFC56D } /* function */
+.CodeRay .gv { color:#D0CFFE } /* global variable */
+.CodeRay .i { color:#A4C260 } /* integer */
+.CodeRay .il { background:#151515 } /* inline code */
+.CodeRay .iv { color:#D0CFFE } /* instance variable */
+.CodeRay .pp { color:#E7BE69 } /* doctype */
+.CodeRay .r { color:#CB7832 } /* keyword */
+.CodeRay .rx { color:#A4C260 } /* regex */
+.CodeRay .s { color:#A4C260 } /* string */
+.CodeRay .sy { color:#6C9CBD } /* symbol */
+.CodeRay .ta { color:#E7BE69 } /* html tag */
+.CodeRay .pc { color:#6C9CBD } /* boolean */
210 content/css/master.css
@@ -0,0 +1,210 @@
+body {
+ text-align: center;
+ font: 11px Verdana, "Trebuchet MS", sans-serif;
+ line-height: 18px;
+ color: #333;
+}
+
+#nest {
+ text-align: left;
+ width: 890px;
+ margin: 0 auto 50px auto;
+ padding: 20px 0;
+}
+
+img#equation {float: right;}
+
+ul#nav {
+ background: #1a1a1a url(../images/nav_background.png) repeat-x top left;
+ height: 33px;
+}
+
+ul#nav li {
+ list-style-type: none;
+ margin: 0;
+ float: left;
+ display: inline;
+
+}
+
+ul#nav li.last {float: right; width: 285px;}
+
+a, a:link, a:hover, a:visited {color: #900;}
+
+div#rightcol {
+ width: 285px;
+ float: right;
+ margin-top: 2px;
+}
+
+div#step1 {
+ background-image: url(../images/step1.png);
+ width: 265px;
+ height: 138px;
+ margin-bottom: 1px;
+ padding: 35px 0 0 20px;
+}
+
+div#step1 p {color: #fff;}
+div#step1 p a,
+div#step1 p a:link,
+div#step1 p a:hover,
+div#step1 p a:visited {color: #fff; font-weight: bold;}
+
+div#step2 {
+ background-image: url(../images/step2.png);
+ width: 285px;
+ height: 94px;
+}
+
+div#step3 {
+ background-image: url(../images/step3.png);
+ width: 220px;
+ height: 63px;
+ padding: 30px 50px 0 15px;
+}
+
+div#step3 p {color: #fff;}
+div#step3 p a,
+div#step3 p a:link,
+div#step3 p a:hover,
+div#step3 p a:visited {color: #fff; font-weight: bold;}
+
+div#leftcol {
+ width: 595px;
+ padding-right: 10px;;
+}
+
+p.callout {
+ padding: 5px 0;
+ font-size: 16px;
+ line-height: 24px;
+ font-family: Georgia, Times, serif;
+}
+
+p.callout strong {
+ font-family: Verdana, "Trebuchet MS", sans-serif;
+ font-weight: bold;
+}
+
+hr.harvardrule {
+ /* Faking a Harvard Rule */
+ margin: 2px 0 7px 0;
+ color: #fff;
+ background-color: #fff;
+ height: 2px;
+ border: 0;
+ border-top: 4px solid #aaa;
+ border-bottom: 1px solid #aaa;
+ }
+
+hr.doublerule { /* Faking a Harvard Rule */
+ margin: 7px 0;
+ color: #f0efe9;
+ background-color: #f0efe9;
+ height: 2px;
+ border: 0;
+ border-top: 1px solid #aaa;
+ border-bottom: 1px solid #aaa;
+ }
+
+
+div#newsbox,
+div#eventbox {
+ width: 265px;
+ background-color: #f0efe9;
+ padding: 10px;
+}
+
+div#newsbox {float: left; margin-right: 10px;}
+div#eventbox {margin-top: 7px; font-size: 10px;}
+
+div#newsbox h3 {
+ border-bottom: 1px solid #aaa;
+ padding-bottom: 5px;
+ margin-bottom: 5px;
+}
+div#eventbox h3 {
+ padding-bottom: 5px;
+ margin-bottom: 5px;
+}
+
+div#eventbox p {
+ border-top: 1px solid #aaa;
+ padding-top: 5px;
+ margin-top: 5px;
+}
+
+div#newsbox h4 {
+ font-size: 18px;
+ color: #900;
+ font-family: Georgia, Times, serif;
+ line-height: 24px;
+}
+
+div#newsbox span.date,
+div#eventbox span.date {color: #999; font-style: italic;}
+
+h1.title {
+ font-size: 30px;
+ font-family: Georgia, Times, serif;
+ line-height: 30px;
+ margin-top: 10px;
+ color: #333;
+ padding-bottom: 5px;
+ border-bottom: 1px solid #aaa;
+ margin-bottom: 10px;
+}
+
+h2 {
+ font-size: 24px;
+ font-family: Georgia, Times, serif;
+ line-height: 30px;
+ color: #333;
+}
+
+p {margin-bottom: 10px;}
+
+pre.commands {
+ padding: 5px;
+ overflow: auto;
+ margin-top: 10px;
+ margin-left: 5px;
+ margin-right: 5px;
+ font-family: Courier, Monaco, monospace;
+ background-color: #f0efe9;
+ color: #000;
+ margin-bottom: 10px;
+}
+
+div.article .title {
+ font-size: 18px;
+ font-family: Georgia, Times, serif;
+ line-height: 30px;
+ color: #333;
+}
+
+div.article .title a {
+ font-size: 18px;
+ font-family: Georgia, Times, serif;
+ line-height: 30px;
+ color: #333;
+ text-decoration: none;
+}
+
+div.article .date {
+ padding-top: 7px;
+ float: right;
+ color: #999;
+}
+
+div.article .author {
+ color: #999;
+ font-style: italic;
+ margin-bottom: 5px;
+}
+
+div.article .header {
+ border-bottom: 1px dotted #aaa;
+ margin-bottom: 4px;
+}
55 content/css/reset.css
@@ -0,0 +1,55 @@
+/* reset reload by Eric Meyer: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline;
+}
+/* remember to define focus styles! */
+:focus {
+ outline: 0;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+/* tables still need 'cellspacing="0"' in the markup */
+table {
+ border-collapse: separate;
+ border-spacing: 0;
+}
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+}
+blockquote, q { quotes: none; }
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: "";
+}
+blockquote, q {
+ quotes: "" "";
+}
+ins { text-decoration: none; }
+del { text-decoration: line-through; }
+
+/* bicubic resizing for images in IE */
+img {
+ -ms-interpolation-mode: bicubic;
+}
+
20 content/documentation.txt
@@ -0,0 +1,20 @@
+---
+title: Learning About MacRuby
+created_at: 2009-03-07 16:48:32.084407 -05:00
+filter:
+ - erb
+ - textile
+---
+h1(title). <%= h(@page.title) %>
+
+Below are a list of tutorials, articles and recipes for MacRuby. Tutorials are the longest content and delve deep on a particular area. Recipes are short and specific examples of how to accomplish something with MacRuby.
+
+Articles found in the "MacRuby Blog":/blog/index.html
+
+h2. Tutorials
+
+Lists of tutorials...
+
+h2. Recipes
+
+Lists of recipes...
16 content/downloads.txt
@@ -0,0 +1,16 @@
+---
+title: Downloads
+created_at: 2009-03-08 22:40:01.091865 -04:00
+filter:
+ - erb
+ - textile
+---
+h1(title). <%= h(@page.title) %>
+
+h2. Current Version
+
+Where there versions of MacRuby here, this is where you could download them.
+
+h2. Older versions
+
+This will be older versions...
BIN content/images/dmg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/h3_macruby-events.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/h3_macruby_blog.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/h3_see-older-articles.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/macruby_logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_background.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_documentation.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_downloads.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_source.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/nav_tickets.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/step1.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/step2.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/step3.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/tar.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/three_easy_steps.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/upper_right_equation.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN content/images/zip.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 content/index.txt
@@ -0,0 +1,43 @@
+---
+title: Home
+created_at: 2008-08-02 14:06:40.000000 -06:00
+filter:
+ - erb
+---
+<p class="callout"><strong>MacRuby</strong> is a version of Ruby 1.9, ported to run directly on top of Mac OS X core technologies such as the Objective-C common runtime and garbage collector, and the CoreFoundation framework. While still a work in progress, it is the goal of MacRuby to enable the creation of full-fledged Mac OS X applications which do not sacrifice performance in order to enjoy the benefits of using Ruby.</p>
+<hr size="0" noshade class="harvardrule" />
+
+<div id="newsbox">
+ <h3><img src="/images/h3_macruby_blog.png" alt="MacRuby Blog" /></h3>
+
+ <%
+ articles = @pages.find(:all, :in_directory => File.join(@page.dir, 'blog'), :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles[0,3].each do |page|
+ -%>
+ <h4><%= page.title %></h4>
+ <%= blog_excerpt(page) %>
+ <hr size="0" noshade class="doublerule" />
+ <% end -%>
+
+ <a href="/blog/index.html"><img src="/images/h3_see-older-articles.png" alt="See Older Articles" /></a>
+
+</div><!-- //end newsbox -->
+
+<h2>HotCocoa Is For Me!</h2>
+<p>If you've done any amount of programming on OS X, you know that the API can be quite verbose. HotCocoa simplifies this down to very elegant and simple methods that then return super sexy UI elements. <a href="">Check out some of the cool things you can do with HotCocoa!</a></p>
+<% coderay :lang => 'ruby' do -%>
+require 'hotcocoa'
+include HotCocoa
+application do |app|
+ win = window :size => [100,50]
+ b = button :title => 'Hello'
+ b.on_action { puts 'World!' }
+ win << b
+end
+<% end -%>
+<hr size="0" noshade class="doublerule" />
+
+<h2>Why MacRuby?</h2>
+<p>MacRuby began as an attempt to work around many problems inherent in RubyCocoa. In the course of solving these problems, MacRuby has also solved numerous problems in Ruby 1.8. Consequently, there are a number of reasons (e.g. conveience, efficiency, flexibility, performance) why one might wish to use MacRuby for new (and ongoing) Ruby applications... <a href=""><i>Read more...</i></a></p>
+<hr size="0" noshade class="doublerule" />
41 content/source.txt
@@ -0,0 +1,41 @@
+---
+title: Accessing MacRuby's Source
+created_at: 2009-03-07 17:02:44.847855 -05:00
+filter:
+ - erb
+ - textile
+---
+h1(title). <%= h(@page.title) %>
+
+h2. MacRuby Development
+
+MacRuby development happens in the trunk SVN branch. However, be careful, because trunk may not work (or even compile) all of the time.
+
+<code><pre class="commands">
+$ svn co http://svn.macosforge.org/repository/ruby/MacRuby/trunk MacRuby-trunk
+</pre></code>
+
+
+For building instructions, please refer to
+
+h2. Git
+
+Git aficionados will be glad to learn that there is a mirror of the SVN trunk repository on GitHub, maintained by Claudio Poli: "MacRuby Git Repository":http://github.com/masterkain/macruby/tree/master
+
+h2. Roadmap
+
+Check out the "MacRubyRoadmap":http://www.macruby.org/trac/wiki/MacRubyRoadmap
+
+h2. Mailing Lists
+
+"MacRuby-devel":http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel is the developer mailing-list. Please subscribe to it, if you are interested in following the MacRuby development process or would like to start a discussion. All activity in the tracker generates notifications in this list.
+
+"MacRuby-changes":http://lists.macosforge.org/mailman/listinfo.cgi/macruby-changes is the SVN changes mailing-list. This is a read-only list, but you might want to subscribe to it if you are interested in tracking all of the changes in the project's source code.
+
+h2. Contributions
+
+Please "file a ticket":http://trac.macosforge.org/projects/ruby/newticket on the MacRuby Trac component, if you want to contribute an enhancement request or a bug report. Patches with test cases are welcome.
+
+You can also send your feedback to the MacRuby-devel mailing-list.
+
+If you want to help us, do not hesitate to introduce yourself in the mailing-list; we will give you an overview of things that need to be done. If you want to commit your code directly in the repository, please note that you will have to sign a committer agreement first; we will provide this to you.
65 layouts/default.txt
@@ -0,0 +1,65 @@
+---
+extension: html
+filter: erb
+---
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+
+ <title>MacRuby &raquo; <%= @page.title %></title>
+ <meta name="author" content="<%= @page.author %>" />
+ <link rel="stylesheet" href="/css/reset.css" type="text/css" media="screen" />
+ <link rel="stylesheet" href="/css/master.css" type="text/css" media="screen" />
+
+ <!-- CodeRay syntax highlighting CSS -->
+ <link rel="stylesheet" href="/css/coderay.css" type="text/css" />
+
+</head>
+
+<body>
+ <div id="nest">
+ <a href="/"><img src="/images/macruby_logo.png" alt="MacRuby" id="logo" /></a>
+
+ <ul id="nav">
+ <li><a href="/" title="Home"><img src="/images/nav_home.png" alt="Home" /></a></li>
+ <li><a href="/downloads.html" title="Downloads"><img src="/images/nav_downloads.png" alt="Downloads" /></a></li>
+ <li><a href="/source.html" title="Source"><img src="/images/nav_source.png" alt="Source" /></a></li>
+ <li><a href="/documentation.html" title="Documentation"><img src="/images/nav_documentation.png" alt="Home" /></a></li>
+ <li><a href="http://www.macruby.org/trac/report/1" title="Tickets"><img src="/images/nav_tickets.png" alt="Tickets" /></a></li>
+ <li class="last"><img src="/images/three_easy_steps.png" alt="" id="3steps" /></li>
+ </ul><!-- // end nav -->
+
+ <div id="rightcol">
+ <div id="step1">
+ <a href="" id="zip"><img src="/images/dmg.png" width="100" height="100" /></a>
+ <a href="" id="tar"><img src="/images/tar.png" width="100" height="100" /></a>
+ <p>or <a href="/source.html">checkout source from svn...</a>
+
+ </div><!-- // end step1 -->
+ <div id="step2">
+
+ </div><!-- // end step2 -->
+ <div id="step3">
+ <p>Check out the <a href="">tutorial</a> and other learning resources and examples available for MacRuby.</p>
+ </div><!-- // end step3 -->
+
+
+ <div id="eventbox">
+ <h3><img src="/images/h3_macruby-events.png" alt="MacRuby Events" /></h3>
+ <% macruby_events.each do |event| -%>
+ <p><span class="date"><%= event.date %> &raquo;</span> <a href="<%= event.href %>"><%= event.name %></a><br />
+ <%= event.location %><br />
+ <%= event.topic %></p>
+ <% end %>
+ </div><!-- // end events -->
+ </div><!-- // end rightcol -->
+ <div id="leftcol">
+ <%= @content %>
+ </div><!-- // end leftcol -->
+ </div><!-- // end nest -->
+ <p>This website was created with <a href="http://webby.rubyforge.org">Webby</a></p>
+</body>
+</html>
15 lib/blog_utils.rb
@@ -0,0 +1,15 @@
+module BlogUtilsHelper
+
+ def blog_excerpt(page)
+ render(page) unless page.excerpt
+ excerpt = "#{blog_date(page)} &raquo; #{page.excerpt} <a href='#{page.url}'>Read more...</a>"
+ RedCloth.new(excerpt).to_html
+ end
+
+ def blog_date(page)
+ "<span class='date'>#{page.created_at.strftime('%Y-%m-%d')}</span>"
+ end
+
+end
+
+Webby::Helpers.register(BlogUtilsHelper)
28 lib/breadcrumbs.rb
@@ -0,0 +1,28 @@
+# breadcrumbs.rb
+
+module BreadcrumbsHelper
+ # call-seq:
+ # breadcrumbs( page ) => html
+ #
+ # Create breadcrumb links for the current page. This will return an HTML
+ # <ul></ul> object.
+ #
+ def breadcrumbs( page )
+ list = ["<li>#{h(page.title)}</li>"]
+ loop do
+ page = @pages.parent_of(page)
+ break if page.nil?
+ list << "<li>#{link_to_page(page)}</li>"
+ end
+ list.reverse!
+
+ html = "<ul class=\"breadcrumbs\">\n"
+ html << list.join("\n")
+ html << "\n</ul>\n"
+ html
+ end
+end # module Breadcrumbs
+
+Webby::Helpers.register(BreadcrumbsHelper)
+
+# EOF
14 lib/events.rb
@@ -0,0 +1,14 @@
+module MacRubyEventsHelper
+
+ Event = Struct.new(:date, :name, :href, :location, :topic)
+
+ def macruby_events
+ [
+ Event.new("18 Oct 2009", "RubyConf 2009", "http://www.rubyconf.com", "Orlando, Florida", "Laurent Presents MacRuby 1.0"),
+ Event.new("17-18 Apr 2009", "Golden Gate Ruby Conference", "http://gogaruco.com/schedule/index.html#kilmer", "San Francisco", "Rich Presents MacRuby & HotCocoa")
+ ]
+ end
+
+end
+
+Webby::Helpers.register(MacRubyEventsHelper)
72 tasks/blog.rake
@@ -0,0 +1,72 @@
+
+namespace :blog do
+
+ # iterate over all the files in the "templates/blog" folder and create a
+ # rake task corresponding to each file found
+ FileList["#{Webby.site.template_dir}/blog/*"].each do |template|
+ next unless test(?f, template)
+ name = template.pathmap('%n')
+ next if name =~ %r/^(month|year)$/ # skip month/year blog entries
+
+ desc "Create a new blog #{name}"
+ task name => [:create_year_index, :create_month_index] do |t|
+ page, title, dir = Webby::Builder.new_page_info
+
+ # if no directory was given use the default blog directory (underneath
+ # the content directory)
+ dir = Webby.site.blog_dir if dir.empty?
+ dir = File.join(dir, Time.now.strftime('%Y/%m/%d'))
+
+ page = File.join(dir, File.basename(page))
+ page = Webby::Builder.create(page, :from => template,
+ :locals => {:title => title, :directory => dir})
+ exec(::Webby.editor, page) unless ::Webby.editor.nil?
+ end
+ end # each
+
+ # this task is used to create the year index file (blog/2008/index.txt)
+ task :create_year_index do |t|
+ # parse out information about the page to create
+ _, _, dir = Webby::Builder.new_page_info
+ year = Time.now.strftime '%Y'
+
+ # if no directory was given use the default blog directory (underneath
+ # the content directory)
+ dir = Webby.site.blog_dir if dir.empty?
+ dir = File.join(dir, year)
+
+ # determine the filename and template name
+ fn = File.join(dir, 'index.txt')
+ tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/year.*')).first.to_s
+
+ if test(?f, tmpl) and not test(?f, File.join(Webby.site.content_dir, fn))
+ Webby::Builder.create(fn, :from => tmpl,
+ :locals => {:title => year, :directory => dir})
+ end
+ end
+
+ # this task is used to create the month index file (blog/2008/04/index.txt)
+ task :create_month_index do |t|
+ # parse out information about the page to create
+ _, _, dir = Webby::Builder.new_page_info
+ now = Time.now
+ month = now.strftime '%m'
+
+ # if no directory was given use the default blog directory (underneath
+ # the content directory)
+ dir = Webby.site.blog_dir if dir.empty?
+ dir = File.join(dir, now.strftime('%Y/%m'))
+
+ # determine the filename and template name
+ fn = File.join(dir, 'index.txt')
+ tmpl = Dir.glob(File.join(Webby.site.template_dir, 'blog/month.*')).first.to_s
+
+ if test(?f, tmpl) and not test(?f, File.join(Webby.site.content_dir, fn))
+ Webby::Builder.create(fn, :from => tmpl,
+ :locals => {:title => month, :directory => dir})
+ end
+ end
+
+end # namespace :blog
+
+# EOF
10 templates/_partial.erb
@@ -0,0 +1,10 @@
+---
+filter: erb
+---
+A partial has access to the page from which it was called. The title below will be the title of the page in which this partial is rendered.
+
+<%%= h(@page.title) %>
+
+A partial does not have access to it's own meta-data. The partial meta-data is used primarily for finding partials or for use in other pages. The filter(s) specified in the meta-data will be applied to the partial text when it is rendered.
+
+A partial does not require meta-data at all. They can contain just text.
39 templates/atom_feed.erb
@@ -0,0 +1,39 @@
+---
+title: MacRuby Blog
+subtitle: The Ultimate Ruby for Mac OS X
+site: macruby.org
+author: Laurent Sansonitti
+extension: xml
+layout: nil
+dirty: true
+filter: erb
+---
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><%%= h(@page.title) %></title>
+ <subtitle><%%= h(@page.subtitle) %></subtitle>
+ <link href="http://<%%= @page.site %>/<%= directory %>/" rel="self" />
+ <link href="http://<%%= @page.site %>/" />
+ <updated><%%= Time.now.xmlschema %></updated>
+ <author>
+ <name><%%= h(@page.author) %></name>
+ <email><%%= h(@page.email) %></email>
+ </author>
+ <id>http://<%%= @page.site %>/</id>
+ <%% @pages.find(:limit => 10,
+ :in_directory => '<%= directory %>',
+ :recursive => true,
+ :sort_by => 'mtime',
+ :reverse => true).each do |article|
+ next if article == @page
+ %>
+ <entry>
+ <title><%%= h(article.title) %></title>
+ <link href="<%%= article.url %>" />
+ <id>tag:<%%= @page.site %>,<%%= article.created_at.strftime('%Y-%m-%d') %>:<%%= article.created_at.to_i %></id>
+ <updated><%%= article.created_at.xmlschema %></updated>
+ <content type="html"><%%= h(render(article)) %></content>
+ </entry>
+ <%% end %>
+</feed>
22 templates/blog/month.erb
@@ -0,0 +1,22 @@
+---
+title: <%= title %>
+created_at: <%= Time.now.to_y %>
+filter: erb
+dirty: true
+---
+<h2><%%= h(@page.title) %></h2>
+
+<%%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%%= link_to_page(page) %><span class="date">(<%%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%%= render(page) %>
+ </div>
+</div>
+<%% end -%>
18 templates/blog/post.erb
@@ -0,0 +1,18 @@
+---
+title: <%= title %>
+created_at: <%= Time.now.to_y %>
+blog_post: true
+author: Your Name Here
+filter:
+ - erb
+ - textile
+---
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at metus.
+
+h3. Litora Sociis
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi et risus. Aliquam nisl. Nulla facilisi. Cras accumsan vestibulum ante. Vestibulum sed tortor. Praesent tempus fringilla elit. Ut elit diam, sagittis in, nonummy in, gravida non, nunc. Ut orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam egestas, orci eu imperdiet malesuada, nisl purus fringilla odio, quis commodo est orci vitae justo. Aliquam placerat odio tincidunt nulla. Cras in libero. Aenean rutrum, magna non tristique posuere, erat odio eleifend nisl, non convallis est tortor blandit ligula. Nulla id augue.
+
+bq. Nullam mattis, odio ut tempus facilisis, metus nisl facilisis metus, auctor consectetuer felis ligula nec mauris. Vestibulum odio erat, fermentum at, commodo vitae, ultrices et, urna. Mauris vulputate, mi pulvinar sagittis condimentum, sem nulla aliquam velit, sed imperdiet mi purus eu magna. Nulla varius metus ut eros. Aenean aliquet magna eget orci. Class aptent taciti sociosqu ad litora.
+
+Vivamus euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse vel nibh ut turpis dictum sagittis. Aliquam vel velit a elit auctor sollicitudin. Nam vel dui vel neque lacinia pretium. Quisque nunc erat, venenatis id, volutpat ut, scelerisque sed, diam. Mauris ante. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec mattis. Morbi dignissim sollicitudin libero. Nulla lorem.
22 templates/blog/year.erb
@@ -0,0 +1,22 @@
+---
+title: <%= title %>
+created_at: <%= Time.now.to_y %>
+filter: erb
+dirty: true
+---
+<h2><%%= h(@page.title) %></h2>
+
+<%%
+ articles = @pages.find(:all, :in_directory => @page.dir, :recursive => true,
+ :sort_by => "created_at", :reverse => true, :blog_post => true)
+ articles.delete(@page)
+ paginate(articles, 10) do |page|
+-%>
+<div class="article">
+ <h1><%%= link_to_page(page) %><span class="date">(<%%= page.created_at.strftime('%Y-%m-%d') %>)</span></h1>
+
+ <div class="body">
+ <%%= render(page) %>
+ </div>
+</div>
+<%% end -%>
18 templates/page.erb
@@ -0,0 +1,18 @@
+---
+title: <%= title %>
+created_at: <%= Time.now.to_y %>
+filter:
+ - erb
+ - textile
+---
+h1(title). <%%= h(@page.title) %>
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nunc congue ipsum vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est eu lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at metus.
+
+h2. Litora Sociis
+
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi et risus. Aliquam nisl. Nulla facilisi. Cras accumsan vestibulum ante. Vestibulum sed tortor. Praesent tempus fringilla elit. Ut elit diam, sagittis in, nonummy in, gravida non, nunc. Ut orci. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos hymenaeos. Nam egestas, orci eu imperdiet malesuada, nisl purus fringilla odio, quis commodo est orci vitae justo. Aliquam placerat odio tincidunt nulla. Cras in libero. Aenean rutrum, magna non tristique posuere, erat odio eleifend nisl, non convallis est tortor blandit ligula. Nulla id augue.
+
+bq. Nullam mattis, odio ut tempus facilisis, metus nisl facilisis metus, auctor consectetuer felis ligula nec mauris. Vestibulum odio erat, fermentum at, commodo vitae, ultrices et, urna. Mauris vulputate, mi pulvinar sagittis condimentum, sem nulla aliquam velit, sed imperdiet mi purus eu magna. Nulla varius metus ut eros. Aenean aliquet magna eget orci. Class aptent taciti sociosqu ad litora.
+
+Vivamus euismod. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Suspendisse vel nibh ut turpis dictum sagittis. Aliquam vel velit a elit auctor sollicitudin. Nam vel dui vel neque lacinia pretium. Quisque nunc erat, venenatis id, volutpat ut, scelerisque sed, diam. Mauris ante. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec mattis. Morbi dignissim sollicitudin libero. Nulla lorem.

0 comments on commit 49422f3

Please sign in to comment.