solnic on v0.9.0
dry-bot on master
[devtools] sync (compare)
solnic on master
Update changelog.yml Bump dry-matcher to 0.9.0 (compare)
dry-bot on master
[devtools] update changelog.yml… [devtools] sync (compare)
solnic on master
Turn evaluator into an Object d… Merge pull request #32 from dry… (compare)
timriley on add-0-19-0-changelog
Add changelog entry for 0.19.0 (compare)
timriley on add-0-19-0-changelog
Add changelog entry for 0.19.0 (compare)
Types::Strict::DateTime
initialisation. When I use the "raw" Gem-supplied types to define everything, all is well; when I use a self-defined module constant, I get a NoMethodError
running what looks like the exact same code. Gist with short single-source-file demo code here
DateTime.now
works when using Types::Strict::DateTime.default { DateTime.now }
; it does not work when attempting to use a constant defined as Types::Strict::DateTime.default { DateTime.now }
Types
module you have a clash with Types::DateTime
constant
require 'bundler/setup'
require 'dry/validation'
Dry::Validation.JSON do
hash? do
required(:data).schema do
required(:foo).value(:int?)
end
end
end
/Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:80:in `merge': no implicit conversion of Dry::Types::Safe into Hash (TypeError)
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:80:in `each'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:80:in `reduce'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:80:in `merge_with'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:67:in `visit_json_hash'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:28:in `visit_type'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:15:in `visit'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-types-ce8761715332/lib/dry/types/compiler.rb:11:in `call'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation/input_processor_compiler.rb:16:in `call'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation/schema.rb:125:in `input_processor'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation/schema.rb:148:in `default_options'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation/schema.rb:46:in `new'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation.rb:37:in `Schema'
from /Users/johnbackus/.rvm/gems/ruby-2.3.1/bundler/gems/dry-validation-fa557778ff0f/lib/dry/validation.rb:46:in `JSON'
from test.rb:36:in `<main>'