Chrononaut-hostconnect 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG
CHANGED
data/hostconnect.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hostconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Bj\xC3\xB8rn Arild M\xC3\xA6land"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
|
11
|
-
date: 2008-
|
11
|
+
date: 2008-09-11 00:00:00 +02:00
|
12
12
|
default_executable:
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
data/lib/hostconnect/builder.rb
CHANGED
@@ -9,7 +9,7 @@ module HostConnect
|
|
9
9
|
|
10
10
|
# Send xml to server. Returns a new object.
|
11
11
|
def submit
|
12
|
-
obj = Inflector.constantize(self.class.to_s.gsub(/Builder/, ''))
|
12
|
+
obj = ActiveSupport::Inflector.constantize(self.class.to_s.gsub(/Builder/, ''))
|
13
13
|
obj.new(Client.post_xml_request(to_s))
|
14
14
|
end
|
15
15
|
|
data/lib/hostconnect/coercion.rb
CHANGED
@@ -17,9 +17,9 @@ module HostConnect
|
|
17
17
|
def self.from_hc(data)
|
18
18
|
case data
|
19
19
|
when /^[0-9]+\d*$/ then data.to_i
|
20
|
-
when /\d{4}-\d\d-\d\d/ then Date.parse(data)
|
21
20
|
when /^(\d+\s){2,}[0-9 ]*$/ then data.split.collect { |i| i.to_i }
|
22
21
|
when /^\s*$/ then nil
|
22
|
+
when /\d{4}-\d\d-\d\d/ then Date.parse(data)
|
23
23
|
when "Y" then true
|
24
24
|
when "N" then false
|
25
25
|
else data.strip
|
data/lib/hostconnect/response.rb
CHANGED
@@ -94,7 +94,7 @@ module HostConnect
|
|
94
94
|
# Sets all instance variables. This only works for the simple requests.
|
95
95
|
# For convenience, query methods gets defined for booleans.
|
96
96
|
def set_attrs
|
97
|
-
class_name = Inflector.demodulize(self.class) << "Reply"
|
97
|
+
class_name = ActiveSupport::Inflector.demodulize(self.class) << "Reply"
|
98
98
|
@data.search("/Reply/" << class_name) do |n|
|
99
99
|
n.containers.each do |e|
|
100
100
|
var = e.name.underscore
|
@@ -1,15 +1,15 @@
|
|
1
1
|
module HostConnect
|
2
2
|
class SupplierInfo < AbstractResponse
|
3
3
|
include Enumerable
|
4
|
-
|
4
|
+
|
5
5
|
def size
|
6
6
|
@size ||= @data.search("/Reply/SupplierInfoReply/Suppliers/Supplier").size
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
private
|
10
10
|
def populate
|
11
11
|
@elements = []
|
12
|
-
|
12
|
+
|
13
13
|
@data.search("/Reply/SupplierInfoReply/Suppliers/Supplier").each do |supplier|
|
14
14
|
s = Struct.new(:supplier_id, :supplier_code, :name, :address1, :address2,
|
15
15
|
:address3, :address4, :address5, :post_code, :supplier_note).new
|
@@ -23,7 +23,7 @@ module HostConnect
|
|
23
23
|
s.address5 = (supplier/"Address5").innerHTML
|
24
24
|
s.post_code = (supplier/"PostCode").innerHTML
|
25
25
|
s.supplier_note = (supplier/"SupplierNotes"/"SupplierNote"/"NoteText").innerHTML
|
26
|
-
|
26
|
+
|
27
27
|
@elements << s
|
28
28
|
end
|
29
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Chrononaut-hostconnect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Bj\xC3\xB8rn Arild M\xC3\xA6land"
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
|
-
date: 2008-
|
11
|
+
date: 2008-09-10 15:00:00 -07:00
|
12
12
|
default_executable:
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|