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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84e19a69e04fe7a0a84e41b45b59e63c7c5512b7
4
- data.tar.gz: f2c01458d6301f936248f8e8b1f4de395ce4ed38
3
+ metadata.gz: 8b34d25becd3be9a26746e8289dd7d39b607a528
4
+ data.tar.gz: f9fba2e1d374c506424e1aff1282b7ceda8ff9c1
5
5
  SHA512:
6
- metadata.gz: ae272c324a1ba68976691c8ef12e9b5c2b8523efb4443c504695213377bbb209ad61cde0188a91d37a976813022f4c4ce95612f0aa8b386da101c20e61e5166b
7
- data.tar.gz: efff522120ad5c8e8a893702f7accf182bc498d70a2047e5f60494448222ae4080b82ad21a144e35e905f2ab5c5019d00978fddccc493a68d7f738f7edfc4df4
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.homepage = ""
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
- class CLI < Thor
5
+ class CLI < Thor
6
6
 
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
- result = GeekDict::Youdao.translate word
12
- output = result.join "\n"
13
- puts output
14
- output
15
- end
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
- end
18
+ end
18
19
  end
@@ -0,0 +1,9 @@
1
+ module LocalHistory
2
+ module_function
3
+
4
+ def save(word)
5
+ open("#{Dir.home}/.geekdict", 'a') { |f|
6
+ f.puts "#{Time.now.utc.iso8601} #{word}"
7
+ }
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module GeekDict
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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.3
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: 2014-08-01 00:00:00.000000000 Z
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: