Class: Jack::Config::Transmit

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/jack/config/transmit.rb

Direct Known Subclasses

Apply, Get, Sort

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util

#app_name_convention, #aws_bin, #check_aws_setup, #confirm, #eb, #eb_base_flags, #eb_bin, #ensure_folder_exist, #get_answer, #get_region, #prerequisites, #settings, #sh

Constructor Details

#initialize(options = {}) ⇒ Transmit

Returns a new instance of Transmit.



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/jack/config/transmit.rb', line 10

def initialize(options={})
  @options = options
  @root = options[:root] || '.'
  @env_name = options[:env_name]
  @app_name = @options[:app] || app_name_convention(@env_name)

  @saved_configs = "#{@root}/.elasticbeanstalk/saved_configs"

  local_config_name = options[:cfg] || @env_name
  @local_config_path = "jack/cfg/#{local_config_name}.cfg.yml"
end

Instance Attribute Details

#local_config_pathObject (readonly)

Returns the value of attribute local_config_path.



9
10
11
# File 'lib/jack/config/transmit.rb', line 9

def local_config_path
  @local_config_path
end

Instance Method Details

#extract_name(path) ⇒ Object



26
27
28
# File 'lib/jack/config/transmit.rb', line 26

def extract_name(path)
  path.split('/').last.sub('.cfg.yml','')
end

#timestampObject



22
23
24
# File 'lib/jack/config/transmit.rb', line 22

def timestamp
  Time.now.strftime "%Y-%m-%d_%H-%M-%S"
end