tureng-cli 0.0.1.1 → 0.0.2

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
  SHA1:
3
- metadata.gz: 86f0d1cae06d35d1eaf40f5d197dd5565ec729d5
4
- data.tar.gz: 3d2b7b9282cded52286c4715d2588f81800a182d
3
+ metadata.gz: 813d5c3907cdd4223cf7fdc5e36897ed9cd433a1
4
+ data.tar.gz: f38d81de3c33a12a6b08d2d0a0dbe1c1ac6aa362
5
5
  SHA512:
6
- metadata.gz: 0107306c1234fd946e4290e8601ccddfb652a62b4f6f89679f6707a5483f6c6a9d1288143bb56aa62b6af873a10ed13090a1e5dbe2abeed3ef7ea67a62eb3769
7
- data.tar.gz: 12e52239f89e5cc6741a44a083c0b948ca4900395acab02be885292fd5aa9f3987ccc5e393c07c6ea0722dcac0c4c29e9e8314e258458e87c1308d2c19e4a3dd
6
+ metadata.gz: a704564472a3132e2e9813f4cad048c323e3171a5e47fd4dbaa3305b37307252d5443052b491d7c733ff59ff1fa34549aa2f7ef3c1ce44be6e119b48f40de7d2
7
+ data.tar.gz: 4a85c665d333b393468509592b557d15275658f36f0f4905e7ee5cdd400848cb8be1424d8a1f5d1ee8311e1d5437b328960fc26e004094b932a3fc0be461c765
data/.gitignore CHANGED
@@ -1,2 +1,3 @@
1
1
  Gemfile.lock
2
- results.html
2
+ results.html
3
+ *.gem
data/README.md CHANGED
@@ -4,7 +4,15 @@ msdundar'ın [tureng betiği](https://github.com/msdundar/tureng)'ne GLI gem'i k
4
4
 
5
5
  ## Kurulum ve Kullanım
6
6
 
7
- Henüz program ruby gem'ine çevrilmediğinden kaynaktan klonlayıp kullanabilirsiniz.
7
+ Rubygems'den indirmek için
8
+
9
+ ```
10
+ $ gem install tureng-cli
11
+ $ gem install nokogiri
12
+ $ gem install text-table
13
+ ```
14
+
15
+ Kaynaktan klonlayıp kullanmak için.
8
16
 
9
17
  ```
10
18
  $ git clone https://github.com/alienaut/tureng
@@ -15,7 +23,7 @@ $ bundle install
15
23
  İnglizceden, türkçeye çeviri yapmak için:
16
24
 
17
25
  ```
18
- $ bundle exec bin/tureng en ruby
26
+ $ tureng en ruby
19
27
  O====O==============O=========O=========================================O
20
28
  | ## | Category | English | Turkish |
21
29
  O====O==============O=========O=========================================O
@@ -37,7 +45,7 @@ O====O==============O=========O=========================================O
37
45
  Türkçeden, ingilizceye çeviri yapmak için:
38
46
 
39
47
  ```
40
- $ bundle exec bin/tureng tr yakut
48
+ $ tureng tr yakut
41
49
  O====O==============O=========O===============O
42
50
  | ## | Category | Turkish | English |
43
51
  O====O==============O=========O===============O
@@ -54,7 +62,7 @@ O====O==============O=========O===============O
54
62
  Listelenen çevirileri sınırlamak için:
55
63
 
56
64
  ```
57
- $ bundle exec bin/tureng -l 5 en ruby
65
+ $ tureng -l 5 en ruby
58
66
  O====O==============O=========O================O
59
67
  | ## | Category | English | Turkish |
60
68
  O====O==============O=========O================O
@@ -69,7 +77,7 @@ O====O==============O=========O================O
69
77
  Diğer terimler tablosunu görüntülemek için:
70
78
 
71
79
  ```
72
- $ bundle exec bin/tureng -f en ruby
80
+ $ tureng -f en ruby
73
81
  O====O===========O==================O========================O
74
82
  | ## | Category | English | Turkish |
75
83
  O====O===========O==================O========================O
@@ -101,10 +109,10 @@ O====O===========O==================O========================O
101
109
 
102
110
  ```
103
111
 
104
- Yardım ve mevcut komutları görüntülemek için:
112
+ Yardımı ve mevcut komutları görüntülemek için:
105
113
 
106
114
  ```
107
- $ bundle exec bin/tureng --help
115
+ $ tureng --help
108
116
  ```
109
117
 
110
118
  ## Bilinen Hatalar
@@ -112,7 +120,7 @@ $ bundle exec bin/tureng --help
112
120
  İngilizce bir kelilme türkçe olarak arandığında hata veriyor:
113
121
 
114
122
  ```
115
- $ bundle exec bin/tureng tr ruby
123
+ $ tureng tr ruby
116
124
  error: undefined method `css' for nil:NilClass
117
125
  ```
118
126
 
@@ -120,6 +128,7 @@ error: undefined method `css' for nil:NilClass
120
128
 
121
129
  * Proje ruby gem'ine çevirelerek kurulum kolaylaştırılacak.
122
130
  * İngilizce Readme dosyası hazırlanacak.
131
+ * Rdoc dökümantasyonu hazırlanacak
123
132
 
124
133
  ## Uyarı
125
134
 
@@ -13,7 +13,7 @@ module Tureng
13
13
 
14
14
  class Translator
15
15
  attr_reader :word, :limit, :language_code, :table_type, :table, :status,
16
- :table_tag, :response
16
+ :table_tag, :response, :uri
17
17
 
18
18
  def initialize(word, settings = {})
19
19
  @word = word
@@ -26,6 +26,7 @@ module Tureng
26
26
  horizontal_boundary: '|',
27
27
  boundary_intersection: 'O'
28
28
  )
29
+ @uri = URI.escape(SEARCH_URL + word)
29
30
  @table_id = set_table_id
30
31
  @response = get_response
31
32
  @status = @response.css('h1')[1].text.strip
@@ -39,7 +40,8 @@ module Tureng
39
40
  end
40
41
 
41
42
  def get_response
42
- Nokogiri::HTML(open(SEARCH_URL + word), nil, 'utf-8')
43
+
44
+ Nokogiri::HTML(open(uri), nil, 'utf-8')
43
45
  end
44
46
 
45
47
  def parse_table_from_response
@@ -1,3 +1,3 @@
1
1
  module Tureng
2
- VERSION = '0.0.1.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tureng-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Your Name Here
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-19 00:00:00.000000000 Z
11
+ date: 2014-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake