Sha256: 26ac0c53ab1c05e95f90c156cde04fbcac60da0b5930bbc69f842dcfcfce96a2

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

require 'rubygems'
require 'active_resource'
require 'provisional/scm/svn'

module Beanstalk
  class Repository < ActiveResource::Base
  end
end

module Provisional
  module SCM
    class Beanstalk < Provisional::SCM::Svn
      def initialize(options)
        %w(username password domain).each do |opt|
          raise ArgumentError, "#{opt} must be specified" unless options[opt]
        end
        super
      end

      def init
        begin
          ::Beanstalk::Repository.site     = "http://#{@options['domain']}.beanstalkapp.com/"
          ::Beanstalk::Repository.user     = @options['username']
          ::Beanstalk::Repository.password = @options['password']
          ::Beanstalk::Repository.create   :name => @options['name'], :title => @options['name'], :create_structure => true
          @options['url'] = "http://#{@options['domain']}.svn.beanstalkapp.com/#{@options['name']}/"
        rescue
          raise RuntimeError, "Repository not created on Beanstalk due to exception: #{$!}"
        end
      end

      def generate_rails
        super(false)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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