Skip to content

Commit

Permalink
feat: update to Crystal 0.25.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vladfaust committed Jun 16, 2018
1 parent a8ab86f commit be09a8e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.2.0
authors:
- Vlad Faust <[email protected]>

crystal: 0.24.1
crystal: 0.25.0

license: MIT

Expand Down
2 changes: 1 addition & 1 deletion spec/params/validation_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module Prism::Params::ValidationSpec

describe "#height" do
it "validates in" do
assert_invalid_param("?id=42&name=kek&height=0.1", "height", "must be included in 0.5..2.5")
assert_invalid_param("?id=42&name=kek&height=0.1", "height", "must be included in (0.5..2.5)")
end
end

Expand Down
2 changes: 1 addition & 1 deletion src/prism/params/abstract_param.cr
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module Prism::Params

# :nodoc:
struct JSONParam < AbstractParam
getter value : JSON::Type
getter value : JSON::Any

def initialize(@name, @value, @path = [] of String)
end
Expand Down
2 changes: 1 addition & 1 deletion src/prism/params/definition.cr
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module Prism::Params
%}

# Damn hacks
alias ParamsTuple = NamedTuple({{"#{hash}".gsub(/\"/, "\"").gsub(%r[=> {(.*), "__nilable" => true(.*)}[,}]], "=> {\\1\\2} | Nil ").gsub(%r[=> {(.*)"__nilable" => true, (.*)}[,}]], "=> {\\1\\2} | Nil ").gsub(/ \=>/, ":")[1..-2].id}})
alias ParamsTuple = NamedTuple({{"#{hash}".gsub(/\"/, "\"").gsub(%r[=> {(.*), "__nilable" => true(.*)}[,}]], "=> {\\1\\2} | Nil,").gsub(%r[=> {(.*)"__nilable" => true, (.*)}[,}]], "=> {\\1\\2} | Nil,").gsub(/ \=>/, ":")[1..-2].id}})
end

private macro define_param_type
Expand Down

0 comments on commit be09a8e

Please sign in to comment.