iciba 0.0.11 → 0.0.12
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.
- data/README.md +3 -4
- data/bin/fy +5 -5
- data/lib/iciba/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -20,10 +20,9 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
Command-line usage:
|
22
22
|
|
23
|
-
$ fy
|
24
|
-
$ fy
|
25
|
-
$ fy
|
26
|
-
$ fy 'You will need to have root access to do this.' -p #to get pinyin for chinese characters, (hopefully fy.iciba.com is correct)
|
23
|
+
$ fy words to be translated
|
24
|
+
$ fy english -e #for complete definition if available
|
25
|
+
$ fy You will need to have root access to do this. -p #to get pinyin for chinese characters, (hopefully fy.iciba.com is correct)
|
27
26
|
$ fy http://www.chinadaily.com.cn/business/2012-09/07/content_15742188.htm -l #to download links
|
28
27
|
|
29
28
|
Ruby usage:
|
data/bin/fy
CHANGED
@@ -10,10 +10,10 @@ $links = false
|
|
10
10
|
OptionParser.new do |opts|
|
11
11
|
opts.banner = "Usage: #{File.basename($0)} ('words'|word)"
|
12
12
|
opts.on("-l", "--links", "Download links?") { |b| $links = true }
|
13
|
-
opts.on("-i", "--interactive", "Download links?") { |b| $interactive = true }
|
14
13
|
opts.on("-e", "--extended", "Extended") { |b| $extended = true }
|
15
14
|
opts.on("-p", "--pinyin", "Pinyin") { |b| $pinyin = true }
|
16
|
-
opts.on("-
|
15
|
+
opts.on("-o", "--open", "go to fy.iciba.com") { |b| $pinyin = true }
|
16
|
+
opts.on("-h", "--help", "Print") do
|
17
17
|
puts opts
|
18
18
|
exit 0
|
19
19
|
end
|
@@ -53,9 +53,9 @@ def loop_through_links(links)
|
|
53
53
|
puts '------------------------------------------------------------------------------------' unless text == ''
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
# puts ARGV.join(' ')
|
57
57
|
pinyin = ($pinyin ? true : false)
|
58
58
|
extended = ($extended ? true : false)
|
59
|
-
|
60
|
-
Iciba::Fanyi.new(
|
59
|
+
input_text = ARGV.join(' ').dup.encode("UTF-8")
|
60
|
+
Iciba::Fanyi.new(input_text, 'auto', true, extended, pinyin)
|
61
61
|
loop_through_links(links) if ($links && links.size > 0)
|
data/lib/iciba/version.rb
CHANGED