google_web_translate 0.2.4 → 0.2.5

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
- SHA256:
3
- metadata.gz: 7ffd5385d2f29f6faa1034ea2c9c0f458b063b7aa7b769789352727027e3167d
4
- data.tar.gz: 3809d0162a684d6d452a0b0a83a07fb5fa36ecfbbf9f3967768aa457ffb6a421
2
+ SHA1:
3
+ metadata.gz: 84a0b1e937d840bb96a8f007512e1e5bfa1c7526
4
+ data.tar.gz: 46b98b62a305a6e723f0e28e26c4829bb5f27d42
5
5
  SHA512:
6
- metadata.gz: f901517261b1887923faaaa7ceaf8ea418bab7e7e71cda5b506e947d810bdd51790c44b81f15c1fc5e760f4fff954ef71a93bb5aaca273dd4e4fa0c46ffc1202
7
- data.tar.gz: d9fd55c8cf55eede4671fda0d228bf89022a5babc418f8f9891afa1ac9844b27e460c437a1040ed46a7ce946b3165f3b657e5fa6b1b58132dde2f22dc1b90073
6
+ metadata.gz: b79ccc6480fa43057717ce0005204a50a3089b932a04af5a11190dc8cd1c49e0d10fa834f222a41608221730fbaf973e8396fd3c6c642b20c3a17c91cd2eb3a7
7
+ data.tar.gz: c47de7745b5e92e91cc5cfca84c2ae5c06c2174106a9c4c682874fbc5bff1ee9887e15da49bf130666cc506fe0f5d7404da0f209298dbc1cb5bcc206f508a780
@@ -4,4 +4,4 @@ rvm:
4
4
  - 2.2
5
5
  - 2.3
6
6
  - 2.4
7
- before_install: gem install bundler -v 1.16.1
7
+ before_install: gem install bundler -v 1.16.1
@@ -103,9 +103,7 @@ module GoogleWebTranslate
103
103
 
104
104
  def tk(string)
105
105
  update_token unless valid_token?
106
- @js_context.call('setWindowProperty', 'TKK', @tkk)
107
- # tk = @js_context.call("wq", string)
108
- tk = @js_context.call(@tk_function, string)
106
+ tk = @js_context.call('generateToken', @tk_function, @tkk, string)
109
107
  (tk.split('=') || [])[1]
110
108
  end
111
109
 
@@ -1,3 +1,3 @@
1
1
  module GoogleWebTranslate
2
- VERSION = '0.2.4'.freeze
2
+ VERSION = '0.2.5'.freeze
3
3
  end
@@ -11,3 +11,8 @@ var document = {};
11
11
  function setWindowProperty(key, value) {
12
12
  window[key] = value;
13
13
  }
14
+ function generateToken(tk_function, tkk, string) {
15
+ setWindowProperty('TKK', tkk);
16
+ var fn = eval(tk_function);
17
+ return fn(string);
18
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google_web_translate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-23 00:00:00.000000000 Z
11
+ date: 2018-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.7.4
177
+ rubygems_version: 2.6.11
178
178
  signing_key:
179
179
  specification_version: 4
180
180
  summary: Text translation using the google web interface