i18n-tasks 0.5.3 → 0.5.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: 6c261d8b23e8817ba86c745be24cb3fa56c96443
4
- data.tar.gz: 2228dcb943e500a2c901bcdb3b0a9fa292de6ef7
3
+ metadata.gz: 6579b9cbd049e1fa2d48871a7ca13f7fd8ad96a4
4
+ data.tar.gz: eaa10ec60b66db271f1c3f25f7369d4c0ba6e36e
5
5
  SHA512:
6
- metadata.gz: 361d00affbc2d10ca407b86b40c6c46a28b79d9bfaf0102ff4cce08b82b9fdd11aee1c45a43ab0de60b7208094eacdff97ec7cacab1742bdc41f05ee620e435a
7
- data.tar.gz: e38f00ef20108497b456c8a8039d33d9593bde583543fe6773a90a206662a6d1b7a441861c33e138ef092dd453a1c25870a80ad76486e1aafec1485093246717
6
+ metadata.gz: 1119961b325f1bf1f678b42304ed9669f4c8800a865f257a09817ceff1d5bfc69038ebf6ec8932e4833e90fea3b969574b2d3a0315245981a3f230793ae4665c
7
+ data.tar.gz: 3c69f7d4e2f8edde4dd4407f6e18085fd4d8318565bc366ec1f39288465f345466fd5da8967f9ed279d35f089f75236710f73f0a45cf41e88d9e6cfaf8eaa909
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.5.4
2
+
3
+ * ActiveSupport 3 compatibility
4
+
1
5
  ## 0.5.3
2
6
 
3
7
  * Fix Google translate regression
data/README.md CHANGED
@@ -18,7 +18,7 @@ i18n-tasks can be used with any project using [i18n][i18n-gem] (default in Rails
18
18
  Add to Gemfile:
19
19
 
20
20
  ```ruby
21
- gem 'i18n-tasks', '~> 0.5.3'
21
+ gem 'i18n-tasks', '~> 0.5.4'
22
22
  ```
23
23
 
24
24
 
@@ -33,7 +33,7 @@ module I18n
33
33
  end
34
34
 
35
35
  def inspect
36
- "i18n-tasks BaseTask config: #{config_for_inspect}"
36
+ "#{self.class.name}#{config_for_inspect}"
37
37
  end
38
38
  end
39
39
  end
@@ -106,7 +106,7 @@ module I18n::Tasks::Configuration
106
106
  end
107
107
 
108
108
  def config_for_inspect
109
- to_hash_from_indifferent(config_sections.deep_stringify_keys.reject { |k, v| v.blank? }).tap do |sections|
109
+ to_hash_from_indifferent(config_sections.reject { |k, v| v.blank? }).tap do |sections|
110
110
  sections.each do |_k, section|
111
111
  section.merge! section.delete('config') if Hash === section && section.key?('config')
112
112
  end
@@ -118,7 +118,9 @@ module I18n::Tasks::Configuration
118
118
  def to_hash_from_indifferent(v)
119
119
  case v
120
120
  when Hash
121
- v.to_hash
121
+ v.stringify_keys.to_hash.tap do |h|
122
+ h.each { |k, v| h[k] = to_hash_from_indifferent(v) if Hash === v || Array === v }
123
+ end
122
124
  when Array
123
125
  v.map { |e| to_hash_from_indifferent e }
124
126
  else
@@ -1,5 +1,9 @@
1
1
  module I18n::Tasks
2
2
  class ConsoleContext < BaseTask
3
+ def to_s
4
+ @to_s ||= "i18n-tasks-#{I18n::Tasks::VERSION}"
5
+ end
6
+
3
7
  def banner
4
8
  puts Messages.banner
5
9
  end
@@ -30,7 +30,7 @@ module I18n::Tasks
30
30
  end
31
31
 
32
32
  def build_tree(hash)
33
- I18n::Tasks::Data::Tree::Siblings.from_nested_hash(hash.deep_stringify_keys)
33
+ I18n::Tasks::Data::Tree::Siblings.from_nested_hash(hash)
34
34
  end
35
35
 
36
36
  def t_proc(locale = base_locale)
@@ -199,7 +199,7 @@ module I18n::Tasks::Data::Tree
199
199
 
200
200
  # value can be a nested hash
201
201
  def from_key_value(key, value)
202
- Node.new(key: key).tap do |node|
202
+ Node.new(key: key.try(:to_s)).tap do |node|
203
203
  if value.is_a?(Hash)
204
204
  node.children = Siblings.from_nested_hash(value, parent: node)
205
205
  else
@@ -1,6 +1,6 @@
1
1
  # coding: utf-8
2
2
  module I18n
3
3
  module Tasks
4
- VERSION = '0.5.3'
4
+ VERSION = '0.5.4'
5
5
  end
6
6
  end
@@ -6,6 +6,6 @@ module Trees
6
6
  end
7
7
 
8
8
  def build_tree(hash)
9
- I18n::Tasks::Data::Tree::Siblings.from_nested_hash(hash.deep_stringify_keys)
9
+ I18n::Tasks::Data::Tree::Siblings.from_nested_hash(hash)
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebm