Sha256: b8ab0ca740ad63512e7d963f246645fe9a6cc5953c02ff53e9270b23303f07d3

Contents?: true

Size: 767 Bytes

Versions: 21

Compression:

Stored size: 767 Bytes

Contents

class AppCreator
  def self.get_config url
    response = RestClient.post url, :plan => 'test', :heroku_id => 123 
    json = JSON.parse response

    trackman_url = json['config']['TRACKMAN_URL'].gsub('https', 'http')

    [[:@@server_url, trackman_url], [:@@site, "#{trackman_url}/assets"]]
  end

  def self.create
    user = ENV['HEROKU_USERNAME']
    pass = ENV['HEROKU_PASSWORD']
    server = ENV['TRACKMAN_SERVER_URL']

    @@config = get_config "http://#{user}:#{pass}@#{server}/heroku/resources"

    @@config.each do |s, v| 
      RemoteAsset.send(:class_variable_set, s, v)
    end
  end

  def self.reset
    RemoteAsset.all.each do |a|
      a.delete
    end

    @@config.each do |k,v|
      RemoteAsset.send(:class_variable_set, k, v)
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
trackman-0.2.90 spec/helpers/app_creator.rb
trackman-0.2.89 spec/helpers/app_creator.rb
trackman-0.2.88 spec/helpers/app_creator.rb
trackman-0.2.87 spec/helpers/app_creator.rb
trackman-0.2.86 spec/helpers/app_creator.rb
trackman-0.2.85 spec/helpers/app_creator.rb
trackman-0.2.84 spec/helpers/app_creator.rb
trackman-0.2.83 spec/helpers/app_creator.rb
trackman-0.2.82 spec/helpers/app_creator.rb
trackman-0.2.81 spec/helpers/app_creator.rb
trackman-0.2.80 spec/helpers/app_creator.rb
trackman-0.2.65 spec/helpers/app_creator.rb
trackman-0.2.64 spec/helpers/app_creator.rb
trackman-0.2.63 spec/helpers/app_creator.rb
trackman-0.2.62 spec/helpers/app_creator.rb
trackman-0.2.61 spec/helpers/app_creator.rb
trackman-0.2.5 spec/helpers/app_creator.rb
trackman-0.2.4 spec/helpers/app_creator.rb
trackman-0.2.3 spec/helpers/app_creator.rb
trackman-0.2.1 spec/helpers/app_creator.rb