Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 07 14:03

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 10:01
    Travis dry-rb/dry-view (master) errored (636)
  • Dec 07 09:58
    Travis dry-rb/dry-view (master) errored (635)
  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:56

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

  • Dec 07 09:54

    dry-bot on master

    [devtools] config sync (compare)

Christopher Dennl-Ortega Arrieta
@cdennl
def my_predicate
  return eql? || none? || ... #this is pseudo code
end

my_predicate: 'custom message'

optional(:attr) { my_predicate }
Tim Riley
@timriley
@andriytyurnikov dry-web already has some sort of application config system, but I’m interested in making it behave a little more like dotenv instead of using a .yml file. As for foreman, this seems like something that’s better suited to people’s own skeletons or applications rather than being built in?
Pol Miro
@polmiro

hi! I'm running into a struggle with dry-transaction and I wonder if it is something any of you have run into.

1)The interface expected is always in the form call(input) but since we have been using dry-initializer a lot, our callable objects are initialized with the input, and called with call() without any arguments.
I can wrap the registered methods so they get called correctly but seems a bit of an overhead. Step adapters don't really solve anything since they adapt the handling of the output but not the way the method is called.
Is there any way to streamline this? Has any of you felt this need before?

Pol Miro
@polmiro
2) In a similar fashion, the schemas from dry-validation return a Dry::Validation::Result, which resembles a lot to a Dry::Monads::Either class but it's not, so dry-transaction does not work when chaining a dry-validation schema directly. I wonder if the dry-transaction contract could accept results in a more dynamically typed way so that this would not happen.
Tim Riley
@timriley
@polmiro I haven’t run into someone using dry-transaction with objects like yours before. I’d really recommend against setting your input as state via the initializer, because that means your objects become stateful, non-reusable, and you effectively have to throw them away after #call-ing them once.
the kind of object that dry-transaction is designed to work with is one that receives static things in its initializer (config or collaborating objects, i.e. things that never need to change), and then #call is receives the variable input.
This means you can have the same object and #call on it many times over.
As for (2), there’s actually a “monads” extension for dry-validation that lets you return either objects: https://github.com/dry-rb/dry-validation/blob/master/lib/dry/validation/extensions/monads.rb
you could provie a base validation schema class for your app with a #call method that does that to_either conversion for you
(or I suppose write a step adapter to do it)
Pol Miro
@polmiro
cool that makes sense, thanks for the explanation Tim :thumbsup:
Pol Miro
@polmiro
it's great to hear about that monads extension, did not realize it existed
Pol Miro
@polmiro
where could I find more usage examples of dry-transaction?
Tim Riley
@timriley
A couple of releases this morning!
Lonnie VanZandt
@lonniev

newbie here. I watched @timriley's Singapore presentation and really liked the functional-ity and separation of concerns. I'm looking for some convention to surround me as I get started with these new-to-me dry and rom capabilities. Something like a "click here to download Trailblazer with skeleton support for a Riley-like dry/rom app".Is there any getting-started resource like that? Maybe @fran-worley can recommend where someone new to both dry/rom and Trailblazer should start if they have no legacy app to evolve?

I'm really interested in the ROM Relations concept that allows architect/developers to work with objects that look like business objects rather than detailed database scaffolding because the kind of applications that I work on have complex object-with-object relationships and all relational database repositories eventually so pollute the network-graph business concepts that the business services often have to be simplified or be reduced in flexibility if the relational-model details are implemented in the business objects themselves. Therefore, the dry/rom architecture of separating out associations as proper objects, of separating out repository query handlers, of separating out functional dependency-injected command objects, from the business objects themselves is intoxicating.

Lonnie VanZandt
@lonniev
Hmm, may be "...dry-web-roda gem and then generate a new project via the dry-web-roda new my_app_name..." from a recent reply by @timriley . Back to googling.
Oskar Szrajer
@gotar
generating new project might by a good idea, but a lot strange (new) ideas you will find there. So go directory -> file by file and ask.
asking here might be the best idea to understand it @lonniev
Tim Riley
@timriley
@lonniev you can also check out icelab/Berg on github for a real functioning app
I plan to make some improvements to dry-web this Jan and Feb, too, including docs.
Oskar Szrajer
@gotar
berg can be really hard to understand but of course it's wonderful source of knowleadge I used it many times
Eger Andreas
@andreaseger
hi, is there a way to make dry-validation care about unknown keys, meaning adding a UnknownKeysError?
Lonnie VanZandt
@lonniev
@timriley, yes, I spotted Berg in your github repos and thought that might be a good starter sample. Now, both you and @solnic have mentioned that your cool dry-system and rom components could or do work with Trailblazer and Hanami. I'd like to see an example of that. Got one? @gotar, yes, there's often nothing better than taking time to RTFC(ode). :-)
Piotr Solnica
@solnic
@lonniev berg is pretty big so I agree with @gotar that it could feel overwhelming a bit
We just need a Todo app or a blog app examples. Something very basic but complex enough to show off some important features
Steve
@dnd
is there any kind of built in predicate to check whether a field is true or not? I have a form that has a valid? method, and rather than make a custom predicate or something, I was hoping something already existed to do it in a generic way
Christopher Dennl-Ortega Arrieta
@cdennl
or do you mean truey?@dnd
truey? doesnt exist built in
Piotr Solnica
@solnic
@dnd there’s bool? and true? and false?
@cdennl no need for truthy/falsy because coercion will turn values into booleans prior validation :)
Christopher Dennl-Ortega Arrieta
@cdennl
@solnic I know, was just a reply to dnd
Steve
@dnd
@timriley yeah. true? was what I was looking for. I needed to nest the schema, and I just brainfarted. Thanks
Tim Riley
@timriley
If there are any dry-view users here, you might be interested to check out dry-rb/dry-view#18 - it should hopefully make a big improvement to those #locals methods that might’ve become sprawling in a few places
Lonnie VanZandt
@lonniev
Happy New Year all. After a few days away, I am returning to look at dry-web. I came across the dry-web-skelton raygun template. This seems to be a good way to "terraform" an empty directory into a new project planet ready for app colonization. While I begin to grok the piece parts of the dry-rb ecosystem, I'm still wary to start just adding files here and there while not sure of the expected conventions. Is there a dry-web-roda generate entity MY_NEW_ENTITY generation script that helps one seed a new entity into the terraformed directories? For example, if I have just raygunned out a new dry-web-roda app from the skeleton, what's the next step to, say, add a route and view for a first-pass-do-nothing entity of "Tweets"? (This is likely all very evident for someone very familiar with the whole stack, conventions, and traditions but isn't evident to a newcomer or, at least, to me.)
Fran Worley
@fran-worley
@lonniev I've been switched off over Christmas and new year, returning this week!! I've got a couple of demo apps that use trailblazer 1.0 and dry-validation. Reform/Rom integration is a work in progress at the moment. You should check out the trailblazer channel and see if anyone has any working Rom examples. Also if your only just starting out definitely checkout trailblazer 2.0. It's awesome as is its creator @apotonick :heart_eyes_cat:
Lonnie VanZandt
@lonniev
@fran-worley My angst is that I have to compare and contrast all the competing frameworks to try to spot what I gain or lose by working with one versus the other. I like the dry-web-roda, dry-system, dry-transaction, and rom-rb piece parts. Do I lose one or more of these if I choose TRB to get some convention? Or are we talking about supersets here where TRB is everything I find in dry-web-skeleton plus the crutch of convention that I seek? Am I afraid to adopt the very thing I seek?
Fran Worley
@fran-worley
Trailblazer isn't a framework in itself so you should be able to adopt what you please. The caveats being that currently we don't officially support ROM and you might find that dry transaction and trailblazers operations are so similar that you choose one or the other.
Lonnie VanZandt
@lonniev
Often, the best way is to just try something. TRB has a nice set of documentation and even an ebook. Is there a just-do-it raygun template or gem or thor generator that populates an empty directory with all of TRB2 and its starter app? I want the live local code so that I can simply surf that code rather than working through the hard reading and mental assimilation process.
Lonnie VanZandt
@lonniev
BTW I come to the party without Rails baggage and with no intention of first adopting Rails. Reading a bit, I see that the typical use case for TRB is a developer already using Rails, wanting to improve their situation. I'm in a green field looking for a way to explore dry-web, hoping to avoid ActiveRecord. This is why I'm looking around for the dry-web-roda entity or TRB generators.
Rijul Raut
@mindseyeblind
So I'm in the process of converting my Rails stack to use dry-validations, and I just had one question: how do I handle conditional validations? Do I just use an if block?
Christopher Dennl-Ortega Arrieta
@cdennl
@lonniev Im using Rails + TRB2 + Dry-v, using sequel instead of AR and using Cells instead of AV
Fran Worley
@fran-worley
@lonniev trailblazer is not a framework in itself, rather it's a series of gems - the main ones being Reform - form objects, operations to make sense of business logic and processes (similar to dry transaction) - that you can incorporate what you want and need into your project whatever your framework or ORM. I've got apps in Sinatra that use elements of trailblazer and an app (no framework so to speak) that uses Roda for routing, Sequel as an ORM, dry-validations and types for validations and coercions with trailblazer gems to bring it all together.
@lonniev hey, we won’t have generators for things like entities mostly because dry-web is not a full stack framework that ships with such concepts
we can have generators for some things though, like roda routes or transaction skeletons
Piotr Solnica
@solnic
@lonniev could you start a thread on discuss.dry-rb.org? it’s a better place to ask such questions
Lonnie VanZandt
@lonniev
@solnic sure bye-here