bilisim_sozlugu 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/sozluk +3 -3
- data/lib/bilisim_sozlugu.rb +6 -6
- data/lib/bilisim_sozlugu/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3984ac925d7e3be93e6ca52df1d626f889ca3da4
|
4
|
+
data.tar.gz: 415ae4b16edcfa5ab67612c78db9273c40096d48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bfe8737a9191b6c2784feff3378fdb8866fbf6f8cda7c39b049feccda9a868ad0ebe2659b29788ca1145b979b872e133c1006ba4f528cc7ef73c82c8432ca06
|
7
|
+
data.tar.gz: b09027bd4b79374021ef081ac1dfdccf22106ed2bf54f9d73bccecf2f378fe49b6f9ddf1b4df95281673bfc870b542d979f089f99f5e944c1f6316a8c79d7436
|
data/bin/sozluk
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
require 'bilisim_sozlugu'
|
3
3
|
|
4
4
|
if ARGV.empty?
|
5
|
-
|
5
|
+
puts "Lütfen geçerli bir komut giriniz."
|
6
6
|
else
|
7
|
-
|
8
|
-
|
7
|
+
puts "Lütfen bekleyiniz...\n"
|
8
|
+
BilisimSozlugu.search(ARGV[0])
|
9
9
|
end
|
data/lib/bilisim_sozlugu.rb
CHANGED
@@ -2,23 +2,23 @@ require "rubygems"
|
|
2
2
|
require "open-uri"
|
3
3
|
require "nokogiri"
|
4
4
|
require 'terminal-table'
|
5
|
-
|
6
5
|
require "bilisim_sozlugu/version"
|
7
6
|
|
8
7
|
module BilisimSozlugu
|
9
|
-
URL
|
8
|
+
URL = "http://eski.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama=".freeze
|
10
9
|
CSS_SELECTOR = "table tbody tr".freeze
|
11
10
|
|
12
11
|
def self.search(word)
|
13
12
|
call_url = URL + word
|
14
|
-
page
|
15
|
-
rows
|
16
|
-
|
13
|
+
page = Nokogiri::HTML(open(call_url))
|
14
|
+
rows = page.css(CSS_SELECTOR)
|
15
|
+
|
16
|
+
if rows.last.text.match("Aranan Kelime")
|
17
17
|
puts "Aradığınız kelime bulunamadı."
|
18
18
|
else
|
19
19
|
words = rows.map { |row| [row.children.first.children.text, row.children.last.text] }
|
20
20
|
table = Terminal::Table.new :rows => words.drop(2)
|
21
21
|
puts table
|
22
|
-
end
|
22
|
+
end
|
23
23
|
end
|
24
24
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bilisim_sozlugu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ender Ahmet Yurt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -104,9 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
106
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.
|
107
|
+
rubygems_version: 2.6.8
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: Translate the word from English to Turkish.
|
111
111
|
test_files: []
|
112
|
-
has_rdoc:
|