Skip to content

Commit 4deeae0

Browse files
authored
Merge pull request #71 from ifad/chore/update-dependencies
Update dependencies
2 parents 20928c8 + 2a04eb9 commit 4deeae0

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

.rubocop.yml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ inherit_from: .rubocop_todo.yml
22

33
require:
44
- rubocop-packaging
5+
6+
plugins:
57
- rubocop-performance
68
- rubocop-rails
79
- rubocop-rake
@@ -23,6 +25,9 @@ AllCops:
2325
Layout/LineLength:
2426
Enabled: false
2527

28+
Rails/Delegate:
29+
Enabled: false
30+
2631
RSpec/ExampleLength:
2732
Enabled: false
2833

.rubocop_todo.yml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/hawk/model/association.rb

+1
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ def #{entity}
319319
}
320320

321321
}.freeze
322+
private_constant :CODE
322323
end
323324
end
324325
end

lib/hawk/model/schema.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -163,22 +163,26 @@ def to_s
163163
alias pretty_inspect to_s
164164
end
165165

166-
bools = Set.new(['1', 'true', 1, true])
166+
BOOLS = Set.new(['1', 'true', 1, true]).freeze
167+
private_constant :BOOLS
168+
167169
CASTERS = [
168170
Caster.new(:integer, ->(value) { Integer(value) }),
169171
Caster.new(:float, ->(value) { Float(value) }),
170172
Caster.new(:datetime, ->(value) { Time.parse(value) }),
171173
Caster.new(:date, ->(value) { Date.parse(value) }),
172174
Caster.new(:bignum, ->(value) { BigDecimal(value) }),
173-
Caster.new(:boolean, ->(value) { bools.include?(value) })
175+
Caster.new(:boolean, ->(value) { BOOLS.include?(value) })
174176
].inject({}) { |h, c| h.update(c.type => c) }
177+
private_constant :CASTERS
175178

176179
ATTRIBUTE_CASTS = {
177180
/_(?:at|from|until|on)$/ => :datetime,
178181
/_date$/ => :date,
179182
/_num$/ => :bignum,
180183
/^is_/ => :boolean
181184
}.freeze
185+
private_constant :ATTRIBUTE_CASTS
182186
end
183187
end
184188
end

lib/hawk/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Hawk
4-
VERSION = '3.0.0'
4+
VERSION = '4.0.0'
55
end

0 commit comments

Comments
 (0)