Permalink
Browse files

Merge branch 'master' of https://github.com/Shopify/active_shipping

* 'master' of https://github.com/Shopify/active_shipping:
  We don't want to have ruby version specific dependencies
  Release v0.9.14
  No need to have a begin / end block anymore.
  We do not need to downcase, split and capitalize each word as titleize does this for us.
  Interpolation implicitly calls .to_s
  Add spacing in CanadaPost's service_name
  NZ Post: Add International API and switch to JSON
  Remove invalid CanadaPost test expectation
  Calculates UPS delivery date for rate estimates Closes #38
  • Loading branch information...
jbrowning committed May 17, 2012
2 parents 4d9f4a5 + c93754b commit 22faec578a0daf9dd0906e375b3e89998546d21f
View
@@ -20,6 +20,7 @@ Gem::Specification.new do |s|
s.add_dependency('i18n')
s.add_dependency('active_utils', '>= 1.0.1')
s.add_dependency('builder')
+ s.add_dependency('json', '>= 1.5.1')
s.add_development_dependency('rake')
s.add_development_dependency('mocha')
@@ -153,7 +153,7 @@ def parse_rate_response(response, origin, destination, options = {})
boxes = []
if success
xml.elements.each('eparcel/ratesAndServicesResponse/product') do |product|
- service_name = (@options[:french] ? @@name_french : @@name) + product.get_text('name').to_s
+ service_name = (@options[:french] ? @@name_french : @@name) + " " + product.get_text('name').to_s
service_code = product.attribute('id').to_s
rate_estimates << RateEstimate.new(origin, destination, @@name, service_name,
@@ -122,10 +122,7 @@ class FedEx < Carrier
})
def self.service_name_for_code(service_code)
- ServiceTypes[service_code] || begin
- name = service_code.downcase.split('_').collect{|word| word.capitalize }.join(' ')
- "FedEx #{name.sub(/Fedex /, '')}"
- end
+ ServiceTypes[service_code] || "FedEx #{service_code.titleize.sub(/Fedex /, '')}"
end
def requirements
@@ -386,7 +383,7 @@ def response_success?(document)
def response_message(document)
response_node = response_status_node(document)
- "#{response_status_node(document).get_text('Severity').to_s} - #{response_node.get_text('Code').to_s}: #{response_node.get_text('Message').to_s}"
+ "#{response_status_node(document).get_text('Severity')} - #{response_node.get_text('Code')}: #{response_node.get_text('Message')}"
end
def commit(request, test = false)
Oops, something went wrong.

0 comments on commit 22faec5

Please sign in to comment.