acts-as-atdw 0.0.1 → 0.0.2
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/Gemfile +11 -0
- data/Gemfile.lock +43 -0
- data/Rakefile +53 -0
- data/VERSION +1 -1
- data/acts-as-atdw.gemspec +9 -2
- data/lib/client.rb +8 -0
- data/test/helper.rb +18 -0
- data/test/test_acts-as-atdw.rb +7 -0
- metadata +9 -4
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
akami (1.0.0)
|
5
|
+
gyoku (>= 0.4.0)
|
6
|
+
builder (3.0.0)
|
7
|
+
git (1.2.5)
|
8
|
+
gyoku (0.4.4)
|
9
|
+
builder (>= 2.1.2)
|
10
|
+
httpi (0.9.5)
|
11
|
+
rack
|
12
|
+
jeweler (1.6.4)
|
13
|
+
bundler (~> 1.0)
|
14
|
+
git (>= 1.2.5)
|
15
|
+
rake
|
16
|
+
nokogiri (1.5.0)
|
17
|
+
nori (1.0.2)
|
18
|
+
rack (1.3.5)
|
19
|
+
rake (0.9.2.2)
|
20
|
+
rcov (0.9.11)
|
21
|
+
savon (0.9.7)
|
22
|
+
akami (~> 1.0)
|
23
|
+
builder (>= 2.1.2)
|
24
|
+
gyoku (>= 0.4.0)
|
25
|
+
httpi (~> 0.9)
|
26
|
+
nokogiri (>= 1.4.0)
|
27
|
+
nori (~> 1.0)
|
28
|
+
wasabi (~> 2.0)
|
29
|
+
shoulda (2.11.3)
|
30
|
+
wasabi (2.0.0)
|
31
|
+
nokogiri (>= 1.4.0)
|
32
|
+
xml-simple (1.1.1)
|
33
|
+
|
34
|
+
PLATFORMS
|
35
|
+
ruby
|
36
|
+
|
37
|
+
DEPENDENCIES
|
38
|
+
bundler (~> 1.1.rc)
|
39
|
+
jeweler (~> 1.6.4)
|
40
|
+
rcov
|
41
|
+
savon (= 0.9.7)
|
42
|
+
shoulda
|
43
|
+
xml-simple (= 1.1.1)
|
data/Rakefile
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "acts-as-atdw"
|
18
|
+
gem.homepage = "http://github.com/yuritomanek/acts-as-atdw"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{A simple wrapper for the ATDW SOAP API}
|
21
|
+
gem.description = %Q{A simple wrapper for the ATDW SOAP API}
|
22
|
+
gem.email = "yuri@tomanek.com.au"
|
23
|
+
gem.authors = ["Yuri Tomanek"]
|
24
|
+
# dependencies defined in Gemfile
|
25
|
+
end
|
26
|
+
Jeweler::RubygemsDotOrgTasks.new
|
27
|
+
|
28
|
+
require 'rake/testtask'
|
29
|
+
Rake::TestTask.new(:test) do |test|
|
30
|
+
test.libs << 'lib' << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'rcov/rcovtask'
|
36
|
+
Rcov::RcovTask.new do |test|
|
37
|
+
test.libs << 'test'
|
38
|
+
test.pattern = 'test/**/test_*.rb'
|
39
|
+
test.verbose = true
|
40
|
+
test.rcov_opts << '--exclude "gems/*"'
|
41
|
+
end
|
42
|
+
|
43
|
+
task :default => :test
|
44
|
+
|
45
|
+
require 'rake/rdoctask'
|
46
|
+
Rake::RDocTask.new do |rdoc|
|
47
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
+
|
49
|
+
rdoc.rdoc_dir = 'rdoc'
|
50
|
+
rdoc.title = "acts-as-atdw #{version}"
|
51
|
+
rdoc.rdoc_files.include('README*')
|
52
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/acts-as-atdw.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "acts-as-atdw"
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Yuri Tomanek"]
|
@@ -17,10 +17,17 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
+
"Gemfile",
|
21
|
+
"Gemfile.lock",
|
22
|
+
"LICENSE.txt",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
20
25
|
"VERSION",
|
21
26
|
"acts-as-atdw.gemspec",
|
22
27
|
"lib/acts_as_atdw.rb",
|
23
|
-
"lib/client.rb"
|
28
|
+
"lib/client.rb",
|
29
|
+
"test/helper.rb",
|
30
|
+
"test/test_acts-as-atdw.rb"
|
24
31
|
]
|
25
32
|
s.homepage = "http://github.com/yuritomanek/acts-as-atdw"
|
26
33
|
s.licenses = ["MIT"]
|
data/lib/client.rb
CHANGED
@@ -54,6 +54,14 @@ module ActsAsAtdw
|
|
54
54
|
|
55
55
|
result = XmlSimple.xml_in(response.body[:get_specific_product_record_response][:get_specific_product_record_result].gsub("<?xml version=\"1.0\" encoding=\"utf-16\" ?>", ""))
|
56
56
|
|
57
|
+
if result["error"] && result["error"] == ["No rows returned"]
|
58
|
+
return nil
|
59
|
+
elsif result["product_distribution"]
|
60
|
+
return result["product_distribution"].first
|
61
|
+
else
|
62
|
+
return nil
|
63
|
+
end
|
64
|
+
|
57
65
|
end
|
58
66
|
|
59
67
|
end
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'acts-as-atdw'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: acts-as-atdw
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.0.
|
5
|
+
version: 0.0.2
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Yuri Tomanek
|
@@ -88,12 +88,17 @@ extra_rdoc_files:
|
|
88
88
|
- LICENSE.txt
|
89
89
|
- README.rdoc
|
90
90
|
files:
|
91
|
+
- Gemfile
|
92
|
+
- Gemfile.lock
|
93
|
+
- LICENSE.txt
|
94
|
+
- README.rdoc
|
95
|
+
- Rakefile
|
91
96
|
- VERSION
|
92
97
|
- acts-as-atdw.gemspec
|
93
98
|
- lib/acts_as_atdw.rb
|
94
99
|
- lib/client.rb
|
95
|
-
-
|
96
|
-
-
|
100
|
+
- test/helper.rb
|
101
|
+
- test/test_acts-as-atdw.rb
|
97
102
|
homepage: http://github.com/yuritomanek/acts-as-atdw
|
98
103
|
licenses:
|
99
104
|
- MIT
|
@@ -107,7 +112,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
112
|
requirements:
|
108
113
|
- - ">="
|
109
114
|
- !ruby/object:Gem::Version
|
110
|
-
hash: -
|
115
|
+
hash: -3268202143746126171
|
111
116
|
segments:
|
112
117
|
- 0
|
113
118
|
version: "0"
|