Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:58
    rokhimin starred dry-rb/dry-matcher
  • 08:53
    flash-gordon labeled #376
  • 08:44
    solnic commented #376
  • Dec 12 21:34
    flash-gordon commented #376
  • Dec 12 21:34
    flash-gordon labeled #376
  • Dec 12 21:34
    flash-gordon opened #376
  • Dec 12 19:32
    RyanLafferty starred dry-rb/dry-types
  • Dec 12 05:53
    technofreak starred dry-rb/dry-monads
  • Dec 12 00:14
    thekuwayama starred dry-rb/dry-monads
  • Dec 11 09:29
    blasterun starred dry-rb/dry-monads
  • Dec 11 08:34
    flash-gordon closed #115
  • Dec 11 08:34
    flash-gordon commented #115
  • Dec 11 08:31

    flash-gordon on v1.3.3

    (compare)

  • Dec 11 08:30

    flash-gordon on master

    Bump version to 1.3.3 (compare)

  • Dec 11 08:30

    flash-gordon on master

    Update CHANGELOG (compare)

  • Dec 10 23:46
    johnmaxwell commented #116
  • Dec 10 21:54

    flash-gordon on master

    Halt with mutable backtrace Ex… Merge pull request #116 from jo… (compare)

  • Dec 10 21:54
    flash-gordon closed #116
  • Dec 10 21:54
    flash-gordon commented #116
  • Dec 10 21:49
    johnmaxwell commented #116
Andy Holland
@AMHOL
I think anyway
Krzysztof Wawer
@wafcio
let me check
Andy Holland
@AMHOL
Or container.register should be called in the init block
# system/boot/db.rb

Application.finalize(:db) do |container|
  init do
    require 'some/3rd/party/db'

    container.register(:db, DB.configure(ENV['DB_URL']))
  end

  start do
    db.establish_connection
  end

  stop do
    db.close_connection
  end
end
Krzysztof Wawer
@wafcio
without namespace it works
Andy Holland
@AMHOL
Ahh OK, yeah, the idea there is that you add a bootable :rom component, but that registers persistence.rom in the container
Whereas you're trying to boot the namespace
Krzysztof Wawer
@wafcio
thanks for help
Andy Holland
@AMHOL
NP
Krzysztof Wawer
@wafcio
I am creating console ruby app with dry-system and some features are missing, which exist in dry-web. dry-web shouldn't be small wrapper with rack, monitoring stuff, which easly allow to create web app ? Am I correct or not ?
Pablo Herrero
@pabloh
Where can you find some documentation about defining custom types with coercion to use with dry-validation?
Don Morrison
@elskwid
@pabloh I went looking for this the other day and ended up digging around in rom-sql since there are custom types built for postgres (for example)
Andy Holland
@AMHOL
@wafcio if it's useful for a console app then it should probably be in dry-system
Krzysztof Wawer
@wafcio
@AMHOL should I create new topic about it on forum ?
Piotr Solnica
@solnic
Just report an issue
John Backus
@backus
@solnic thoughts on adding something like Dry::Types::Type which all type definitions inherit from? Seems like it would make dry types a bit easier to work with if all type definitions === Dry::Types::Type
blob
Not exactly true right now
(would also make the docs simpler :laughing: I'm currently trying to improve them even though they are already quite thorough)
Tim Riley
@timriley
@AMHOL Do you reckon you might be able to start a CHANGELOG.md for dry-configurable? :pray: :angel:
Oskar Szrajer
@gotar
hmm what happens with dry-fixtures? I was sure it was added some time ago to dry family , but cannot find it anywhere.
Tim Riley
@timriley
@gotar I don't think we had it. You might be interested in rom-factory though
Oskar Szrajer
@gotar
ah yes my mistake, I was searching for rom-factory ;]
thx
Andy Holland
@AMHOL
@timriley sure
Pablo Herrero
@pabloh
Is there an easy way to customize how dates and date_time attributes ares parsed from strings by the forms?
Nikita Shilnikov
@flash-gordon
@pabloh you can build a custom type for that. Time.constructor { ... }
Pablo Herrero
@pabloh
@flash-gordon, and then you can just use it like this?:
CustomType = Time.constructor { ... }

Dry::Validation.Form do
  required(:date).filled(type?: CustomType)
end
Nikita Shilnikov
@flash-gordon
@pabloh I'm not sure if type? will work, there are some issues with using custom types IIRC
    to_time = -> x { Time.iso8601("#{x}Z") }
    ISOTime = Types::Strict::Time.constructor(to_time)

    Schema = Dry::Validation.JSON do
      optional(:sent_at, :time).value(ISOTime)
...
that's what I have^
Pablo Herrero
@pabloh
@flash-gordon , why do you need the second argument at optional?
can you not just do optional(:sent_at) { time? | value(ISOTime) }?
Nikita Shilnikov
@flash-gordon
@pabloh the second argument is for type_specs, i.e. specifies value type, as far as I know dry-v atm can work without it, but slower
just test^ I dunno, not an expert here lol
Pablo Herrero
@pabloh
hehe, I was trying... Dry::Types::Strict::Time did not work for some reason...
Nikita Shilnikov
@flash-gordon
@pabloh mb related dry-rb/dry-validation#223
Pablo Herrero
@pabloh
mmm...
Joakim Repomaa
@repomaa
hi, just want to point out that the link to hanami is broken
on the dry-types page
it links to https://hanamirb.org
which uses github's cert
you can only use http
Nikita Shilnikov
@flash-gordon
@jreinert thx, fixed
Joakim Repomaa
@repomaa
@flash-gordon nice! That was quick!
Loïc Guitaut
@Flink
Hey there! Do you know if it’s possible to raise (or report) errors on unknown parameters with dry-validation?
I didn’t see how to do this in the documentation
Loïc Guitaut
@Flink
nvm found a way to do something similar with another approach