bing_dictionary 0.1.5 → 0.1.6

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
- SHA1:
3
- metadata.gz: 5f98c43922d4b8eb91fc37102a51a839a58532f2
4
- data.tar.gz: 29562da51e61ee74c77ae6202905a0f4fdba8768
2
+ SHA256:
3
+ metadata.gz: 81839a4a2c0db47ca6748695874d665d5da117275e8008ebb9d30d258e794ca8
4
+ data.tar.gz: a907576387cbf7d109bcc14ff97c9ee97d9e3da695b8ad6427345952c0a3b58e
5
5
  SHA512:
6
- metadata.gz: b0c7bfbd5134fe649a0be47bb50d29c39416b260ef3c48168e1a42d10c1b08964d9f22f9d4d733075b01d0f27f585c06738d745abc025d2e7dfe1b7fd01e53a7
7
- data.tar.gz: 8f6a1f96a3afa854e01d581fb89287f777674c90d24c267b6e7f894eaa0718d3f3b609703c0a410ab0b315b6639cf97b09ef7f6082854cb17e57261fdb4cb7d4
6
+ metadata.gz: 342c0525ed961f9d6b4c2f4c7aa71a90f1e57ac980d37cabc89d625b2c38211e6026e175ef2df3d9866a92494442084f2b26501c6faff2e8e679c9c141708ff3
7
+ data.tar.gz: cef434ed6cc6b22ce04e0c9b777943e4af2c29819984ead8826e48ac08ac170c6b80691f9f980e815d40d4877c7d814380140e5863de6a6339eaf316a21adaca
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # BingDictionary
2
2
 
3
- 这是一个ruby脚本,用来在命令行中直接查询单词含义,免去打开软件或浏览器的麻烦。
4
-
5
3
  Here is a command line dictionary written with ruby that can
6
- translate English to Chinese.
4
+ translate English to Chinese or vice versa.
7
5
 
8
6
  It uses http://cn.bing.com/dict/ to query.
9
7
  ![DEMO ](./dict.png)
@@ -53,6 +51,11 @@ Now long sentence is supported
53
51
  All queried word default cached to ~/.bing_dictionary.db.
54
52
  So it's much faster when you query the word again.
55
53
 
54
+ [Here](https://github.com/first20hours/google-10000-english) have the most common English words.
55
+ You can cache them all with following script:
56
+
57
+ curl https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-no-swears.txt | while read line; do dict $line; done
58
+
56
59
  ## More options
57
60
 
58
61
  $ dict --help
@@ -63,19 +66,14 @@ So it's much faster when you query the word again.
63
66
  -v, --version Show the version
64
67
 
65
68
  ## Work with vim
66
- You can make it work tegother with Vim by add follows to $HOME/.vimrc
67
-
68
- nnoremap <leader>d :!dict <cword><CR>
69
- vnoremap <leader>d y:!dict <c-r>"<CR>
69
+ You can make it work tegother with Vim with [bing_dictionary.vim](https://github.com/lingceng/bing_dictionary.vim)
70
70
 
71
71
  ## Thanks
72
72
  Heavily borrowed from [Command-Line-Youdao-Dictionary](https://github.com/qhwa/Command-Line-Youdao-Dictionary)
73
73
 
74
74
  ## Development
75
75
 
76
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
77
-
78
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
76
+ bundle exec ./bin/dict --no-cache hello
79
77
 
80
78
  ## Contributing
81
79
 
@@ -8,9 +8,10 @@ Gem::Specification.new do |spec|
8
8
  spec.version = BingDictionary::VERSION
9
9
  spec.authors = ["lingceng"]
10
10
  spec.email = ["lingceng2008@gmail.com"]
11
+ spec.licenses = "MIT"
11
12
 
12
13
  spec.summary = %q{Command line dictionary grabing http://cn.bing.com/}
13
- spec.description = %q{Command line dictionary grabing http://cn.bing.com/}
14
+ spec.description = %q{With local cache and can work with vim}
14
15
  spec.homepage = "https://github.com/lingceng/bing_dictionary"
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
@@ -18,8 +19,8 @@ Gem::Specification.new do |spec|
18
19
  spec.executables = 'dict'
19
20
  spec.require_paths = ["lib"]
20
21
 
21
- spec.add_development_dependency "bundler", "~> 1.11"
22
- spec.add_development_dependency "rake", "~> 10.0"
22
+ spec.add_development_dependency "bundler", ">= 2.2.10"
23
+ spec.add_development_dependency "rake", ">= 12.3.3"
23
24
  spec.add_development_dependency "minitest", "~> 5.0"
24
25
 
25
26
  spec.add_dependency "nokogiri", "~> 1.6"
@@ -15,7 +15,7 @@ module BingDictionary
15
15
  end
16
16
 
17
17
  def initialize(word, options = {})
18
- file = open("http://cn.bing.com/dict/?q=#{CGI::escape(word)}")
18
+ file = URI.open("http://cn.bing.com/dict/?q=#{CGI::escape(word)}")
19
19
  self.word = word
20
20
  self.doc = Nokogiri::HTML(file)
21
21
  self.options = options
@@ -1,3 +1,3 @@
1
1
  module BingDictionary
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bing_dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - lingceng
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-07 00:00:00.000000000 Z
11
+ date: 2021-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.11'
19
+ version: 2.2.10
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.11'
26
+ version: 2.2.10
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: 12.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: 12.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.6'
69
- description: Command line dictionary grabing http://cn.bing.com/
69
+ description: With local cache and can work with vim
70
70
  email:
71
71
  - lingceng2008@gmail.com
72
72
  executables:
@@ -88,7 +88,8 @@ files:
88
88
  - lib/bing_dictionary.rb
89
89
  - lib/bing_dictionary/version.rb
90
90
  homepage: https://github.com/lingceng/bing_dictionary
91
- licenses: []
91
+ licenses:
92
+ - MIT
92
93
  metadata: {}
93
94
  post_install_message:
94
95
  rdoc_options: []
@@ -105,8 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
106
  - !ruby/object:Gem::Version
106
107
  version: '0'
107
108
  requirements: []
108
- rubyforge_project:
109
- rubygems_version: 2.6.8
109
+ rubygems_version: 3.0.6
110
110
  signing_key:
111
111
  specification_version: 4
112
112
  summary: Command line dictionary grabing http://cn.bing.com/