geekdict 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +21 -0
- data/geekdict.gemspec +2 -1
- data/lib/geekdict/cli.rb +13 -12
- data/lib/geekdict/local_history.rb +9 -0
- data/lib/geekdict/version.rb +1 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b34d25becd3be9a26746e8289dd7d39b607a528
|
4
|
+
data.tar.gz: f9fba2e1d374c506424e1aff1282b7ceda8ff9c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b74fc4484acf5733ddde44e2eb77d2705b85160def6fdcd67d71810a131f96adc530c8b71eb31512915341426ff44568bc39b5fb2738c54d87a86da02629441c
|
7
|
+
data.tar.gz: ec043b6dfacad6311d1206fc2e08b9b48f6a00af8b808ea5eaa253c4614eef4b0fcc16f05383b510d0d37bcbd15cde268014ddc0a4bebf27489f06ff43f7fa0b
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/geekdict.svg)](http://badge.fury.io/rb/geekdict)
|
2
|
+
|
1
3
|
Geek Dict
|
2
4
|
---------
|
3
5
|
A command line tool for translation.
|
@@ -19,6 +21,25 @@ Commands
|
|
19
21
|
vi. 试验;测试
|
20
22
|
n. (Test)人名;(英)特斯特
|
21
23
|
|
24
|
+
Command Help
|
25
|
+
------------
|
26
|
+
Use *help* command to get detail information.
|
27
|
+
|
28
|
+
$geekdict
|
29
|
+
Commands:
|
30
|
+
geekdict help [COMMAND] # Describe available commands or one specific command
|
31
|
+
geekdict t # Translate a word
|
32
|
+
|
33
|
+
$geekdict help t
|
34
|
+
Usage:
|
35
|
+
geekdict t
|
36
|
+
|
37
|
+
Options:
|
38
|
+
-d, [--debug], [--no-debug]
|
39
|
+
|
40
|
+
Translate a word
|
41
|
+
|
42
|
+
|
22
43
|
TODOs
|
23
44
|
-----
|
24
45
|
It's under active development until it satisfy my needs. Below are something in my mind:
|
data/geekdict.gemspec
CHANGED
@@ -7,7 +7,8 @@ Gem::Specification.new do |s|
|
|
7
7
|
s.version = GeekDict::VERSION
|
8
8
|
s.authors = ["Bruce Li"]
|
9
9
|
s.email = ["wbinglee@gmail.com"]
|
10
|
-
s.
|
10
|
+
s.licenses = ['MIT']
|
11
|
+
s.homepage = "https://github.com/wbinglee/geekdict"
|
11
12
|
s.summary = %q{A command line tool for translation.}
|
12
13
|
s.description = %q{A command line tool for translation.}
|
13
14
|
|
data/lib/geekdict/cli.rb
CHANGED
@@ -1,18 +1,19 @@
|
|
1
1
|
require "thor"
|
2
|
-
|
2
|
+
require_relative 'local_history'
|
3
3
|
module GeekDict
|
4
4
|
|
5
|
-
|
5
|
+
class CLI < Thor
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
7
|
+
desc "t", "Translate a word"
|
8
|
+
option :debug, :aliases=>'-d', :type=>:boolean,:default=>false
|
9
|
+
def t(word)
|
10
|
+
GeekDict.debugger options[:debug]
|
11
|
+
LocalHistory.save word
|
12
|
+
result = GeekDict::Youdao.translate word
|
13
|
+
output = result.join "\n"
|
14
|
+
puts output
|
15
|
+
output
|
16
|
+
end
|
16
17
|
|
17
|
-
|
18
|
+
end
|
18
19
|
end
|
data/lib/geekdict/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geekdict
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruce Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -83,14 +83,16 @@ files:
|
|
83
83
|
- lib/geekdict.rb
|
84
84
|
- lib/geekdict/cli.rb
|
85
85
|
- lib/geekdict/debugger.rb
|
86
|
+
- lib/geekdict/local_history.rb
|
86
87
|
- lib/geekdict/version.rb
|
87
88
|
- lib/geekdict/youdao/api.rb
|
88
89
|
- lib/geekdict/youdao/config.rb
|
89
90
|
- spec/cli_spec.rb
|
90
91
|
- spec/debugger_spec.rb
|
91
92
|
- spec/youdao/api_spec.rb
|
92
|
-
homepage:
|
93
|
-
licenses:
|
93
|
+
homepage: https://github.com/wbinglee/geekdict
|
94
|
+
licenses:
|
95
|
+
- MIT
|
94
96
|
metadata: {}
|
95
97
|
post_install_message:
|
96
98
|
rdoc_options: []
|
@@ -116,3 +118,4 @@ test_files:
|
|
116
118
|
- spec/cli_spec.rb
|
117
119
|
- spec/debugger_spec.rb
|
118
120
|
- spec/youdao/api_spec.rb
|
121
|
+
has_rdoc:
|