bing_dictionary 0.1.3 → 0.1.4

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: 8c815fd924860c6926cec410939ee4c1012a2698
4
- data.tar.gz: 2a74d6e5d1bc2776ed51629feaf7f741d03a1e8c
3
+ metadata.gz: dbc50af5b5ddf83a0775fe03469d2fc42bc5d0df
4
+ data.tar.gz: 986b3a6e3b531094b82dfce73cdc9600932baad9
5
5
  SHA512:
6
- metadata.gz: c80f47b478f95e684a23cf71a25ce9fea3d2aa2d44cc41dd327dd6f815f0c2e9f50acb0333eb6b2d4ea12ba258e89c9f444f6bb64ac43f16f9c626852023ce3b
7
- data.tar.gz: c07bcf66d85f0d60ae7487cae295df5e0dde29083550a21fe515fd685309519ee234014cb5b9d2f24b97aefd4054c9eb0f6d2b4b128e9476480a8d45b2cd1cff
6
+ metadata.gz: 295bcaed92324fc045cecc392cd9d8c2ed1fcd21d1e93118dbe7dbc9a5091db98989051e1e02f59602ee28e4f3e35edb576f13cd3de957ab901af93882ff313f
7
+ data.tar.gz: d32676c749a9f616ea190f15b6bb463fe380cd1ca145948dc67570eb70bd2ee8bfe4597c609c94ad5cd4b90e4a246032aca26dfe1450fa91c948bea2e4b784fc
data/README.md CHANGED
@@ -10,18 +10,6 @@ It uses http://cn.bing.com/dict/ to query.
10
10
 
11
11
  ## Installation
12
12
 
13
- Add this line to your application's Gemfile:
14
-
15
- ```ruby
16
- gem 'bing_dictionary'
17
- ```
18
-
19
- And then execute:
20
-
21
- $ bundle
22
-
23
- Or install it yourself as:
24
-
25
13
  $ gem install bing_dictionary
26
14
 
27
15
  ## Usage
@@ -29,23 +17,18 @@ A `dict` runable bin file provided.
29
17
 
30
18
  DEMO:
31
19
 
32
- dict cake
33
- dict 蛋糕
34
-
35
- You can make it work tegother with Vim by add follows to $HOME/.vimrc
36
-
37
- nnoremap <leader>d :!dict <cword><CR>
38
- vnoremap <leader>d y:!dict <c-r>"<CR>
20
+ $ dict cake
21
+ $ dict 蛋糕
39
22
 
40
23
  ## Support long sentence
41
24
  Now long sentence is supported
42
25
 
43
- dict 你好吗
44
- dict How old are you
26
+ $ dict 你好吗
27
+ $ dict How old are you
45
28
 
46
29
  ## Support fuzzy query
47
30
 
48
- dict hexxo
31
+ $ dict hexxo
49
32
 
50
33
  您要找的是不是
51
34
 
@@ -55,11 +38,30 @@ Now long sentence is supported
55
38
  hexode六极管
56
39
  ...
57
40
 
58
- ## For Mac user
59
- You can open your local dictionary.app with `open dict://someword`. It may be faster.
60
- Add following to your vimrc to make it work in vim:
41
+ ## Support Chinese to English
61
42
 
62
- nnoremap <leader>dd :!open dic://<cword><CR>
43
+ $ dict 单片机
44
+ 单片机
45
+
46
+ 网络 MCU; Single Chip Microcomputer; Microcontroller
47
+
48
+ The monolithic integrated circuit occurs the explanation , did not understand may have a look !
49
+ 单片机发生的讲解,不懂得可以看看!
50
+ ...
51
+
52
+ ## More options
53
+
54
+ $ dict --help
55
+ Example: dict hello
56
+ -p, --[no-]pronounce Pronounce the word
57
+ -j, --[no-]jump Jump to web page
58
+ -v, --version Show the version
59
+
60
+ ## Work with vim
61
+ You can make it work tegother with Vim by add follows to $HOME/.vimrc
62
+
63
+ nnoremap <leader>d :!dict <cword><CR>
64
+ vnoremap <leader>d y:!dict <c-r>"<CR>
63
65
 
64
66
  ## Thanks
65
67
  Heavily borrowed from [Command-Line-Youdao-Dictionary](https://github.com/qhwa/Command-Line-Youdao-Dictionary)
@@ -79,11 +79,11 @@ class String
79
79
  COLORS = %w(black red green yellow blue magenta cyan white)
80
80
  COLORS.each_with_index do |color, idx|
81
81
  define_method color do
82
- "\e[3#{idx}m" << self.to_s << "\e[0m"
82
+ $stdout.tty? ? "\e[3#{idx}m" << self.to_s << "\e[0m" : self
83
83
  end
84
84
 
85
85
  define_method "#{color}_bg" do
86
- "\e[4#{idx}m" << self.to_s << "\e[0m"
86
+ $stdout.tty? ? "\e[4#{idx}m" << self.to_s << "\e[0m" : self
87
87
  end
88
88
  end
89
89
 
@@ -1,3 +1,3 @@
1
1
  module BingDictionary
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bing_dictionary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - lingceng