cargowise-ts 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cargowise-ts/abstract_result.rb +3 -3
- data/lib/cargowise-ts/client.rb +5 -5
- data/lib/cargowise-ts/shipment.rb +6 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c3576fc83f5d8c42c94b26ad50b1c202ffbf3cb
|
4
|
+
data.tar.gz: 3222372862e95bab188a2eb47fc96afa89679ad4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 144f7761f209aafb94ea17b708954038ddb5ab03925b650f37920a61b696b2c7c9e966dd791a675893886674daae166e7ed939cb20e3415644e7ddc40c8c50f0
|
7
|
+
data.tar.gz: 9446f502dc09e75afd0570ad864b7157a61352f446545ea6aa77ab9861844e4261034ac8336bc3002ebd31031866ba58f49a958a236fa40b943aede4c405d130
|
@@ -27,17 +27,17 @@ module CargowiseTS
|
|
27
27
|
|
28
28
|
def node_array(path)
|
29
29
|
path = path.gsub("/","/tns:")
|
30
|
-
node.xpath("#{path}", "tns" =>
|
30
|
+
node.xpath("#{path}", "tns" => CargowiseTS::DEFAULT_NS)
|
31
31
|
end
|
32
32
|
|
33
33
|
def text_value(path)
|
34
34
|
path = path.gsub("/","/tns:")
|
35
|
-
node.xpath("#{path}/text()", "tns" =>
|
35
|
+
node.xpath("#{path}/text()", "tns" => CargowiseTS::DEFAULT_NS).to_s
|
36
36
|
end
|
37
37
|
|
38
38
|
def attribute_value(path)
|
39
39
|
path = path.gsub(/\/([^@])/u,'/tns:\1')
|
40
|
-
node.xpath(path, "tns" =>
|
40
|
+
node.xpath(path, "tns" => CargowiseTS::DEFAULT_NS).to_s
|
41
41
|
end
|
42
42
|
|
43
43
|
def time_value(path)
|
data/lib/cargowise-ts/client.rb
CHANGED
@@ -22,13 +22,13 @@ module CargowiseTS
|
|
22
22
|
@password = opts[:password]
|
23
23
|
end
|
24
24
|
|
25
|
-
# begin an order search. See the docs for
|
25
|
+
# begin an order search. See the docs for CargowiseTS::OrderSearch for info
|
26
26
|
# on what you can do with the object returned from this method.
|
27
27
|
def orders
|
28
28
|
OrderSearch.new(orders_client)
|
29
29
|
end
|
30
30
|
|
31
|
-
# begin a shipment search. See the docs for
|
31
|
+
# begin a shipment search. See the docs for CargowiseTS::ShipmentSearch for
|
32
32
|
# info on what you can do with the object returned from this method.
|
33
33
|
def shipments
|
34
34
|
ShipmentSearch.new(shipments_client)
|
@@ -36,12 +36,12 @@ module CargowiseTS
|
|
36
36
|
|
37
37
|
def orders_hello
|
38
38
|
response = orders_client.call(:hello)
|
39
|
-
response.xpath("//tns:HelloResponse/tns:HelloResult/text()", {"tns" =>
|
39
|
+
response.xpath("//tns:HelloResponse/tns:HelloResult/text()", {"tns" => CargowiseTS::DEFAULT_NS}).to_s
|
40
40
|
end
|
41
41
|
|
42
42
|
def shipments_hello
|
43
43
|
response = shipments_client.call(:hello)
|
44
|
-
response.xpath("//tns:HelloResponse/tns:HelloResult/text()", {"tns" =>
|
44
|
+
response.xpath("//tns:HelloResponse/tns:HelloResult/text()", {"tns" => CargowiseTS::DEFAULT_NS}).to_s
|
45
45
|
end
|
46
46
|
|
47
47
|
# Find the base URI for the web interface at this client
|
@@ -75,7 +75,7 @@ module CargowiseTS
|
|
75
75
|
)
|
76
76
|
end
|
77
77
|
|
78
|
-
# TODO: make some of these configurable via the initialize to
|
78
|
+
# TODO: make some of these configurable via the initialize to CargowiseTS::Client. Will enable
|
79
79
|
# providers that need special treatment to work (like OHL) to be configured differently
|
80
80
|
# by the calling code
|
81
81
|
def build_client(wsdl_path, endpoint_uri)
|
@@ -92,19 +92,19 @@ module CargowiseTS
|
|
92
92
|
@consols.map { |con| con.transport_mode }.uniq.sort.join(" ")
|
93
93
|
end
|
94
94
|
|
95
|
-
# lookup full
|
95
|
+
# lookup full CargowiseTS::Order objects for each order on this shipment.
|
96
96
|
#
|
97
|
-
# client is a
|
97
|
+
# client is a CargowiseTS::Client instance to look for the related shipments on
|
98
98
|
#
|
99
99
|
def orders(client)
|
100
100
|
@orders ||= client.orders.by_shipment_number(self.number)
|
101
101
|
end
|
102
102
|
|
103
|
-
# lookup related
|
103
|
+
# lookup related CargowiseTS::Shipment objects. These are usually "child" shipments
|
104
104
|
# grouped under a parent. Think a consolidated pallet (the parent) with cartons from
|
105
105
|
# multiple suppliers (the children).
|
106
106
|
#
|
107
|
-
# client is a
|
107
|
+
# client is a CargowiseTS::Client instance to look for the related shipments on
|
108
108
|
#
|
109
109
|
def related_shipments(client)
|
110
110
|
@related ||= @consols.map { |consol|
|
@@ -121,7 +121,7 @@ module CargowiseTS
|
|
121
121
|
# This data isn't available via the API, so we need to screen scrape the
|
122
122
|
# website to get it.
|
123
123
|
#
|
124
|
-
# client is a
|
124
|
+
# client is a CargowiseTS::Client instance to look for the related shipments on
|
125
125
|
#
|
126
126
|
def order_ref(client)
|
127
127
|
if client.base_uri
|
@@ -142,7 +142,7 @@ module CargowiseTS
|
|
142
142
|
login_uri = client.base_uri + "/Login/Login.aspx"
|
143
143
|
agent = Mechanize.new
|
144
144
|
agent.agent.http.ssl_version = :TLSv1
|
145
|
-
if File.file?(
|
145
|
+
if File.file?(CargowiseTS::CA_CERT_FILE)
|
146
146
|
agent.agent.http.ca_file = CA_CERT_FILE
|
147
147
|
end
|
148
148
|
page = agent.get(login_uri)
|