delocalize 1.0.0 → 1.1.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: 00c6fb17341720d91984d417a166c15085fd39fa
4
- data.tar.gz: b9c1d5688872a8692ab3fc2c82b8283ea434d4d7
3
+ metadata.gz: bf99ef08d5088f5fd791efc0acf489fa51ea5417
4
+ data.tar.gz: 013d7f081dea1507d1819b129ffe1697059abea5
5
5
  SHA512:
6
- metadata.gz: 71bdd8bf81b15f4cb496dc7d266ea237a51ab5e18e657f0869bbdfed27363c69f13ddf96b2d88041a18ae0c4f095d6f6c9fbd1a3341115115eca4ee5eef4c962
7
- data.tar.gz: e9032a044a45f7456a19d6f80a262d1448e058265c45cca990bf051eaa639a7ded115fe42f89c11f8b4f35c4f170158edef024f624595af3c39a47d80ecc01bf
6
+ metadata.gz: a6c5091da9618f1886ddc60472593f84e42bfa2d9392c75d77b069774384811764e0899344f8e37a0cfefcef2291cc464687c7f83d55d1315d896b43de291786
7
+ data.tar.gz: 18f7bbf54dfc495b934b6a7e8253fbe763dda21b72231a5ecbac47de21e3189ec388edbac91c21137999bbd07fbca681eeb922762e4de356905bd7ffa64b3991
@@ -7,11 +7,12 @@ end
7
7
  module Delocalize
8
8
  class ParserNotFound < ArgumentError; end
9
9
 
10
- autoload :Parsers, 'delocalize/parsers'
10
+ autoload :Parsers, 'delocalize/parsers'
11
11
 
12
- autoload :Parameters, 'delocalize/parameters'
13
- autoload :ParameterDelocalizing, 'delocalize/parameter_delocalizing'
12
+ autoload :Parameters, 'delocalize/parameters'
13
+ autoload :ParameterDelocalizing, 'delocalize/parameter_delocalizing'
14
+ autoload :DelocalizableParameters, 'delocalize/delocalizable_parameters'
14
15
 
15
- autoload :NumberParser, 'delocalize/number_parser'
16
- autoload :DateTimeParser, 'delocalize/date_time_parser'
16
+ autoload :NumberParser, 'delocalize/number_parser'
17
+ autoload :DateTimeParser, 'delocalize/date_time_parser'
17
18
  end
@@ -10,10 +10,10 @@ module Delocalize
10
10
  hash.each do |key, value|
11
11
  key_stack = [*base_key_stack, key] # don't modify original key stack!
12
12
 
13
- hash[key] = case value
14
- when Hash
13
+ hash[key] = case
14
+ when value.respond_to?(:each_pair)
15
15
  delocalize_hash(value, options, key_stack)
16
- when Array
16
+ when Array === value
17
17
  key_stack += [:[]] # pseudo-key to denote arrays
18
18
  value.map { |item| delocalize_parse(options, key_stack, item) }
19
19
  else
@@ -1,3 +1,3 @@
1
1
  module Delocalize
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'test_helper'
2
+ require 'action_controller'
2
3
 
3
4
  parameters_classes = [Delocalize::Parameters]
4
5
 
@@ -8,6 +9,8 @@ if defined?(ActionController::Parameters)
8
9
  parameters_classes << ActionController::Parameters
9
10
  end
10
11
 
12
+ puts "Testing parameter classes: #{parameters_classes.inspect}"
13
+
11
14
  parameters_classes.each do |parameters_class|
12
15
  describe parameters_class do
13
16
  before do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delocalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clemens Kofler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-12 00:00:00.000000000 Z
11
+ date: 2016-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails