Sha256: 2760fffc8d9772acd7d123ef3d9f5211068d60b252e72bb969cd89ba6c48b7e3

Contents?: true

Size: 895 Bytes

Versions: 11

Compression:

Stored size: 895 Bytes

Contents

require 'yaml'

def create(who, *args)

  options = args.last.is_a?(Hash) ? args.pop : {}

  case who

  when :local_repo
    Vx::Router.root.join("fixtures/repo").to_s

  when :configuration
    klass = Vx::BuildConfiguration
    configuration = nil
    if options[:yaml]
      configuration = klass.from_yaml options[:yaml]
    elsif options[:attributes]
      configuration = klass.from_attributes options[:attributes]
    else
      klass.from_yaml fixture("travis.yml")
    end

  when :message
    name = args.shift

    klass = Vx::Message.const_get name
    klass.test_message options

  when :build
    message = options[:message] || create(:message, 'PerformBuild', options)
    Vx::Router::Build.new message

  when :git
    build = args.shift
    path  = args.shift
    SCM::Git.new build.src, build.sha, path, deploy_key: build.deploy_key, &build.method(:add_to_output)

  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
vx-router-0.2.0.pre38 spec/support/create.rb
vx-router-0.2.0.pre37 spec/support/create.rb
vx-router-0.2.0.pre36 spec/support/create.rb
vx-router-0.2.0.pre35 spec/support/create.rb
vx-router-0.2.0.pre34 spec/support/create.rb
vx-router-0.2.0.pre33 spec/support/create.rb
vx-router-0.2.0.pre32 spec/support/create.rb
vx-router-0.2.0.pre31 spec/support/create.rb
vx-router-0.2.0.pre30 spec/support/create.rb
vx-router-0.2.0.pre29 spec/support/create.rb
vx-router-0.2.0.pre28 spec/support/create.rb