bilisim_sozlugu 0.0.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e8fceb1e2382066c32d45a1109cb707c01e80e5b
4
- data.tar.gz: 4d4ebbd30704313a338052e213c6a92ce54f189a
2
+ SHA256:
3
+ metadata.gz: 5352629a505e9557ca606f6860c053ec981d501d9cbc5ed5b9b06c3f10360e6f
4
+ data.tar.gz: 62e2a031616ef835f0cb7abe1bd49d50dadac411e78756b5cfbf368cf167a85e
5
5
  SHA512:
6
- metadata.gz: d58524ec102131818ad980520193929c684e24b4e8af25cdb30ffc10026c98fc60ba98c1f43f5f119a85643ee550fc5e8ce05e59fdb86932c45ad2cd1471b7ef
7
- data.tar.gz: 6755e393a319857990d36cd77323251f126063bc830cc961d315d7cb0d71eeda7caa8f5e2f81c4d35da5e8793e0b736ccd78ca2e8650acfa7238fc1d9faeb79e
6
+ metadata.gz: bd8d385a4f1900703350b6e00cd1a7ecc7e4dc6cf05b11f653a6f540fa2adcdf40d480a36a1b5e778bfe8a830a330e342e101ca0810c5b25bc2f74e820a2ba90
7
+ data.tar.gz: 255bbc2741d5e516354beb9466b4d81e16db5adf5faddf02ab23c007d07dfa30dd138204740caf654a99b03527e6c99b2b716ebd889b2d0fbe2d5b88bd7c3ebc
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 |
@@ -8,18 +8,18 @@ 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 the word from English to Turkish."
12
- spec.description = "Translating English words which are used in computer world to Turkish from Informatics Association of Turkey offical website."
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
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
17
+ spec.executables = 'sozluk'
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_development_dependency "bundler", "~> 1.6"
22
22
  spec.add_development_dependency "rake"
23
- spec.add_development_dependency "nokogiri", "~> 1.6.0"
23
+ spec.add_development_dependency "nokogiri", ">= 1.10.8"
24
24
  spec.add_development_dependency "terminal-table"
25
25
  end
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env ruby
2
+ require 'bilisim_sozlugu'
3
+
4
+ if ARGV.empty?
5
+ puts "Lütfen geçerli bir komut giriniz."
6
+ else
7
+ puts "Lütfen bekleyiniz...\n"
8
+ BilisimSozlugu.search(ARGV[0])
9
+ end
@@ -2,25 +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 = "http://www.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama="
8
+ URL = "http://eski.tbd.org.tr/index.php?sayfa=sozluk&mi1&tipi=ara&harf=A&arama=".freeze
9
+ CSS_SELECTOR = "table tbody tr".freeze
10
10
 
11
11
  def self.search(word)
12
- words = []
13
12
  call_url = URL + word
14
- page = Nokogiri::HTML(open(call_url))
15
- rows = page.css("table").css('tbody').css('tr')
16
- if rows.last.text == "Aranan Kelime "
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
- rows.each do |row|
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
- end
22
+ end
25
23
  end
26
24
  end
@@ -1,3 +1,3 @@
1
1
  module BilisimSozlugu
2
- VERSION = "0.0.1"
2
+ VERSION = "1.3.0"
3
3
  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.1
4
+ version: 1.3.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: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2020-11-08 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.6.0
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.6.0
54
+ version: 1.10.8
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: terminal-table
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,11 +66,12 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
- description: Translating English words which are used in computer world to Turkish
70
- from Informatics Association of Turkey offical website.
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
- executables: []
73
+ executables:
74
+ - sozluk
74
75
  extensions: []
75
76
  extra_rdoc_files: []
76
77
  files:
@@ -80,13 +81,14 @@ 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: ''
86
88
  licenses:
87
89
  - MIT
88
90
  metadata: {}
89
- post_install_message:
91
+ post_install_message:
90
92
  rdoc_options: []
91
93
  require_paths:
92
94
  - lib
@@ -101,10 +103,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
101
103
  - !ruby/object:Gem::Version
102
104
  version: '0'
103
105
  requirements: []
104
- rubyforge_project:
105
- rubygems_version: 2.2.2
106
- signing_key:
106
+ rubyforge_project:
107
+ rubygems_version: 2.7.10
108
+ signing_key:
107
109
  specification_version: 4
108
- summary: Translate the word from English to Turkish.
110
+ summary: Translate Computer Terms from English to Turkish.
109
111
  test_files: []
110
- has_rdoc: