fy 1.0.0 → 1.0.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: 956cb074af820b4bce5c4fa549eb02dbe35d6da8
4
- data.tar.gz: 4e0ace04344f0213b5d3390f7fc48e4869670286
3
+ metadata.gz: 2087a6328053fa6615105596c20d9c0b8e6e77e8
4
+ data.tar.gz: c2b709dd2d365b2a049dc7a18ae6da8fb56195a7
5
5
  SHA512:
6
- metadata.gz: 824222907a2296150b94c6704c937c5e303f1660e9a0c8d643f239b962315ad6bf19d92db580469f52e8498198791ec7b43305672198a3190243303dd65e5435
7
- data.tar.gz: 7cd1623d07db4fbd695b9ae4378058f2c49e7c414102550f9aafe5979654b07818efb33c261d017d4fd5c669c470e6046581db8c2288d44c42cf565f51de19a4
6
+ metadata.gz: 60509e560c0a4e3fee3ef3cbdc1370b64ed26c27657a2edfa28874617718010d43222bf9e40eb60af40c40b25da91babe31eb2220afc1f34f63803c7e71508ea
7
+ data.tar.gz: f932f5139afb0b4c6534cdf197f53d6ce5b6f73d01b97db03b468fd793a8c34591b60911e2eeff0cb49cab6e269239255064d65a8a6baee8a1d3b6058cfbeb07
data/README.md CHANGED
@@ -1,8 +1,9 @@
1
1
  # Fy
2
+ [![Gem](https://img.shields.io/gem/v/fy.svg)](https://rubygems.org/gems/fy)
2
3
 
3
4
  A translate tool in your command line, inspired by [Fanyi](https://github.com/afc163/fanyi).
4
5
 
5
- ![](http://dd-personal.qiniudn.com/Screenshot from 2014-11-25 17:21:23.png)
6
+ ![](http://dd-personal.qiniudn.com/Screenshot from 2015-04-25 20:33:21.png)
6
7
 
7
8
  ---
8
9
 
@@ -4,6 +4,8 @@ require "json"
4
4
  require "rainbow/ext/string"
5
5
 
6
6
  module Fy
7
+ API_URL = "http://fanyi.youdao.com/openapi.do?keyfrom=JIANGDi&key=891853312&type=data&doctype=json&version=1.1&q="
8
+
7
9
  class Fanyi
8
10
 
9
11
  def initialize(input)
@@ -11,12 +13,8 @@ module Fy
11
13
  query_for_hash
12
14
  end
13
15
 
14
- def api_url
15
- "http://fanyi.youdao.com/openapi.do?keyfrom=JIANGDi&key=891853312&type=data&doctype=json&version=1.1&q="
16
- end
17
-
18
16
  def query_for_hash
19
- query_url = api_url + URI.escape(@words.gsub(/ /, '+'))
17
+ query_url = API_URL + URI.escape(@words.gsub(/ /, '+'))
20
18
  result_json = Net::HTTP.get(URI(query_url))
21
19
  @result_hash = JSON.parse(result_json)
22
20
  end
@@ -1,3 +1,3 @@
1
1
  module Fy
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - JIANG Di
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-12 00:00:00.000000000 Z
11
+ date: 2015-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -89,9 +89,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
89
89
  version: '0'
90
90
  requirements: []
91
91
  rubyforge_project:
92
- rubygems_version: 2.4.6
92
+ rubygems_version: 2.4.5
93
93
  signing_key:
94
94
  specification_version: 4
95
95
  summary: A translate tool in your command line
96
96
  test_files: []
97
- has_rdoc: false