chargify_api_ares 1.3.2 → 1.3.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c515698fa8c8e719aa022e1bb143c236fdddc446
4
- data.tar.gz: 1ae9b90d69b22894710339581f96a613d2fa3ab4
3
+ metadata.gz: a517de7d585c7a4dd84e53ccdf7fac2e7f6da331
4
+ data.tar.gz: 1e7ae136b2102cecc0bdbdd6ea492a6b191dc40e
5
5
  SHA512:
6
- metadata.gz: 37397b10804eac6f36a94535ba832b182a5e1d16763c614f228d2819e395fcc0adb485642a170011f2fa2dc1d9c4fbc9478067bbf7fc73b8f5333b446347ed87
7
- data.tar.gz: 5cc270208d6326272d5cccebb41cbb38cac0466fc1acdcea10085b1f64f0cc7ae41591795e8db5f1cd0dfa4be236478102d71b32af468357274721529782266f
6
+ metadata.gz: f4f914fc01fafb551dd56686a5de6367c9847213511d1b300edfb366e7b361225e6b6f9ebf2eabc4f6f9d1970aee1067994aedb69c9d06a46538041b026ae4c1
7
+ data.tar.gz: ead4e87f9dc098881bd499a4e98d1f40af7cc3ac9c24f5a14c1382c53af280bba7475440354f7d0ff2e18a6b61daee76bce45b2c020ff34605fc5c2de6d18ee3
data/HISTORY.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.3.3 / Mar 27 2015
2
+
3
+ * When reconfiguring, the site should recalculate based on new settings
4
+
1
5
  ## 1.3.2 / Dec 15 2014
2
6
 
3
7
  * `product_change` and `cancel_delayed_product_change` added to Subscription
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.rubygems_version = '1.3.7'
5
5
 
6
6
  s.name = 'chargify_api_ares'
7
- s.version = '1.3.2'
8
- s.date = '2015-02-20'
7
+ s.version = '1.3.3'
8
+ s.date = '2015-03-27'
9
9
  s.summary = 'A Chargify API wrapper for Ruby using ActiveResource'
10
10
  s.description = ''
11
11
  s.authors = ["Michael Klett", "Nathan Verni", "Jeremy W. Rowe", "Eric Farkas", "Wendy Smoak"]
@@ -3,12 +3,18 @@ module Chargify
3
3
  attr_accessor :subdomain, :api_key, :site, :format, :timeout, :domain, :protocol
4
4
 
5
5
  def configure
6
+ # Since site is dependent on other fields, we erase it before yielding so that it is recalculated based
7
+ # on changes from any of the other settings
8
+ self.site = nil
9
+
6
10
  yield self
11
+
7
12
  self.protocol = protocol || "https"
8
13
  self.domain = domain || "chargify.com"
9
14
  self.format = format || :xml
10
15
  self.subdomain = subdomain || "test"
11
16
  self.site = site || "#{protocol}://#{subdomain}.#{domain}"
17
+
12
18
  Base.site = site
13
19
  Base.user = api_key
14
20
  Base.password = 'X'
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Chargify::Base do
4
-
4
+
5
5
  it 'parses element names' do
6
6
  Chargify::Base.stub!(:name).and_return("Test::Namespace::ElementName")
7
7
  Chargify::Base.element_name.should eql('element_name')
@@ -32,7 +32,22 @@ describe Chargify::Base do
32
32
  end
33
33
  end.to change { Chargify::Base.site.to_s }.to("http://test-site.chargify-test.com")
34
34
  end
35
-
35
+
36
+ it "allows the subdomain and site to be reconfigured" do
37
+ Chargify.configure do |c|
38
+ c.subdomain = "first"
39
+ end
40
+
41
+ expect(Chargify::Base.site.to_s).to eql("https://first.chargify.dev")
42
+
43
+ expect do
44
+ Chargify.configure do |c|
45
+ c.subdomain = "second"
46
+ end
47
+ end.to change { Chargify::Base.site.to_s }.to("https://second.chargify.dev")
48
+
49
+ end
50
+
36
51
  after do
37
52
  Chargify.configure do |c|
38
53
  c.subdomain = @original_subdomain
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chargify_api_ares
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Klett
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2015-02-20 00:00:00.000000000 Z
15
+ date: 2015-03-27 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activeresource