Sha256: f4f2c6ef4ed3ecf3ac348642b941a869278595ad597e80c7e0153954a5f11e6f
Contents?: true
Size: 938 Bytes
Versions: 2
Compression:
Stored size: 938 Bytes
Contents
require 'engineyard/account/app' require 'engineyard/account/app_master' require 'engineyard/account/environment' require 'engineyard/account/log' module EY class Account def initialize(api) @api = api end def request(path, options = { }) @api.request(path, {:method => :get}.merge(options)) end def environments return @environments if @environments data = request('/environments')["environments"] @environments = Environment.from_array(data || [], self) end def environment_named(name) environments.find{|e| e.name == name } end def apps return @apps if @apps data = @api.request('/apps')["apps"] @apps = App.from_array(data || [], self) end def app_named(name) apps.find{|a| a.name == name } end def app_for_repo(repo) apps.find{|a| repo.urls.include?(a.repository_url) } end end # Account end # EY
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
engineyard-0.2.11 | lib/engineyard/account.rb |
engineyard-0.2.10 | lib/engineyard/account.rb |