geekdict 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -5
- data/geekdict.gemspec +2 -1
- data/lib/geekdict/cli.rb +11 -4
- data/lib/geekdict/version.rb +1 -1
- data/lib/geekdict/youdao/api.rb +4 -0
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 053b8b18ce1f41931acf408ccadfe262b49eda16
|
4
|
+
data.tar.gz: 48154697b0204e6b8a5270b3f97081720327f888
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5790f2bf30bdc36a1dd831dcd5d561ca560cb681afc5dfc25581ed73c1c145d71e62ed591333ee1f02d6c25b30f9b50d090b6e7ca8c1d7022266889af64bc49
|
7
|
+
data.tar.gz: 03d3cf70aafe5064d6d8bd7efb9278ffb3c092351f512dd463e74a613129e4c982794ba5ca999275ff728eb37b4c64dd5bca70352b4bfa78782df74667fe079d
|
data/README.md
CHANGED
@@ -35,21 +35,24 @@ Use *help* command to get detail information.
|
|
35
35
|
geekdict t
|
36
36
|
|
37
37
|
Options:
|
38
|
-
|
38
|
+
-d, [--debug], [--no-debug]
|
39
|
+
-o, [--open], [--no-open]
|
39
40
|
|
40
41
|
Translate a word
|
41
42
|
|
42
43
|
|
44
|
+
Development
|
45
|
+
----------
|
46
|
+
```
|
47
|
+
bin/console
|
48
|
+
pry>GeekDict::CLI.start(['t','test'])
|
49
|
+
|
43
50
|
TODOs
|
44
51
|
-----
|
45
52
|
It's under active development until it satisfy my needs. Below are something in my mind:
|
46
53
|
* geekdict list : List all words you have searched
|
47
54
|
* geekdict remove : Remove word you know from your new words list
|
48
55
|
* Use google translate engine as alternative, as well as supporting other target language. Low priority, only focus on Chinese.
|
49
|
-
* A simple website
|
50
|
-
- Provide own translate service to translate and save new words
|
51
|
-
- A command line interface to do the same thing like this
|
52
|
-
- A nice web page to show all your new words, which could be a good place to review the new words and remember them.
|
53
56
|
|
54
57
|
License
|
55
58
|
-------
|
data/geekdict.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.rubyforge_project = "geekdict"
|
16
16
|
|
17
17
|
s.files = %w[LICENSE README.md geekdict.gemspec Gemfile Rakefile]
|
18
|
-
s.files += Dir.glob("bin
|
18
|
+
s.files += Dir.glob("bin/geekdict")
|
19
19
|
s.files += Dir.glob("lib/**/*.rb")
|
20
20
|
s.files += Dir.glob("spec/**/*")
|
21
21
|
s.test_files = Dir.glob("spec/**/*")
|
@@ -23,6 +23,7 @@ Gem::Specification.new do |s|
|
|
23
23
|
s.require_paths = ["lib"]
|
24
24
|
|
25
25
|
s.add_development_dependency "rake"
|
26
|
+
s.add_development_dependency "pry"
|
26
27
|
s.add_development_dependency "rspec", "~> 2.13.0"
|
27
28
|
|
28
29
|
s.add_runtime_dependency "thor", "~> 0.19.1"
|
data/lib/geekdict/cli.rb
CHANGED
@@ -6,13 +6,20 @@ module GeekDict
|
|
6
6
|
|
7
7
|
desc "t", "Translate a word"
|
8
8
|
option :debug, :aliases=>'-d', :type=>:boolean,:default=>false
|
9
|
+
option :open, :aliases => '-o', :type => :boolean, :default=> false
|
9
10
|
def t(word)
|
10
11
|
GeekDict.debugger options[:debug]
|
11
12
|
LocalHistory.save word
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
if options[:open]
|
14
|
+
page = GeekDict::Youdao.url word
|
15
|
+
puts "Open Web page : #{page}"
|
16
|
+
`open #{page}`
|
17
|
+
else
|
18
|
+
result = GeekDict::Youdao.translate word
|
19
|
+
output = result.join "\n"
|
20
|
+
puts output
|
21
|
+
output
|
22
|
+
end
|
16
23
|
end
|
17
24
|
|
18
25
|
end
|
data/lib/geekdict/version.rb
CHANGED
data/lib/geekdict/youdao/api.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.5
|
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: 2016-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: pry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rspec
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -118,4 +132,3 @@ test_files:
|
|
118
132
|
- spec/cli_spec.rb
|
119
133
|
- spec/debugger_spec.rb
|
120
134
|
- spec/youdao/api_spec.rb
|
121
|
-
has_rdoc:
|