Sha256: 9b652bcc04c77564856a728a80e3f25a854223d289aa0dbe5b5663f86c27593d

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 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 {|directory| Dir.mkdir(directory)}
            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

      def provision
        self.init
        self.generate_rails
        self.checkin
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vigetlabs-provisional-2.1.11 lib/provisional/scm/svn.rb
vigetlabs-provisional-2.1.12 lib/provisional/scm/svn.rb
vigetlabs-provisional-2.1.7 lib/provisional/scm/svn.rb
vigetlabs-provisional-2.1.8 lib/provisional/scm/svn.rb
vigetlabs-provisional-2.1.9 lib/provisional/scm/svn.rb