Class: Feefi::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/feefi/setup.rb

Class Method Summary collapse

Class Method Details

.create_feefi_configObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/feefi/setup.rb', line 4

def create_feefi_config()
  puts "Setting up #{Feefi::FEEFI_CONFIG_FILE} ..."
  # does directory exist?
  unless Dir.exists? Feefi::FEEFI_CONFIG_PATH
    Dir.mkdir(Feefi::FEEFI_CONFIG_PATH) #unless
  end  
  
  if File.exist?(Feefi::FEEFI_CONFIG_FILE)
    puts "Config file: #{Feefi::FEEFI_CONFIG_FILE} already exists!"
  else
    content = 
      {:apps => [{
            :name => 'my_beanstalk_app',
            :beanstalk_config => {},
            :aws_id => 'ASADFADFSDF',
            :aws_secret => '!@#$!@#!@$',
            :environments => ['staging','production']},
            
        {
            :name => 'my_beanstalk_app2',
            :beanstalk_config => {},
            :aws_id => 'ASADFADFSDF',
            :aws_secret => '!@#$!@#!@$',
            :environments => ['staging','production']}

        ]
        }.to_yaml
    File.open(Feefi::FEEFI_CONFIG_FILE,'w') do |f|
      f << content
    end
  end
end

.upsert_app(app_name, aws_id, aws_secret) ⇒ Object



36
37
38
# File 'lib/feefi/setup.rb', line 36

def upsert_app(app_name,aws_id,aws_secret)
  
end