tml 5.4.2 → 5.4.3

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: 33f557c921b3d9086108631c42e0bd7979a0f775
4
- data.tar.gz: 12be51731404cb49467e4018f7d947d11d56eb85
3
+ metadata.gz: feaf6bc2570ce5c1991d67c9b235f507b2c58f2f
4
+ data.tar.gz: f809be2ed64e60c5c40bf3c3cbb5bd66e28e0969
5
5
  SHA512:
6
- metadata.gz: 7d0d64e427baac61e63eeaab46575e9327a3555448f5e3574d873eedf50cbb2a20fc1d50314b28ef72169949517e9153a239843ad747478c064fca83a39d5b40
7
- data.tar.gz: 3dcc37c4de573d1d39aa99eee6a78ddb7e18d8833f4828c63b8ce55960cc1354f58e6e334dc536516b6b587e72e2b265e74b5fcbd0ec2e64a882b46669e83fb6
6
+ metadata.gz: 1c459edbe540afa5dc514a56febae091f6a1f4176fef03c1d531c12e6336000d9bb3c7e6b002b0a5221334c077cefe8aaf4746ee435d29f053e0bb3a0d64f401
7
+ data.tar.gz: 0b0a89113b6ee5279557891fce239e941e83c0e9bdb070cf9430e3b73e23b283ecb39f41993cc5bf0232dd76175ac69e5b2174614dea1921f9407c8e6af2727c
@@ -168,7 +168,7 @@ class Tml::Api::Client < Tml::Base
168
168
  # should the API go to live server
169
169
  def live_api_request?
170
170
  # if no access token, never use live mode
171
- return false if access_token.blank?
171
+ return false if access_token.nil?
172
172
 
173
173
  # if block is specifically asking for it or inline mode is activated
174
174
  Tml.session.inline_mode? or Tml.session.block_option(:live)
data/lib/tml/cache.rb CHANGED
@@ -41,7 +41,9 @@ module Tml
41
41
  def self.cache
42
42
  @cache ||= begin
43
43
  if Tml.config.cache_enabled?
44
- klass = Tml::CacheAdapters.const_get(Tml.config.cache[:adapter].to_s.camelcase)
44
+ # .capitalize is not ideal, but .camelcase is not available in pure ruby.
45
+ # This works for the current class names.
46
+ klass = Tml::CacheAdapters.const_get(Tml.config.cache[:adapter].to_s.capitalize)
45
47
  klass.new
46
48
  else
47
49
  # blank implementation
@@ -109,7 +109,7 @@ module Tml
109
109
  sentences = Tml::Utils.split_sentences(tml)
110
110
  translation = tml
111
111
  sentences.each do |sentence|
112
- sentence_translation = option('debug') ? debug_translation(sentence) : Tml.session.current_language.translate(sentence, tokens, options)
112
+ sentence_translation = option('debug') ? debug_translation(sentence) : Tml.session.current_language.translate(sentence, tokens, options.dup)
113
113
  translation = translation.gsub(sentence, sentence_translation)
114
114
  end
115
115
  reset_context
@@ -118,7 +118,7 @@ module Tml
118
118
 
119
119
  tml = tml.gsub(/[\n]/, '').gsub(/\s\s+/, ' ').strip
120
120
 
121
- translation = option('debug') ? debug_translation(tml) : Tml.session.target_language.translate(tml, tokens, options)
121
+ translation = option('debug') ? debug_translation(tml) : Tml.session.target_language.translate(tml, tokens, options.dup)
122
122
  reset_context
123
123
  translation
124
124
  end
@@ -37,7 +37,7 @@ module Tml
37
37
  attr_reader :label, :full_name, :short_name, :case_keys, :context_keys
38
38
 
39
39
  def self.expression
40
- /(%?\{{1,2}\s*\w*\s*(:\s*\w+)*\s*(::\s*\w+)*\s*\}{1,2})/
40
+ /(%?\{{1,2}\s*\w+\s*(:\s*\w+)*\s*(::\s*\w+)*\s*\}{1,2})/
41
41
  end
42
42
 
43
43
  def self.parse(label, opts = {})
@@ -41,7 +41,7 @@
41
41
 
42
42
  class Tml::Tokens::Method < Tml::Tokens::Data
43
43
  def self.expression
44
- /(%?\{{1,2}\s*[\w]*\.\w*\s*(:\s*\w+)*\s*(::\s*\w+)*\s*\}{1,2})/
44
+ /(%?\{{1,2}\s*[\w]+\.\w*\s*(:\s*\w+)*\s*(::\s*\w+)*\s*\}{1,2})/
45
45
  end
46
46
 
47
47
  def object_name
@@ -57,7 +57,7 @@ class Tml::Tokens::Transform < Tml::Tokens::Data
57
57
  attr_reader :pipe_separator, :piped_params
58
58
 
59
59
  def self.expression
60
- /(%?\{{1,2}\s*[\w]*\s*(:\s*\w+)*\s*\|\|?[^\{\}\|]+\}{1,2})/
60
+ /(%?\{{1,2}\s*[\w]+\s*(:\s*\w+)*\s*\|\|?[^\{\}\|]+\}{1,2})/
61
61
  end
62
62
 
63
63
  def parse_elements
data/lib/tml/version.rb CHANGED
@@ -31,7 +31,7 @@
31
31
  #++
32
32
 
33
33
  module Tml
34
- VERSION = '5.4.2'
34
+ VERSION = '5.4.3'
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.2
4
+ version: 5.4.3
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-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday