termit 3.5.0 → 3.6.0

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: 17bbd757ecb16b16cfa5846f2647f733c96cb959
4
- data.tar.gz: 28d45e9cc2fd90cb07c8cd57c7a4ccbce994bd57
3
+ metadata.gz: 2556746804ff77045ae5977cf972586b81ca6445
4
+ data.tar.gz: c5ebf6322cca4d5a0586d6688b90cd6f60e829fd
5
5
  SHA512:
6
- metadata.gz: 30d917b4f3387be359449685e31d489840eef9e80d60355c7de51ff469f641bc46060094490bcf841d2d7cdb4102311741e5bf9603fa9802c39fecf7abb15e01
7
- data.tar.gz: 5d61add191c9bf8f675faa70c5cc96eb143fbd439602b2a107a17b4d8ffdac39de18c942dfefac9bb21f5643430aa92ecb219d4835a904229779f845c2371e8a
6
+ metadata.gz: e41fd5faf2a48dd55b34817a5b3912ced6f21c2005630642f88aab826e2c00defe8c2d4e5f4dea1853d0fa9506255bcb60090ce039cf07f09b5cc607c423eb99
7
+ data.tar.gz: 8619a4ec32f40929946c22a2049de87ceec09b091d01179ac5996aedae0bafccfae4dda22896471609cec5b2bfed2273dcaf951319529a2f8b6d4569250c13a3
@@ -5,6 +5,7 @@ module Termit
5
5
  class DataFetcherBase
6
6
  include CanOutput
7
7
  delegate :display_invalid_data_msg, :display_error_msg, to: :output_manager
8
+ DUMMY_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'.freeze
8
9
 
9
10
  def initialize url, text
10
11
  @url = url
@@ -24,7 +25,13 @@ module Termit
24
25
  private
25
26
 
26
27
  def self.auth_cookies
27
- @@_auth_cookies ||= RestClient.get('https://www.bing.com/translator').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
35
  end
29
36
  end
30
37
  end
@@ -1,3 +1,3 @@
1
1
  module Termit
2
- VERSION = "3.5.0"
2
+ VERSION = "3.6.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.5.0
4
+ version: 3.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - pawurb
@@ -186,7 +186,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
186
  version: '0'
187
187
  requirements: []
188
188
  rubyforge_project:
189
- rubygems_version: 2.5.1
189
+ rubygems_version: 2.4.6
190
190
  signing_key:
191
191
  specification_version: 4
192
192
  summary: Translations with speech synthesis in your terminal