dezo 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
2
  SHA256:
3
- metadata.gz: 8c6569f65d8edb47fc12cc49f08800f6b8f99fca6e0801b11e44dc3003337f23
4
- data.tar.gz: d838beb106a1e99bae585fda25c6d788a1fd2fd78f16fb22737a14ad2a1cfa59
3
+ metadata.gz: b8f0bef752461b9ca2c2af7e00dedb87824ca1a886d22a50f40febc879dc2c83
4
+ data.tar.gz: 31b5f1106626ab6d6b32e2335d08d011582c1543d4231353b85d6de88b6b25a2
5
5
  SHA512:
6
- metadata.gz: 4368493e5190c6e0c9f77617bf7b9cfe395422b9f70a4967c4294b904ad5ffcf4bdd568ceeae480a1e0ec41f948b7642af63dfb1d38c0ca9ced498367d06be11
7
- data.tar.gz: 79b38e703f4bc85bf858a0ecd1e24528006630b8e562bc8914cc1647ad8845cbeac2d11568b1c10c5d5a5353e4c871feac1c481fd6e221753d8a7ef5bab716e0
6
+ metadata.gz: 6f5e3b7c5be637c3b9d008423175ad83057eb2f93bc4bc190e3968850f977be0bca055fab6335b08bb420779d46cbc6d7a7e27d465ff3d88bbdbe3cdc0291cd5
7
+ data.tar.gz: bb880498b7490880322c98d0cdbc1ecd6b2720c9df3fa2c5b1a4dbf4e3b9e231744949121c15dd31a9d99e82917440400810a8d1b2aa680bde7f6bb030281820
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dezo (0.1.1)
4
+ dezo (0.1.5)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Dezo
2
- VERSION = "0.1.5"
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.5
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-16 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