fast_gettext 1.4.1 → 1.5.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: c51337b82a6de558d735083be6a64c4ad978913f
4
- data.tar.gz: acd0c04c74f6094dfc7f70e67f9cc7d3db09b684
3
+ metadata.gz: 00720893487b6496102574c6302dc74e831aaad3
4
+ data.tar.gz: ea6917530ee8faed80e2fa49137eaeadfbf0022b
5
5
  SHA512:
6
- metadata.gz: ec26c4c2e4597c6ce98b9735a4c0630afced45470814d0dd3b8f737db630f7221329f748e8e530633a4a623478c7f232d9683107d5eee6fe7810b48d0d395f63
7
- data.tar.gz: c2fe04db3012533445ba4d47e4d19fc1fad6a26230f81f775e7c7be0bcdd8fa3137b920630f4eae6cb2223c3e9ede93930800c7504452c83610a6a2842b76ed8
6
+ metadata.gz: 23249a3be0a308050d90db7bb2e0779aae1e4f9672af4f8dc3f14271c84fcab06efce803042ca492d46e0e8538db6a3c102443a534d6ec291fe8aa21dba2459f
7
+ data.tar.gz: 6bc2e948a165600cc6296715940508175a7479f413d739cefb3039b06f999fd63154dd48c93acb59706696248442d3d1b8b93b00ef4f8925c48e5aec7bc45364
@@ -32,7 +32,7 @@ module FastGettext
32
32
  parser.report_warning = options.fetch(:report_warning, true)
33
33
 
34
34
  mo_file = FastGettext::GetText::MOFile.new
35
- parser.parse(File.read(file), mo_file)
35
+ parser.parse_file(file, mo_file)
36
36
  mo_file
37
37
  end
38
38
  end
@@ -2,7 +2,7 @@ require 'fast_gettext/cache'
2
2
 
3
3
  module FastGettext
4
4
  # Responsibility:
5
- # - store data threadsave
5
+ # - store data threadsafe
6
6
  # - provide error messages when repositories are unconfigured
7
7
  # - accept/reject locales that are set by the user
8
8
  module Storage
@@ -132,14 +132,9 @@ module GetText
132
132
  end
133
133
 
134
134
  def parse_file(po_file, data)
135
- args = [ po_file ]
136
- # In Ruby 1.9, we must detect proper encoding of a PO file.
137
- if String.instance_methods.include?(:encode)
138
- encoding = detect_file_encoding(po_file)
139
- args << "r:#{encoding}"
140
- end
141
135
  @po_file = po_file
142
- parse(File.open(*args) {|io| io.read }, data)
136
+ encoding = detect_file_encoding(po_file)
137
+ parse(File.open(po_file, "r:#{encoding}") {|io| io.read }, data)
143
138
  end
144
139
 
145
140
  def detect_file_encoding(po_file)
@@ -1,3 +1,3 @@
1
1
  module FastGettext
2
- VERSION = Version = '1.4.1'
2
+ VERSION = Version = '1.5.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.4.1
4
+ version: 1.5.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-06-20 00:00:00.000000000 Z
11
+ date: 2017-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake