ruby_omx 0.0.32 → 0.0.33

Sign up to get free protection for your applications and to get access to all the features.
@@ -92,7 +92,7 @@ module RubyOmx
92
92
  xml_reader :errors, :as=>[Error], :in=>'ErrorData'
93
93
 
94
94
  def to_s
95
- error_string = self.errors.collect{ |e| e.message.to_s }.join(',')
95
+ error_string = self.errors ? self.errors.collect{ |e| e.message.to_s }.join(',') : "none"
96
96
  return "success: #{success}, errors: #{error_string}"
97
97
  end
98
98
  end
@@ -1,3 +1,3 @@
1
1
  module RubyOmx
2
- VERSION = "0.0.32"
2
+ VERSION = "0.0.33"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_omx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.32
4
+ version: 0.0.33
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-23 00:00:00.000000000 Z
12
+ date: 2012-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: roxml
@@ -108,8 +108,6 @@ files:
108
108
  - test/memos_test.rb
109
109
  - test/orders_test.rb
110
110
  - test/purchase_orders_test.rb
111
- - test/real_config.yml
112
- - test/real_test.rb
113
111
  - test/test_config.yml
114
112
  - test/test_helper.rb
115
113
  homepage: http://github.com/aew/ruby_omx
@@ -142,7 +140,5 @@ test_files:
142
140
  - test/memos_test.rb
143
141
  - test/orders_test.rb
144
142
  - test/purchase_orders_test.rb
145
- - test/real_config.yml
146
- - test/real_test.rb
147
143
  - test/test_config.yml
148
144
  - test/test_helper.rb
data/test/real_config.yml DELETED
@@ -1,8 +0,0 @@
1
- real:
2
- http_biz_id: KbmCrvnukGKUosDSTVhWbhrYBlggjNYxGqsujuglguAJhXeKBYDdpwyiRcywvmiUrpHilblPqKgiPAOIfxOfvFOmZLUiNuIfeDrKJxvjeeblkhphUhgPixbvaCJADgIfaDjHWFHXePIFchOjQciNRdrephpJFEfGoUaSFAOcjHmhfgZidlmUsCBdXgmmxIBKhgRjxjJaTcrnCgSkghRWvRwjZgVeVvhHqALceQpdJLphwDlfFXgIHYjCGjCiwZW
3
- udi_auth_token: 99d4f1470128304db10a4e301201e21b585f0724ab880aba904b60092140c469c716e4c25e4c949108eea04fc20b79d0905e946d71c3742e327c045f204039080a30542c6751b0ec7e385b580f7b004ebc0a1c80a245393f9a3fdd1ed76c0ae9704be408a8907cf063112d00eccff8c004cae04173080ce0733b948aa66b834
4
-
5
- real_alt:
6
- http_biz_id: KbmCrvnukGKUosDSTVhWbhrYBlggjNYxGqsujuglguAJhXeKBYDdpwyiRcywvmiUrpHilblPqKgiPAOIfxOfvFOmZLUiNuIfeDrKJxvjeeblkhphUhgPixbvaCJADgIfaDjHWFHXePIFchOjQciNRdrephpJFEfGoUaSFAOcjHmhfgZidlmUsCBdXgmmxIBKhgRjxjJaTcrnCgSkghRWvRwjZgVeVvhHqALceQpdJLphwDlfFXgIHYjCGjCiwZW
7
- udi_auth_token: 99d4f1470128304db10a4e301201e21b585f0724ab880aba904b60092140c469c716e4c25e4c949108eea04fc20b79d0905e946d71c3742e327c045f204039080a30542c6751b0ec7e385b580f7b004ebc0a1c80a245393f9a3fdd1ed76c0ae9704be408a8907cf063112d00eccff8c004cae04173080ce0733b948aa66b834
8
- server: https://api.omx.ordermotion.com/OM2/udi.ashx
data/test/real_test.rb DELETED
@@ -1,124 +0,0 @@
1
- require 'test_helper'
2
-
3
- class RealTestTest < MiniTest::Unit::TestCase
4
-
5
- def setup
6
- @config = YAML.load_file( File.join(File.dirname(__FILE__), 'real_config.yml') )['real']
7
- @connection = RubyOmx::Base.new(@config)
8
- @line1 = { :item_code=>'WATCH-1', :quantity => 1, :price => 122.50 }
9
- @line2 = { :item_code=>'APPLE-12', :quantity => 31, :price => 1.50 }
10
- end
11
- =begin
12
- def test_item_update
13
- request_attrs = {:items=>[{
14
- :item_code=>"73080U.GNM.2",
15
- :product_status=>"True",
16
- :incomplete_flag=>"False",
17
- :product_name=>"Sugoi Men's RSE Jacket Gunmetal S",
18
- :product_group=>1,
19
- :weight=>0.6,
20
- :shipping_weight=>0.6,
21
- :cost_of_goods=>125.0,
22
- :upc_code=>nil,
23
- :allow_order_line_info=>"True",
24
- :launch_date=>"08/23/2012 03:14:37 PM",
25
- :file_sub_code=>0,
26
- :inventory_product_flag=>"True",
27
- :tax_code=>"TC1",
28
- :inventory_type=>1,
29
- :inventory_manager=>"AMCLEAN",
30
- :drop_ship_file_sub_code=>0,
31
- :order_split_flag=>"True",
32
- :inventory_warning_ooi=>"True",
33
- :inventory_warning_loi=>"True"}]}
34
-
35
- r = @connection.build_item_update_request(request_attrs)
36
- assert_instance_of String, r.to_xml.to_s
37
- puts r.to_xml.to_s
38
-
39
- response = @connection.append_item(request_attrs)
40
- puts response.to_s
41
- assert_kind_of ItemUpdateResponse, response
42
- end
43
-
44
- def test_supplier_item_update
45
- request_attrs =
46
- request_attrs = {:items=>[{
47
- :item_code=>"73080U.GNM.2",
48
- :supplier_id=>"1120",
49
- :supplier_item_code=>"73080U.GNM.2",
50
- :standard_price=>125.0}]}
51
-
52
- r = @connection.build_supplier_item_update_request(request_attrs)
53
- assert_instance_of String, r.to_xml.to_s
54
- puts r.to_xml.to_s
55
-
56
- response = @connection.append_supplier_item(request_attrs)
57
- puts response.to_s
58
- assert_kind_of SupplierItemUpdateResponse, response
59
- end
60
-
61
- def test_item_price_update
62
- request_attrs = {
63
- :item_code=>"73080U.GNM.2",
64
- :price_type=>"unit",
65
- :quantity_type=>"restricted",
66
- :price_points=>[{:quantity=>1, :price=>249.95, :shipping_handling=>0.0}]
67
- }
68
- r = @connection.build_item_price_update_request(request_attrs)
69
- assert_instance_of String, r.to_xml.to_s
70
- puts r.to_xml.to_s
71
-
72
- response = @connection.append_item_price(request_attrs)
73
- puts response.to_s
74
- assert_kind_of ItemPriceUpdateResponse, response
75
- end
76
-
77
- def test_real_purchase_order
78
- po_data = { :line_items => [@line1, @line2], :supplier_id => '76' }
79
- r = @connection.build_purchase_order_update_request(po_data)
80
- assert_instance_of String, r.to_xml.to_s
81
-
82
- response = @connection.append_po(po_data)
83
- puts response.to_s
84
- assert_kind_of PurchaseOrderUpdateResponse, response
85
- end
86
-
87
- def test_real_order_info
88
- #:store_code=>'Amazon.com MFN HDO'
89
- #order_info_data = { :order_id => '002-5043507-2313848', :store_code=>'Amazon.com MFN HDO' }
90
- order_info_data = { :order_id => '102-2853206-2589018', :store_code=>'Amazon.com MFN HDO' } # no first name
91
-
92
- #order_info_data = { :order_number => '185488', :version=>'2.00' }
93
- r = @connection.build_info_request(order_info_data)
94
- assert_instance_of String, r.to_xml.to_s
95
- puts r.to_xml.to_s
96
-
97
- response = @connection.send_info_request(order_info_data)
98
- puts response.to_xml.to_s
99
- assert_kind_of OrderInfoResponse, response
100
- end
101
-
102
- def test_real_order_info2
103
- order_info_data = { :order_number => '188555' }
104
- r = @connection.build_info_request(order_info_data)
105
- assert_instance_of String, r.to_xml.to_s
106
- puts r.to_xml.to_s
107
-
108
- response = @connection.send_info_request(order_info_data)
109
- puts response.to_xml.to_s
110
- assert_kind_of OrderInfoResponse, response
111
- end
112
-
113
- def test_real_inventory_info
114
- inventory_info_data = { :items => [ {:item_code=>'14141103-021-XL'}, {:item_code=>'14341104-021-XL'}] }
115
- r = @connection.build_inventory_info_request(inventory_info_data)
116
- assert_instance_of String, r.to_xml.to_s
117
- puts r.to_xml.to_s
118
-
119
- response = @connection.send_inventory_info_request(inventory_info_data)
120
- puts response.to_xml.to_s
121
- assert_kind_of InventoryInfoResponse, response
122
- end
123
- =end
124
- end