<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,8 +9,11 @@ class CGI {
 
     has $!crlf = &quot;\x[0D]\x[0A]&quot;;
 
-    # RAKUDO: BUILD method not supported
-    method init() {
+    submethod BUILD() {
+        # RAKUDO #66792, Attribute defaults don't get instantiated when BUILD
+        # method exists.
+        $!crlf = &quot;\x[0D]\x[0A]&quot;;
+
         self.parse_params(%*ENV&lt;QUERY_STRING&gt;);
         # It's prudent to handle CONTENT_LENGTH too, but right now that's not
         # a priority. It would make our tests scripts more complicated, with
@@ -31,11 +34,11 @@ class CGI {
 
         self.eat_cookie( %*ENV&lt;HTTP_COOKIE&gt; ) if %*ENV&lt;HTTP_COOKIE&gt;;
 
-        $!uri = URI.new;
         my $uri_str = 'http://' ~ %*ENV&lt;SERVER_NAME&gt;;
         $uri_str ~= ':' ~ %*ENV&lt;SERVER_PORT&gt; if %*ENV&lt;SERVER_PORT&gt;;
         $uri_str ~=  %*ENV&lt;MODPERL6&gt; ?? %*ENV&lt;PATH_INFO&gt; !! %*ENV&lt;REQUEST_URI&gt;;
-        $.uri.init($uri_str);
+
+        $!uri = URI.new( uri =&gt; $uri_str );
     }
 
     # For debugging</diff>
      <filename>lib/CGI.pm</filename>
    </modified>
    <modified>
      <diff>@@ -18,12 +18,11 @@ class November does Session does Cache {
     has CGI     $.cgi;
     has Config  $.config;
 
-    # RAKUDO: BUILD not implemented yet
-    method init {
+    submethod BUILD( :$config = Config.new ) {
+        $!config = $config;
         $!storage = November::Storage::File.new(
-            storage_root =&gt; $.config.server_root ~ 'data/'
+            storage_root =&gt; $!config.server_root ~ 'data/'
         );
-        $!storage.init(); # Want ze BUILD submethod
     }
 
     method handle_request(CGI $cgi) {
@@ -319,10 +318,10 @@ class November does Session does Cache {
 
         $template.with_params(
             {
-            WEBROOT   =&gt; $.config.web_root,
+            WEBROOT   =&gt; $!config.web_root,
             LOGGED_IN =&gt; self.logged_in,
-            SKIN      =&gt; $.config.skin,
-            TMPL_PATH =&gt; $.config.template_path,
+            SKIN      =&gt; $!config.skin,
+            TMPL_PATH =&gt; $!config.template_path,
             %params
             }
         );</diff>
      <filename>lib/November.pm</filename>
    </modified>
    <modified>
      <diff>@@ -16,11 +16,13 @@ class November::Storage::File is November::Storage {
     has $.recent_changes_path is rw; # = $r ~ 'data/recent-changes';
     has $.index_path          is rw; # = $r ~ 'data/index';
 
-    method init {
-        $.content_path        = $.storage_root ~ 'articles/';
-        $.modifications_path  = $.storage_root ~ 'modifications/';
-        $.recent_changes_path = $.storage_root ~ 'recent-changes';
-        $.index_path          = $.storage_root ~ 'index';
+    submethod BUILD(:$storage_root) {
+        $!storage_root = $storage_root;
+
+        $!content_path        = $!storage_root ~ 'articles/';
+        $!modifications_path  = $!storage_root ~ 'modifications/';
+        $!recent_changes_path = $!storage_root ~ 'recent-changes';
+        $!index_path          = $!storage_root ~ 'index';
     }
 
     method wiki_page_exists($page) {</diff>
      <filename>lib/November/Storage/File.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,8 @@
 role Session;
 
-use Config;
-
-# TODO can we use November $!config here? or parametrise this role?
-has $.sessionfile_path = Config.new.server_root ~ 'data/sessions';
+method sessionfile-path {
+    return $.config.server_root  ~ 'data/sessions';
+}
 
 method add_session($id, %stuff) {
     my $sessions = self.read_sessions();
@@ -18,14 +17,14 @@ method remove_session($id) {
 }
 
 method read_sessions {
-    return {} unless $.sessionfile_path ~~ :e;
-    my $string = slurp( $.sessionfile_path );
+    return {} unless self.sessionfile-path ~~ :e;
+    my $string = slurp( self.sessionfile-path );
     my $stuff = eval( $string );
     return $stuff;
 }
 
 method write_sessions( $sessions ) {
-    my $fh = open( $.sessionfile_path, :w );
+    my $fh = open( self.sessionfile-path, :w );
     $fh.say( $sessions.perl );
     $fh.close;
 }</diff>
      <filename>lib/Session.pm</filename>
    </modified>
    <modified>
      <diff>@@ -1,21 +1,21 @@
 class URI;
 
+use URI::Grammar;
 # RAKUDO: Match object does not do assignment properly :(
 #my Match $.parts; dies in init with 'Type mismatch in assignment';
 # workaround:
 has $.uri;
 has @.chunks;
 
-method init ($str) {
-    use URI::Grammar;
+submethod BUILD(:$uri) {
 
     # clear string before parsing
-    my $c_str = $str;
+    my $c_str = $uri;
     $c_str .= subst(/^ \s* ['&lt;' | '&quot;'] /, '');
     $c_str .= subst(/ ['&gt;' | '&quot;'] \s* $/, '');
 
     URI::Grammar.parse($c_str);
-    unless $/ { die &quot;Could not parse URI: $str&quot; }
+    unless $/ { die &quot;Could not parse URI: $uri&quot; }
 
     $!uri = $/;
     @!chunks = $/&lt;path&gt;&lt;chunk&gt; // ('');</diff>
      <filename>lib/URI.pm</filename>
    </modified>
    <modified>
      <diff>@@ -13,7 +13,5 @@ my $c = Config.new(
 my November $wiki = November.new(
     config =&gt; $c,
 );
-$wiki.init();
 my $cgi = CGI.new;
-$cgi.init();
 $wiki.handle_request($cgi);</diff>
      <filename>wiki</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2d67b9e68d8932494090d5e926bab1f2d3e9a641</id>
    </parent>
  </parents>
  <author>
    <name>Johan Viklund</name>
    <email>johan.viklund@gmail.com</email>
  </author>
  <url>http://github.com/viklund/november/commit/5e2b49ab91e35dc48da17b22464ad496bc063e07</url>
  <id>5e2b49ab91e35dc48da17b22464ad496bc063e07</id>
  <committed-date>2009-06-21T10:36:37-07:00</committed-date>
  <authored-date>2009-06-21T10:36:37-07:00</authored-date>
  <message>BUILD-methods everywhere instead of init(). Closes #12</message>
  <tree>432d5a652c03a3ad79bc1f0751cf9e5f978be95d</tree>
  <committer>
    <name>Johan Viklund</name>
    <email>johan.viklund@gmail.com</email>
  </committer>
</commit>
