fast_gettext 1.5.1 → 1.6.0

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: f9f8ffaa33ff1f8c9bc7d01dd8850b644d4b3be0
4
- data.tar.gz: 7ac2755ca2b22e7161fd8e470d6ca9f360f9c48b
3
+ metadata.gz: 902a77bc80c4d7a349d121874e157d902d8927a1
4
+ data.tar.gz: 57e2ab68b62cb0abaa8657332b381306df515aea
5
5
  SHA512:
6
- metadata.gz: 4fcd1ff81ccacf97d2393d534eb02689ffcb163762016c11dcb7485165e3f58a25adea71b62cff36886b108ee0c5cd76e12d0d811f5388747305c6f832b07085
7
- data.tar.gz: c43859bead37ff566561413cbed1d9c358ed56ac1f2cc655b6f42b0a84a8b9c4c8706b3bfe172e09ab770d0b533bd74d549a320f2bb6d40d8c21098f8864f47e
6
+ metadata.gz: c584454d8a8802e63c02f1d28d7ae4168f1f78335f9c052a077926c5f4828c70ff906df6f0fffd7603965fca9964a5c5fc82df462fd293ed78ee0b5be09cf952
7
+ data.tar.gz: 71f4ec7049fdfa4c0b98ffe4344ca5d929529ff580001ea816210ba0329ebe1c11dab179962c2f9cabf683425bd03d304af7327033a41e6262cf8530a49e04f4
data/CHANGELOG CHANGED
@@ -1,3 +1,4 @@
1
+ 1.6.0 -- Remove restrictions around yaml file names
1
2
  1.1.0 -- translations are no longer eager loaded for improved startup performance, pass `eager_load: true` to preload for example in preforked web server
2
3
  1.0.0 -- do not enforce attr_accessible unless ProtectedAttributes are loaded
3
4
  0.9.0 -- reworked internals of caching to be plugable
@@ -38,8 +38,8 @@ module FastGettext
38
38
  def find_and_store_files(options)
39
39
  @files = {}
40
40
  path = options[:path] || 'config/locales'
41
- Dir["#{path}/??.yml"].each do |yaml_file|
42
- locale = yaml_file.match(/([a-z]{2})\.yml$/)[1]
41
+ Dir["#{path}/*.yml"].each do |yaml_file|
42
+ locale = File.basename(yaml_file, '.yml')
43
43
  @files[locale] = load_yaml(yaml_file, locale)
44
44
  end
45
45
  end
@@ -51,7 +51,7 @@ module FastGettext
51
51
  # Given a yaml file return a hash of key -> translation
52
52
  def load_yaml(file, locale)
53
53
  yaml = YAML.load_file(file)
54
- yaml_hash_to_dot_notation(yaml[locale])
54
+ yaml_hash_to_dot_notation(yaml.fetch(locale))
55
55
  end
56
56
 
57
57
  def yaml_hash_to_dot_notation(yaml_hash)
@@ -1,3 +1,3 @@
1
1
  module FastGettext
2
- VERSION = Version = '1.5.1'
2
+ VERSION = Version = '1.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fast_gettext
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2017-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake