Skip to content

Commit

Permalink
updated rubocop, cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-aladev committed Jul 13, 2020
1 parent 829e0b3 commit d98eed3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,29 @@ Layout/SpaceAroundMethodCallOperator:

Lint/DeprecatedOpenSSLConstant:
Enabled: true
Lint/DuplicateElsifCondition:
Enabled: true
Lint/MixedRegexpCaptureTypes:
Enabled: true
Lint/RaiseException:
Enabled: true
Lint/StructNewOverride:
Enabled: true

Style/ArrayCoercion:
Enabled: true
Style/BisectedAttrAccessor:
Enabled: true
Style/CaseLikeIf:
Enabled: true
Style/ExponentialNotation:
Enabled: true
Style/HashAsLastArrayItem:
Enabled: true
Style/HashEachMethods:
Enabled: true
Style/HashLikeCase:
Enabled: true
Style/HashTransformKeys:
Enabled: true
Style/HashTransformValues:
Expand All @@ -90,6 +100,8 @@ Style/RedundantAssignment:
Enabled: true
Style/RedundantFetchBlock:
Enabled: true
Style/RedundantFileExtensionInRequire:
Enabled: true
Style/RedundantRegexpCharacterClass:
Enabled: true
Style/RedundantRegexpEscape:
Expand Down
5 changes: 3 additions & 2 deletions lib/zstds/stream/writer_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ def printf(*args)
end

def putc(object, encoding: ::Encoding::BINARY)
if object.is_a? ::Numeric
case object
when ::Numeric
write object.chr(encoding)
elsif object.is_a? ::String
when ::String
write object[0]
else
raise ValidateError, "invalid object: \"#{object}\" for putc"
Expand Down

0 comments on commit d98eed3

Please sign in to comment.