goldshark_gem 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -31
- data/Gemfile +1 -1
- data/README.md +14 -7
- data/Rakefile +2 -0
- data/goldshark_gem.gemspec +1 -1
- data/lib/goldshark_gem/tool.rb +2 -1
- data/test/ci_test.rb +1 -1
- data/test/tool_test.rb +14 -0
- metadata +3 -7
- data/test/fixtures/vcr_cassettes/test_channel_intelligence.yml +0 -49
- data/test/fixtures/vcr_cassettes/test_results.yml +0 -687
- data/test/fixtures/vcr_cassettes/test_text.yml +0 -67
- data/test/fixtures/vcr_cassettes/test_tool.yml +0 -68
data/.gitignore
CHANGED
@@ -15,35 +15,5 @@ doc
|
|
15
15
|
pkg
|
16
16
|
|
17
17
|
Gemfile.lock
|
18
|
-
# Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
|
19
|
-
#
|
20
|
-
# * Create a file at ~/.gitignore
|
21
|
-
# * Include files you want ignored
|
22
|
-
# * Run: git config --global core.excludesfile ~/.gitignore
|
23
|
-
#
|
24
|
-
# After doing this, these files will be ignored in all your git projects,
|
25
|
-
# saving you from having to 'pollute' every project you touch with them
|
26
|
-
#
|
27
|
-
# Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
|
28
|
-
#
|
29
|
-
# For MacOS:
|
30
|
-
#
|
31
|
-
#.DS_Store
|
32
18
|
|
33
|
-
|
34
|
-
#*.tmproj
|
35
|
-
#tmtags
|
36
|
-
|
37
|
-
# For emacs:
|
38
|
-
#*~
|
39
|
-
#\#*
|
40
|
-
#.\#*
|
41
|
-
|
42
|
-
# For vim:
|
43
|
-
#*.swp
|
44
|
-
|
45
|
-
# For redcar:
|
46
|
-
#.redcar
|
47
|
-
|
48
|
-
# For rubinius:
|
49
|
-
#*.rbc
|
19
|
+
/test/fixtures/vcr_cassettes/*.yml
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -24,12 +24,18 @@ localization is the parameter key you will need to define in the YAML file. The
|
|
24
24
|
en_us:
|
25
25
|
tool_guid: '12343252'
|
26
26
|
locale: 'en'
|
27
|
-
api_root: 'http://gst.api.igodigital.com/v2_2' # this
|
27
|
+
api_root: 'http://gst.api.igodigital.com/v2_2' # this parameter is optional it defaults to v2_2
|
28
|
+
source: 'web' # this parameter is optional. Has no default
|
28
29
|
|
29
|
-
|
30
|
+
fridge_finder_web:
|
31
|
+
tool_guid: '3255423'
|
32
|
+
locale: 'en'
|
33
|
+
api_root: 'http://gst.api.igodigital.com/v2_2' # this parameter is optional it defaults to v2_2
|
34
|
+
source: 'web' # this parameter is optional. Has no default
|
35
|
+
|
36
|
+
fridge_finder_no_source:
|
30
37
|
tool_guid: '3255423'
|
31
38
|
locale: 'en'
|
32
|
-
api_root: 'http://gst.api.igodigital.com/v2_2' # this option is optional it defaults to v2_2
|
33
39
|
|
34
40
|
###Without YAML config file
|
35
41
|
|
@@ -39,15 +45,16 @@ If the tool\_config.yml file is missing or you are not developing in the Rails e
|
|
39
45
|
gs.tool_guid('132424324')
|
40
46
|
gs.session_id('92034802')
|
41
47
|
gs.locale('en')
|
42
|
-
gs.url('http://gst.api.igodigital.com/v2_2')
|
48
|
+
gs.url('http://gst.api.igodigital.com/v2_2')
|
49
|
+
gs.source('web')
|
43
50
|
|
44
51
|
texts = GS::Text.new
|
45
52
|
texts.tool_guid('132424324')
|
46
53
|
texts.locale('en')
|
47
54
|
|
48
|
-
###
|
55
|
+
###More About Defining Tool Source outside the config file
|
49
56
|
|
50
|
-
|
57
|
+
If you haven't added the source to the config file and Guided Selling tool powers both web and mobile, or guided selling and guided search. Defining a souce may be required by the client. To define a souce just do:
|
51
58
|
|
52
59
|
gs.source('web') or
|
53
60
|
gs.source('mobile')
|
@@ -95,7 +102,7 @@ options**
|
|
95
102
|
|
96
103
|
gs.get_tool
|
97
104
|
|
98
|
-
The following accepts an **
|
105
|
+
The following accepts an **ARRAY of tool step option ids** and returns the results tool object.
|
99
106
|
|
100
107
|
gs.get_results(tool_step_option_ids)
|
101
108
|
|
data/Rakefile
CHANGED
data/goldshark_gem.gemspec
CHANGED
data/lib/goldshark_gem/tool.rb
CHANGED
@@ -7,7 +7,8 @@ module GS
|
|
7
7
|
@tool_guid = tool_info[localization]['tool_guid']
|
8
8
|
@locale = tool_info[localization]['locale']
|
9
9
|
end
|
10
|
-
@url = tool_info['api_root'] rescue nil
|
10
|
+
@url = tool_info[localization]['api_root'] rescue nil
|
11
|
+
@source = tool_info[localization]['source'] rescue nil
|
11
12
|
if @url.nil?
|
12
13
|
@url = 'http://gst.api.igodigital.com/v2_2'
|
13
14
|
end
|
data/test/ci_test.rb
CHANGED
@@ -7,7 +7,7 @@ class TestCi < MiniTest::Unit::TestCase
|
|
7
7
|
@ci = GS::Ci.new
|
8
8
|
@sku = '5410076532216'
|
9
9
|
@rgid = '4332'
|
10
|
-
@result_array = [{:id=>"15582039", :logo=>"http://content.channelintelligence.com/images/vendors/90x60/15582039.gif", :name=>"Amazon - DE", :buy_now_link=>"http://pg.links.origin.channelintelligence.com/pages/redirector.asp?nIID=221439981&nRGID=4332&nVID=15582039&nRow=0&sCt=", :product_name=>"Pantene Pro-V Volume Creation Haarspray, 2er Pack (2 x 250 ml)", :price=>"5.5", :product_image=>"http://ecx.images-amazon.com/images/I/
|
10
|
+
@result_array = [{:id=>"15582039", :logo=>"http://content.channelintelligence.com/images/vendors/90x60/15582039.gif", :name=>"Amazon - DE", :buy_now_link=>"http://pg.links.origin.channelintelligence.com/pages/redirector.asp?nIID=221439981&nRGID=4332&nVID=15582039&nRow=0&sCt=", :product_name=>"Pantene Pro-V Volume Creation Haarspray, 2er Pack (2 x 250 ml)", :price=>"5.5", :product_image=>"http://ecx.images-amazon.com/images/I/31Gb56dED0L.jpg", :available=>"Y"}]
|
11
11
|
end
|
12
12
|
|
13
13
|
def test_that_can_return_data
|
data/test/tool_test.rb
CHANGED
@@ -36,5 +36,19 @@ class TestTool < MiniTest::Unit::TestCase
|
|
36
36
|
assert_equal max_result, 2000
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
def test_that_can_receive_an_event_confirmation
|
41
|
+
VCR.use_cassette('test_event') do
|
42
|
+
@event_record = @gs.record_events('api-test')
|
43
|
+
assert_equal @event_record[:name], 'api-test'
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_that_can_receive_a_micro_confirmation
|
48
|
+
VCR.use_cassette('test_micro_conversion') do
|
49
|
+
@micro = @gs.micro_convert('1312479')
|
50
|
+
assert_equal @micro.first, '1312479'
|
51
|
+
end
|
52
|
+
end
|
39
53
|
|
40
54
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: goldshark_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
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:
|
12
|
+
date: 2013-01-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -63,10 +63,6 @@ files:
|
|
63
63
|
- lib/goldshark_gem/text.rb
|
64
64
|
- lib/goldshark_gem/tool.rb
|
65
65
|
- test/ci_test.rb
|
66
|
-
- test/fixtures/vcr_cassettes/test_channel_intelligence.yml
|
67
|
-
- test/fixtures/vcr_cassettes/test_results.yml
|
68
|
-
- test/fixtures/vcr_cassettes/test_text.yml
|
69
|
-
- test/fixtures/vcr_cassettes/test_tool.yml
|
70
66
|
- test/helper.rb
|
71
67
|
- test/text_test.rb
|
72
68
|
- test/tool_test.rb
|
@@ -91,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
87
|
version: '0'
|
92
88
|
requirements: []
|
93
89
|
rubyforge_project:
|
94
|
-
rubygems_version: 1.8.
|
90
|
+
rubygems_version: 1.8.23
|
95
91
|
signing_key:
|
96
92
|
specification_version: 3
|
97
93
|
summary: A gem to interact with iGodigital GoldShark API
|
@@ -1,49 +0,0 @@
|
|
1
|
-
---
|
2
|
-
http_interactions:
|
3
|
-
- request:
|
4
|
-
method: get
|
5
|
-
uri: http://pg.links.channelintelligence.com/pages/plxml.asp?nRGID=4332&sSKU=5410076532216
|
6
|
-
body:
|
7
|
-
encoding: US-ASCII
|
8
|
-
string: ''
|
9
|
-
headers:
|
10
|
-
Accept:
|
11
|
-
- ! '*/*'
|
12
|
-
User-Agent:
|
13
|
-
- Ruby
|
14
|
-
response:
|
15
|
-
status:
|
16
|
-
code: 200
|
17
|
-
message: OK
|
18
|
-
headers:
|
19
|
-
Server:
|
20
|
-
- Microsoft-IIS/6.0
|
21
|
-
P3p:
|
22
|
-
- CP="OTI DSP COR CURa ADMa DEVa OUR DELa STP"
|
23
|
-
X-Powered-By:
|
24
|
-
- ASP.NET
|
25
|
-
Content-Type:
|
26
|
-
- text/xml
|
27
|
-
Cache-Control:
|
28
|
-
- public, max-age=2473
|
29
|
-
Expires:
|
30
|
-
- Wed, 24 Oct 2012 19:08:58 GMT
|
31
|
-
Date:
|
32
|
-
- Wed, 24 Oct 2012 18:27:45 GMT
|
33
|
-
Content-Length:
|
34
|
-
- '1604'
|
35
|
-
Connection:
|
36
|
-
- keep-alive
|
37
|
-
body:
|
38
|
-
encoding: US-ASCII
|
39
|
-
string: <?xml version="1.0" encoding="utf-8"?><PL_RESPONSE VERSION="1.0" ITEM_COUNT="1"
|
40
|
-
ERROR_COUNT="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><MANUFACTURER_ITEM><ITEM_ID>220798250</ITEM_ID><MODEL><![CDATA[5410076532216]]></MODEL><PRODUCT_NAME><![CDATA[Pantene
|
41
|
-
Pro-V Volume Creation Haarspray]]></PRODUCT_NAME><MANUFACTURER>Procter &
|
42
|
-
Gamble</MANUFACTURER><DESCRIPTION><![CDATA[]]></DESCRIPTION><DATASHEETURL></DATASHEETURL><IMAGE_URL></IMAGE_URL><MAP>0</MAP></MANUFACTURER_ITEM><DEALERS><DEALER
|
43
|
-
id="15582039"><DEALER_LOGO>http://content.channelintelligence.com/images/vendors/90x60/15582039.gif</DEALER_LOGO><DEALER_NAME>Amazon
|
44
|
-
- DE</DEALER_NAME><DEALER_HOME_URL>http://www.amazon.de/</DEALER_HOME_URL></DEALER></DEALERS><DEALER_ITEMS><DEALER_ITEM><DEALER_ID>15582039</DEALER_ID><DEALER_SKU>B006JVLPKS</DEALER_SKU><MODEL><![CDATA[532247]]></MODEL><NAME><![CDATA[Pantene
|
45
|
-
Pro-V Volume Creation Haarspray, 2er Pack (2 x 250 ml)]]></NAME><MANUFACTURER>Procter
|
46
|
-
& Gamble</MANUFACTURER><PRICE>5.5</PRICE><AVAILABILITY>YES</AVAILABILITY><BUY_URL>http://pg.links.origin.channelintelligence.com/pages/redirector.asp?nIID=221439981&nRGID=4332&nVID=15582039&nRow=0&sCt=</BUY_URL><IMAGE_URL>http://ecx.images-amazon.com/images/I/31s71ZXAZfL.jpg</IMAGE_URL><TRUE-TAG>http://pg.links.origin.channelintelligence.com/pages/wl.asp?nCTID=0&nSCID=&nIID=220798250&nICnt=1&nDCnt=1&nRGID=4332&sPCode=&nStoreID=&nVStoreID=&sModelNumber=5410076532216&nRadius=&nColID=0&nOppCnt=&nRID=&sRnd=</TRUE-TAG></DEALER_ITEM></DEALER_ITEMS></PL_RESPONSE>
|
47
|
-
http_version:
|
48
|
-
recorded_at: Wed, 24 Oct 2012 18:27:45 GMT
|
49
|
-
recorded_with: VCR 2.2.5
|