lib/shelly/app.rb in shelly-0.1.16 vs lib/shelly/app.rb in shelly-0.1.17

- old
+ new

@@ -7,11 +7,12 @@ DATABASE_KINDS = %w(postgresql mongodb redis) DATABASE_CHOICES = DATABASE_KINDS + %w(none) SERVER_SIZES = %w(small large) attr_accessor :code_name, :databases, :ruby_version, :environment, - :git_url, :domains, :web_server_ip, :mail_server_ip, :size, :thin + :git_url, :domains, :web_server_ip, :mail_server_ip, :size, :thin, + :redeem_code def initialize(code_name = nil) self.code_name = code_name end @@ -39,11 +40,11 @@ def remove_git_remote system("git remote rm #{code_name} > /dev/null 2>&1") end def create - attributes = {:code_name => code_name} + attributes = {:code_name => code_name, :redeem_code => redeem_code} response = shelly.create_app(attributes) self.git_url = response["git_url"] self.domains = response["domains"] self.ruby_version = response["ruby_version"] self.environment = response["environment"] @@ -193,9 +194,17 @@ attributes["git_info"] end def state attributes["state"] + end + + def trial? + !!attributes["trial"] + end + + def credit + attributes["credit"] end def self.inside_git_repository? system("git status > /dev/null 2>&1") end