sogou-search-api 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +10 -0
- data/lib/sogou/search/api/core/base_service.rb +6 -1
- data/lib/sogou/search/api/version.rb +1 -1
- data/sogou-search-api.gemspec +4 -4
- metadata +14 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3199b69d43c4a4f0b6fbff6bbfd43bf7dfb62860287d70b232136ba4776315e0
|
4
|
+
data.tar.gz: da8203bf9672c0069d7e91b6d64767828af254edf0b605320e5ba963b4cac446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e30024b6823061482c114bc34d9abcb54f9c44a83f61f061387034ba0f375573e400ec12e85790ffe1ac5b714bb7fb2227429db4a65c754e1745094a0c02ee00
|
7
|
+
data.tar.gz: d57a26d5faf7a16a1aaf3a93ce68294c5fe7b1782b90fc0ff44ec7c02473eb67d56b6cf7460ab1dd95fc10af3603f63aaa0c9fc5824c7314827fc3d1853a7f6b
|
data/README.md
CHANGED
@@ -82,6 +82,16 @@ SOGOU_USERNAME="YOUR SOGOU USERNAME"
|
|
82
82
|
SOGOU_PASSWORD="YOUR SOGOU PASSWORD"
|
83
83
|
```
|
84
84
|
|
85
|
+
### Env
|
86
|
+
|
87
|
+
There are two ways to set the environment. One is `ENV['ENV']` environment variable. Another is service attribute.
|
88
|
+
If service attribute is set, environment variable will be ignored.
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
account = Service::Account.new
|
92
|
+
account.env = 'production'
|
93
|
+
```
|
94
|
+
|
85
95
|
## Logging
|
86
96
|
|
87
97
|
The client includes a `Logger` instance that can be used to capture debugging information.
|
@@ -9,6 +9,7 @@ module Sogou
|
|
9
9
|
class BaseService
|
10
10
|
attr_accessor :authorization
|
11
11
|
attr_accessor :client_options
|
12
|
+
attr_accessor :env
|
12
13
|
|
13
14
|
def initialize(service)
|
14
15
|
@url = "http://#{service_host}/sem/sms/v1/#{service}?wsdl"
|
@@ -50,7 +51,11 @@ module Sogou
|
|
50
51
|
private
|
51
52
|
|
52
53
|
def service_host
|
53
|
-
"api.agent.sogou.com#{
|
54
|
+
"api.agent.sogou.com#{environment == 'development' ? ':8080' : ''}"
|
55
|
+
end
|
56
|
+
|
57
|
+
def environment
|
58
|
+
@env ||= ENV.fetch('ENV', 'development')
|
54
59
|
end
|
55
60
|
end
|
56
61
|
end
|
data/sogou-search-api.gemspec
CHANGED
@@ -23,8 +23,8 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_runtime_dependency 'savon', '~> 2.12'
|
25
25
|
|
26
|
-
spec.add_development_dependency 'bundler', '~> 1
|
27
|
-
spec.add_development_dependency 'rake', '~>
|
28
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
29
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
26
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
27
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.11'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.21'
|
30
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sogou-search-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Min Kim
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: savon
|
@@ -30,56 +30,56 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1
|
33
|
+
version: '2.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1
|
40
|
+
version: '2.1'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '3.
|
61
|
+
version: '3.11'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '3.
|
68
|
+
version: '3.11'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0.
|
75
|
+
version: '0.21'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0.
|
82
|
+
version: '0.21'
|
83
83
|
description: Sogou Search API ruby client
|
84
84
|
email:
|
85
85
|
- developers@forward3d.com
|
@@ -119,7 +119,7 @@ homepage: https://github.com/forward3d/sogou-search-api
|
|
119
119
|
licenses:
|
120
120
|
- MIT
|
121
121
|
metadata: {}
|
122
|
-
post_install_message:
|
122
|
+
post_install_message:
|
123
123
|
rdoc_options: []
|
124
124
|
require_paths:
|
125
125
|
- lib
|
@@ -134,9 +134,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
|
-
|
138
|
-
|
139
|
-
signing_key:
|
137
|
+
rubygems_version: 3.1.6
|
138
|
+
signing_key:
|
140
139
|
specification_version: 4
|
141
140
|
summary: Sogou Search API ruby client
|
142
141
|
test_files: []
|