tml 5.4.1 → 5.4.2
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 +4 -4
- data/lib/tml/api/client.rb +1 -7
- data/lib/tml/application.rb +3 -3
- data/lib/tml/session.rb +6 -6
- data/lib/tml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 33f557c921b3d9086108631c42e0bd7979a0f775
|
|
4
|
+
data.tar.gz: 12be51731404cb49467e4018f7d947d11d56eb85
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7d0d64e427baac61e63eeaab46575e9327a3555448f5e3574d873eedf50cbb2a20fc1d50314b28ef72169949517e9153a239843ad747478c064fca83a39d5b40
|
|
7
|
+
data.tar.gz: 3dcc37c4de573d1d39aa99eee6a78ddb7e18d8833f4828c63b8ce55960cc1354f58e6e334dc536516b6b587e72e2b265e74b5fcbd0ec2e64a882b46669e83fb6
|
data/lib/tml/api/client.rb
CHANGED
|
@@ -249,13 +249,7 @@ class Tml::Api::Client < Tml::Base
|
|
|
249
249
|
|
|
250
250
|
path = prepare_api_path(path)
|
|
251
251
|
|
|
252
|
-
|
|
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
|
data/lib/tml/application.rb
CHANGED
|
@@ -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
|
|
47
|
-
host
|
|
48
|
-
|
|
49
|
-
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
|
|
95
|
+
@application ||= Tml::Application.new
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def source_language
|
data/lib/tml/version.rb
CHANGED
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.
|
|
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-
|
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: faraday
|