This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rest.get_rest("/cookbooks") | |
| => {"build-essential"=>{"versions"=>[{"version"=>"1.1.0", "url"=>"http://makerservers.com:4000/cookbooks/build-essential/1.1.0"}], "url"=>"http://makerservers.com:4000/cookbooks/build-essential"}, "chef-client"=>{"versions"=>[{"version"=>"1.1.4", "url"=>"http://makerservers.com:4000/cookbooks/chef-client/1.1.4"}], "url"=>"http://makerservers.com:4000/cookbooks/chef-client"}, "openssl"=>{"versions"=>[{"version"=>"1.0.0", "url"=>"http://makerservers.com:4000/cookbooks/openssl/1.0.0"}], "url"=>"http://makerservers.com:4000/cookbooks/openssl"}, "postgresql"=>{"versions"=>[{"version"=>"1.0.0", "url"=>"http://makerservers.com:4000/cookbooks/postgresql/1.0.0"}], "url"=>"http://makerservers.com:4000/cookbooks/postgresql"}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rgumentError: can't get const Chef::ApiClient: uninitialized constant Chef | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:43:in `rescue in block in deep_const_get' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:40:in `block in deep_const_get' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:35:in `each' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:35:in `inject' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:35:in `deep_const_get' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:148:in `parse' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/json-1.6.1/lib/json/common.rb:148:in `parse' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/multi_json-1.3.6/lib/multi_json/adapters/json_common.rb:7:in `load' | |
| from /home/aa/.rvm/gems/ruby-1.9.3-rc1/gems/multi_json-1.3.6/lib/multi_json.rb:93:in `load' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ProvisionServer | |
| @queue = :provision_server | |
| def self.perform(server_id) | |
| @server = Server.find(server_id) | |
| name = SecureRandom.urlsafe_base64(10) | |
| rackspace = CloudServers::Connection.new(:username => RACKSPACE_USER_NAME, :api_key => RACKSPACE_API_KEY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ProvisionServer | |
| @queue = :provision_server | |
| def self.perform(server_id) | |
| @server = Server.find(server_id) | |
| name = SecureRandom.urlsafe_base64(10) | |
| rackspace = CloudServers::Connection.new(:username => RACKSPACE_USER_NAME, :api_key => RACKSPACE_API_KEY) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server.inspect | |
| => "#<Spice::Client:0x0000000640d318 @attrs={\"name\"=>\"amplifyone\", \"chef_type\"=>\"client\", \"public_key\"=>\"-----BEGIN RSA PUBLIC KEY-----\\nMIIBCgKCAQEApTXM3c7kCgEk6zahSKEMaJYALrzL2BPJFVWEgDhG3TilAZZcDcSj\\n6ZXTlEt59sJ8B0HBoJcHHn6Q3WRMtGTA+zFYLxtyMVgc1S9/NDnoSwEmTXgLFG0G\\nvIeYlXijzMh7rvxQjhbM/gMwoeoHkxS36+4/pDUaGQanf8RAltI4ckzKFMlfZv5j\\nIfHjHVVIpWr9TiI0hmE78kg5ix31pawuR9SBykxvVFEKmMnBt0tkcqUd0Z2IpXdJ\\nVi+zT/h6b6vYWIM2RGUVYwkckpbVH5rXXG+OekiF3Uxg0wCvj1sLWyDkpmVceK8m\\nOUC8Dl3y335NFEU99MNo5kapm3B0yIG2NwIDAQAB\\n-----END RSA PUBLIC KEY-----\\n\", \"_rev\"=>\"1-171933e6ae86fc0138445af35cb07578\", \"json_class\"=>\"Chef::ApiClient\", \"admin\"=>false}>" | |
| 1.9.3-p0 :021 > |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This is a manifest file that'll be compiled into application.js, which will include all the files | |
| // listed below. | |
| // | |
| // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
| // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
| // | |
| // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
| // the compiled file. | |
| // | |
| // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create | |
| @subscription = Subscription.new(params[:subscription]) | |
| @user = User.new(params[:user]) | |
| if @user.save | |
| redirect_to "http://google.com" | |
| # @subscription.update_attributes[:user_id => @user.id] | |
| # redirect_to @subscription, :notice => "Thank you for subscribing!" | |
| else | |
| respond_to do |format| | |
| format.html { render action: "new", notice: @user.errors } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| subscriptions/new.html.erb | |
| <div class="account-container register"> | |
| <div class="content clearfix"> | |
| <h1>Create Your Account</h1> | |
| <div class="login-fields"> | |
| <%= form_for(@subscription) do |f| %> | |
| <%= f.hidden_field :stripe_card_token %> | |
| <% if @subscription.stripe_card_token.present? %> | |
| Credit card has been provided. | |
| <% else %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def create | |
| @subscription = Subscription.new(params[:subscription]) | |
| @user = User.new(params[:user]) | |
| if @user.save | |
| redirect_to "http://google.com" | |
| # @subscription.update_attributes[:user_id => @user.id] | |
| # redirect_to @subscription, :notice => "Thank you for subscribing!" | |
| else | |
| respond_to do |format| | |
| format.html { render action: "new", notice: @user.errors } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Subscription < ActiveRecord::Base | |
| belongs_to :user | |
| attr_accessible :user_id, :stripe_card_token | |
| def save_with_payment | |
| if valid? | |
| self.stripe_customer_token = customer.id | |
| save! | |
| end |