termit 3.6.0 → 3.7.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
2
  SHA1:
3
- metadata.gz: 2556746804ff77045ae5977cf972586b81ca6445
4
- data.tar.gz: c5ebf6322cca4d5a0586d6688b90cd6f60e829fd
3
+ metadata.gz: 4867c761affc0af62bbfa348421bf272ccddd8ff
4
+ data.tar.gz: b14c468f4a27289c9c1de5f6ddd12b8eec0c1b99
5
5
  SHA512:
6
- metadata.gz: e41fd5faf2a48dd55b34817a5b3912ced6f21c2005630642f88aab826e2c00defe8c2d4e5f4dea1853d0fa9506255bcb60090ce039cf07f09b5cc607c423eb99
7
- data.tar.gz: 8619a4ec32f40929946c22a2049de87ceec09b091d01179ac5996aedae0bafccfae4dda22896471609cec5b2bfed2273dcaf951319529a2f8b6d4569250c13a3
6
+ metadata.gz: 3e7f0efea7f8110afb315e2cdf5dcf183fd6b745924bf91708cf6d260aff284ef899c0db45dd986d0b53c8dd61e085cf08befee5bcdcd47ec30c2fd225bc3287
7
+ data.tar.gz: 7683b205af801e5b9ce8f1d912a9435afebdc414cb8e156ccf11c73961222806366878fac892e9cc1bc09bee297b5bafd790548edf9ccc103cf9000cd3ce9e6d
@@ -25,13 +25,20 @@ module Termit
25
25
  private
26
26
 
27
27
  def self.auth_cookies
28
- @@_auth_cookies ||= RestClient::Request.execute(
29
- method: :get,
30
- url: 'https://www.bing.com/translator',
31
- headers: {
32
- 'User-Agent' => DUMMY_AGENT
33
- }
34
- ).cookies
28
+ @@_auth_cookies ||= begin
29
+ res = RestClient::Request.execute(
30
+ method: :get,
31
+ url: 'https://www.bing.com/translator',
32
+ headers: {
33
+ 'User-Agent' => DUMMY_AGENT
34
+ }
35
+ )
36
+ shy_cookie = res.headers.fetch(:set_cookie)[0].split(';')[0]
37
+ key, value = shy_cookie.split('=')
38
+ res.cookies.tap do |cookies_param|
39
+ cookies_param[key] = value
40
+ end
41
+ end
35
42
  end
36
43
  end
37
44
  end
@@ -1,3 +1,3 @@
1
1
  module Termit
2
- VERSION = "3.6.0"
2
+ VERSION = "3.7.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: termit
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb