ializer 0.12.0 → 0.14.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
  SHA256:
3
- metadata.gz: 046653c46495303f818fed936f4017c82a8c951882ab704630b2eeb0f1ec0729
4
- data.tar.gz: 71f59e15ab4fb65620a9b589e2f8b6711b0d3e16f9e3b39e86492d200c5a5224
3
+ metadata.gz: 47951e84e1f35863d32623f8759930325fbb59a515b78b177b35ab1a71dee354
4
+ data.tar.gz: 1fbd19294162024a7b47c230940f9f121f465c949f1196377467880bf5acc7ba
5
5
  SHA512:
6
- metadata.gz: 14305639f9d74861e2e5013fb9dfe22bb8e6ba82c6d6cbf52d8c7f2f753205f04bdccf34f99939213df70f71b1db002841fcc7efe01c8ac8cc5cd43a2c40628e
7
- data.tar.gz: 6cab0473cd8e107c8be3b63a1aade57b69f2464304e48c7ba73f43f559ee6c0bbcf97fcaec1b9aeca66bf15fe4bb1c77cac208b4725a5f421cfb8adcf8391d14
6
+ metadata.gz: 0f767ce0b7c931ef8ac62ea4f1e8c3f0df6f51ca3969bfef9d0b65d93ffc1dc8c655f83fcba46a5ad860005fe56d1a6a3b6085189521c2d3f4fa6ca2bebf8eb0
7
+ data.tar.gz: c95aec89841decd0907742c95e1318be0c2a2ec2715b2f9fdd416b5c56d549627826a8bd806072d5949912ed344497d8b02cebc55261cdce8b63176ab5b12562
@@ -8,29 +8,21 @@ jobs:
8
8
 
9
9
  strategy:
10
10
  matrix:
11
- ruby: [ '2.5.x', '2.6.x' ]
11
+ ruby: [ '2.7', '3.0', '3.1' ]
12
12
 
13
13
  name: Ruby ${{ matrix.ruby }}
14
14
  steps:
15
15
  - uses: actions/checkout@v1
16
16
  - name: Set up Ruby ${{ matrix.ruby }}
17
- uses: actions/setup-ruby@v1
17
+ uses: ruby/setup-ruby@v1
18
18
  with:
19
19
  ruby-version: ${{ matrix.ruby }}
20
+ bundler-cache: true
20
21
 
21
22
  - name: Install bundler
22
23
  run: |
23
24
  gem install bundler
24
25
 
25
- - name: Cache bundled gems
26
- uses: actions/cache@v1
27
- with:
28
- path: vendor/bundle
29
- key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/ializer.gemspec') }}
30
- restore-keys: |
31
- ${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('**/ializer.gemspec') }}
32
- ${{ runner.os }}-${{ matrix.ruby }}-
33
-
34
26
  - name: Bundle
35
27
  run: |
36
28
  bundle config path vendor/bundle
data/README.md CHANGED
@@ -316,21 +316,22 @@ end
316
316
 
317
317
  The following types are included with `ializer`
318
318
 
319
- | Type | method alias | mappings |
320
- |------------|--------------|----------------------------|
321
- | BigDecimal | `decimal()` | :BigDecimal, :decimal |
322
- | Boolean | `boolean()` | :Boolean, :boolean |
323
- | Date | `date()` | Date, :date |
324
- | Integer | `integer()` | Integer, :integer |
325
- | Float | `float()` | Float, :float |
326
- | Time | `millis()` | :Millis, :millis |
327
- | String | `string()` | String, :millis |
328
- | Symbol | `symbol()` | Symbol, :symbol, :sym |
329
- | Time | `timestamp()`| Time, DateTime, :timestamp |
330
- | JSON | `json()` | :json |
331
- | Default | `default()` | :default |
332
-
333
- **Note: JSON/Default just uses the current value of the field and will only properly deserialize if it is a standard json value type(number, string, boolean).**
319
+ | Type | method alias | mappings |
320
+ |------------|---------------|----------------------------|
321
+ | BigDecimal | `decimal()` | :BigDecimal, :decimal |
322
+ | Boolean | `boolean()` | :Boolean, :boolean |
323
+ | Date | `date()` | Date, :date |
324
+ | Integer | `integer()` | Integer, :integer |
325
+ | Float | `float()` | Float, :float |
326
+ | Time | `millis()` | :Millis, :millis |
327
+ | String | `string()` | String, :millis |
328
+ | Symbol | `symbol()` | Symbol, :symbol, :sym |
329
+ | Time | `timestamp()` | Time, DateTime, :timestamp |
330
+ | Array | `array()` | :array |
331
+ | JSON | `json()` | :json |
332
+ | Default | `default()` | :default |
333
+
334
+ **Note: Array/JSON/Default just uses the current value of the field and will only properly deserialize if it is a standard json value type(number, string, boolean).**
334
335
 
335
336
  #### Default Attribute Configuration Options
336
337
 
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bigdecimal'
4
+ require 'bigdecimal/util'
4
5
 
5
6
  module Ializer
6
7
  class BigDecimalDeSer
@@ -13,4 +13,5 @@ module Ializer
13
13
  end
14
14
 
15
15
  Ser::Ializer.register_default(Ializer::DefaultDeSer)
16
+ Ser::Ializer.register('array', Ializer::DefaultDeSer, :array)
16
17
  Ser::Ializer.register('json', Ializer::DefaultDeSer, :json)
@@ -3,7 +3,7 @@
3
3
  module Ializer
4
4
  class FixNumDeSer
5
5
  def self.serialize(value, _context = nil)
6
- value
6
+ value.to_i
7
7
  end
8
8
 
9
9
  def self.parse(value)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ializer
4
- VERSION = '0.12.0'
4
+ VERSION = '0.14.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Steinberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-05-05 00:00:00.000000000 Z
11
+ date: 2023-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -193,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  requirements: []
196
- rubygems_version: 3.2.22
196
+ rubygems_version: 3.3.7
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Simple (de)serializers for Ruby objects