binarylogic-shippinglogic 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 1.0.6 released 2009-07-09
2
+
3
+ * Reset the cached response if an attribute changes.
4
+
1
5
  == 1.0.5 released 2009-07-08
2
6
 
3
7
  * Added request to error objects so you can see both the raw request and response.
data/Rakefile CHANGED
@@ -6,7 +6,7 @@ begin
6
6
  Jeweler::Tasks.new do |gem|
7
7
  gem.name = "shippinglogic"
8
8
  gem.summary = "A simple and clean library to interface with shipping carriers"
9
- gem.description = "A simple and clean library to interface with shipping carriers"
9
+ gem.description = "Easily use FedEx, UPS, USPS web services with an elegant and simple syntax."
10
10
  gem.email = "bjohnson@binarylogic.com"
11
11
  gem.homepage = "http://github.com/binarylogic/shippinglogic"
12
12
  gem.authors = ["Ben Johnson of Binary Logic"]
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :minor: 0
3
- :patch: 5
3
+ :patch: 6
4
4
  :major: 1
@@ -86,6 +86,7 @@ module Shippinglogic
86
86
  end
87
87
 
88
88
  def write_attribute(name, value)
89
+ reset_target
89
90
  @attributes[name.to_sym] = value
90
91
  end
91
92
 
@@ -31,6 +31,11 @@ module Shippinglogic
31
31
  target.send(name, *args, &block)
32
32
  end
33
33
 
34
+ # Allows the cached response to be reset, specifically when an attribute changes
35
+ def reset_target
36
+ @target = nil
37
+ end
38
+
34
39
  # For each service you need to overwrite this method. This is where you make the call to fedex
35
40
  # and do your magic. See the child classes for examples on how to define this method. It is very
36
41
  # important that you cache the result into a variable to avoid uneccessary requests.
@@ -5,12 +5,12 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{shippinglogic}
8
- s.version = "1.0.5"
8
+ s.version = "1.0.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ben Johnson of Binary Logic"]
12
- s.date = %q{2009-08-08}
13
- s.description = %q{A simple and clean library to interface with shipping carriers}
12
+ s.date = %q{2009-08-09}
13
+ s.description = %q{Easily use FedEx, UPS, USPS web services with an elegant and simple syntax.}
14
14
  s.email = %q{bjohnson@binarylogic.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
@@ -38,4 +38,21 @@ describe "FedEx Attributes" do
38
38
  rates = new_fedex.rate
39
39
  rates.ship_time.to_s.should == Time.now.to_s
40
40
  end
41
+
42
+ it "should reset the cached response if an attribute changes" do
43
+ use_response(:rate_defaults)
44
+
45
+ fedex = new_fedex
46
+ rates = fedex.rate
47
+ rates.attributes = fedex_shipper
48
+ rates.attributes = fedex_recipient
49
+ rates.attributes = fedex_package
50
+ rates.size.should == 6
51
+
52
+ use_response(:rate_non_custom_packaging)
53
+
54
+ rates.packaging_type = "FEDEX_ENVELOPE"
55
+ rates.package_weight = 0.1
56
+ rates.size.should == 5
57
+ end
41
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: binarylogic-shippinglogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-08 00:00:00 -07:00
12
+ date: 2009-08-09 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -42,7 +42,7 @@ dependencies:
42
42
  - !ruby/object:Gem::Version
43
43
  version: 0.4.4
44
44
  version:
45
- description: A simple and clean library to interface with shipping carriers
45
+ description: Easily use FedEx, UPS, USPS web services with an elegant and simple syntax.
46
46
  email: bjohnson@binarylogic.com
47
47
  executables: []
48
48