saucy 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,9 @@
1
+ 0.6.1
2
+
3
+ Fix for this known bug in Rails 3.0.7
4
+
5
+ https://rails.lighthouseapp.com/projects/8994/tickets/6757-hashfrom_xml-chokes-on-empty-cdata
6
+
1
7
  0.6.0
2
8
 
3
9
  Upgrading to, and making an explicit dependency on Clearance ~> 0.11.0. You can
data/README.md CHANGED
@@ -19,12 +19,11 @@ Installation
19
19
 
20
20
  In your Gemfile:
21
21
 
22
- gem "saucy", :git => 'git@github.com:thoughtbot/saucy.git'
22
+ gem "saucy"
23
23
 
24
- After you bundle, run the generators:
24
+ After you bundle, run the generator:
25
25
 
26
26
  rails generate saucy:install
27
- rails generate saucy:views
28
27
 
29
28
  You will want to include the `ensure_active_account` `before_filter` in any controller actions that you want to protect if the user is using an past due paid account.
30
29
 
@@ -99,6 +98,10 @@ partials:
99
98
 
100
99
  app/views/limits/_#{limitname}_meter.html.erb
101
100
 
101
+ You can override all the views by generating them into your app and customizing them there:
102
+
103
+ rails g saucy:views
104
+
102
105
  ## Gotchas
103
106
 
104
107
  Make sure you don't do this in ApplicationController:
@@ -49,10 +49,13 @@ ShamRack.at("www.braintreegateway.com", 443).sinatra do
49
49
  customer["id"] ||= Digest::MD5.hexdigest("#{params[:merchant_id]}#{Time.now.to_f}")
50
50
  customer["merchant-id"] = params[:merchant_id]
51
51
  if customer["credit_card"] && customer["credit_card"].is_a?(Hash)
52
- customer["credit_card"]["last_4"] = customer["credit_card"].delete("number")[-4..-1]
53
- customer["credit_card"]["token"] = Digest::MD5.hexdigest("#{customer['merchant_id']}#{customer['id']}#{Time.now.to_f}")
54
- credit_card = customer.delete("credit_card")
55
- customer["credit_cards"] = [credit_card]
52
+ customer["credit_card"].delete("__content__")
53
+ if !customer["credit_card"].empty?
54
+ customer["credit_card"]["last_4"] = customer["credit_card"].delete("number")[-4..-1]
55
+ customer["credit_card"]["token"] = Digest::MD5.hexdigest("#{customer['merchant_id']}#{customer['id']}#{Time.now.to_f}")
56
+ credit_card = customer.delete("credit_card")
57
+ customer["credit_cards"] = [credit_card]
58
+ end
56
59
  end
57
60
  FakeBraintree.customers[customer["id"]] = customer
58
61
  [201, { "Content-Encoding" => "gzip" }, ActiveSupport::Gzip.compress(customer.to_xml(:root => 'customer'))]
@@ -72,10 +75,13 @@ ShamRack.at("www.braintreegateway.com", 443).sinatra do
72
75
  customer["id"] = params[:id]
73
76
  customer["merchant-id"] = params[:merchant_id]
74
77
  if customer["credit_card"] && customer["credit_card"].is_a?(Hash)
75
- customer["credit_card"]["last_4"] = customer["credit_card"].delete("number")[-4..-1]
76
- customer["credit_card"]["token"] = Digest::MD5.hexdigest("#{customer['merchant_id']}#{customer['id']}#{Time.now.to_f}")
77
- credit_card = customer.delete("credit_card")
78
- customer["credit_cards"] = [credit_card]
78
+ customer["credit_card"].delete("__content__")
79
+ if !customer["credit_card"].empty?
80
+ customer["credit_card"]["last_4"] = customer["credit_card"].delete("number")[-4..-1]
81
+ customer["credit_card"]["token"] = Digest::MD5.hexdigest("#{customer['merchant_id']}#{customer['id']}#{Time.now.to_f}")
82
+ credit_card = customer.delete("credit_card")
83
+ customer["credit_cards"] = [credit_card]
84
+ end
79
85
  end
80
86
  FakeBraintree.customers[params["id"]] = customer
81
87
  [200, { "Content-Encoding" => "gzip" }, ActiveSupport::Gzip.compress(customer.to_xml(:root => 'customer'))]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-05-02 00:00:00 -04:00
21
+ date: 2011-05-03 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency