air18n 0.1.53 → 0.1.54

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,14 +22,14 @@ module Air18n
22
22
 
23
23
  # We use divmod to avoid the edge condition where the floating point math
24
24
  # result is 5.000001 and the ceil would result in 6.
25
- quotient, modulus = value_json.size.divmod(MAX_CHUNK_SIZE)
25
+ quotient, modulus = value_json.bytesize.divmod(MAX_CHUNK_SIZE)
26
26
  num_chunks = modulus > 0 ? quotient + 1 : quotient
27
27
  cache.write(CHECKSUM_CACHE_KEY % key, [num_chunks, Zlib::crc32(value_json)].to_json)
28
28
 
29
29
  1.upto(num_chunks) do |i|
30
- chunk = value_json[(i-1)*MAX_CHUNK_SIZE, MAX_CHUNK_SIZE]
30
+ chunk = value_json.byteslice((i-1)*MAX_CHUNK_SIZE, MAX_CHUNK_SIZE)
31
31
  if cache.write(CHUNK_CACHE_KEY % [key, i], chunk, :expires_in => expires_in) == false
32
- LoggingHelper.error "ChunkCache set: failed to write chunk #{CHUNK_CACHE_KEY % [key, i]} (#{chunk.size} bytes)"
32
+ LoggingHelper.error "ChunkCache set: failed to write chunk #{CHUNK_CACHE_KEY % [key, i]} (#{chunk.size} chars / #{chunk.bytesize} bytes)"
33
33
  end
34
34
  end
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Air18n
2
- VERSION = "0.1.53"
2
+ VERSION = "0.1.54"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: air18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.53
4
+ version: 0.1.54
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2013-01-18 00:00:00.000000000 Z
16
+ date: 2013-01-22 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: i18n
@@ -219,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  version: '0'
220
220
  requirements: []
221
221
  rubyforge_project:
222
- rubygems_version: 1.8.22
222
+ rubygems_version: 1.8.24
223
223
  signing_key:
224
224
  specification_version: 3
225
225
  summary: Dynamic I18n backend