tml 5.4.1 → 5.4.2

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: 4a84984e64ec22f712cec34434ceba677ccb757a
4
- data.tar.gz: 91eaaef9c8621cc7459bb76b7e2abfaece3b702e
3
+ metadata.gz: 33f557c921b3d9086108631c42e0bd7979a0f775
4
+ data.tar.gz: 12be51731404cb49467e4018f7d947d11d56eb85
5
5
  SHA512:
6
- metadata.gz: b82d16a5ed538b5c53e458d5c46a999eb80622812de47fb0e325a6b8e3123f564195c81a86e9741f694f7c1d9067a1b64e9241b3429f93db8485834a36d9ae24
7
- data.tar.gz: 196079f8c475c04383978418e96dacf95d91d3ed7cf89266a147eefc7b6de0f714881ac7cc690f34359321729879f64db4bc141630695c45e626e520dc085979
6
+ metadata.gz: 7d0d64e427baac61e63eeaab46575e9327a3555448f5e3574d873eedf50cbb2a20fc1d50314b28ef72169949517e9153a239843ad747478c064fca83a39d5b40
7
+ data.tar.gz: 3dcc37c4de573d1d39aa99eee6a78ddb7e18d8833f4828c63b8ce55960cc1354f58e6e334dc536516b6b587e72e2b265e74b5fcbd0ec2e64a882b46669e83fb6
@@ -249,13 +249,7 @@ class Tml::Api::Client < Tml::Base
249
249
 
250
250
  path = prepare_api_path(path)
251
251
 
252
- unless opts[:public]
253
- params = params.merge(:access_token => access_token)
254
- end
255
-
256
- if opts[:method] == :post
257
- params = params.merge(:app_id => application.key)
258
- end
252
+ params = params.merge(:access_token => access_token, :app_id => application.key)
259
253
 
260
254
  @compressed = false
261
255
  trace_api_call(path, params, opts.merge(:host => application.host)) do
@@ -34,11 +34,11 @@ require 'faraday'
34
34
 
35
35
  class Tml::Application < Tml::Base
36
36
 
37
+ API_HOST = 'https://api.translationexchange.com'
37
38
  CDN_HOST = 'https://cdn.translationexchange.com'
38
39
  # CDN_HOST = 'https://trex-snapshots.s3-us-west-1.amazonaws.com'
39
- API_HOST = 'https://api.translationexchange.com'
40
40
 
41
- attributes :host, :id, :key, :access_token, :name, :description, :threshold, :default_locale, :default_level
41
+ attributes :host, :cdn_host, :id, :key, :access_token, :name, :description, :threshold, :default_locale, :default_level
42
42
  has_many :features, :languages, :languages_by_locale, :sources, :tokens, :css, :shortcuts, :translations, :extensions
43
43
  has_many :ignored_keys
44
44
 
@@ -61,7 +61,7 @@ class Tml::Application < Tml::Base
61
61
  end
62
62
 
63
63
  def cdn_host
64
- CDN_HOST
64
+ super || CDN_HOST
65
65
  end
66
66
 
67
67
  # Fetches application definition from the service
data/lib/tml/session.rb CHANGED
@@ -43,10 +43,10 @@ module Tml
43
43
  def init(opts = {})
44
44
  return if Tml.config.disabled?
45
45
 
46
- key = opts[:key] || Tml.config.application[:key]
47
- host = opts[:host] || Tml.config.application[:host]
48
- # token = opts[:token] || Tml.config.application[:token]
49
- token = opts[:access_token]
46
+ key = opts[:key] || Tml.config.application[:key]
47
+ host = opts[:host] || Tml.config.application[:host]
48
+ cdn_host = opts[:cdn_host] || Tml.config.application[:cdn_host]
49
+ token = opts[:access_token]
50
50
 
51
51
  Tml.cache.reset_version
52
52
 
@@ -57,7 +57,7 @@ module Tml
57
57
 
58
58
  # Tml.logger.debug(opts.inspect)
59
59
 
60
- self.application = Tml::Application.new(:key => key, :access_token => token, :host => host).fetch
60
+ self.application = Tml::Application.new(:key => key, :access_token => token, :host => host, :cdn_host => cdn_host).fetch
61
61
 
62
62
  if self.current_translator
63
63
  self.current_translator.application = self.application
@@ -92,7 +92,7 @@ module Tml
92
92
  end
93
93
 
94
94
  def application
95
- @application ||= Tml::Application.new(:host => Tml::Api::Client::API_HOST)
95
+ @application ||= Tml::Application.new
96
96
  end
97
97
 
98
98
  def source_language
data/lib/tml/version.rb CHANGED
@@ -31,7 +31,7 @@
31
31
  #++
32
32
 
33
33
  module Tml
34
- VERSION = '5.4.1'
34
+ VERSION = '5.4.2'
35
35
 
36
36
  def self.full_version
37
37
  "tml-ruby v#{Tml::VERSION} (Faraday v#{Faraday::VERSION})"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tml
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.4.1
4
+ version: 5.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Berkovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-24 00:00:00.000000000 Z
11
+ date: 2016-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday