Class: Travis::Deploy::Config

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/travis/deploy/config.rb,
lib/travis/deploy/config/builder.rb

Defined Under Namespace

Classes: Builder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(shell, remote, options) ⇒ Config

Returns a new instance of Config.



12
13
14
15
16
17
# File 'lib/travis/deploy/config.rb', line 12

def initialize(shell, remote, options)
  @remote = remote
  @options = options
  @shell = shell
  @env = options['env'] || remote
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



10
11
12
# File 'lib/travis/deploy/config.rb', line 10

def env
  @env
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/travis/deploy/config.rb', line 10

def options
  @options
end

#remoteObject (readonly)

Returns the value of attribute remote.



10
11
12
# File 'lib/travis/deploy/config.rb', line 10

def remote
  @remote
end

#shellObject (readonly)

Returns the value of attribute shell.



10
11
12
# File 'lib/travis/deploy/config.rb', line 10

def shell
  @shell
end

Instance Method Details

#invokeObject



19
20
21
22
# File 'lib/travis/deploy/config.rb', line 19

def invoke
  store unless options['source']
  push unless @env == 'development'
end

#pretendObject



24
25
26
27
# File 'lib/travis/deploy/config.rb', line 24

def pretend
  say 'Config to upload:'
  say YAML.dump(config)
end