Class: CuffSert::BaseAction

Inherits:
Object
  • Object
show all
Defined in:
lib/cuffsert/actions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta, stack) ⇒ BaseAction

Returns a new instance of BaseAction.



11
12
13
14
15
16
17
# File 'lib/cuffsert/actions.rb', line 11

def initialize(meta, stack)
  @cfclient = nil
  @confirmation = nil
  @meta = meta
  @s3client = nil
  @stack = stack
end

Instance Attribute Details

#cfclientObject

Returns the value of attribute cfclient.



9
10
11
# File 'lib/cuffsert/actions.rb', line 9

def cfclient
  @cfclient
end

#confirmationObject

Returns the value of attribute confirmation.



9
10
11
# File 'lib/cuffsert/actions.rb', line 9

def confirmation
  @confirmation
end

#s3clientObject

Returns the value of attribute s3client.



9
10
11
# File 'lib/cuffsert/actions.rb', line 9

def s3client
  @s3client
end

Instance Method Details

#upload_template_if_oversized(cfargs) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/cuffsert/actions.rb', line 19

def upload_template_if_oversized(cfargs)
  if needs_template_upload?(cfargs)
    raise 'Template bigger than 51200; please supply --s3-upload-prefix' unless @s3client
    uri, progress = @s3client.upload(@meta.stack_uri)
    [CuffSert.s3_uri_to_https(uri, @meta.aws_region).to_s, progress]
  else
    [nil, Rx::Observable.empty]
  end
end