bilisim_sozlugu 0.0.2 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +4 -1
- data/README.md +1 -3
- data/bilisim_sozlugu.gemspec +3 -3
- data/bin/sozluk +3 -3
- data/lib/bilisim_sozlugu.rb +13 -8
- data/lib/bilisim_sozlugu/version.rb +2 -1
- metadata +13 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6dd0d2be97710eb6d9b84fa2ad2442b264bc66531f64a39035e56406b8f0710b
|
4
|
+
data.tar.gz: bb1e160ac90867e0e775cabe7fb5812b3fff624e768fd4beb8732ca142cc8676
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4a040a5844c224ddd6de879c5a0e31bdb97c3a7f0c85f9b322087aab2159bb4e9fb2899bb416f2619a8e442cb5f153cefa5492e83ce7c3692d2a03db14d7cd1
|
7
|
+
data.tar.gz: bdd67da0e3abb284bf43ab4cf02970bb4e6f816acd7162d970acbe77662c7f6f457c73094f10be13278147eeb1bc2ddf37b86b3f651396b177f3c76c601270a5
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -20,9 +20,7 @@ Or install it yourself as:
|
|
20
20
|
## Usage
|
21
21
|
|
22
22
|
```
|
23
|
-
|
24
|
-
$ require 'bilisim_sozlugu'
|
25
|
-
$ BilisimSozlugu.search('memory')
|
23
|
+
$ sozluk memory
|
26
24
|
|
27
25
|
# +---------------------------+-----------------------------+
|
28
26
|
# | belleği derleyip toplama | memory compaction |
|
data/bilisim_sozlugu.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = BilisimSozlugu::VERSION
|
9
9
|
spec.authors = ["Ender Ahmet Yurt"]
|
10
10
|
spec.email = ["enderyurt@gmail.com"]
|
11
|
-
spec.summary = "Translate
|
12
|
-
spec.description = "Translating English
|
11
|
+
spec.summary = "Translate Computer Terms from English to Turkish."
|
12
|
+
spec.description = "Translating English terms related to Computer Sciences to Turkish from Informatics Association of Turkey's offical website."
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
@@ -20,6 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.6"
|
22
22
|
spec.add_development_dependency "rake"
|
23
|
-
spec.add_development_dependency "nokogiri", "
|
23
|
+
spec.add_development_dependency "nokogiri", ">= 1.10.8"
|
24
24
|
spec.add_development_dependency "terminal-table"
|
25
25
|
end
|
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
@@ -1,24 +1,29 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
1
3
|
require "rubygems"
|
2
4
|
require "open-uri"
|
3
5
|
require "nokogiri"
|
4
6
|
require 'terminal-table'
|
5
|
-
|
6
7
|
require "bilisim_sozlugu/version"
|
7
8
|
|
8
9
|
module BilisimSozlugu
|
9
|
-
|
10
|
-
CSS_SELECTOR = "table tbody tr".freeze
|
10
|
+
extend T::Sig
|
11
11
|
|
12
|
+
URL = T.let("http://eski.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama=".freeze, String)
|
13
|
+
CSS_SELECTOR = T.let("table tbody tr".freeze, String)
|
14
|
+
|
15
|
+
sig {params(word: String).void}
|
12
16
|
def self.search(word)
|
13
|
-
call_url = URL + word
|
14
|
-
page
|
15
|
-
rows
|
16
|
-
|
17
|
+
call_url = T.let(URL + word, String)
|
18
|
+
page = Nokogiri::HTML(open(call_url))
|
19
|
+
rows = page.css(CSS_SELECTOR)
|
20
|
+
|
21
|
+
if rows.last.text.match("Aranan Kelime")
|
17
22
|
puts "Aradığınız kelime bulunamadı."
|
18
23
|
else
|
19
24
|
words = rows.map { |row| [row.children.first.children.text, row.children.last.text] }
|
20
25
|
table = Terminal::Table.new :rows => words.drop(2)
|
21
26
|
puts table
|
22
|
-
end
|
27
|
+
end
|
23
28
|
end
|
24
29
|
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: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ender Ahmet Yurt
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: 1.10.8
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: 1.10.8
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: terminal-table
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,8 +66,8 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description: Translating English
|
70
|
-
|
69
|
+
description: Translating English terms related to Computer Sciences to Turkish from
|
70
|
+
Informatics Association of Turkey's offical website.
|
71
71
|
email:
|
72
72
|
- enderyurt@gmail.com
|
73
73
|
executables:
|
@@ -88,7 +88,7 @@ homepage: ''
|
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata: {}
|
91
|
-
post_install_message:
|
91
|
+
post_install_message:
|
92
92
|
rdoc_options: []
|
93
93
|
require_paths:
|
94
94
|
- lib
|
@@ -103,10 +103,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
103
|
- !ruby/object:Gem::Version
|
104
104
|
version: '0'
|
105
105
|
requirements: []
|
106
|
-
|
107
|
-
|
108
|
-
signing_key:
|
106
|
+
rubygems_version: 3.1.4
|
107
|
+
signing_key:
|
109
108
|
specification_version: 4
|
110
|
-
summary: Translate
|
109
|
+
summary: Translate Computer Terms from English to Turkish.
|
111
110
|
test_files: []
|
112
|
-
has_rdoc:
|