dezo 0.1.1 → 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
2
  SHA256:
3
- metadata.gz: 5f38e2cd02580e47f917a241241f68877ca3831e39448b6a5e2a42095652e05a
4
- data.tar.gz: ecb261b9e8b2828b9b608910a45e7f9507fe333a46bef6386e7e689de59f7b57
3
+ metadata.gz: b8f0bef752461b9ca2c2af7e00dedb87824ca1a886d22a50f40febc879dc2c83
4
+ data.tar.gz: 31b5f1106626ab6d6b32e2335d08d011582c1543d4231353b85d6de88b6b25a2
5
5
  SHA512:
6
- metadata.gz: 20a77b4b6384591e2acab26e4b8b30eed189f3dbf6bb96ccd406fdf283a65e2649f37bbe9b8a9692b87f184f2f7c15cdb25ab6735af12ad3a1220aabd3eef982
7
- data.tar.gz: 1ce909af4abddfd7959a5f51803bf3a22e46219f41f9cd1c5c3efbc36d383a0253edcf6cb74d8eaca965f714445b8395b7e77222f0093d35e4f7fa6cf4ff1f91
6
+ metadata.gz: 6f5e3b7c5be637c3b9d008423175ad83057eb2f93bc4bc190e3968850f977be0bca055fab6335b08bb420779d46cbc6d7a7e27d465ff3d88bbdbe3cdc0291cd5
7
+ data.tar.gz: bb880498b7490880322c98d0cdbc1ecd6b2720c9df3fa2c5b1a4dbf4e3b9e231744949121c15dd31a9d99e82917440400810a8d1b2aa680bde7f6bb030281820
data/Gemfile.lock CHANGED
@@ -1,29 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dezo (0.1.0)
5
- activesupport
6
- thor
4
+ dezo (0.1.5)
7
5
 
8
6
  GEM
9
7
  remote: https://rubygems.org/
10
8
  specs:
11
- activesupport (6.0.1)
12
- concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (>= 0.7, < 2)
14
- minitest (~> 5.1)
15
- tzinfo (~> 1.1)
16
- zeitwerk (~> 2.2)
17
- concurrent-ruby (1.1.5)
18
- i18n (1.7.0)
19
- concurrent-ruby (~> 1.0)
20
- minitest (5.13.0)
21
9
  rake (10.5.0)
22
- thor (0.20.3)
23
- thread_safe (0.3.6)
24
- tzinfo (1.2.5)
25
- thread_safe (~> 0.1)
26
- zeitwerk (2.2.1)
27
10
 
28
11
  PLATFORMS
29
12
  ruby
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Dezo
2
- Dezo is a cli tool that transrates Japanese between English.
2
+ Dezo is a cli tool that transrates a word Japanese between English.
3
3
 
4
4
 
5
5
  ## Installation
@@ -18,6 +18,18 @@ and then type a word which you wanna transrate.
18
18
 
19
19
  ![dezo1](https://user-images.githubusercontent.com/32477095/70144939-543e2400-16e2-11ea-80a0-c458d37b9aa4.gif)
20
20
 
21
+ or
22
+
23
+ you can write oneline
24
+
25
+ ```
26
+ $ dezo word
27
+ ```
28
+
29
+ ```
30
+ $ dezo word1 word2 ...
31
+ ```
32
+
21
33
 
22
34
  ## Depends on
23
35
  Dezo depends on デ辞蔵Webサービス
data/dezo.gemspec CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Yuma Ishikawa"]
10
10
  spec.email = ["yuma.fuu05@gmail.com"]
11
11
 
12
- spec.summary = "dezo can transrate tool on cli."
13
- spec.description = "dezo can transrate japanese and english."
12
+ spec.summary = "dezo transrates words on cli."
13
+ spec.description = "dezo transrates words on cli."
14
14
  spec.homepage = "https://github.com/YumaFuu/dezo"
15
15
 
16
16
 
data/exe/dezo CHANGED
@@ -2,12 +2,23 @@
2
2
 
3
3
  require "dezo"
4
4
 
5
- loop do
6
- print "word> "
7
- word = gets.chomp
8
- #word = Word.new
5
+ if ARGV != []
6
+ words = ARGV
7
+ words.each do |word|
8
+ Dezo.search(word)
9
+ end
10
+ else
11
+ loop do
12
+ print "word> "
13
+ begin
14
+ word = STDIN.gets.chomp
15
+ rescue Interrupt
16
+ puts "\nBye"
17
+ break
18
+ end
9
19
 
10
- break if word === "Q"
11
- next if word == ""
12
- Dezo.search(word)
20
+ break if word === "Q"
21
+ next if word == ""
22
+ Dezo.search(word)
23
+ end
13
24
  end
data/lib/dezo.rb CHANGED
@@ -8,12 +8,22 @@ module Dezo
8
8
 
9
9
  GET_ID_ENDPOINT = "http://public.dejizo.jp/NetDicV09.asmx/SearchDicItemLite"
10
10
  GET_ITEM_ENDPOINT = "http://public.dejizo.jp/NetDicV09.asmx/GetDicItemLite"
11
+ GOOGLE_SEARCH_ENDPOINT = "https://google.com/search"
11
12
 
12
13
  class << self
13
14
  def search(word)
14
15
  is_japanese = word =~ /(?:\p{Hiragana}|\p{Katakana}|[一-龠々])/
15
16
  dic_type = is_japanese ? "EdictJE" : "EJdict"
16
- search_service(dic_type, word)
17
+ result = search_service(dic_type, word)
18
+
19
+ if result.nil?
20
+ search_language = is_japanese ? "英語" : "日本語"
21
+ puts "You wanna search in google? (y / n)"
22
+ ans = gets.chomp
23
+ if ans == "y" || ans == "Y"
24
+ `open #{GOOGLE_SEARCH_ENDPOINT}?q=#{word}+#{search_language}`
25
+ end
26
+ end
17
27
  end
18
28
 
19
29
  def search_service(dic_type, word)
data/lib/dezo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Dezo
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dezo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuma Ishikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-04 00:00:00.000000000 Z
11
+ date: 2019-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,7 +38,7 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
- description: dezo can transrate japanese and english.
41
+ description: dezo transrates words on cli.
42
42
  email:
43
43
  - yuma.fuu05@gmail.com
44
44
  executables:
@@ -78,5 +78,5 @@ requirements: []
78
78
  rubygems_version: 3.0.4
79
79
  signing_key:
80
80
  specification_version: 4
81
- summary: dezo can transrate tool on cli.
81
+ summary: dezo transrates words on cli.
82
82
  test_files: []