mini_i18n 0.3.0 → 0.3.1

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: 20636bf9386b74aa7c786890b22b4a185914531e
4
- data.tar.gz: 4115ce5559244a91b342ef733e4a7101b4ccfd99
3
+ metadata.gz: 32665206618cf4c4a45344aae4696c61f4a66b36
4
+ data.tar.gz: cf097c2379dcc4df553f3de6268484a02e9d76f5
5
5
  SHA512:
6
- metadata.gz: 4e65114f78f650be2226de898c20fa9185403ea5b20b78c366a318b1bd4d679a4aecbed01584993f67ea60c2ba9c22db827108c1702ced3ff21769563e862ee1
7
- data.tar.gz: 53aea95dcf486f55ad2f21cfefc64bbfb9162fbb449b638e456895d6a198132086089d5090e2917b8d1aa71282d688df588ca76b277e504ac56e36e38bff962f
6
+ metadata.gz: aa093915daa4b2db6191e00e8e85c1a45842e3642df4299ea3509e27e758cc6d91c68664ddf2357197b10df82fd07efaa4e3467661d31169e4d7ba7b95e142a2
7
+ data.tar.gz: 920f5bff55a01206f365c5a1bc2286b0bc8c639b2d1500883ea95b2da6cad9308eadd847fdc231c26ed3146ec7c73d3f702fad51ec860a9785757b9471879d45
@@ -1,3 +1,3 @@
1
1
  module MiniI18n
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/lib/mini_i18n.rb CHANGED
@@ -46,15 +46,15 @@ module MiniI18n
46
46
  end
47
47
 
48
48
  def load_translations(path)
49
- Dir[path].each do |file|
50
- YAML.load_file(file).each do |locale, values|
49
+ Dir[path.to_s].each do |file|
50
+ YAML.load_file(file).each do |locale, new_translations|
51
51
  locale = locale.to_s
52
52
  @@available_locales << locale unless available_locale?(locale)
53
53
 
54
54
  if translations[locale]
55
- translations[locale] = Utils.deep_merge(translations[locale], values)
55
+ translations[locale] = Utils.deep_merge(translations[locale], new_translations)
56
56
  else
57
- translations[locale] = values
57
+ translations[locale] = new_translations
58
58
  end
59
59
  end
60
60
  end
@@ -15,6 +15,10 @@ RSpec.describe MiniI18n do
15
15
  expect(MiniI18n.translations.size). to eq 3
16
16
  expect(MiniI18n.translations["en"]).to include 'bye'
17
17
  end
18
+
19
+ it "does not raise if path is nil" do
20
+ expect(MiniI18n.load_translations(nil)).to eq []
21
+ end
18
22
  end
19
23
 
20
24
  describe 'default_locale=' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - markets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-18 00:00:00.000000000 Z
11
+ date: 2018-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler