Class: Sup::Api::Status

Inherits:
Base
  • Object
show all
Defined in:
lib/sup/api.rb

Class Method Summary collapse

Class Method Details

.add(attributes) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sup/api.rb', line 13

def self.add(attributes)
  unless self.project_id
    render "You're not in an UtSup project.  Run 'sup init' to add this directory.".in_red
    return false
  end
  
  create attributes.merge({:project_id => @@project_id, :branch => Sup::current_branch_name, :version => VERSION})
  
rescue ActiveResource::ResourceNotFound
  render "Your project_id was invalid, check #{PROJECT_CONFIG_PATH}".in_red
rescue SocketError
  Sup::socket_error
end