Class: TravisCustomDeploy::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/travis-custom-deploy/options.rb

Class Method Summary collapse

Class Method Details

.deploy_allowed?Boolean

Returns true if travis-custom-deploy is not invoked as part of a pull request. The deployment would fail anyway if secure environment variables are used.

Returns true if the deployment is allowed.

Returns:

  • (Boolean)


56
57
58
59
60
61
62
# File 'lib/travis-custom-deploy/options.rb', line 56

def self.deploy_allowed?
  allowed = ENV['TRAVIS_PULL_REQUEST']
  unless allowed.nil?
    return false if allowed != "false"
  end
  true
end

.get_options(transfer_type) ⇒ Object

Returns the options for the corresponding transfer type

transfer_type - the transfer type

Returns an array of options, which must be available



42
43
44
45
46
47
48
49
# File 'lib/travis-custom-deploy/options.rb', line 42

def self.get_options(transfer_type)
  OPTIONS.each do |k,v|
    if k == transfer_type
      return v
    end
  end
  nil
end