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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e77b14a238c8df2acfabe2005aba572e4987dea
4
- data.tar.gz: ca3284f0a97ef80dbdf4fd8bb38b44b06d52c3b3
3
+ metadata.gz: 17fe1cf6993cc5f20ab47650446e397d412bf9d0
4
+ data.tar.gz: 3224d9fe95eec06722f93764ce91dc15390f594e
5
5
  SHA512:
6
- metadata.gz: 09c1533aca79157a7c35d54d7daac668895ad4ca371fd9a909ca1a3c79d4a3c017c97e52d446e93396990a0c64d801b2f1d57e5801eee4aeff618b98bc3eccf6
7
- data.tar.gz: 8d7331509028338e81a2ed8a61af273c74837e06b6137c5ec46e738a0f825be8d4e0b0e79142b4f1d179c5349d0ef4026aea8ce181e13b4636881de6d89bc31b
6
+ metadata.gz: 83703581d06abf22ac912f5b82df3bc9cc78e380d6e6fd28a711a039fec7ccbc4864faeca66528e9aa5a4b6877a95e0b553272c3401093fe65fa24ede03e16e7
7
+ data.tar.gz: a4b6f0010c58d8918af5abe834e839af3c9f9c38dfc0c2340c7d988737e128491153707b50a182776ef72ced448c4c33e2a80987765db45a0b0eac48b9654a07
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ $ shanbay word
26
26
 
27
27
  ## Development
28
28
 
@@ -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
-
@@ -1,3 +1,3 @@
1
1
  module Shanbay
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
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: 2016-06-18 00:00:00.000000000 Z
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