Module: Hanzo::Installers::Remotes

Included in:
Hanzo::Install
Defined in:
lib/hanzo/modules/installers/remotes.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_remote(app, env) ⇒ Object



12
13
14
15
16
# File 'lib/hanzo/modules/installers/remotes.rb', line 12

def self.add_remote(app, env)
  Hanzo.print "Adding #{env}"
  Hanzo.run "git remote rm #{env} 2>&1 > /dev/null"
  Hanzo.run "git remote add #{env} [email protected]:#{app}.git"
end

.environmentsObject



18
19
20
# File 'lib/hanzo/modules/installers/remotes.rb', line 18

def self.environments
  Hanzo.config['remotes']
end

.installed_environmentsObject



22
23
24
# File 'lib/hanzo/modules/installers/remotes.rb', line 22

def self.installed_environments
  `git remote`.split("\n")
end

Instance Method Details

#install_remotesObject



4
5
6
7
8
9
10
# File 'lib/hanzo/modules/installers/remotes.rb', line 4

def install_remotes
  Hanzo.title 'Creating git remotes'

  Hanzo::Installers::Remotes.environments.each_pair do |env, app|
    Hanzo::Installers::Remotes.add_remote(app, env)
  end
end