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 +4 -4
- data/lib/delocalize.rb +6 -5
- data/lib/delocalize/parameter_delocalizing.rb +3 -3
- data/lib/delocalize/version.rb +1 -1
- data/test/parameters_test.rb +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf99ef08d5088f5fd791efc0acf489fa51ea5417
|
4
|
+
data.tar.gz: 013d7f081dea1507d1819b129ffe1697059abea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c5091da9618f1886ddc60472593f84e42bfa2d9392c75d77b069774384811764e0899344f8e37a0cfefcef2291cc464687c7f83d55d1315d896b43de291786
|
7
|
+
data.tar.gz: 18f7bbf54dfc495b934b6a7e8253fbe763dda21b72231a5ecbac47de21e3189ec388edbac91c21137999bbd07fbca681eeb922762e4de356905bd7ffa64b3991
|
data/lib/delocalize.rb
CHANGED
@@ -7,11 +7,12 @@ end
|
|
7
7
|
module Delocalize
|
8
8
|
class ParserNotFound < ArgumentError; end
|
9
9
|
|
10
|
-
autoload :Parsers,
|
10
|
+
autoload :Parsers, 'delocalize/parsers'
|
11
11
|
|
12
|
-
autoload :Parameters,
|
13
|
-
autoload :ParameterDelocalizing,
|
12
|
+
autoload :Parameters, 'delocalize/parameters'
|
13
|
+
autoload :ParameterDelocalizing, 'delocalize/parameter_delocalizing'
|
14
|
+
autoload :DelocalizableParameters, 'delocalize/delocalizable_parameters'
|
14
15
|
|
15
|
-
autoload :NumberParser,
|
16
|
-
autoload :DateTimeParser,
|
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
|
14
|
-
when
|
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
|
data/lib/delocalize/version.rb
CHANGED
data/test/parameters_test.rb
CHANGED
@@ -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.
|
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:
|
11
|
+
date: 2016-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|