ebayapi 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. data/CHANGELOG +7 -0
  2. data/Rakefile +62 -61
  3. data/examples/end_item.rb +3 -1
  4. data/lib/ebay.rb +0 -7
  5. data/lib/ebay/api_methods.rb +8 -24
  6. data/lib/ebay/inflections.rb +1 -0
  7. data/lib/ebay/requests.rb +1 -3
  8. data/lib/ebay/requests/abstract.rb +5 -0
  9. data/lib/ebay/requests/fetch_token.rb +2 -0
  10. data/lib/ebay/requests/get_category_specifics.rb +23 -0
  11. data/lib/ebay/requests/get_item.rb +2 -0
  12. data/lib/ebay/requests/get_item_transactions.rb +2 -0
  13. data/lib/ebay/requests/get_order_transactions.rb +2 -0
  14. data/lib/ebay/requests/get_seller_transactions.rb +2 -0
  15. data/lib/ebay/requests/get_store.rb +2 -0
  16. data/lib/ebay/requests/place_offer.rb +3 -0
  17. data/lib/ebay/responses.rb +1 -3
  18. data/lib/ebay/responses/abstract.rb +3 -0
  19. data/lib/ebay/responses/fetch_token.rb +2 -0
  20. data/lib/ebay/responses/get_category_specifics.rb +16 -0
  21. data/lib/ebay/responses/get_ebay_details.rb +6 -0
  22. data/lib/ebay/schema/version.rb +1 -1
  23. data/lib/ebay/types.rb +3 -1
  24. data/lib/ebay/types/ad_format_enabled_code.rb +1 -0
  25. data/lib/ebay/types/{operation_type_code.rb → auth_token_type_code.rb} +3 -3
  26. data/lib/ebay/types/bot_block_request.rb +17 -0
  27. data/lib/ebay/types/bot_block_response.rb +19 -0
  28. data/lib/ebay/types/category_feature.rb +2 -0
  29. data/lib/ebay/types/category_item_specifics.rb +20 -0
  30. data/lib/ebay/types/category_listings_order_code.rb +2 -0
  31. data/lib/ebay/types/country_code.rb +3 -0
  32. data/lib/ebay/types/currency_code.rb +1 -0
  33. data/lib/ebay/types/detail_name_code.rb +2 -0
  34. data/lib/ebay/types/feature_definitions.rb +3 -0
  35. data/lib/ebay/types/feature_id_code.rb +1 -0
  36. data/lib/ebay/types/get_recommendations_response_container.rb +3 -0
  37. data/lib/ebay/types/item.rb +0 -2
  38. data/lib/ebay/types/item_specific_details.rb +21 -0
  39. data/lib/ebay/types/item_specific_source_code.rb +12 -0
  40. data/lib/ebay/types/item_specifics_enabled_code.rb +11 -0
  41. data/lib/ebay/types/item_specifics_enabled_definition.rb +13 -0
  42. data/lib/ebay/types/item_specifics_recommendations.rb +16 -0
  43. data/lib/ebay/types/motors_local_market_enabled_definition.rb +13 -0
  44. data/lib/ebay/types/name_value_list.rb +2 -0
  45. data/lib/ebay/types/notification_event_type_code.rb +1 -0
  46. data/lib/ebay/types/order.rb +0 -2
  47. data/lib/ebay/types/promotion_rule.rb +0 -5
  48. data/lib/ebay/types/recommendation_engine_code.rb +1 -0
  49. data/lib/ebay/types/search_sort_order_code.rb +2 -0
  50. data/lib/ebay/types/selling_manager_product_details.rb +8 -0
  51. data/lib/ebay/types/shipping_carrier_code.rb +5 -0
  52. data/lib/ebay/types/shipping_package_code.rb +12 -0
  53. data/lib/ebay/types/shipping_service_code.rb +72 -0
  54. data/lib/ebay/types/shipping_service_details.rb +10 -0
  55. data/lib/ebay/types/site_defaults.rb +2 -0
  56. data/lib/ebay/types/transaction.rb +6 -2
  57. data/lib/ebay/types/unit_of_measurement.rb +17 -0
  58. data/lib/ebay/types/unit_of_measurement_details.rb +16 -0
  59. data/lib/support/xml_mapping/money_node.rb +1 -1
  60. data/lib/support/xml_mapping/time_node.rb +2 -1
  61. data/rakefile +62 -61
  62. data/test/{unit → mapping}/class_definition_test.rb +1 -0
  63. data/test/{unit → mapping}/generate_from_xsd.rb +2 -0
  64. data/test/{unit → mapping}/mapping_subclass_test.rb +1 -0
  65. data/test/{unit → mapping}/node_test.rb +1 -0
  66. data/test/{unit → mapping}/template_test.rb +1 -0
  67. data/test/test_helper.rb +0 -9
  68. data/test/unit/xml_mapping_money_node_test.rb +8 -1
  69. metadata +22 -25
  70. data/lib/ebay/requests/get_category2_finance_offer.rb +0 -17
  71. data/lib/ebay/requests/get_finance_offers.rb +0 -17
  72. data/lib/ebay/requests/set_promotion_rules.rb +0 -18
  73. data/lib/ebay/responses/get_category2_finance_offer.rb +0 -18
  74. data/lib/ebay/responses/get_finance_offers.rb +0 -18
  75. data/lib/ebay/responses/set_promotion_rules.rb +0 -13
  76. data/lib/ebay/types/category_finance_offer.rb +0 -17
  77. data/lib/ebay/types/finance_offer.rb +0 -29
@@ -0,0 +1,13 @@
1
+
2
+ module Ebay # :nodoc:
3
+ module Types # :nodoc:
4
+ # == Attributes
5
+ class MotorsLocalMarketEnabledDefinition
6
+ include XML::Mapping
7
+ include Initializer
8
+ root_element_name 'MotorsLocalMarketEnabledDefinition'
9
+ end
10
+ end
11
+ end
12
+
13
+
@@ -4,12 +4,14 @@ module Ebay # :nodoc:
4
4
  # == Attributes
5
5
  # text_node :name, 'Name', :optional => true
6
6
  # text_node :value, 'Value', :optional => true
7
+ # text_node :source, 'Source', :optional => true
7
8
  class NameValueList
8
9
  include XML::Mapping
9
10
  include Initializer
10
11
  root_element_name 'NameValueList'
11
12
  text_node :name, 'Name', :optional => true
12
13
  text_node :value, 'Value', :optional => true
14
+ text_node :source, 'Source', :optional => true
13
15
  end
14
16
  end
15
17
  end
@@ -45,6 +45,7 @@ module Ebay # :nodoc:
45
45
  AccountSuspended = 'AccountSuspended'
46
46
  AccountSummary = 'AccountSummary'
47
47
  ThirdPartyCartCheckout = 'ThirdPartyCartCheckout'
48
+ ItemRevisedAddCharity = 'ItemRevisedAddCharity'
48
49
  end
49
50
  end
50
51
  end
@@ -17,7 +17,6 @@ module Ebay # :nodoc:
17
17
  # object_node :shipping_details, 'ShippingDetails', :class => ShippingDetails, :optional => true
18
18
  # text_node :creating_user_role, 'CreatingUserRole', :optional => true
19
19
  # time_node :created_time, 'CreatedTime', :optional => true
20
- # text_node :finance_offer_id, 'FinanceOfferID', :optional => true
21
20
  # value_array_node :payment_methods, 'PaymentMethods', :default_value => []
22
21
  # text_node :seller_email, 'SellerEmail', :optional => true
23
22
  # object_node :shipping_address, 'ShippingAddress', :class => Address, :optional => true
@@ -41,7 +40,6 @@ module Ebay # :nodoc:
41
40
  object_node :shipping_details, 'ShippingDetails', :class => ShippingDetails, :optional => true
42
41
  text_node :creating_user_role, 'CreatingUserRole', :optional => true
43
42
  time_node :created_time, 'CreatedTime', :optional => true
44
- text_node :finance_offer_id, 'FinanceOfferID', :optional => true
45
43
  value_array_node :payment_methods, 'PaymentMethods', :default_value => []
46
44
  text_node :seller_email, 'SellerEmail', :optional => true
47
45
  object_node :shipping_address, 'ShippingAddress', :class => Address, :optional => true
@@ -1,10 +1,7 @@
1
- require 'ebay/types/promoted_item'
2
1
 
3
2
  module Ebay # :nodoc:
4
3
  module Types # :nodoc:
5
4
  # == Attributes
6
- # array_node :promoted_items, 'PromotedItem', :class => PromotedItem, :default_value => []
7
- # text_node :site_id, 'SiteID', :optional => true
8
5
  # numeric_node :promoted_store_category_id, 'PromotedStoreCategoryID', :optional => true
9
6
  # text_node :promoted_ebay_category_id, 'PromotedeBayCategoryID', :optional => true
10
7
  # text_node :promoted_keywords, 'PromotedKeywords', :optional => true
@@ -18,8 +15,6 @@ module Ebay # :nodoc:
18
15
  include XML::Mapping
19
16
  include Initializer
20
17
  root_element_name 'PromotionRule'
21
- array_node :promoted_items, 'PromotedItem', :class => PromotedItem, :default_value => []
22
- text_node :site_id, 'SiteID', :optional => true
23
18
  numeric_node :promoted_store_category_id, 'PromotedStoreCategoryID', :optional => true
24
19
  text_node :promoted_ebay_category_id, 'PromotedeBayCategoryID', :optional => true
25
20
  text_node :promoted_keywords, 'PromotedKeywords', :optional => true
@@ -7,6 +7,7 @@ module Ebay # :nodoc:
7
7
  SIFFTAS = 'SIFFTAS'
8
8
  ProductPricing = 'ProductPricing'
9
9
  SuggestedAttributes = 'SuggestedAttributes'
10
+ ItemSpecifics = 'ItemSpecifics'
10
11
  end
11
12
  end
12
13
  end
@@ -20,6 +20,8 @@ module Ebay # :nodoc:
20
20
  SortByBidCountDesc = 'SortByBidCountDesc'
21
21
  BestMatchSort = 'BestMatchSort'
22
22
  BestMatchCategoryGroup = 'BestMatchCategoryGroup'
23
+ PricePlusShippingAsc = 'PricePlusShippingAsc'
24
+ PricePlusShippingDesc = 'PricePlusShippingDesc'
23
25
  end
24
26
  end
25
27
  end
@@ -5,6 +5,10 @@ module Ebay # :nodoc:
5
5
  # text_node :product_name, 'ProductName', :optional => true
6
6
  # numeric_node :part_number, 'PartNumber', :optional => true
7
7
  # text_node :product_part_number, 'ProductPartNumber', :optional => true
8
+ # text_node :product_id, 'ProductID', :optional => true
9
+ # text_node :custom_label, 'CustomLabel', :optional => true
10
+ # numeric_node :quantity_available, 'QuantityAvailable', :optional => true
11
+ # money_node :unit_cost, 'UnitCost', :optional => true
8
12
  class SellingManagerProductDetails
9
13
  include XML::Mapping
10
14
  include Initializer
@@ -12,6 +16,10 @@ module Ebay # :nodoc:
12
16
  text_node :product_name, 'ProductName', :optional => true
13
17
  numeric_node :part_number, 'PartNumber', :optional => true
14
18
  text_node :product_part_number, 'ProductPartNumber', :optional => true
19
+ text_node :product_id, 'ProductID', :optional => true
20
+ text_node :custom_label, 'CustomLabel', :optional => true
21
+ numeric_node :quantity_available, 'QuantityAvailable', :optional => true
22
+ money_node :unit_cost, 'UnitCost', :optional => true
15
23
  end
16
24
  end
17
25
  end
@@ -10,6 +10,11 @@ module Ebay # :nodoc:
10
10
  Hermes = 'Hermes'
11
11
  ILoxx = 'iLoxx'
12
12
  Other = 'Other'
13
+ ColiposteDomestic = 'ColiposteDomestic'
14
+ ColiposteInternational = 'ColiposteInternational'
15
+ Chronopost = 'Chronopost'
16
+ Correos = 'Correos'
17
+ Seur = 'Seur'
13
18
  end
14
19
  end
15
20
  end
@@ -21,6 +21,18 @@ module Ebay # :nodoc:
21
21
  Motorbikes = 'Motorbikes'
22
22
  Caravan = 'Caravan'
23
23
  IndustryVehicles = 'IndustryVehicles'
24
+ ParcelOrPaddedEnvelope = 'ParcelOrPaddedEnvelope'
25
+ SmallCanadaPostBox = 'SmallCanadaPostBox'
26
+ MediumCanadaPostBox = 'MediumCanadaPostBox'
27
+ LargeCanadaPostBox = 'LargeCanadaPostBox'
28
+ SmallCanadaPostBubbleMailer = 'SmallCanadaPostBubbleMailer'
29
+ MediumCanadaPostBubbleMailer = 'MediumCanadaPostBubbleMailer'
30
+ LargeCanadaPostBubbleMailer = 'LargeCanadaPostBubbleMailer'
31
+ PaddedBags = 'PaddedBags'
32
+ ToughBags = 'ToughBags'
33
+ ExpandableToughBags = 'ExpandableToughBags'
34
+ MailingBoxes = 'MailingBoxes'
35
+ Winepak = 'Winepak'
24
36
  end
25
37
  end
26
38
  end
@@ -431,6 +431,78 @@ module Ebay # :nodoc:
431
431
  USPSFirstClassMailInternational = 'USPSFirstClassMailInternational'
432
432
  USPSPriorityMailInternational = 'USPSPriorityMailInternational'
433
433
  USPSExpressMailInternational = 'USPSExpressMailInternational'
434
+ CHStandardInternational = 'CH_StandardInternational'
435
+ CHExpeditedInternational = 'CH_ExpeditedInternational'
436
+ CHSonstigerVersandSieheArtikelbeschreibung = 'CH_SonstigerVersandSieheArtikelbeschreibung'
437
+ TWStandardInternationalFixedRate = 'TW_StandardInternationalFixedRate'
438
+ TWExpeditedInternationalFixedRate = 'TW_ExpeditedInternationalFixedRate'
439
+ USPSGlobalExpressGuaranteed = 'USPSGlobalExpressGuaranteed'
440
+ AURegularWithInsurance = 'AU_RegularWithInsurance'
441
+ AUExpressWithInsurance = 'AU_ExpressWithInsurance'
442
+ DEDeutschePostWarensendungInternational = 'DE_DeutschePostWarensendungInternational'
443
+ DEDeutschePostByendung = 'DE_DeutschePostByendung'
444
+ DEHermesPaketUnversichertInternational = 'DE_HermesPaketUnversichertInternational'
445
+ DEHermesPaketVersichertInternational = 'DE_HermesPaketVersichertInternational'
446
+ DEILoxxTransportXXLInternational = 'DE_iLoxxTransportXXLInternational'
447
+ DEILoxxUbernachtExpressInternational = 'DE_iLoxxUbernachtExpressInternational'
448
+ DEILoxxStandardInternational = 'DE_iLoxxStandardInternational'
449
+ DEStandardInternational = 'DE_StandardInternational'
450
+ DEExpeditedInternational = 'DE_ExpeditedInternational'
451
+ ATBitteTreffenSieEineAuswahl = 'AT_BitteTreffenSieEineAuswahl'
452
+ ATEinschreibenVersandInklEinschreibengebuhr = 'AT_EinschreibenVersandInklEinschreibengebuhr'
453
+ ATNachnahmeVersandInklNachnahmegebuhr = 'AT_NachnahmeVersandInklNachnahmegebuhr'
454
+ ATExpressOrCourierInternational = 'AT_ExpressOrCourierInternational'
455
+ ATInsuredExpressOrCourierInternational = 'AT_InsuredExpressOrCourierInternational'
456
+ ATSpecialDispatchInternational = 'AT_SpecialDispatchInternational'
457
+ ATInsuredSpecialDispatchInternational = 'AT_InsuredSpecialDispatchInternational'
458
+ ATStandardInternational = 'AT_StandardInternational'
459
+ ATExpeditedInternational = 'AT_ExpeditedInternational'
460
+ ATOtherInternationalShipping = 'AT_OtherInternationalShipping'
461
+ CHBitteTreffenSieEineAuswahl = 'CH_BitteTreffenSieEineAuswahl'
462
+ CHUnversicherterVersand = 'CH_UnversicherterVersand'
463
+ CHVersicherterVersand = 'CH_VersicherterVersand'
464
+ CHEinschreibenVersandInklEinschreibengebuhr = 'CH_EinschreibenVersandInklEinschreibengebuhr'
465
+ CHNachnahmeVersandInklNachnahmegebuhr = 'CH_NachnahmeVersandInklNachnahmegebuhr'
466
+ CHExpressOrCourierInternational = 'CH_ExpressOrCourierInternational'
467
+ CHInsuredExpressOrCourierInternational = 'CH_InsuredExpressOrCourierInternational'
468
+ CHSonderversandZBSperrgutKFZ = 'CH_SonderversandZBSperrgutKFZ'
469
+ CHVersicherterSonderversandZBSperrgutKFZ = 'CH_VersicherterSonderversandZBSperrgutKFZ'
470
+ CHStandardversandAPostPriority = 'CH_StandardversandAPostPriority'
471
+ CHStandardversandBPostEconomy = 'CH_StandardversandBPostEconomy'
472
+ DEBitteTreffenSieEineAuswahl = 'DE_BitteTreffenSieEineAuswahl'
473
+ DEEinschreibenVersandInklEinschreibengebuhr = 'DE_EinschreibenVersandInklEinschreibengebuhr'
474
+ DENachnahmeVersandInklNachnahmegebuhr = 'DE_NachnahmeVersandInklNachnahmegebuhr'
475
+ DEExpressOrCourierInternational = 'DE_ExpressOrCourierInternational'
476
+ DEInsuredExpressOrCourierInternational = 'DE_InsuredExpressOrCourierInternational'
477
+ DESonderversandZBMobelKFZ = 'DE_SonderversandZBMobelKFZ'
478
+ DEVersicherterSonderversandZBMobelKFZ = 'DE_VersicherterSonderversandZBMobelKFZ'
479
+ DEDeutschePostBriefInternational = 'DE_DeutschePostBriefInternational'
480
+ IEStandardInternationalFlatRatePostage = 'IE_StandardInternationalFlatRatePostage'
481
+ IEExpeditedInternationalFlatRatePostage = 'IE_ExpeditedInternationalFlatRatePostage'
482
+ IEOtherInternationalPostage = 'IE_OtherInternationalPostage'
483
+ UKStandardInternationalFlatRatePostage = 'UK_StandardInternationalFlatRatePostage'
484
+ UKExpeditedInternationalFlatRatePostage = 'UK_ExpeditedInternationalFlatRatePostage'
485
+ UKOtherInternationalPostage = 'UK_OtherInternationalPostage'
486
+ FRChronopostChronoRelais = 'FR_ChronopostChronoRelais'
487
+ FRChrono10 = 'FR_Chrono10'
488
+ FRChrono13 = 'FR_Chrono13'
489
+ FRChrono18 = 'FR_Chrono18'
490
+ FRChronopostExpressInternational = 'FR_ChronopostExpressInternational'
491
+ Pickup = 'Pickup'
492
+ Delivery = 'Delivery'
493
+ CAPickup = 'CA_Pickup'
494
+ DEPickup = 'DE_Pickup'
495
+ AUPickup = 'AU_Pickup'
496
+ FRPickup = 'FR_Pickup'
497
+ ATPickup = 'AT_Pickup'
498
+ BENLPickup = 'BENL_Pickup'
499
+ BEFRPickup = 'BEFR_Pickup'
500
+ CHPickup = 'CH_Pickup'
501
+ ITPickup = 'IT_Pickup'
502
+ NLPickup = 'NL_Pickup'
503
+ PLPickup = 'PL_Pickup'
504
+ ESPickup = 'ES_Pickup'
505
+ SGDelivery = 'SG_Delivery'
434
506
  end
435
507
  end
436
508
  end
@@ -10,6 +10,11 @@ module Ebay # :nodoc:
10
10
  # numeric_node :shipping_time_max, 'ShippingTimeMax', :optional => true
11
11
  # numeric_node :shipping_time_min, 'ShippingTimeMin', :optional => true
12
12
  # text_node :shipping_service_code, 'ShippingServiceCode', :optional => true
13
+ # value_array_node :service_types, 'ServiceType', :default_value => []
14
+ # value_array_node :shipping_packages, 'ShippingPackage', :default_value => []
15
+ # boolean_node :dimensions_required, 'DimensionsRequired', 'true', 'false', :optional => true
16
+ # boolean_node :valid_for_selling_flow, 'ValidForSellingFlow', 'true', 'false', :optional => true
17
+ # boolean_node :surcharge_applicable, 'SurchargeApplicable', 'true', 'false', :optional => true
13
18
  class ShippingServiceDetails
14
19
  include XML::Mapping
15
20
  include Initializer
@@ -22,6 +27,11 @@ module Ebay # :nodoc:
22
27
  numeric_node :shipping_time_max, 'ShippingTimeMax', :optional => true
23
28
  numeric_node :shipping_time_min, 'ShippingTimeMin', :optional => true
24
29
  text_node :shipping_service_code, 'ShippingServiceCode', :optional => true
30
+ value_array_node :service_types, 'ServiceType', :default_value => []
31
+ value_array_node :shipping_packages, 'ShippingPackage', :default_value => []
32
+ boolean_node :dimensions_required, 'DimensionsRequired', 'true', 'false', :optional => true
33
+ boolean_node :valid_for_selling_flow, 'ValidForSellingFlow', 'true', 'false', :optional => true
34
+ boolean_node :surcharge_applicable, 'SurchargeApplicable', 'true', 'false', :optional => true
25
35
  end
26
36
  end
27
37
  end
@@ -42,6 +42,7 @@ module Ebay # :nodoc:
42
42
  # boolean_node :classified_ad_contact_by_email_enabled, 'ClassifiedAdContactByEmailEnabled', 'true', 'false', :optional => true
43
43
  # boolean_node :safe_payment_required, 'SafePaymentRequired', 'true', 'false', :optional => true
44
44
  # boolean_node :classified_ad_pay_per_lead_enabled, 'ClassifiedAdPayPerLeadEnabled', 'true', 'false', :optional => true
45
+ # text_node :item_specifics_enabled, 'ItemSpecificsEnabled', :optional => true
45
46
  class SiteDefaults
46
47
  include XML::Mapping
47
48
  include Initializer
@@ -85,6 +86,7 @@ module Ebay # :nodoc:
85
86
  boolean_node :classified_ad_contact_by_email_enabled, 'ClassifiedAdContactByEmailEnabled', 'true', 'false', :optional => true
86
87
  boolean_node :safe_payment_required, 'SafePaymentRequired', 'true', 'false', :optional => true
87
88
  boolean_node :classified_ad_pay_per_lead_enabled, 'ClassifiedAdPayPerLeadEnabled', 'true', 'false', :optional => true
89
+ text_node :item_specifics_enabled, 'ItemSpecificsEnabled', :optional => true
88
90
  end
89
91
  end
90
92
  end
@@ -47,7 +47,9 @@ module Ebay # :nodoc:
47
47
  # object_node :listing_checkout_redirect_preference, 'ListingCheckoutRedirectPreference', :class => ListingCheckoutRedirectPreference, :optional => true
48
48
  # array_node :refunds, 'RefundArray', 'Refund', :class => Refund, :default_value => []
49
49
  # text_node :transaction_site_id, 'TransactionSiteID', :optional => true
50
- # text_node :transaction_cobrand_id, 'TransactionCobrandID', :optional => true
50
+ # text_node :platform, 'Platform', :optional => true
51
+ # text_node :cart_id, 'CartID', :optional => true
52
+ # boolean_node :seller_contact_buyer_by_email, 'SellerContactBuyerByEmail', 'true', 'false', :optional => true
51
53
  class Transaction
52
54
  include XML::Mapping
53
55
  include Initializer
@@ -86,7 +88,9 @@ module Ebay # :nodoc:
86
88
  object_node :listing_checkout_redirect_preference, 'ListingCheckoutRedirectPreference', :class => ListingCheckoutRedirectPreference, :optional => true
87
89
  array_node :refunds, 'RefundArray', 'Refund', :class => Refund, :default_value => []
88
90
  text_node :transaction_site_id, 'TransactionSiteID', :optional => true
89
- text_node :transaction_cobrand_id, 'TransactionCobrandID', :optional => true
91
+ text_node :platform, 'Platform', :optional => true
92
+ text_node :cart_id, 'CartID', :optional => true
93
+ boolean_node :seller_contact_buyer_by_email, 'SellerContactBuyerByEmail', 'true', 'false', :optional => true
90
94
  end
91
95
  end
92
96
  end
@@ -0,0 +1,17 @@
1
+
2
+ module Ebay # :nodoc:
3
+ module Types # :nodoc:
4
+ # == Attributes
5
+ # text_node :alternate_text, 'AlternateText', :optional => true
6
+ # text_node :suggested_text, 'SuggestedText', :optional => true
7
+ class UnitOfMeasurement
8
+ include XML::Mapping
9
+ include Initializer
10
+ root_element_name 'UnitOfMeasurement'
11
+ text_node :alternate_text, 'AlternateText', :optional => true
12
+ text_node :suggested_text, 'SuggestedText', :optional => true
13
+ end
14
+ end
15
+ end
16
+
17
+
@@ -0,0 +1,16 @@
1
+ require 'ebay/types/unit_of_measurement'
2
+
3
+ module Ebay # :nodoc:
4
+ module Types # :nodoc:
5
+ # == Attributes
6
+ # array_node :unit_of_measurements, 'UnitOfMeasurement', :class => UnitOfMeasurement, :default_value => []
7
+ class UnitOfMeasurementDetails
8
+ include XML::Mapping
9
+ include Initializer
10
+ root_element_name 'UnitOfMeasurementDetails'
11
+ array_node :unit_of_measurements, 'UnitOfMeasurement', :class => UnitOfMeasurement, :default_value => []
12
+ end
13
+ end
14
+ end
15
+
16
+
@@ -16,7 +16,7 @@ class MoneyNode < XML::Mapping::SingleAttributeNode
16
16
 
17
17
  def set_attr_value(xml, value)
18
18
  raise "Not a Money object: #{value}" unless Money === value
19
- @amount_path.first(xml, :ensure_created => true).text = value.cents
19
+ @amount_path.first(xml, :ensure_created => true).text = sprintf("%.2f", value.cents.to_f / 100 )
20
20
  @currency_path.first(xml, :ensure_created => true).text = value.currency
21
21
  end
22
22
  end
@@ -9,6 +9,7 @@ class TimeNode < XML::Mapping::SingleAttributeNode
9
9
  end
10
10
  def set_attr_value(xml, value) # :nodoc:
11
11
  raise "Not a Time object: #{value}" unless value.is_a?(Time)
12
- @path.first(xml,:ensure_created=>true).text = value.to_s(:db)
12
+
13
+ @path.first(xml,:ensure_created=>true).text = value.strftime("%Y-%m-%d %H:%M:%S")
13
14
  end
14
15
  end
data/rakefile CHANGED
@@ -6,7 +6,7 @@ require 'rake/rdoctask'
6
6
  require 'rake/gempackagetask'
7
7
  require 'rake/contrib/rubyforgepublisher'
8
8
 
9
- PKG_VERSION = "0.10.2"
9
+ PKG_VERSION = "0.11.0"
10
10
  PKG_NAME = "ebayapi"
11
11
  PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
12
12
 
@@ -17,78 +17,80 @@ PKG_FILES = FileList[
17
17
  response_dir = File.join(File.dirname(__FILE__), 'test', 'fixtures', 'responses')
18
18
 
19
19
  desc "Default: Run all the unit tests"
20
- task :default => [ :test ]
21
-
22
- desc 'Run all unit tests.'
23
- Rake::TestTask.new do |t|
24
- t.libs << "test"
25
- t.pattern = 'test/**/*_test.rb'
26
- t.verbose = true
20
+ task :default => [ 'test:units' ]
21
+
22
+ namespace :test do
23
+ desc 'Run all unit tests.'
24
+ Rake::TestTask.new(:units) do |t|
25
+ t.libs << "test"
26
+ t.pattern = 'test/unit/**/*_test.rb'
27
+ t.verbose = true
28
+ end
29
+
30
+ desc 'Run all unit tests.'
31
+ Rake::TestTask.new(:mapping) do |t|
32
+ t.libs << "test"
33
+ t.pattern = 'test/mapping/**/*_test.rb'
34
+ t.verbose = true
35
+ end
27
36
  end
28
37
 
29
38
  desc "Delete tar.gz / zip / rdoc"
30
39
  task :cleanup => [ :clobber_package, :clobber_rdoc ]
31
40
 
32
- desc 'Get the latest version of the eBay XML schema'
33
- task :update_schema do
34
- puts 'Updating the eBay schema'
41
+ namespace :schema do
42
+ desc 'Get the latest version of the eBay XML schema'
43
+ task :update do
44
+ puts 'Updating the eBay schema'
35
45
 
36
- folder = File.dirname(__FILE__) + "/lib/ebay/schema"
37
- url = 'http://developer.ebay.com/webservices/latest/ebaySvc.xsd'
46
+ folder = File.dirname(__FILE__) + "/lib/ebay/schema"
47
+ url = 'http://developer.ebay.com/webservices/latest/ebaySvc.xsd'
38
48
 
39
- cd folder do
40
- rm_f 'ebaySvc.xsd'
41
- system("wget #{url}")
49
+ cd folder do
50
+ rm_f 'ebaySvc.xsd'
51
+ system("wget #{url}")
52
+ end
42
53
  end
43
- end
54
+
55
+ desc "Update the schema version"
56
+ task :update_version do
57
+ schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
58
+ # Update the schema version string
59
+ version = File.open(schema) do |f|
60
+ version_string = f.gets
61
+ version_string.match(/Version (\d+)/)
62
+ $1
63
+ end
44
64
 
45
- desc "Remove the generated Ruby classes"
46
- task :clean_classes do
47
- folder = File.dirname(__FILE__) + '/lib/ebay'
48
- folders = %w( responses requests types )
49
- cd folder do
50
- rm_rf 'requests.rb'
51
- rm_rf 'responses.rb'
52
- rm_rf 'types.rb'
53
- folders.each do |f|
54
- cd f do
55
- rm_rf '*.rb'
56
- end
65
+ version_file_path = File.dirname(__FILE__) + "/lib/ebay/schema/version.rb"
66
+ version_file = File.read(version_file_path)
67
+ version_file.gsub!(/VERSION = \d+/, "VERSION = #{version}")
68
+ File.open(version_file_path, 'w') do |f|
69
+ f.puts version_file
57
70
  end
58
71
  end
59
- end
60
-
61
- desc "Generate Ruby classes from the schema and updates the schema version"
62
- task :generate_classes_with_version => [:generate_classes, :update_schema_version]
63
-
64
- desc "Generate Ruby classes from the schema file"
65
- task :generate_classes => :clean_classes do
66
- require 'ebay'
67
- require 'ebay/schema/mapper'
68
- %w(requests responses types).each do |dir|
69
- folder = File.dirname(__FILE__) + "/lib/ebay/#{dir}"
70
- Dir.mkdir(folder) unless File.directory?(folder)
71
- end
72
- schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
73
- data = File.read(schema)
74
- Ebay::Schema::XSD2eBay.run(data, File.dirname(__FILE__) + '/lib/ebay')
72
+
75
73
  end
76
74
 
77
- desc "Update the schema version"
78
- task :update_schema_version do
79
- schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
80
- # Update the schema version string
81
- version = File.open(schema) do |f|
82
- version_string = f.gets
83
- version_string.match(/Version (\d+)/)
84
- $1
85
- end
86
-
87
- version_file_path = File.dirname(__FILE__) + "/lib/ebay/schema/version.rb"
88
- version_file = File.read(version_file_path)
89
- version_file.gsub!(/VERSION = \d+/, "VERSION = #{version}")
90
- File.open(version_file_path, 'w') do |f|
91
- f.puts version_file
75
+ namespace :classes do
76
+ desc "Remove the generated Ruby classes"
77
+ task :cleanup do
78
+ FileList[
79
+ "lib/ebay/requests.rb", "lib/ebay/responses.rb", "lib/ebay/types.rb", "lib/ebay/requests/*.rb", "lib/ebay/responses/*.rb", "lib/ebay/types/*.rb"
80
+ ].each{|f| rm_rf f }
81
+ end
82
+
83
+ desc "Generate Ruby classes from the schema file and updates the schema version"
84
+ task :generate => [:cleanup, 'schema:update_version'] do
85
+ require 'ebay'
86
+ require 'ebay/schema/mapper'
87
+ %w(requests responses types).each do |dir|
88
+ folder = File.dirname(__FILE__) + "/lib/ebay/#{dir}"
89
+ Dir.mkdir(folder) unless File.directory?(folder)
90
+ end
91
+ schema = File.dirname(__FILE__) + '/lib/ebay/schema/ebaySvc.xsd'
92
+ data = File.read(schema)
93
+ Ebay::Schema::XSD2eBay.run(data, File.dirname(__FILE__) + '/lib/ebay')
92
94
  end
93
95
  end
94
96
 
@@ -113,7 +115,6 @@ spec = Gem::Specification.new do |s|
113
115
  s.email = "codyfauser@gmail.com"
114
116
  s.homepage = "http://ebayapi.rubyforge.org"
115
117
  s.add_dependency('xml-mapping', '>= 0.8.1')
116
- s.add_dependency('activesupport', '>= 1.3.1')
117
118
  s.add_dependency('money', '>= 1.7.1')
118
119
  end
119
120