<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,9 +9,3 @@
   * look for a new version of the gems that are in the repository and send an
     alert to someone about them.
 
-= sync
-
-  check the configuration file, looking for all the version that are stored
-  there.  Make sure that they are all available.
-
-= </diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -233,11 +233,49 @@ module Stickler
       run {
         p = Stickler.params_to_hash( params )
         repo = Stickler::Repository.new( p )
-        puts p.inspect
         repo.sync( p['rebuild'] )
       }
     end
 
+    mode( 'generate' ) do
+      mode( 'sysconfig' ) do
+        description &lt;&lt;-desc
+        generate the system wide configuration for use by rubygem clients that should use
+        the repository stickler creates.  
+        desc
+
+        example &lt;&lt;-txt
+          . stickler generate sysconfig
+        txt
+
+        mixin :option_directory
+        run {
+          p = Stickler.params_to_hash( params )
+          repo = Stickler::Repository.new( p )
+          repo.generate_sysconfig
+        }
+      end
+
+      mode( 'index' ) do
+        description &lt;&lt;-desc
+        generate the rubygems index of the gems to distribute in this repository.  
+        This is the same as doing a 'gem generate_index' but with a scope limited
+        to just the gems in this repository.
+        desc
+
+        example &lt;&lt;-txt
+          . stickler generate index
+        txt
+
+        mixin :option_directory
+        run {
+          p = Stickler.params_to_hash( params )
+          repo = Stickler::Repository.new( p )
+          repo.generate_index
+        }
+      end
+    end
+
     ##
     # common options used by more than one commands
     #</diff>
      <filename>lib/stickler/cli.rb</filename>
    </modified>
    <modified>
      <diff>@@ -31,7 +31,9 @@ module Stickler
         @gem_dependencies = []
         if hash['gems'] then
           hash['gems'].each do |name, reqs|
-            @gem_dependencies &lt;&lt; ::Gem::Dependency.new( name, reqs )
+            [ reqs ].flatten.each do |req|
+              @gem_dependencies &lt;&lt; ::Gem::Dependency.new( name, req )
+            end
           end
         end
       end
@@ -40,9 +42,10 @@ module Stickler
 
     def write
       File.open( config_file_name, 'w' ) do |f|
-        g = {}
-        gem_dependencies.each do |dep|
-          g[dep.name] = dep.requirement_list
+        g = Hash.new { |h,k| h[k] = [] }
+        gem_dependencies.each do |d|
+          g[d.name] &lt;&lt; d.requirement_list
+          g[d.name].flatten!
         end
         hash['gems'] = g
         f.write hash.to_yaml</diff>
      <filename>lib/stickler/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,15 +7,15 @@ module Stickler
   class Console
     class &lt;&lt; self
       #
-      # Items that get logged to stdout for the user to see should use this logger
+      # Items that get logged to stderr for the user to see should use this logger
       #
       def logger
         unless @logger 
           @logger = ::Logging::Logger['User']
           @logger.level = :info
-          @logger.add_appenders(::Logging::Appender.stdout)
-          ::Logging::Appender.stdout.layout = Logging::Layouts::Pattern.new( :pattern =&gt; &quot;%m\n&quot; )
-          ::Logging::Appender.stdout.level = :info
+          @logger.add_appenders(::Logging::Appender.stderr)
+          ::Logging::Appender.stderr.layout = Logging::Layouts::Pattern.new( :pattern =&gt; &quot;%m\n&quot; )
+          ::Logging::Appender.stderr.level = :info
         end
         return @logger
       end</diff>
      <filename>lib/stickler/console.rb</filename>
    </modified>
    <modified>
      <diff>@@ -320,19 +320,24 @@ module Stickler
       end
 
 
-      keys = configuration.keys
-      max_width = keys.collect { |k| k.length }.max
-
-      keys = keys.sort - %w[ sources ]
+      Console.info &quot;&quot;
+      Console.info &quot;Configured gems (in stickler.yml)&quot;
+      Console.info &quot;---------------------------------&quot;
+      Console.info &quot;&quot;
+      configuration.gem_dependencies.sort.each do |dep|
+        Console.info &quot;#{dep.name} : #{dep.version_requirements}&quot;
+      end
 
       Console.info &quot;&quot;
-      Console.info &quot;Configuration variables&quot;
-      Console.info &quot;-----------------------&quot;
+      Console.info &quot;Existing gems&quot;
+      Console.info &quot;-------------&quot;
       Console.info &quot;&quot;
 
-      keys.each do |key|
-        Console.info &quot;  #{key.rjust( max_width )} : #{configuration[ key ]}&quot;
+      source_group.gems.keys.sort.each do |g|
+        puts g
       end
+
+
     end
 
     #
@@ -428,7 +433,9 @@ module Stickler
       ulist = source_group.search_existing( search_pattern )
       source_group.search_existing( search_pattern ).each do |spec|
         source_group.remove( spec )
+        configuration.gem_dependencies.reject! { |d| d.name == spec.name }
       end
+      configuration.write
     end
 
     #
@@ -448,5 +455,48 @@ module Stickler
         source_group.add_from_dependency( dep )
       end
     end
+
+    #
+    # generate the system configuration to be used by rubygem clients of the
+    # repository that stickler managers
+    #
+    def generate_sysconfig( to = $stdout )
+      Console.info &quot;Generating configuration to stdout&quot;
+      txt = &lt;&lt;-cfg
+#
+# This is the system wide configuration to be used by
+# rubygem clients that install gems from the repository
+# located at :
+#
+#   #{configuration.downstream_source}
+#
+# On Unix like machines install in
+#
+#   /etc/gemrc
+#
+# On Windows machines install in
+#
+#   C:\\Documents and Settings\\All Users\\Application Data\\gemrc
+#
+---
+:sources:
+- #{configuration.downstream_source}
+cfg
+      to.puts txt
+    end
+
+    #
+    # Generate the gem index that can be rsynced to another location
+    #
+    #
+    def generate_index
+      require 'rubygems/indexer'
+      Console.info &quot;Generating rubygems index in #{dist_dir}&quot;
+      FileUtils.rm_rf dist_dir
+      FileUtils.mkdir_p dist_dir
+      FileUtils.cp_r gems_dir, dist_dir
+      indexer = ::Gem::Indexer.new dist_dir
+      indexer.generate_index
+    end
   end
-end
+end </diff>
      <filename>lib/stickler/repository.rb</filename>
    </modified>
    <modified>
      <diff>@@ -311,7 +311,7 @@ module Stickler
     #
     def remove_gems_and_specs( remove_list )
       while spec = remove_list.pop do
-        Console.info &quot;Removeing #{ spec.full_name }&quot;
+        Console.info &quot;Removing #{ spec.full_name }&quot;
         delete_gem_files( spec )
       end
     end</diff>
      <filename>lib/stickler/source_group.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,13 +44,16 @@ describe Stickler::Configuration do
   end
 
   it &quot;can have multiple requirements for each gem&quot; do
-    d = ::Gem::Dependency.new( 'rake', [&quot;&gt;= 0.8.0&quot;, &quot;~&gt; 0.9.0&quot;] )
-    @config.gem_dependencies &lt;&lt; d
+    d1 = ::Gem::Dependency.new( 'rake', &quot;&gt;= 0.8.0&quot; )
+    @config.gem_dependencies &lt;&lt; d1
+    d2 = ::Gem::Dependency.new( 'rake', &quot;&gt;= 0.8.0&quot; )
+    @config.gem_dependencies &lt;&lt; d2
     @config.write
 
     @config = Stickler::Configuration.new( @config_file_name )
-    @config.gem_dependencies.size.should == 1
-    @config.gem_dependencies.should be_include( d )
+    @config.gem_dependencies.size.should == 2
+    @config.gem_dependencies.should be_include( d1 )
+    @config.gem_dependencies.should be_include( d2 )
   end
 
 </diff>
      <filename>spec/configuration_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5fb397030c5d1f7abe5bc54f1e86858ae81be661</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Hinegardner</name>
    <email>jeremy@hinegardner.org</email>
  </author>
  <url>http://github.com/copiousfreetime/stickler/commit/e9b0fc99c9265724f05e271290ebc8f0ddd4a94f</url>
  <id>e9b0fc99c9265724f05e271290ebc8f0ddd4a94f</id>
  <committed-date>2008-10-08T22:55:12-07:00</committed-date>
  <authored-date>2008-10-08T22:55:12-07:00</authored-date>
  <message>Added generate index and generate sysconfig commands</message>
  <tree>5be059eb08fd562f421d3f1f72cab42d434d08eb</tree>
  <committer>
    <name>Jeremy Hinegardner</name>
    <email>jeremy@hinegardner.org</email>
  </committer>
</commit>
