<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -4,61 +4,76 @@ require &quot;giraffe/page&quot;
 require &quot;ostruct&quot;
 require &quot;pathname&quot;
 
+
 module Giraffe
 
-  Conf = OpenStruct.new
+  class &lt;&lt; self
+
+    # Configuration
+    #
+    attr_accessor :wikiroot,
+                  :reporoot,
+
+                  :to_filename,
+                  :to_uri,
+
+                  :list_filter,
+                  :resource_filter,
+
+                  :home,
+
+                  :authenticator,
+
+                  :itself
+
+    # Wiki object
+    #
+    attr_reader   :wiki
 
-  # TODO: Move statics out of method
+  end
+
+  # Default configuration
+  #
   def self.reload()
     # No authentication by default.
-    Conf.authenticator = nil
+    self.authenticator    = nil
 
     # Root of wiki pages and root of the repository if needed.
-    Conf.wikiroot      = File.join ENV[&quot;HOME&quot;], &quot;wiki&quot;
-    Conf.reporoot      = Conf.wikiroot
+    self.wikiroot         = File.join ENV[&quot;HOME&quot;], &quot;wiki&quot;
+    self.reporoot         = wikiroot
 
     # Page name &lt;-&gt; filesystem mapping (none by default).
-    Conf.to_filename   = lambda {|uri| uri }
-    Conf.to_uri        = lambda {|file| file }
-
-    Conf.list_filter   = lambda {|file| true }
-
-    Conf.resource_filter = lambda {|uri| false }
+    self.to_filename      = lambda {|uri| uri }
+    self.to_uri           = lambda {|file| file }
 
+    self.list_filter      = lambda {|file| true }
+    self.resource_filter  = lambda {|uri| false }
 
     # Wiki setup.
-    Conf.home          = &quot;/Home&quot;
+    self.home             = &quot;/Home&quot;
 
     # Some type of a link to software version used.
-    Conf.itself        = (`git remote -v` =~ (/origin\s+git@(.+?)\.git/) &amp;&amp; &quot;http://#{$1.sub &quot;:&quot;, &quot;/&quot;}/&quot;) ||
-                            &quot;http://github.com/rue/giraffe/&quot;
+    self.itself           = (`git remote -v` =~ (/origin\s+git@(.+?)\.git/) &amp;&amp; &quot;http://#{$1.sub &quot;:&quot;, &quot;/&quot;}/&quot;) ||
+                             &quot;http://github.com/rue/giraffe/&quot;
+
+# Load user config overrides if any, rest of ARGV goes unchanged.
 
-    # Load user config overrides if any, rest of ARGV goes unchanged.
     load(ENV[&quot;GIRAFFE_CONF&quot;] || &quot;config.rb&quot;)
 
     # Expand all paths just in case.
-    Conf.wikiroot      = File.expand_path Conf.wikiroot
-    Conf.reporoot      = File.expand_path Conf.reporoot
-
-    # Compute relative path to wiki root if necessary.
-    Conf.relative      = if Conf.wikiroot != Conf.reporoot
-                              wiki = Pathname.new Conf.wikiroot
-                              repo = Pathname.new Conf.reporoot
-
-                              # TODO: Check that wiki is a child of repo
-                              wiki.relative_path_from(repo).to_s
-                            else
-                              &quot;&quot;
-                            end
+    self.wikiroot      = File.expand_path wikiroot
+    self.reporoot      = File.expand_path reporoot
   end
 
+
+  # Load the wiki.
+  #
+  # By default loads HEAD but can be given a commit
+  # to load from instead.
+  #
   def self.wiki!(commit = &quot;HEAD&quot;)
     reload
-    @wiki = Git::Repository.open Conf.wikiroot, commit
-  end
-
-  def self.wiki()
-    @wiki
+    @wiki = Git::Repository.open wikiroot, commit
   end
 
 end</diff>
      <filename>lib/giraffe.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ module Giraffe
     attr_reader :object
 
     def self.from_git(object)
-      name  = Giraffe::Conf.to_uri.call object.name
+      name  = Giraffe.to_uri.call object.name
       dir   = File.dirname(object.path).split &quot;/&quot;
       dir   = [] if dir == [&quot;.&quot;]
 
@@ -24,7 +24,7 @@ module Giraffe
       dir       = dir
       uri       = if dir.empty? then name else File.join(dir, name) end
 
-      filename  = Giraffe::Conf.to_filename.call name
+      filename  = Giraffe.to_filename.call name
       relative  = if dir.empty? then filename else File.join(dir, filename) end
 
       object    = Giraffe.wiki.object_for relative
@@ -53,7 +53,7 @@ module Giraffe
     def create!(content, comments)
       # Set up a backend object to fill in.
       dir = Giraffe.wiki.object_for @dir.join(&quot;/&quot;)
-      name = Giraffe::Conf.to_filename.call @name
+      name = Giraffe.to_filename.call @name
 
       path = if dir.path.empty? then name else File.join(dir.path, name) end
 
@@ -82,7 +82,7 @@ module Giraffe
     #         horribly with more complex name mappings.
     #
     def directory?()
-      File.directory? File.join(Giraffe::Conf.wikiroot, File.join(@dir), @name.downcase)
+      File.directory? File.join(Giraffe.wikiroot, File.join(@dir), @name.downcase)
     end
 
     # Escape &lt; and &gt; from the raw page content.
@@ -159,7 +159,7 @@ module Giraffe
       filename  = name
       relative  = if dir.empty? then filename else File.join(dir, filename) end
 
-      object    = Giraffe::Conf.wiki.object_for relative
+      object    = Giraffe.wiki.object_for relative
 
       new name, dir, uri, object, info
     end</diff>
      <filename>lib/giraffe/page.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,7 +18,7 @@ module Giraffe
 
         # TODO: May need further guarding here.
         @matches =  Giraffe.wiki!.grep(@search).select {|obj, match|
-                      Giraffe::Conf.list_filter.call obj.name
+                      Giraffe.list_filter.call obj.name
                     }
 
         eruby = Erubis::Eruby.new File.read(&quot;views/grep.erb&quot;)</diff>
      <filename>resources/grep.rb</filename>
    </modified>
    <modified>
      <diff>@@ -174,16 +174,16 @@ describe &quot;Completely empty path&quot; do
     Waves.applications.clear
   end
 
-  it &quot;redirects to the page named as Giraffe::Conf.home&quot; do
+  it &quot;redirects to the page named as Giraffe.home&quot; do
     response = get(&quot;&quot;)
 
     response.status.should == 301
-    response.location.should == Giraffe::Conf.home
+    response.location.should == Giraffe.home
 
     response = get(&quot;/&quot;)
 
     response.status.should == 301
-    response.location.should == Giraffe::Conf.home
+    response.location.should == Giraffe.home
   end
 
 end</diff>
      <filename>spec/page_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,15 +9,15 @@ $LOAD_PATH.unshift GIRAFFE_ROOT
 $LOAD_PATH.unshift GIRAFFE_WAVES
 
 require &quot;waves&quot;
-require &quot;runtime/mocks&quot;
+require &quot;waves/runtime/mocks&quot;
 
 require &quot;rubygems&quot;
   require &quot;nokogiri&quot;
 
-Waves::Runtime.instance = Waves::Runtime.new
-Object.send :include, Waves::Mocks
+Waves::Runtime.new
+include Waves::Mocks
 
-require &quot;startup&quot;
+require &quot;run_giraffe_run&quot;
 
 require &quot;fileutils&quot;
 
@@ -62,22 +62,22 @@ def create_good_repo()
 
   config = &lt;&lt;-ENDCONFIG
 # Directory in which the wiki pages live
-Giraffe::Conf.wikiroot    = &quot;#{File.join @repo, @wiki}&quot;
+Giraffe.wikiroot    = &quot;#{File.join @repo, @wiki}&quot;
 
 # Directory in which .git lives
-Giraffe::Conf.reporoot    = &quot;#{File.join @repo, @wiki}/..&quot;
+Giraffe.reporoot    = &quot;#{File.join @repo, @wiki}/..&quot;
 
 # Append extension to *all* page name candidates
-Giraffe::Conf.to_filename = lambda {|uri| uri + &quot;.txt&quot; }
-Giraffe::Conf.to_uri      = lambda {|file| file.chomp &quot;.txt&quot; }
+Giraffe.to_filename = lambda {|uri| uri + &quot;.txt&quot; }
+Giraffe.to_uri      = lambda {|file| file.chomp &quot;.txt&quot; }
 
 # No showing stuff other than .txt for now
-Giraffe::Conf.list_filter = lambda {|file| file =~ /\.txt$/ }
+Giraffe.list_filter = lambda {|file| file =~ /\.txt$/ }
 
 # Resource files allowed
 RESOURCES = { &quot;png&quot;     =&gt; {:mime =&gt; &quot;image/png&quot;} } unless defined? RESOURCES
 
-Giraffe::Conf.resource_filter = lambda {|uri|
+Giraffe.resource_filter = lambda {|uri|
                                 uri.match /.+\.(.+)$/
                                 RESOURCES[$1]
                                 }</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -30,7 +30,7 @@
         &lt;!-- Main navigation --&gt;
         &lt;div id=&quot;navigation&quot;&gt;
           &lt;ul&gt;
-            &lt;li&gt;&lt;a href=&quot;&lt;%= Giraffe::Conf.home %&gt;&quot; title=&quot;Go to home page&quot; accesskey=&quot;i&quot;&gt;home&lt;/a&gt;&lt;/li&gt;
+            &lt;li&gt;&lt;a href=&quot;&lt;%= Giraffe.home %&gt;&quot; title=&quot;Go to home page&quot; accesskey=&quot;i&quot;&gt;home&lt;/a&gt;&lt;/li&gt;
             &lt;li&gt;&lt;a href=&quot;/changes&quot;  title=&quot;View wiki history&quot; accesskey=&quot;y&quot;&gt;history&lt;/a&gt;&lt;/li&gt;
             &lt;li&gt;&lt;a href=&quot;/pages&quot;  title=&quot;List of pages&quot; accesskey=&quot;l&quot;&gt;pages&lt;/a&gt;&lt;/li&gt;
             &lt;li&gt;
@@ -52,7 +52,7 @@
             &lt;li&gt;&lt;a href=&quot;http://validator.w3.org/check?uri=referer&quot;&gt;Valid XHTML 1.1&lt;/a&gt;&lt;/li&gt;
             &lt;li&gt;&lt;a href=&quot;http://jigsaw.w3.org/css-validator/check/referer&quot;&gt;Valid CSS 2.1&lt;/a&gt;&lt;/li&gt;
             &lt;li&gt;&lt;a href=&quot;http://www.section508.info/check_this.cfm?URLtest=http://http://cs.helsinki.fi/u/esaynatk&amp;amp;s508=1&amp;amp;CheckURL=0&quot;&gt;508 OK&lt;/a&gt;&lt;/li&gt;
-            &lt;li&gt;&lt;a href=&quot;&lt;%= Giraffe::Conf.itself %&gt;&quot; title=&quot;Giraffe website&quot; class=&quot;imagelink&quot;&gt;
+            &lt;li&gt;&lt;a href=&quot;&lt;%= Giraffe.itself %&gt;&quot; title=&quot;Giraffe website&quot; class=&quot;imagelink&quot;&gt;
               &lt;img src=&quot;/giraffe/images/giraffe_logo_small.png&quot; alt=&quot;Giraffe&quot; /&gt; power!
             &lt;/a&gt;&lt;/li&gt;
           &lt;/ul&gt;</diff>
      <filename>views/layout.erb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@
 
 &lt;div id=&quot;page_list&quot;&gt;
   &lt;% if @objects.empty? %&gt;
-    &lt;p&gt;&lt;a href=&quot;/editable/&lt;%= Giraffe::Conf.home %&gt;&quot; title=&quot;Create your home page&quot; accesskey=&quot;i&quot;&gt;Go to create your first page.&lt;/a&gt;&lt;/p&gt;
+    &lt;p&gt;&lt;a href=&quot;/editable/&lt;%= Giraffe.home %&gt;&quot; title=&quot;Create your home page&quot; accesskey=&quot;i&quot;&gt;Go to create your first page.&lt;/a&gt;&lt;/p&gt;
   &lt;% else %&gt;
     &lt;div class=&quot;content&quot;&gt;
       &lt;ul class=&quot;page_list&quot;&gt;
@@ -23,7 +23,7 @@
               &lt;/ul&gt;
             &lt;/li&gt;
           &lt;% else %&gt;
-            &lt;% next unless Giraffe::Conf.list_filter.call object.path %&gt;
+            &lt;% next unless Giraffe.list_filter.call object.path %&gt;
             &lt;% page = Giraffe::Page.from_git object %&gt;
             &lt;li class=&quot;entry&quot;&gt;
               &lt;ul class=&quot;page&quot;&gt;</diff>
      <filename>views/pages.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9c6728cba6dbf1259adbdcee94e0b0401b7afbf0</id>
    </parent>
  </parents>
  <author>
    <name>Eero Saynatkari</name>
    <email>projects@kittensoft.org</email>
  </author>
  <url>http://github.com/rue/giraffe/commit/b41008e81d7aed77d8c37e6c607d28102fd6b6cf</url>
  <id>b41008e81d7aed77d8c37e6c607d28102fd6b6cf</id>
  <committed-date>2008-12-15T07:05:10-08:00</committed-date>
  <authored-date>2008-12-15T06:19:51-08:00</authored-date>
  <message>Moved back to config directly in Giraffe rather than Giraffe::Conf.</message>
  <tree>5090a872fddcc58ab224d8c5cc3cc445dc67a248</tree>
  <committer>
    <name>Eero Saynatkari</name>
    <email>projects@kittensoft.org</email>
  </committer>
</commit>
