shanbay 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/shanbay/api.rb +3 -3
- data/lib/shanbay/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17fe1cf6993cc5f20ab47650446e397d412bf9d0
|
4
|
+
data.tar.gz: 3224d9fe95eec06722f93764ce91dc15390f594e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83703581d06abf22ac912f5b82df3bc9cc78e380d6e6fd28a711a039fec7ccbc4864faeca66528e9aa5a4b6877a95e0b553272c3401093fe65fa24ede03e16e7
|
7
|
+
data.tar.gz: a4b6f0010c58d8918af5abe834e839af3c9f9c38dfc0c2340c7d988737e128491153707b50a182776ef72ced448c4c33e2a80987765db45a0b0eac48b9654a07
|
data/README.md
CHANGED
data/lib/shanbay/api.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require "open-uri"
|
2
2
|
require "json"
|
3
|
+
require 'uri'
|
3
4
|
module Shanbay
|
4
5
|
class Api
|
5
6
|
def search(word)
|
6
|
-
getwordui = "https://api.shanbay.com/bdc/search/?word=#{word}"
|
7
|
+
getwordui = URI.escape("https://api.shanbay.com/bdc/search/?word=#{word}")
|
7
8
|
open( getwordui) do |io|
|
8
9
|
jsonstr = io.read
|
9
10
|
json = JSON.parse(jsonstr)
|
@@ -13,7 +14,7 @@ module Shanbay
|
|
13
14
|
end
|
14
15
|
|
15
16
|
def parse_data(raw)
|
16
|
-
data = Data.new
|
17
|
+
data = Data.new
|
17
18
|
data.raw = raw
|
18
19
|
data.cn_definition = raw["cn_definition"]
|
19
20
|
data.en_definition = raw["en_definition"]
|
@@ -29,4 +30,3 @@ module Shanbay
|
|
29
30
|
|
30
31
|
end
|
31
32
|
end
|
32
|
-
|
data/lib/shanbay/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shanbay
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ji-Yuhang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: em-http-request
|