Class: DeployTool::Target::Heroku
Class Method Summary
collapse
Instance Method Summary
collapse
find, from_config, get_json_resource
Constructor Details
#initialize(options) ⇒ Heroku
Returns a new instance of Heroku.
14
15
16
|
# File 'lib/deploytool/target/heroku.rb', line 14
def initialize(options)
@app_name = options['app_name']
end
|
Class Method Details
.create(target_name) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/deploytool/target/heroku.rb', line 18
def self.create(target_name)
app_name = target_name.gsub('.heroku.com', '')
puts `heroku create #{app_name}`
Heroku.new('app_name' => app_name)
end
|
.matches?(target_spec) ⇒ Boolean
2
3
4
|
# File 'lib/deploytool/target/heroku.rb', line 2
def self.matches?(target_spec)
target_spec[/(^|\.)heroku\.com$/]
end
|
Instance Method Details
#push(opts) ⇒ Object
26
27
28
29
|
# File 'lib/deploytool/target/heroku.rb', line 26
def push(opts)
puts `git push -f [email protected]:#{@app_name}.git master`
$?.exitstatus
end
|
#to_h ⇒ Object
6
7
8
|
# File 'lib/deploytool/target/heroku.rb', line 6
def to_h
{:type => "Heroku", :app_name => @app_name}
end
|
#to_s ⇒ Object
10
11
12
|
# File 'lib/deploytool/target/heroku.rb', line 10
def to_s
"%s.heroku.com (Heroku)" % [@app_name]
end
|