my_utils 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. data/lib/my_utils/toputils.rb +8 -2
  2. metadata +2 -2
@@ -9,7 +9,7 @@ require 'uri'
9
9
  module Toputils
10
10
 
11
11
  TOP_URL = 'http://gw.api.taobao.com/router/rest?'
12
- SB_TOP_URL = "http://gw.api.tbsandbox.com/router/rest?"
12
+ SB_TOP_URL = 'http://gw.api.tbsandbox.com/router/rest?'
13
13
  STREAM_URL = "http://stream.api.taobao.com/stream"
14
14
  SB_STREAM_URL = "http://stream.api.tbsandbox.com/stream"
15
15
 
@@ -31,7 +31,13 @@ module Toputils
31
31
  params.each {
32
32
  |k, v| params_str << k.to_s<<'='<<URI.escape(v.to_s).to_s<<'&'
33
33
  }
34
- target = (app_secret.start_with?("sandbox") ? SB_TOP_URL : TOP_URL)+ params_str
34
+ if app_secret.start_with? "sandbox"
35
+ target = SB_TOP_URL
36
+ else
37
+ target = TOP_URL
38
+ end
39
+ target = target + params_str
40
+ #target = (app_secret.start_with?("sandbox") ? SB_TOP_URL : TOP_URL)+ params_str
35
41
 
36
42
  res = Net::HTTP.get_response(URI.parse(target))
37
43
  res.body
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Nick Quaranto