<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>AUTHORS</filename>
    </added>
    <added>
      <filename>generator/move.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -22,9 +22,9 @@ Gem::Specification.new do |s|
    s.summary = %q{art_generators provides rails-style generators for managing a digital art project.}
    s.homepage = %q{http://www.robmyers.org/}
    s.description = %q{art_generators provides rails-style generators for managing a digital art project.}
-   s.files = [ &quot;README&quot;, &quot;Changelog&quot;, &quot;COPYING&quot;, &quot;bin/art_project&quot;, 
+   s.files = [ &quot;README&quot;, &quot;Changelog&quot;, &quot;COPYING&quot;, &quot;bin/art_project&quot;,
    	       &quot;generator/project.rb&quot;, &quot;generator/release.rb&quot;, 
-	       &quot;generator/web.rb&quot;, &quot;generator/work.rb&quot;,
+	       &quot;generator/web.rb&quot;, &quot;generator/work.rb&quot;, &quot;generator/move.rb&quot;,
 	       &quot;templates/template.svg&quot;]
    s.executables = ['art_project']
 end 
\ No newline at end of file</diff>
      <filename>art_generators.gemspec</filename>
    </modified>
    <modified>
      <diff>@@ -34,10 +34,10 @@
 #   -v, --version       Display version number
 #   -a, --artist        Your name
 #   -l, --license       Set the Creative Commons license URL for the project
-#   -g, --git           Use the git version control system for the project
+#   -g, --git URL       Use the git version control system for the project
+#   -s, --svn URL       Use the svn version control system for the project
 #   -d, --date          The year(s) for the copyright message
 #
-#
 # == Author
 #    Rob Myers &lt;rob@robmyers.org&gt;
 #
@@ -47,10 +47,11 @@
 
 
 require 'fileutils'
+#require 'liblicense'
 require 'optparse' 
 require 'ostruct'
 require 'rdoc/usage'
-#require 'liblicense'
+require 'yaml'
 
 class ArtProject
   VERSION = &quot;0.0.1&quot;
@@ -80,22 +81,31 @@ class ArtProject
   def initialize_project_details
     @project = OpenStruct.new
     @project.name = ''
-    @project.license_id = ''
-    @project.license_metadata = ''
-    @project.license_full_text = ''
-    @project.dir = ''
+    @project.unix_name = ''
     @project.artist = ''
+    @project.remote_repository = nil
     @project.use_git = false
     @project.use_svn = false
+    @project.license_uri = ''
+    
+    # Don't save to the yaml in case the directory is moved by the user
+    @project_dir = ''
+    @version_control_dir = ''
   end
   
   def parsed_options?
     opts = OptionParser.new       
     opts.on('-v', '--version')  { output_version ; exit 0 }
     opts.on('-h', '--help')     { output_help }
-    opts.on(&quot;-g&quot;, &quot;--git&quot;)      {|git| @project.use_git &lt;&lt; git}
-    #opts.on(&quot;-s&quot;, &quot;--svn&quot;)     {|svn| @project.use_svn &lt;&lt; svn}
-    #opts.on('-l LICENSE', '--license LICENSE')  do |license|
+    opts.on(&quot;-g&quot;, &quot;--git URI&quot;)  do |uri| 
+      @project.use_git = true
+      @project.remote_repository = uri
+    end
+    opts.on(&quot;-s&quot;, &quot;--svn URI&quot;)  do |uri| 
+      @project.use_svn = true
+      @project.remote_repository = uri
+    end 
+    #opts.on('-l LICENSE', '--license URI')  do |license|
     #  @project.license_id &lt;&lt; license
     #end 
     opts.on('-a', '--artist')  { |artist| @project.artist &lt;&lt; artist }
@@ -117,20 +127,40 @@ class ArtProject
   end
   
   def arguments_valid?
-    if @arguments[0] == nil
+    if @arguments.length != 1
+      puts &quot;No project name specified.&quot;
       return false
     end
-    #if @project.git &amp;&amp; @project.svn
-    #  puts &quot;Both git and svn specified. Please one or the other, not both.&quot;
-    #  return false
-    #end
+    if @project.use_git &amp;&amp; @project.use_svn
+      puts &quot;Both git and svn specified. Please one or the other, not both.&quot;
+      return false
+    end
+    if @project.use_git
+      if @project.remote_repository.rindex('.git') == nil
+        puts &quot;git uri must be of the format: ssh://git.com/var/git/project.git&quot;
+        return false
+      end
+    end
+    if @project.use_svn
+      if @project.remote_repository.rindex(@project.unix_name) == nil
+        puts &quot;svn uri must end with project name&quot;
+        return false
+      end
+    end
     #TODO Check the licence id is valid
     true
   end
   
   def process_arguments
     @project.name = @arguments[0] # nil if unsupplied
-    @project.dir = Dir.pwd + &quot;/&quot; + @project.name
+    # Make a safe UNIX filename
+    #TODO: Improve this
+    @project.unix_name = @project.name.downcase.gsub(/ \//, '_')        
+    @version_control_dir = Dir.pwd + '/' + @project.unix_name
+    @project_dir = @version_control_dir
+    if @project.use_svn
+      @project_dir += '/trunk'
+    end  
   end
   
   def output_help
@@ -152,47 +182,83 @@ class ArtProject
   end
   
   def make_directories
-    if File.exists? @project.dir
-      die &quot;Cannot create project. Directory named {@project.dir} already exists. Please rename or move the existing directory.&quot;
+    if File.exists? @project_dir
+      puts &quot;Cannot create project. Directory named #{@project_dir} already exists. Please rename or move the existing directory.&quot;
+      exit 1
     end
-    FileUtils.mkdir_p @project.dir
-    FileUtils.mkdir_p @project.dir + &quot;/discard&quot;
-    FileUtils.mkdir_p @project.dir + &quot;/final&quot;
-    FileUtils.mkdir_p @project.dir + &quot;/preparatory&quot;
-    FileUtils.mkdir_p @project.dir + &quot;/releases&quot;
-    FileUtils.mkdir_p @project.dir + &quot;/resources&quot;
-    FileUtils.mkdir_p @project.dir + &quot;/script&quot;
+    
+    FileUtils.mkdir_p @project_dir
+    
+    if @project.use_svn
+      FileUtils.mkdir_p @version_control_dir + '/branches'
+      FileUtils.mkdir_p @version_control_dir + '/tags'
+    end
+    
+    
+    FileUtils.mkdir_p @project_dir + &quot;/discard&quot;
+    FileUtils.mkdir_p @project_dir + &quot;/final&quot;
+    FileUtils.mkdir_p @project_dir + &quot;/preparatory&quot;
+    FileUtils.mkdir_p @project_dir + &quot;/releases&quot;
+    FileUtils.mkdir_p @project_dir + &quot;/resources&quot;
+    FileUtils.mkdir_p @project_dir + &quot;/script&quot;
   end
   
   def make_script_link(name)
-    script=@project.dir + &quot;/script/&quot; + name
+    script=&quot;#{@project_dir}/script/#{name}&quot;
     File.open(script, 'w') {|f| 
       f.puts(&quot;#!/usr/bin/env ruby&quot;)
       f.puts(&quot;$project_dir=File.dirname(File.dirname(File.expand_path(__FILE__)))&quot;)
-      f.puts(&quot;require '&quot; + @generator_dir + &quot;/&quot; + name + &quot;.rb'&quot;)
+      f.puts(&quot;require '#{@generator_dir}/#{name}.rb'&quot;)
       File.chmod(0700, script)}
   end
   
   def make_script_links
+    make_script_link(&quot;move&quot;)
     make_script_link(&quot;release&quot;)
     make_script_link(&quot;web&quot;)
     make_script_link(&quot;work&quot;)
   end
   
   def make_files
-    File.open(@project.dir + &quot;/resources/license.xml&quot;, 'w') {|f| 
-      f.write(@project.license_metadata) }
-    File.open(@project.dir + &quot;/COPYING&quot;, 'w') {|f| 
-      f.write(@project.license_full_text) }
-    File.open(@project.dir + &quot;/README&quot;, 'w') {|f| 
-      f.write(@project.name + &quot; by &quot; + @project.artist +
-              &quot;.\nSee COPYING for license.\n&quot;) }
-    FileUtils.cp(@template_dir + &quot;/template.svg&quot;, @project.dir + &quot;/resources&quot;)
+    #File.open(&quot;#{@project_dir}/resources/license.xml&quot;, 'w') {|f| 
+    #  f.write(@project.license_metadata) }
+    File.open(&quot;#{@project_dir}/COPYING&quot;, 'w') do |f| 
+      f.write(&quot;See: &quot;)
+      f.write(@project.license_uri)
+    end
+    File.open(&quot;#{@project_dir}/README&quot;, 'w') do |f| 
+      f.write(&quot;#{@project.name}&quot;)
+      if @project.artist != ''
+        f.write(&quot;by #{@project.artist}\name&quot;)
+      end
+      f.write(&quot;\nSee COPYING for license.\n&quot;)
+    end
+    FileUtils.cp(&quot;#{@template_dir}/template.svg&quot;, &quot;#{@project_dir}/resources&quot;)
+    File.open(&quot;#{@project_dir}/resources/configuration.yaml&quot;, 'w') do |f|
+      f.write(@project.marshal_dump.to_yaml)
+    end
   end
   
   def initialize_version_control
-    Kernel.system('git-init') if @project.use_git
-    #Kernel.system('svn-init') if @project.use_svn
+    if @project.use_git
+      # Need to make sure we cd .. if something fails
+      File.cd(@version_Control_dir)
+      Kernel.system('git', 'init')
+      Kernel.system('git', 'add', '.')
+      Kernel.system('git', 'commit')
+      Kernel.system('git', 'remote', 'add', 'origin', 
+                    @project.remote_repository)
+      Kernel.system('git', 'push', 'origin', 'master')
+      file.cd('..')
+   end
+     if @project.use_svn
+       Kernel.system('svn', 'import', @version_control_dir, 
+                     @project.remote_repository,
+                     &quot;-m&quot;, &quot;Checkin of generated directory structure.&quot;)
+       FileUtils.remove_entry_secure(@version_control_dir)
+       Kernel.system('svn', 'checkout', @project.remote_repository,
+                     @project.name)
+     end
   end
   
   def process_command</diff>
      <filename>generator/project.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,6 +16,7 @@
 #    You should have received a copy of the GNU General Public License
 #    along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
 
+require 'date'
 require 'optparse' 
 require 'rdoc/usage'
 
@@ -27,7 +28,7 @@ require 'rdoc/usage'
 #    art_release
 #
 # == Usage
-#    art_release [options]
+#    release [options]
 #
 #    For help use: art_project -h
 #
@@ -49,12 +50,12 @@ class ArtRelease
   def initialize (arguments)    
     @arguments = arguments
 
-    
     @script_dir = File.dirname(File.expand_path(__FILE__))
     @project_dir = File.dirname(@script_dir)
     @project_name = File.basename(@project_dir)
     @archive_dir = @project_dir + &quot;/archives&quot;
     @archive_file = ''
+    @tag = &quot;release_#{Date::today.to_s}&quot;
   end
   
   def run
@@ -74,6 +75,9 @@ class ArtRelease
     opts.on('-f FILENAME', '--file FILENAME')     do |file|
       @archive_file &lt;&lt; @archive_dir + file || &quot;#(@archive_dir)/#(@project_name)&quot;
     end       
+    opt.on('-t TAG', '--tag TAG') do |tag|
+      @tag = tag
+    end
     # This consumes matched arguments from @arguments
     opts.parse!(@arguments) rescue return false
     process_options
@@ -81,8 +85,8 @@ class ArtRelease
   end
   
   def process_options
-    if ! (@archive_file.ends_with &quot;.tar.gz&quot; ||
-          @archive_file.ends_with &quot;.tgz&quot;)
+    if ! (@archive_file.index(&quot;.tar.gz&quot;) != nil) ||
+          (@archive_file.index(&quot;.tgz&quot;) != nil)
     @archive_file += &quot;tar.gz&quot;
     end
   end
@@ -114,8 +118,22 @@ class ArtRelease
       die &quot;Failed to create archive.&quot;
     end
   end
+
+  def using_git?
+    File.exists(&quot;#{@project.project_path}/.git&quot;)
+  end
+   
+  def using_svn?
+    File.exists(&quot;#{@project.project_path}/.svn&quot;)
+  end
+  
+  def tag_release_version
+    Kernel.system(&quot;git' 'tag' @tag) if @project.git
+    #Kernel.system(&quot;svn tag #{tag}&quot;) if @project.svn
+  end
   
   def process_command
+    tag_release_version
     make_archive
   end
 end</diff>
      <filename>generator/release.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,10 +16,6 @@
 #    You should have received a copy of the GNU General Public License
 #    along with this program. If not, see &lt;http://www.gnu.org/licenses/&gt;.
 
-require 'fileutils'
-require 'optparse' 
-require 'rdoc/usage'
-
 # == Synopsis
 #    Copies an existing work (or the project template) to start a new work.
 #
@@ -28,7 +24,7 @@ require 'rdoc/usage'
 #    art_project -c leaves.svg flowers.svg
 #
 # == Usage
-#    art_work [options] work_name
+#    work [options] work_name
 #
 #    For help use: art_work -h
 #
@@ -44,6 +40,10 @@ require 'rdoc/usage'
 #    Copyright (C) 2008 Rob Myers. Licensed under the GNU GPL 3 or later.
 #    http://www.gnu.org/licenses/gpl-3.0.html
 
+require 'fileutils'
+require 'optparse'
+require 'rdoc/usage'
+
 class ArtWork
   VERSION = &quot;0.0.1&quot;
   
@@ -95,8 +95,12 @@ class ArtWork
   end
   
   def arguments_valid?
-    @arguments.length == 1
+    if @arguments.length != 1
+      puts &quot;No work file name specified.&quot;
+      return false
+    end
     # And the argument refers to an existing file
+    return true
   end
   
   def process_arguments
@@ -130,16 +134,16 @@ class ArtWork
   end
 
   def add_work_to_version_control
-    if using_git?
-      Kernel.system(&quot;git add  #{@destination_work_name}&quot;)
-    end
-    if using_svn?
-      Kernel.system(&quot;svn add  #{@destination_work_name}&quot;)
-    end
+    Kernel.system(&quot;git add  #{@destination_work_name}&quot;) if using_git?
+    Kernel.system(&quot;svn add  #{@destination_work_name}&quot;) if using_svn?
   end
 
   def process_command
-    if File.exists? @destination_work_name
+    if ! File.exists?(@source_work_name)
+      puts &quot;File doesn't exist #{@source_work_name}&quot;
+      exit 1
+    end
+    if File.exists?(@destination_work_name)
       puts &quot;File already exists #{@destination_work_name}&quot;
       exit 1
     end</diff>
      <filename>generator/work.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>4302916f80ba9b2beffb121f097ea6f91c19e9f1</id>
    </parent>
  </parents>
  <author>
    <name>Rob Myers</name>
    <email>rob@robmyers.org</email>
  </author>
  <url>http://github.com/robmyers/art_generators/commit/0f0d04946732fed282e0b007717fe787205f9a52</url>
  <id>0f0d04946732fed282e0b007717fe787205f9a52</id>
  <committed-date>2008-08-31T13:04:26-07:00</committed-date>
  <authored-date>2008-08-31T13:04:26-07:00</authored-date>
  <message>art_project now works with svn, added move script (not working with svn yet), added AUTHORS.</message>
  <tree>29c9c84383e52ae2d2dfb0e8c07247ca4a80b62d</tree>
  <committer>
    <name>Rob Myers</name>
    <email>rob@robmyers.org</email>
  </committer>
</commit>
