iciba 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +3 -4
  2. data/bin/fy +5 -5
  3. data/lib/iciba/version.rb +1 -1
  4. 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 'words to be translated'
24
- $ fy 'english' # for single word answers
25
- $ fy 'english' -e #for complete definition if available
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("-h", "--help", "go to fy.iciba.com") do
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(ARGV.first.dup.force_encoding("UTF-8"), 'auto', true, extended, pinyin)
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)
@@ -1,3 +1,3 @@
1
1
  module Iciba
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iciba
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: