Class: Pah::Templates::Config

Inherits:
Pah::Template
  • Object
show all
Defined in:
lib/pah/templates/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Pah::Template

#ask_unless_test, #copy_static_file, #git_commit, #static_files, #will_you_like_to?

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/pah/templates/config.rb', line 4

def config
  @config
end

Instance Method Details

#callObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/pah/templates/config.rb', line 6

def call
  if create_heroku_app?
    deploy_to_heroku?
    add_custom_domain?

    create_app_on_heroku!

    add_collaborators?
  end
end

#create_app_on_heroku!Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/pah/templates/config.rb', line 17

def create_app_on_heroku!
  

  created = false
  until created
    how_do_you_want_to_name_the_app?

    say "Creating Heroku app '#{Pah.configuration.heroku[:name]}.herokuapp.com'".green

    created = system "heroku create #{Pah.configuration.heroku[:name]}"

    unless created
      puts "Heroku '#{Pah.configuration.heroku[:name]}' app already exists or could not be created, please provide a new name".yellow
    end
  end
end