c3po 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -11
- data/lib/c3po/translator.rb +5 -1
- data/lib/c3po/translator/result.rb +3 -1
- data/lib/c3po/version.rb +5 -0
- metadata +16 -18
- data/Gemfile +0 -3
- data/init.rb +0 -2
data/README.md
CHANGED
@@ -1,16 +1,17 @@
|
|
1
1
|
C3PO
|
2
2
|
====
|
3
3
|
|
4
|
-
Ruby translator client.
|
4
|
+
Ruby translator client.
|
5
|
+
|
6
|
+
Current backends :
|
5
7
|
|
6
8
|
* Google Translate
|
7
9
|
* Bing Translate
|
8
10
|
|
9
11
|
Ruby 1.9.2 is strongly recommanded.
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
----------
|
13
|
+
Dependencies
|
14
|
+
------------
|
14
15
|
|
15
16
|
`libcurl4-gnutls-dev`
|
16
17
|
|
@@ -55,13 +56,9 @@ translator.is # => :en
|
|
55
56
|
translator.is?(:de) # => false
|
56
57
|
```
|
57
58
|
|
58
|
-
Todo
|
59
|
-
----
|
60
|
-
|
61
|
-
* More specs
|
62
|
-
* Use it
|
63
|
-
|
64
59
|
Copyright
|
65
60
|
---------
|
66
61
|
|
67
|
-
|
62
|
+
Copyright (c) 2011 af83
|
63
|
+
|
64
|
+
Released under the MIT license
|
data/lib/c3po/translator.rb
CHANGED
@@ -16,7 +16,11 @@ class C3po
|
|
16
16
|
# @since 0.0.1
|
17
17
|
#
|
18
18
|
def translate(from, to)
|
19
|
-
@result.
|
19
|
+
if @result.send(to)
|
20
|
+
@result.send(to)
|
21
|
+
else
|
22
|
+
@result.send("#{to}=", fetch(@adaptor.build_query(from, to)))
|
23
|
+
end
|
20
24
|
end
|
21
25
|
|
22
26
|
# Grab languages list from provider.
|
data/lib/c3po/version.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: c3po
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-01-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &16812760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '2.6'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *16812760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: typhoeus
|
27
|
-
requirement: &
|
27
|
+
requirement: &16812260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 0.2.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *16812260
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: nokogiri
|
38
|
-
requirement: &
|
38
|
+
requirement: &16811760 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 1.5.0
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *16811760
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: yajl-ruby
|
49
|
-
requirement: &
|
49
|
+
requirement: &16811200 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,25 +54,23 @@ dependencies:
|
|
54
54
|
version: 0.8.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *16811200
|
58
58
|
description: Ruby translation client
|
59
59
|
email: jboyer@af83.com
|
60
60
|
executables: []
|
61
61
|
extensions: []
|
62
|
-
extra_rdoc_files:
|
63
|
-
- README.md
|
62
|
+
extra_rdoc_files: []
|
64
63
|
files:
|
65
64
|
- LICENSE
|
66
65
|
- README.md
|
67
|
-
- Gemfile
|
68
66
|
- lib/c3po.rb
|
69
|
-
- lib/c3po/
|
67
|
+
- lib/c3po/client.rb
|
68
|
+
- lib/c3po/translator.rb
|
70
69
|
- lib/c3po/translator/bing.rb
|
70
|
+
- lib/c3po/translator/configuration.rb
|
71
71
|
- lib/c3po/translator/google.rb
|
72
72
|
- lib/c3po/translator/result.rb
|
73
|
-
- lib/c3po/
|
74
|
-
- lib/c3po/translator.rb
|
75
|
-
- init.rb
|
73
|
+
- lib/c3po/version.rb
|
76
74
|
homepage:
|
77
75
|
licenses: []
|
78
76
|
post_install_message:
|
@@ -93,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
93
91
|
version: '0'
|
94
92
|
requirements: []
|
95
93
|
rubyforge_project:
|
96
|
-
rubygems_version: 1.8.
|
94
|
+
rubygems_version: 1.8.10
|
97
95
|
signing_key:
|
98
96
|
specification_version: 3
|
99
97
|
summary: Ruby translation client
|
data/Gemfile
DELETED
data/init.rb
DELETED