tml 4.3.3 → 4.3.4

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: 8cb97be993ac6b62a23169eed2b85c4bada498fd
4
- data.tar.gz: 4c26fe9e93653f846bef308a83072fdf24860c4f
3
+ metadata.gz: 4c93181c73e8d51d0547614c850cd4f1902397a5
4
+ data.tar.gz: 8388206c002b497ee3210f6cc07860374c0aaeee
5
5
  SHA512:
6
- metadata.gz: 6dab4c995a187be0e6ae96ad1a8e841908b757db025e0637075aac2083988e4391c5e5bba87aeea8ceee6bb7f843f4ed2c64583b97ae3a0cf660b3638f9d412a
7
- data.tar.gz: cb35f547b74edd78f2a6052b5a9667cd6dc61c2a95e685fb164c3ac636e29ecdceea4aa660af55c66bf808a0130e1b4a19ef2eabfb6a04c06a8cb819832b1779
6
+ metadata.gz: e6f3cb0e93280f4fba083a262f54996e464712ca57caf597a22a46b361315768b0f6f32e20d2a827c64a832e1170de167738985dece40d88317b9aecb150c02a
7
+ data.tar.gz: 977bfea69f9e79248688fab4b9b48d62d803c8931cac356a32e6471c0bf55cf46b7e8a39ac3780066bb688255e39eec1f20fbb5e4501d0b60e8f6f21330d02d1
@@ -134,18 +134,18 @@ module Tml
134
134
  end
135
135
 
136
136
  def source_language
137
- arr = @block_options || []
138
- arr.reverse.each do |opts|
139
- return application.language(opts[:locale]) unless opts[:locale].blank?
137
+ (@block_options || []).reverse.each do |opts|
138
+ return application.language(opts[:locale]) unless opts[:locale].nil?
140
139
  end
140
+
141
141
  application.language
142
142
  end
143
143
 
144
144
  def target_language
145
- arr = @block_options || []
146
- arr.reverse.each do |opts|
145
+ (@block_options || []).reverse.each do |opts|
147
146
  return application.language(opts[:target_locale]) unless opts[:target_locale].nil?
148
147
  end
148
+
149
149
  current_language
150
150
  end
151
151
 
@@ -170,6 +170,10 @@ module Tml
170
170
  (@block_options ||= []).last || {}
171
171
  end
172
172
 
173
+ def block_options_queue
174
+ @block_options
175
+ end
176
+
173
177
  def with_block_options(opts)
174
178
  push_block_options(opts)
175
179
  if block_given?
@@ -381,11 +381,7 @@ module Tml
381
381
  return error("Missing value for #{full_name} in #{label}", false)
382
382
  end
383
383
 
384
- if object.nil? and not Tml::Config.allow_nil_token_values?
385
- return error("Token value is nil for #{full_name} in #{label}", false)
386
- end
387
-
388
- return label.gsub(full_name, "") if object.nil?
384
+ return label.gsub(full_name, '') if object.nil?
389
385
 
390
386
  value = token_value(object, language, options)
391
387
  label.gsub(full_name, value)
@@ -30,5 +30,5 @@
30
30
  #++
31
31
 
32
32
  module Tml
33
- VERSION = '4.3.3'
33
+ VERSION = '4.3.4'
34
34
  end
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: 4.3.3
4
+ version: 4.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Berkovich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-28 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday