Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* Rails uses United States not United State of America

  • Loading branch information...
commit 86860d0a790b228bc3bac36ddd47c553ec9dadfe 1 parent 0d8e3a4
Ben Johnson authored
8 CHANGELOG.rdoc
View
@@ -1,7 +1,11 @@
-== 1.0.2
+== 1.0.3 released 2009-07-08
+
+* Rails uses United States not United State of America
+
+== 1.0.2 released 2009-07-08
* Remove notifications with a successful severity in the errors message.
-* Added country code mapping so that we can pass full country named and have it convert it to a FedEx friendly code behind the scenes.
+* Added country code mapping so that we can pass full country names and have it convert it to a FedEx friendly code behind the scenes.
== 1.0.1 released 2009-07-08
14 Rakefile
View
@@ -11,10 +11,11 @@ begin
gem.homepage = "http://github.com/binarylogic/shippinglogic"
gem.authors = ["Ben Johnson of Binary Logic"]
gem.rubyforge_project = "shippinglogic"
+ gem.add_development_dependency "rspec"
gem.add_dependency "activesupport", ">= 2.2.0"
gem.add_dependency "httparty", ">= 0.4.4"
end
-
+ Jeweler::RubyforgeTasks.new
rescue LoadError
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
end
@@ -32,14 +33,3 @@ Spec::Rake::SpecTask.new(:rcov) do |spec|
end
task :default => :spec
-
-begin
- require 'rake/contrib/sshpublisher'
- namespace :rubyforge do
- desc "Release gem to RubyForge"
- task :release => ["rubyforge:release:gem"]
- end
-rescue LoadError
- puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
-end
-
7 lib/shippinglogic/fedex/enumerations.rb
View
@@ -59,7 +59,7 @@ module Enumerations
DROP_OFF_TYPES = ["REGULAR_PICKUP", "REQUEST_COURIER", "DROP_BOX", "BUSINESS_SERVICE_CENTER", "STATION"]
RATE_REQUEST_TYPES = ["ACCOUNT", "LIST", "MULTIWEIGHT"]
- COUNTRY_CODES = {
+ FEDEX_COUNTRY_CODES = {
"Albania" => "AL",
"Algeria" => "DZ",
"American Samoa" => "AS",
@@ -246,7 +246,6 @@ module Enumerations
"U.A.E." => "AE",
"U.S. Virgin Islands" => "VI",
"U.S.A." => "US",
- "United States of America" => "US",
"Uganda" => "UG",
"Ukraine" => "UA",
"United Kingdom" => "GB",
@@ -261,6 +260,10 @@ module Enumerations
"Zambia" => "ZM",
"Zimbabwe" => "ZW"
}
+
+ RAILS_COUNTRY_CODES = {
+ "United States" => "US"
+ }
end
end
end
6 lib/shippinglogic/fedex/request.rb
View
@@ -92,11 +92,7 @@ def custom_packaging?
end
def country_code(value)
- if Enumerations::COUNTRY_CODES.key?(value.to_s)
- Enumerations::COUNTRY_CODES[value.to_s]
- else
- value.to_s
- end
+ Enumerations::FEDEX_COUNTRY_CODES[value.to_s] || Enumerations::RAILS_COUNTRY_CODES[value.to_s] || value.to_s
end
end
end
3  shippinglogic.gemspec
View
@@ -92,13 +92,16 @@ Gem::Specification.new do |s|
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<rspec>, [">= 0"])
s.add_runtime_dependency(%q<activesupport>, [">= 2.2.0"])
s.add_runtime_dependency(%q<httparty>, [">= 0.4.4"])
else
+ s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<activesupport>, [">= 2.2.0"])
s.add_dependency(%q<httparty>, [">= 0.4.4"])
end
else
+ s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<activesupport>, [">= 2.2.0"])
s.add_dependency(%q<httparty>, [">= 0.4.4"])
end
2  spec/fedex/request_spec.rb
View
@@ -4,6 +4,6 @@
it "should convert full country names to country codes" do
fedex = new_fedex
rates = fedex.rate
- rates.send(:country_code, "United States of America").should == "US"
+ rates.send(:country_code, "United States").should == "US"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.