bilisim_sozlugu 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bilisim_sozlugu.gemspec +1 -1
- data/bin/sozluk +9 -0
- data/lib/bilisim_sozlugu.rb +4 -6
- data/lib/bilisim_sozlugu/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f25847a76600e63082fbfc6eedc61e25780ed38b
|
4
|
+
data.tar.gz: 196c94fbf9c0f51fd2433392b8921b2f9eb57426
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81f9297fb6a72726eb790e3b18589960d8553412a6a3feb5c772b7f947375f7d1b7ef8d1dbf9a63b00847231982489f660cf79227349a7569665c9e1acc6ef50
|
7
|
+
data.tar.gz: 477284e53771ae2a16592379db7c27ac9dd0f3515962b798c59e05097b7b5b4f0dc940a3c56d1aadd5d90308df9ad7cabc8e304e3fa807f8f710531b4a8f0f4f
|
data/bilisim_sozlugu.gemspec
CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables =
|
17
|
+
spec.executables = 'sozluk'
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
data/bin/sozluk
ADDED
data/lib/bilisim_sozlugu.rb
CHANGED
@@ -6,19 +6,17 @@ require 'terminal-table'
|
|
6
6
|
require "bilisim_sozlugu/version"
|
7
7
|
|
8
8
|
module BilisimSozlugu
|
9
|
-
URL = "http://www.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama="
|
9
|
+
URL = "http://www.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama=".freeze
|
10
|
+
CSS_SELECTOR = "table tbody tr".freeze
|
10
11
|
|
11
12
|
def self.search(word)
|
12
|
-
words = []
|
13
13
|
call_url = URL + word
|
14
14
|
page = Nokogiri::HTML(open(call_url))
|
15
|
-
rows = page.css(
|
15
|
+
rows = page.css(CSS_SELECTOR)
|
16
16
|
if rows.last.text == "Aranan Kelime "
|
17
17
|
puts "Aradığınız kelime bulunamadı."
|
18
18
|
else
|
19
|
-
rows.
|
20
|
-
words << [row.children.first.children.text, row.children.last.text]
|
21
|
-
end
|
19
|
+
words = rows.map { |row| [row.children.first.children.text, row.children.last.text] }
|
22
20
|
table = Terminal::Table.new :rows => words.drop(2)
|
23
21
|
puts table
|
24
22
|
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: 0.0.2
|
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: 2015-04-
|
11
|
+
date: 2015-04-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -70,7 +70,8 @@ description: Translating English words which are used in computer world to Turki
|
|
70
70
|
from Informatics Association of Turkey offical website.
|
71
71
|
email:
|
72
72
|
- enderyurt@gmail.com
|
73
|
-
executables:
|
73
|
+
executables:
|
74
|
+
- sozluk
|
74
75
|
extensions: []
|
75
76
|
extra_rdoc_files: []
|
76
77
|
files:
|
@@ -80,6 +81,7 @@ files:
|
|
80
81
|
- README.md
|
81
82
|
- Rakefile
|
82
83
|
- bilisim_sozlugu.gemspec
|
84
|
+
- bin/sozluk
|
83
85
|
- lib/bilisim_sozlugu.rb
|
84
86
|
- lib/bilisim_sozlugu/version.rb
|
85
87
|
homepage: ''
|