<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/suprails_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -19,6 +19,7 @@ spec = Gem::Specification.new do |s|
     &quot;lib/insertion_helper.rb&quot;,
     &quot;lib/runner.rb&quot;,
     &quot;lib/suprails.rb&quot;,
+    &quot;lib/suprails_helper.rb&quot;,
     &quot;lib/yaml_helper.rb&quot;,
     &quot;facets/haml.rb&quot;,
     &quot;bin/suprails&quot;,</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -34,7 +34,11 @@ module FacetSugar
   end
 end
 
+require File.dirname(__FILE__) + '/suprails_helper'
+
 class Facet
+  include SuprailsHelper
+  
   @registered_facets = {}
   class &lt;&lt; self
     attr_reader :registered_facets</diff>
      <filename>lib/facet.rb</filename>
    </modified>
    <modified>
      <diff>@@ -18,23 +18,35 @@
 #     along with Suprails.  If not, see &lt;http://www.gnu.org/licenses/&gt;.
 #
 
-require File.dirname(__FILE__) + '/insertion_helper'
-require File.dirname(__FILE__) + '/db'
-require File.dirname(__FILE__) + '/gems'
+require File.dirname(__FILE__) + '/suprails_helper'
 require File.dirname(__FILE__) + '/facet'
 
 class Runner
+include SuprailsHelper
   
   class &lt;&lt; self
     attr_accessor :app_name
-  end
+    attr_accessor :runfile
+    attr_accessor :sources
+    attr_accessor :facets_source
+    attr_accessor :base
+    
+    def sources sourcefolder
+      @sources = File.expand_path &quot;#{sourcefolder}/&quot;
+    end
   
+    def init_variables(app_name, runfile)
+      @app_name = app_name
+      @runfile = File.expand_path(runfile)
+      @sources = File.expand_path('~/.suprails/sources/')
+      @facets_source = File.expand_path('~/.suprails/facets/')
+      @base = File.expand_path &quot;./#{@app_name}&quot;
+    end
+  end
+      
   def initialize(app_name, runfile = &quot;~/.suprails/config&quot;)
-    Runner.app_name = app_name
-    @runfile = File.expand_path(runfile)
-    @sources = File.expand_path('~/.suprails/sources/')
-    @facets_source = File.expand_path('~/.suprails/facets/')
-    Dir[&quot;#{@facets_source}/*.rb&quot;].each{|x| load x }
+    Runner.init_variables(app_name, runfile)
+    Dir[&quot;#{Runner.facets_source}/*.rb&quot;].each{|x| load x }
     
     Facet.registered_facets.each do |name, facet|
       self.class.send(:define_method, name) {}
@@ -54,114 +66,9 @@ class Runner
   def run
     gems = Gems.new Runner.app_name
     db = DB.new Runner.app_name
-    @base = File.expand_path &quot;./#{Runner.app_name}&quot;
-    Dir.mkdir(@base)
-    text = File.read(@runfile)
+    
+    Dir.mkdir(Runner.base)
+    text = File.read(Runner.runfile)
     instance_eval(text)
-  end
-
-  def sources sourcefolder
-    @sources = File.expand_path &quot;#{sourcefolder}/&quot;
-    puts &quot;Using #{@sources} for file sources&quot;
-  end
-
-  def rails
-    shell &quot;rails #{Runner.app_name}&quot;
-  end
-  
-  def frozen_rails
-    shell &quot;rails #{Runner.app_name} --freeze&quot;
-  end
-
-  def debug p = ''
-    puts &quot;debug: #{p}&quot;
-  end
-
-  def plugin plugin_location
-    runinside(&quot;script/plugin install #{plugin_location}&quot;)
-  end
-
-  def generate generator, *opts
-    runinside(&quot;script/generate #{generator} #{opts.join(' ')}&quot;)
-  end
-
-  def folder folder_name
-    path = &quot;#{@base}/&quot;
-    puts &quot;New folder: #{@base}&quot;
-    paths = folder_name.split('/')
-    paths.each do |p|
-      path += &quot;#{p}/&quot;
-      Dir.mkdir path if !File.exists? path
-    end
-  end
-
-  def file source_file, destination, absolute = false
-    require 'ftools'
-    if absolute
-      source = File.expand_path &quot;#{source_file}&quot;
-    else
-      source = File.expand_path &quot;#{@sources}/#{source_file}&quot;
-    end
-    dest = File.expand_path &quot;./#{Runner.app_name}/#{destination}&quot;
-    File.copy(source, dest, true) if File.exists? source
-  end
-
-  def delete file_name
-    file_name = &quot;#{@base}/#{file_name}&quot;
-    puts &quot;Deleting: #{@file_name}&quot;
-    File.delete file_name if File.exists?(file_name)
-  end
-
-  def gpl
-    puts 'Installing the GPL into COPYING'
-    require 'net/http'
-    http = Net::HTTP.new('www.gnu.org')
-    path = '/licenses/gpl-3.0.txt'
-    begin
-      resp = http.get(path)
-      if resp.code == '200'
-        File.open(&quot;#{@base}/COPYING&quot;, 'w') do |f|
-          f.puts(resp.body)
-        end
-      else
-        puts &quot;Error #{resp.code} while retrieving GPL text.&quot;
-      end
-    rescue SocketError
-      puts 'SocketError: You might not be connected to the internet. GPL retrieval failed.'
-    end
-  end
-
-  def rake *opts
-    runinside(&quot;rake #{opts.join(' ')}&quot;)
-  end
-
-  def git
-    runinside('git init')
-  end
-
-  def svn
-    runinside('svnadmin create')
-  end
-  
-  def runinside *opts
-    shell &quot;cd #{Runner.app_name}; #{opts.join(' ')}&quot;
-  end
-  
-  def save
-    file @runfile, &quot;doc/suprails.config&quot;, true
-  end
-  
-  def new_file filename, contents
-    File.open(File.expand_path(&quot;./#{Runner.app_name}/#{filename}&quot;), 'w') do |f|
-      f.puts contents
-    end
-    puts &quot;Generating file: #{filename}&quot;
-  end
-  
-  private
-  
-  def shell cmd
-    puts `#{cmd}`
-  end
-  
+  end  
 end</diff>
      <filename>lib/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
   s.description = %q{This project is intended to be a replacement for the &quot;rails&quot; command. It  does not replace the rails framework but rather provides a starting point for a rails application far beyond what the &quot;rails&quot; command provides.  During execution, in fact, the suprails command calls the rails command.}
   s.email = %q{listrophy@gmail.com}
   s.executables = [&quot;suprails&quot;]
-  s.files = [&quot;README&quot;, &quot;COPYING&quot;, &quot;TODO&quot;, &quot;lib/db.rb&quot;, &quot;lib/facet.rb&quot;, &quot;lib/gems.rb&quot;, &quot;lib/insertion_helper.rb&quot;, &quot;lib/runner.rb&quot;, &quot;lib/suprails.rb&quot;, &quot;lib/yaml_helper.rb&quot;, &quot;facets/haml.rb&quot;, &quot;bin/suprails&quot;, &quot;suprails.config.example&quot;]
+  s.files = [&quot;README&quot;, &quot;COPYING&quot;, &quot;TODO&quot;, &quot;lib/db.rb&quot;, &quot;lib/facet.rb&quot;, &quot;lib/gems.rb&quot;, &quot;lib/insertion_helper.rb&quot;, &quot;lib/runner.rb&quot;, &quot;lib/suprails.rb&quot;, &quot;lib/yaml_helper.rb&quot;, &quot;lib/suprails_helper.rb&quot;, &quot;facets/haml.rb&quot;, &quot;bin/suprails&quot;, &quot;suprails.config.example&quot;]
   s.homepage = %q{http://suprails.org}
   s.require_paths = [&quot;lib&quot;]
   s.rubyforge_project = %q{suprails}</diff>
      <filename>suprails.gemspec</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>9961001a9e868acfd5f9e6a0a01098c5e068accc</id>
    </parent>
  </parents>
  <author>
    <name>Angel N. Sciortino</name>
    <email>contact@angeliccomputing.com</email>
  </author>
  <url>http://github.com/listrophy/suprails/commit/9e5861cb71ebbb8fbea749743a918e58df86ebc4</url>
  <id>9e5861cb71ebbb8fbea749743a918e58df86ebc4</id>
  <committed-date>2008-12-31T12:21:02-08:00</committed-date>
  <authored-date>2008-12-20T13:21:48-08:00</authored-date>
  <message>moved many methods from Runner into SuprailsHelper so they can be used inside facets

Signed-off-by: Bradley Grzesiak &lt;listrophy@gmail.com&gt;</message>
  <tree>b7116c8141975075eb0337b67104247cadead7d8</tree>
  <committer>
    <name>Bradley Grzesiak</name>
    <email>listrophy@gmail.com</email>
  </committer>
</commit>
