flash-gordon on custom-builder-methods
Support for custom builder meth… (compare)
flash-gordon on or_nil-extension
Add Type#or_nil via builders ex… (compare)
dry-bot on master
[devtools] sync (compare)
flash-gordon on master
Fix changelog (compare)
dry-bot on master
[devtools] sync (compare)
flash-gordon on master
Update changelog.yml Add reminder (compare)
flash-gordon on deprecate-class-name-inferring
flash-gordon on master
Deprecate predicate inferring f… Merge pull request #414 from dr… (compare)
flash-gordon on deprecate-class-name-inferring
Deprecate predicate inferring f… (compare)
flash-gordon on or_nil-extension
Add Type#or_nil via builders ex… (compare)
Hi guys, it seems that I maybe encounter a bug of dry-types SUM
, but I'm not sure. Could you help me on this?
It happens when I try to verify a object which should be a hash or a string
test = Dry::Types['hash'].map(Dry::Types['symbol'], Dry::Types['strict.string']) | Dry::Types['strict.string']
test[a: 'b'] # passed as expected
test['a' => 'b'] # should fail but pass!
test['test'] # passed as expected
test[12345] # should fail but pass!
I'm wondering if there is anything that I didn't notice or I use the wrong way to build my rule. Thanks :)
Links = Map(Symbol, String | JSONAPI::Types::Link.optional)
reader: true
Hello, I wanted to try out dry-web-roda but encountered problems quite early in the process. I read the docs a few times but could not figure it out. Could anybody assist?
Basically, I created a new project with dry-web-roda new dwr_test
. Then, within the directory, I ran rake db:create
. Then I tried rackup
and then got this:
dwr_test rackup
/Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:13:in `block in <class:Controller>': undefined method `context=' for #<#<Class:0x00007f82150fe198>:0x00007f82150e5e18> (NoMethodError)
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-configurable-0.7.0/lib/dry/configurable.rb:70:in `configure'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:11:in `<class:Controller>'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:10:in `<module:View>'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:9:in `<module:Main>'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:8:in `<module:DwrTest>'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/view/controller.rb:7:in `<top (required)>'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/views/welcome.rb:1:in `require'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/lib/dwr_test/main/views/welcome.rb:1:in `<top (required)>'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/container.rb:541:in `require'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/container.rb:541:in `require_component'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:37:in `block in call'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:34:in `each'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:34:in `call'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:27:in `block in finalize!'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:27:in `each'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/auto_registrar.rb:27:in `finalize!'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/dry-system-0.9.2/lib/dry/system/container.rb:300:in `finalize!'
from /Users/eliavlavi/git_projects/roda/dwr_test/apps/main/system/boot.rb:3:in `<top (required)>'
from /Users/eliavlavi/git_projects/roda/dwr_test/system/boot.rb:15:in `require'
from /Users/eliavlavi/git_projects/roda/dwr_test/system/boot.rb:15:in `block in <top (required)>'
from /Users/eliavlavi/git_projects/roda/dwr_test/system/boot.rb:14:in `each'
from /Users/eliavlavi/git_projects/roda/dwr_test/system/boot.rb:14:in `<top (required)>'
from /Users/eliavlavi/git_projects/roda/dwr_test/config.ru:1:in `require_relative'
from /Users/eliavlavi/git_projects/roda/dwr_test/config.ru:1:in `block in <main>'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/rack-2.0.6/lib/rack/builder.rb:55:in `instance_eval'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/rack-2.0.6/lib/rack/builder.rb:55:in `initialize'
from /Users/eliavlavi/git_projects/roda/dwr_test/config.ru:in `new'
from /Users/eliavlavi/git_projects/roda/dwr_test/config.ru:in `<main>'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/rack-2.0.6/lib/rack/builder.rb:49:in `eval'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/rack-2.0.6/lib/rack/builder.rb:49:in `new_from_string'
from /Users/eliavlavi/.rvm/gems/ruby-2.4.2/gems/rack-2.0.6/lib/rack/builder.rb:40:in
I had to truncate the end of it, gitter was trimming me. Any idea what's wrong?
Thanks a lot 🙏
configure
doesn't have a context
attribute). If it's easier I'll push it to github, would that be preferable?