<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 module Visage
   class Config 
-    class &lt;&lt; self
 
+    class &lt;&lt; self
       def use
         @configuration ||= {}
         yield @configuration
@@ -20,5 +20,30 @@ module Visage
         @configuration
       end
     end
+
+    class Profiles
+      class &lt;&lt; self
+        attr_accessor :profiles
+
+        def get(id)
+          id.gsub!(/\s+/, '+')
+          if found = @profiles.find {|p| p[1][&quot;splatpart&quot;] == id }
+            OpenStruct.new(found[1])
+          else
+            nil
+          end
+        end
+
+        def all
+          # here be ugliness
+          profiles = @profiles.to_a.sort_by { |profile| 
+            profile[1][&quot;order&quot;] 
+          }.map { |profile| 
+            OpenStruct.new(profile[1].merge({'name' =&gt; profile[0]}))
+          }
+        end
+      end
+    end
+
   end
 end</diff>
      <filename>lib/visage-config.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,6 @@ require 'RRDtool'
 require 'yajl'
 require 'haml'
 require 'lib/collectd-json'
-require 'lib/collectd-profile'
 require 'lib/visage-config'
 
 set :public, __DIR__ + '/public'
@@ -19,7 +18,7 @@ configure do
   require 'config/init'
 
   CollectdJSON.rrddir = Visage::Config.rrddir
-  CollectdProfile.profiles = Visage::Config.profiles
+  Visage::Config::Profiles.profiles = Visage::Config.profiles
 end
 
 template :layout do 
@@ -43,15 +42,15 @@ end
 
 get '/:host' do 
   @hosts = CollectdJSON.hosts
-  @profiles = CollectdProfile.all
+  @profiles = Visage::Config::Profiles.all
 
   haml :index
 end
 
 get '/:host/:profile' do 
   @hosts = CollectdJSON.hosts
-  @profiles = CollectdProfile.all
-  @profile = CollectdProfile.get(params[:profile])
+  @profiles = Visage::Config::Profiles.all
+  @profile = Visage::Config::Profiles.get(params[:profile])
   
   haml :index
 end</diff>
      <filename>visage.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c4e18262238247bbd0fa2ab4c2cae4e4f8ede3a8</id>
    </parent>
  </parents>
  <author>
    <name>jf</name>
    <email>jfs.world@gmail.com</email>
  </author>
  <url>http://github.com/jf/visage/commit/6c012677b77e53e52f375dc72ce62f62ee27e121</url>
  <id>6c012677b77e53e52f375dc72ce62f62ee27e121</id>
  <committed-date>2009-10-11T09:16:15-07:00</committed-date>
  <authored-date>2009-10-11T09:16:15-07:00</authored-date>
  <message>refactor - profiles have more to do with 'Visage::Config', than 'Collectd'</message>
  <tree>d7a49116067704bfba791d638b1d8cd650859023</tree>
  <committer>
    <name>jf</name>
    <email>jfs.world@gmail.com</email>
  </committer>
</commit>
