Sha256: b3d2f7f5036345c59f5855c93eae6bf20968cc4d7adb17fb29659ba254d0afdb

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

require 'fileutils'
require 'provisional/rails_application'

module Provisional
  module SCM
    class Svn
      def initialize(options)
        @options = options
      end

      def init
        raise NotImplementedError, "The SVN scm cannot currently be used directly"
      end

      def generate_rails(create_structure = true)
        rescuing_exceptions do
          system("svn co --username=#{@options['username']} --password=#{@options['password']} #{@options['url']} #{@options['name']}")
          Dir.chdir @options['name']
          if create_structure
            %w(branches tags trunk).each {|d| Dir.mkdir(d)}
            system("svn add branches tags trunk")
            system("svn commit -m 'Structure by Provisional'")
          end
          Provisional::RailsApplication.new('trunk', @options['template_path'])
        end
      end

      def checkin
        # TODO: set svn:ignores
        rescuing_exceptions do
          system("svn add *")
          system("svn commit -m 'Initial commit by Provisional'")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vigetlabs-provisional-2.1.5 lib/provisional/scm/svn.rb
vigetlabs-provisional-2.1.6 lib/provisional/scm/svn.rb