cinnamon_serial 1.0.1 → 2.0.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: 8c9b9354343df332901c6e37aa9afa2a71af2191
4
- data.tar.gz: 6518ce3938c3c47767498baca8c534a590295047
3
+ metadata.gz: cc99c26bd3ac755f7bc43b101f399f62ee21162f
4
+ data.tar.gz: 8cbf16165c228458d3acf6793d648ceb361a658b
5
5
  SHA512:
6
- metadata.gz: 6fb294e486c9b286bcec242ee406f9920978513d73317db43b1871ce7c930d21bebcae7bdc3475d097a5625abfe02d4167c982316f1dfa610322f64cdea1507b
7
- data.tar.gz: 11f928e8c73e624440658a2a19dd1c5db76fb56bbf6b616428cc11df96d2d5b9cf0460100d4bf1a79320fa58da6f3d06be889c0882f99f801a053bf2743caa71
6
+ metadata.gz: 292175294b5a88a7d56d4f30ebf3854a69c4662c32f5d78d2acf5f4e0e534f2361a486f54dff4ca16258066e83b549805e25504175ece222e4dc9bfae92a9296
7
+ data.tar.gz: 7788ac0567c1cfbfb097f103785ae7b492ea728ba170c819fa81877fd56c0d27d9eab1bf5418534a758a40084b35c0b968afe68dde7cad59d3b5835cd4b32168
data/.rubocop_todo.yml CHANGED
@@ -6,20 +6,6 @@
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- # Cop supports --auto-correct.
11
- # Configuration parameters: EnforcedStyle.
12
- # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
13
- Layout/EmptyLinesAroundClassBody:
14
- Exclude:
15
- - 'spec/examples.rb'
16
-
17
- # Offense count: 4
18
- Lint/BooleanSymbol:
19
- Exclude:
20
- - 'lib/cinnamon_serial/resolver.rb'
21
- - 'spec/examples.rb'
22
-
23
9
  # Offense count: 4
24
10
  Metrics/AbcSize:
25
11
  Max: 26
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cinnamon_serial (1.0.1)
4
+ cinnamon_serial (2.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -19,8 +19,6 @@ module CinnamonSerial
19
19
 
20
20
  nil
21
21
  end
22
- # <b>DEPRECATED:</b> Please use <tt>serialize</tt> instead.
23
- alias present serialize
24
22
 
25
23
  def hydrate(&block)
26
24
  cinnamon_serial_specification.hydrate(block)
@@ -12,8 +12,6 @@ module CinnamonSerial
12
12
  class Resolver
13
13
  attr_accessor :as,
14
14
  :blank,
15
- # <b>DEPRECATED:</b> Please use <tt>false_alias</tt> instead.
16
- :false,
17
15
  :false_alias,
18
16
  :for,
19
17
  :manual,
@@ -26,8 +24,6 @@ module CinnamonSerial
26
24
  :present,
27
25
  :through,
28
26
  :transform,
29
- # <b>DEPRECATED:</b> Please use <tt>true_alias</tt> instead.
30
- :true,
31
27
  :true_alias
32
28
 
33
29
  def initialize(options = {})
@@ -91,14 +87,8 @@ module CinnamonSerial
91
87
  def resolve_alias(value)
92
88
  if @option_keys.include?('true_alias') && value.is_a?(TrueClass)
93
89
  true_alias
94
- # <b>DEPRECATED:</b> Please use <tt>true_alias</tt> instead.
95
- elsif @option_keys.include?('true') && value.is_a?(TrueClass)
96
- self.true
97
90
  elsif @option_keys.include?('false_alias') && value.is_a?(FalseClass)
98
91
  false_alias
99
- # <b>DEPRECATED:</b> Please use <tt>false_alias</tt> instead.
100
- elsif @option_keys.include?('false') && value.is_a?(FalseClass)
101
- self.false
102
92
  elsif @option_keys.include?('null') && value.nil?
103
93
  null
104
94
  elsif @option_keys.include?('blank') && Formatting.blank?(value)
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module CinnamonSerial
11
- VERSION = '1.0.1'
11
+ VERSION = '2.0.0'
12
12
  end
data/spec/base_spec.rb CHANGED
@@ -24,9 +24,7 @@ describe CinnamonSerial::Base do
24
24
  manager_name
25
25
  renewal_date
26
26
  notify_date
27
- true_value
28
27
  true_alias_value
29
- false_value
30
28
  false_alias_value
31
29
  null
32
30
  present
@@ -96,9 +94,7 @@ describe CinnamonSerial::Base do
96
94
  expect(data['renewal_date']).to eq(matt.start_date + (60 * 60 * 24 * 24))
97
95
  expect(data['notify_date']).to eq(matt.start_date + (60 * 60 * 24 * 23))
98
96
 
99
- expect(data['true_value']).to eq('I am true.')
100
97
  expect(data['true_alias_value']).to eq('I am true alias.')
101
- expect(data['false_value']).to eq('I am false.')
102
98
  expect(data['false_alias_value']).to eq('I am false alias.')
103
99
  expect(data['null']).to eq('I am null.')
104
100
  expect(data['present']).to eq('I am present.')
data/spec/dsl_spec.rb CHANGED
@@ -24,9 +24,7 @@ describe CinnamonSerial::Dsl do
24
24
  manager_name
25
25
  renewal_date
26
26
  notify_date
27
- true_value
28
27
  true_alias_value
29
- false_value
30
28
  false_alias_value
31
29
  null
32
30
  present
data/spec/examples.rb CHANGED
@@ -93,15 +93,9 @@ class EmployeeListSerializer < CinnamonSerial::Base
93
93
  serialize :notify_date, for: :start_date, transform: :notification_date
94
94
 
95
95
  # Test 'true' alias
96
-
97
- # <b>DEPRECATED:</b> Please use <tt>true_alias</tt> instead.
98
- serialize :true_value, true: 'I am true.'
99
96
  serialize :true_alias_value, true_alias: 'I am true alias.'
100
97
 
101
98
  # Test 'false' alias
102
-
103
- # <b>DEPRECATED:</b> Please use <tt>false_alias</tt> instead.
104
- serialize :false_value, false: 'I am false.'
105
99
  serialize :false_alias_value, false_alias: 'I am false alias.'
106
100
 
107
101
  # Test 'null' alias
@@ -160,10 +154,10 @@ end
160
154
  # Subclass to test inheritance.
161
155
  # #############################
162
156
  class EmployeeSerializer < EmployeeListSerializer
163
- present :start_date, :job
157
+ serialize :start_date, :job
164
158
 
165
- present :founder,
166
- :owner, manual: true
159
+ serialize :founder,
160
+ :owner, manual: true
167
161
 
168
162
  hydrate do
169
163
  set_founder(obj.id < 10)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cinnamon_serial
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-04 00:00:00.000000000 Z
11
+ date: 2018-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry