These are chat archives for dry-rb/chat

6th
Jun 2016
Gilbert Komin
@myf9000
Jun 06 2016 07:57
thanks a lot! when will be 0.8.0 release? :)
Dawid Leszczyński
@davebream
Jun 06 2016 08:07
Hello everyone, I can not manage to validate array of integers using dry-validation. I want it to be required but check each value with int?. Can anybody help me?
Nikita Shilnikov
@flash-gordon
Jun 06 2016 08:13
@myf9000 this month
Gilbert Komin
@myf9000
Jun 06 2016 08:39
@flash-gordon Thanks
Piotr Solnica
@solnic
Jun 06 2016 09:21
@davebream try key(:my_arr) { filled? & each { int? } } we’ll make it nicer in 0.8.0
Dawid Leszczyński
@davebream
Jun 06 2016 09:25
@solnic when using it in Dry::Validation.Form I got
NoMethodError:
       undefined method `merge' for #<Dry::Types::Definition primitive=String options={}>
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `each'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `reduce'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `merge_with'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:48:in `visit_form_hash'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:23:in `visit_type'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:53:in `visit_key'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `block in merge_with'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `map'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:58:in `merge_with'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:48:in `visit_form_hash'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:23:in `visit_type'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:15:in `visit'
     # /bundle/gems/dry-types-0.6.0/lib/dry/types/compiler.rb:11:in `call'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation/input_processor_compiler.rb:16:in `call'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:118:in `input_processor'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:141:in `default_options'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation/schema.rb:45:in `new'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation.rb:36:in `Schema'
     # /bundle/gems/dry-validation-0.7.2/lib/dry/validation.rb:41:in `Form'
     # ./app/forms/api/v1/share_holidays_form.rb:34:in `schema'
     # ./app/forms/api/v1/share_holidays_form.rb:26:in `validate!'
     # ./app/forms/api/v1/share_holidays_form.rb:14:in `attributes'
     # ./spec/forms/api/v1/share_holidays_form_spec.rb:27:in `block (4 levels) in <top (required)>'
Piotr Solnica
@solnic
Jun 06 2016 09:26
@davebream pls report an issue with a repro
Maciej Mensfeld
@mensfeld
Jun 06 2016 10:10
@mrbongiolo exactly - I just want to know when something is not exactly as I defined
Oskar Szrajer
@gotar
Jun 06 2016 10:51
Fast probably stupid question ;] how to list everything from container? To check what I have defined there
Tim Riley
@timriley
Jun 06 2016 10:52
my_container.keys @gotar ?
Oskar Szrajer
@gotar
Jun 06 2016 11:01
;] thx I was sure it must be sth obvious
Tim Riley
@timriley
Jun 06 2016 11:03
Turned out the key was right before our eyes :wink:
Piotr Solnica
@solnic
Jun 06 2016 13:34
hey folks, I improved/fixed how “safe” types work in dry-types which dry-validation heavily relies on and there were many known bugs that I think I fixed. please help with testing, just grab dry-v/t from master and lemme know if it works for you /cc @jodosha @timriley
Tim Riley
@timriley
Jun 06 2016 13:41
Will take a look @solnic!
Fran Worley
@fran-worley
Jun 06 2016 13:41
@solnic I think you've fixed dry-rb/dry-validation#125
Just checking the specs now
Fran Worley
@fran-worley
Jun 06 2016 13:59
@solnic it looks like this can also be closed: dry-rb/dry-validation#133
Piotr Solnica
@solnic
Jun 06 2016 14:11
@fran-worley I thought my commit would close them
Fran Worley
@fran-worley
Jun 06 2016 14:12
@solnic I'm just updating the integration specs to check that all the skipped ones now pass
Piotr Solnica
@solnic
Jun 06 2016 14:20
@fran-worley yeah we might need to tweak some of the specs, I noticed today that some specs had incorrect expectations
I fixed them but I didn’t have enough time to check xit specs
Fran Worley
@fran-worley
Jun 06 2016 14:21
I'm going through them now. I'll PR in a few
Piotr Solnica
@solnic
Jun 06 2016 14:21
sweeet
Fran Worley
@fran-worley
Jun 06 2016 14:55
Are you happy for me to close the issues now fixed?
dry-validation issues: #125
Piotr Solnica
@solnic
Jun 06 2016 15:01
@fran-worley yes please!
Fran Worley
@fran-worley
Jun 06 2016 15:01
@solnic with regards to #134, would you raise the error when compiling the schema or when trying to validate ?
Piotr Solnica
@solnic
Jun 06 2016 15:03
@fran-worley the dsl should yell when somebody tries to do that
Fran Worley
@fran-worley
Jun 06 2016 15:06
so basically:
it "should raise error" do
  expect { Dry::Validation.Form do
      required(:foo).maybe(:none?)
    end }.to raise_error SomeError
end
Oskar Szrajer
@gotar
Jun 06 2016 15:10

If I have container like:

require 'dry/web/container'

module Blog
  class Container < Dry::Web::Container
    setting :auto_register, 'lib'

    configure do
      load_paths!('lib')
    end
  end
end

and in lib directory I have for example repository, that require single arg when initialize, how I can do that? Container above register it automatically without any args,

module Persistence
  module Repo
    class Posts < ROM::Repository
      relations :posts

      def index
        posts.to_a
      end
    end
  end
end
>> Blog::Container['persistence.repo.posts']
ArgumentError: wrong number of arguments (given 0, expected 1)
    from /Users/gotar/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/rom-repository-37ec20210a66/lib/rom/repository.rb:33:in `initialize'
Piotr Solnica
@solnic
Jun 06 2016 15:14
@gotar you can use it with auto-inject thingie
include YourInjectModule[“your.rom.container”]
Oskar Szrajer
@gotar
Jun 06 2016 15:15

hmm ok then I define sth like:

require_relative 'container'

module Blog
  Import = Container.import_module

  def self.Import(*args)
    Import[*args]
  end
end

and then

require "blog/import"

module Persistence
  module Repo
    class Posts < ROM::Repository
      include Blog::Import("persistence.rom")

      relations :posts

      def index
        posts.to_a
      end
    end
  end
end
??
those above do not works for me
but I think i'm close
Fran Worley
@fran-worley
Jun 06 2016 15:17
@solnic I assume that it also should raise an error if you try to do: required(:foo).filled(:filled?)
Oskar Szrajer
@gotar
Jun 06 2016 15:17
I was trying to find in any article or repo but have no luck
Piotr Solnica
@solnic
Jun 06 2016 15:21
@fran-worley yep
@gotar it’s a recent improvement
@gotar icelab’s skeletons might have it
see Berg app
Oskar Szrajer
@gotar
Jun 06 2016 15:26
I read whole code of berg and skeleton, but didn't found it. He do not use Repository
and define all relation and commands containers manually
but if it's AutoInject then I will find a way
Piotr Solnica
@solnic
Jun 06 2016 15:30
@gotar make sure you’re using latest-latest-latest stuff
although auto-inject was recently released
so maybe it’s ok to use released ver, I’m not really up-to-date with the recent stuff, better ask @timriley
Oskar Szrajer
@gotar
Jun 06 2016 15:48
i always use master master
in all my projects ;] even produciton
I will try to skip Import and use AutoInject manually
Oskar Szrajer
@gotar
Jun 06 2016 15:56
ok found it, eh
module Berg
  class Repository < ROM::Repository::Root
    # This .new shouldn't be needed, since repos should work with dry-
    # auto_inject. This is not working yet, so this remains as a workaround.
    def self.new(rom = nil)
      super(rom || Berg::Container["persistence.rom"])
    end
  end
end
Piotr Solnica
@solnic
Jun 06 2016 15:58
uhm I thought we made that work
Andy Holland
@AMHOL
Jun 06 2016 16:01
@gotar @solnic yeah, pretty sure @timriley fixed that, probably just that the skeleton hasn't been updated
Oskar Szrajer
@gotar
Jun 06 2016 16:01

my Gemfile:

source "https://rubygems.org"

ruby "2.3.0"

# Web framework
gem "dry-web", github: "dry-rb/dry-web"

# Database persistence
gem "sqlite3"
gem "rom",            github: "rom-rb/rom"
gem "rom-mapper",     github: "rom-rb/rom-mapper"
gem "rom-repository", github: "rom-rb/rom-repository"
gem "rom-sql",        github: "rom-rb/rom-sql"
gem "rom-support",    github: "rom-rb/rom-support"

# Application dependencies
gem 'rake'
gem "dry-validation", github: "dryrb/dry-validation"

group :test do
  gem "rspec"
  gem "rack-test"
end

and it's not working still

but maybe i'm doing sth in a wrong way
Piotr Solnica
@solnic
Jun 06 2016 16:03
yeah you defo need auto-inject and auto-component from master too
better wait for Tim
Oskar Szrajer
@gotar
Jun 06 2016 16:05
uuh ok
my mistake I miss those two
Oskar Szrajer
@gotar
Jun 06 2016 17:04
hmm even on master sth not works. will w8 for @timriley maybe he have some working example
Nikita Shilnikov
@flash-gordon
Jun 06 2016 17:08
oh, auto-expand again
@gotar I use auto_inject from master, < ROM::Repository[:posts] instead of < ROM::Repository, and ArgsImport because kwargs is the default strategy atm but rom-repo requires sequential arguments
Oskar Szrajer
@gotar
Jun 06 2016 17:29
ok then maybe it's the problem with those kwargs, will try ArgsImport, thx
Oskar Szrajer
@gotar
Jun 06 2016 17:40
@flash-gordon can you put somewhere whole exmapled code, still not sure how to define it
Nikita Shilnikov
@flash-gordon
Jun 06 2016 17:43
@gotar wdym? The link I posted is the whole example :)
Piotr Solnica
@solnic
Jun 06 2016 17:44
uhm, we should change it to accept kwargs
Nikita Shilnikov
@flash-gordon
Jun 06 2016 17:44
I mean gist, not this cropped preview
Piotr Solnica
@solnic
Jun 06 2016 17:44
I’m pretty sure it’s gonna need more options soon :D
Nikita Shilnikov
@flash-gordon
Jun 06 2016 17:44
:laughing:
Oskar Szrajer
@gotar
Jun 06 2016 17:46
ah sorry, It's to late for me :p
I try to prepare workshops based on rom, roda, and whole Dry stack but already see it will be too hard to accept by anyone
need to think how to go through it
Fran Worley
@fran-worley
Jun 06 2016 18:06
@solnic is there a way of distinguishing between a :key? rule being created via required/optional vs the value block?
Piotr Solnica
@solnic
Jun 06 2016 18:08
@gotar rom-rb or roda alone would be a lot for a single workshop :)
@fran-worley not really. why?
Fran Worley
@fran-worley
Jun 06 2016 18:10
Trying to raise an error when you do: required(:foo) { key? } I can catch it easily with the macros but not with the blocks...
Piotr Solnica
@solnic
Jun 06 2016 18:12
it’d be better to do that thing we talked about last month with predicates being available already when DSL is initialized
then we can explicitly define which predicates are available where
and improve UX in general
Fran Worley
@fran-worley
Jun 06 2016 18:13
that's true. I'll take out the changes I made in #177 and then it can merge as its just spec updates?
Piotr Solnica
@solnic
Jun 06 2016 18:16
actually that part can stay
just merge it in :)
Fran Worley
@fran-worley
Jun 06 2016 18:17
Ok cool, does the error name make sense? InvalidSchemaError ?
Piotr Solnica
@solnic
Jun 06 2016 18:17
yep
Fran Worley
@fran-worley
Jun 06 2016 18:17
cool
Piotr Solnica
@solnic
Jun 06 2016 18:18
seems like the fixes in dry-types made tons of specs pass :)
Fran Worley
@fran-worley
Jun 06 2016 18:19
I got the whole lot to pass, then skipped another load which were fudged
Ralf Schmitz Bongiolo
@mrbongiolo
Jun 06 2016 18:38
@solnic dry-rb/dry-validation#172 should be passing now too, I updated my app code and the array? rule seems to be working correctly
Piotr Solnica
@solnic
Jun 06 2016 18:39
@mrbongiolo pls merge these specs in if they are passing now
Ralf Schmitz Bongiolo
@mrbongiolo
Jun 06 2016 18:39
let me check it
Ralf Schmitz Bongiolo
@mrbongiolo
Jun 06 2016 18:52
@solnic that's weird, in my app it's working, but the specs are still failing...
Piotr Solnica
@solnic
Jun 06 2016 19:21
@mrbongiolo it needs dry-types from master
Ralf Schmitz Bongiolo
@mrbongiolo
Jun 06 2016 19:22
@solnic shouldn't a bundle update get it from master already?
Piotr Solnica
@solnic
Jun 06 2016 19:22
yeah but travis is weird with caching so…maybe remove cache and restart
Ralf Schmitz Bongiolo
@mrbongiolo
Jun 06 2016 19:42
@solnic the build passed on Travis, for some reason my local build doesn't want to update dry-types or is just not using the version from master, gonna check out later what's going on
Oskar Szrajer
@gotar
Jun 06 2016 20:14

Another probably stupid question ;]

require "dry-validation"

module Validations
  PostValidator = Dry::Validation.Form do
    required(:title) { filled? & str? }
    required(:body){ filled? & str? }
  end
end

if I have Validator like this how I can use it with AutoInject? There is no method new to call by it, t's just a function. I need to mark it somehow or do sth else?

Blog::Container["validations.post_validator"]
NoMethodError: undefined method `new' for #<#<Class:0x007fdbb0c8b1b0>:0x007fdbb0bf2898>
    from /Users/gotar/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/bundler/gems/dry-component-0bebc656b625/lib/dry/component/loader.rb:42:in `instance'
Nikita Shilnikov
@flash-gordon
Jun 06 2016 20:31
@gotar I know @timriley had a similar issue. I don't use dry-component atm so I don't know how to handle it properly, too high level for me :)
Oskar Szrajer
@gotar
Jun 06 2016 20:32
ok I have solution
just pack class around it
require "dry-validation"

module Validations
  class PostValidator
    PostSchema = Dry::Validation.Form do
      required(:title) { filled? & str? }
      required(:body){ filled? & str? }
    end

    def call(args)
      PostSchema.call(args)
    end
  end
end
Piotr Solnica
@solnic
Jun 06 2016 20:36
I don't register schemas in containers
just set them as constants
Andy Holland
@AMHOL
Jun 06 2016 21:15
@gotar you can pass a block to auto_register!
And use that to determine how to construct the objects
@solnic perhaps we should have a configuration and delegate that to an object
Piotr Solnica
@solnic
Jun 06 2016 21:16
better to skip auto-registering schemas
just define them as constants
that's why I added block syntax for building an object
Andy Holland
@AMHOL
Jun 06 2016 21:17
How come @solnic ?
Oskar Szrajer
@gotar
Jun 06 2016 21:18
it will be the best if AutoInject recognize it's class or not and then defind as contant not call new on it
Andy Holland
@AMHOL
Jun 06 2016 21:19
@gotar just watching your wroc_love.rb talk BTW :)
Piotr Solnica
@solnic
Jun 06 2016 21:19
link pls?
Oskar Szrajer
@gotar
Jun 06 2016 21:19
nothing to see :p
:cat2:
Andy Holland
@AMHOL
Jun 06 2016 21:20
lol I'm sure you're being humble
Piotr Solnica
@solnic
Jun 06 2016 21:21
@AMHOL it didn't feel right to use a container for things like schemas or data classes like structs and values, they are treated as app boundaries, not some "abstract service objects" that your app relies on
Andy Holland
@AMHOL
Jun 06 2016 21:21
Interesting
What about using them in dry-transaction?
Piotr Solnica
@solnic
Jun 06 2016 21:22
so ie whenever I see a require "some_app/validation/some_schema" I know that this thing works at a specific boundary of my system
I never used as a schema as a separate step
Andy Holland
@AMHOL
Jun 06 2016 21:22
Ahh OK
You just use them in commands?
Piotr Solnica
@solnic
Jun 06 2016 21:23
it's always an object that uses a schema internally and typically talks to a db through a repo or command or sutin
Andy Holland
@AMHOL
Jun 06 2016 21:23
That makes sense
Piotr Solnica
@solnic
Jun 06 2016 21:23
a...service object :P
one thing I still don't like is that this still mixes an http-specific schema with a lower-level app stuff
not sure how to make this nicer
w/o any duplication
Andy Holland
@AMHOL
Jun 06 2016 21:23
Still not sure about the not registering them, it's still a dependency, but I don't have experience using dry-component yet
A separate transaction step? :joy:
Piotr Solnica
@solnic
Jun 06 2016 21:32
@AMHOL for me it's not an abstract dependency, that's where I draw the line
think about an ActiveRecord model, it's also a boundary, and a really huge one, everywhere your code references an AR model it makes it clear that a given part of your app is coupled to a database
it's the same here, everywhere you use a schema that validates data coming from an http request it's pretty clear that this is part of your system that deals with http stuff
fwiw you could treat that as an abstract concept and only rely on its interface but I think it's an overkill
Andy Holland
@AMHOL
Jun 06 2016 21:35
Yeah, I've backed myself into a corner many times trying to be too strict about things, and past experience would indicate that when I disagree with you I'm wrong lol
But I was still thinking in terms of the interface
Still not sure on that one, will have to try it out sometime I guess
Piotr Solnica
@solnic
Jun 06 2016 21:36
well, we can both be right :D
I can make dry-v schemas work with auto-registration, but I don't want to ;)
Andy Holland
@AMHOL
Jun 06 2016 21:36
BTW, what do you think of pre-configuring a key mapping in component?
Piotr Solnica
@solnic
Jun 06 2016 21:37
wdym?
Andy Holland
@AMHOL
Jun 06 2016 21:37
To allow registration under keys that don't have any relation to the class name
Piotr Solnica
@solnic
Jun 06 2016 21:38
yeah we can use some configurable strategies for figuring this out
Andy Holland
@AMHOL
Jun 06 2016 21:39
sth like
Dry::Component.configure do |config|
  config.mapping = {
    'user_validator' => 'users.validator'
  }
end
Then when it loads UserValidator it registers under users.validator
Rather than just computing keys from the constant name
It's a bad example, but the idea is that it allows for more abstract keys
Andy Holland
@AMHOL
Jun 06 2016 21:44
Or perhaps just allow for a custom component loader
Piotr Solnica
@solnic
Jun 06 2016 21:44
we can have a configurable object that takes
yeah we can easily do that
we probably should :)
Andy Holland
@AMHOL
Jun 06 2016 21:47
:+1:
Tim Riley
@timriley
Jun 06 2016 21:54
@gotar I'll be at work in 40 minutes - will look into this stuff for you right away
@solnic I don't quite see how the explicit require and accessing an object via a constant implies it's a boundary enforcer... Repos also demarcate boundaries, for example, but we don't do it for those...
Piotr Solnica
@solnic
Jun 06 2016 22:01
not really an enforcer, just a signal that it's a concrete dependency being a boundary
repos are objects because it's better to have them as abstract stuff, this is 100 x bigger than a small object validating data (well ok a schema is big but not even close to the size of a repo object giving you access to data in your db including data mutation interfaces)
besides if these were not objects we would have to stick globals like db connections to classes etc, do-not-like
Tim Riley
@timriley
Jun 06 2016 22:04
So concrete dependency == something that's just not another internal object in our app's core, something a bit more "foreign"
Is that kinda what you're saying?
Piotr Solnica
@solnic
Jun 06 2016 22:05
wdym by "foreign"?
Tim Riley
@timriley
Jun 06 2016 22:06
Foreign as is not quite like the other objects that comprise our app's core behavior, all of which are in the container. Foreign as in a bit like using another gem, even.
Piotr Solnica
@solnic
Jun 06 2016 22:06
haven't thought about it like that
Tim Riley
@timriley
Jun 06 2016 22:06
I can't equate it to the explicit require etc. we need for instantiatiiself value objects, because this is still a functional object and could be in our container
Piotr Solnica
@solnic
Jun 06 2016 22:07
foreign as in external to the app's container, yes, of course
Tim Riley
@timriley
Jun 06 2016 22:07
Yeah, that's what I meant
Piotr Solnica
@solnic
Jun 06 2016 22:07
I think about schemas as types too
Tim Riley
@timriley
Jun 06 2016 22:07
I'm gonna need to come up with a different injection scenario for my talk, haha
Piotr Solnica
@solnic
Jun 06 2016 22:07
it's an fp object that responds to call but it also very strictly defines a very specific type of data that your app deals with
Tim Riley
@timriley
Jun 06 2016 22:08
Yeah, I think I'm starting to get you now
Piotr Solnica
@solnic
Jun 06 2016 22:08
so even though we don't instantiate an instance of that "type" a schema still defines "a type"
I can say exactly the same thing about domain types defined by dry-types structs and values
Tim Riley
@timriley
Jun 06 2016 22:09
This is true!
Piotr Solnica
@solnic
Jun 06 2016 22:09
it's just that source data for these types come from a db, not an http request
Tim Riley
@timriley
Jun 06 2016 22:09
Yeah. And I don't care abut injecting them because there are so many. It's completely unwarranted.
So I guess the same rule can apply to schemas
Piotr Solnica
@solnic
Jun 06 2016 22:10
yeah, I think DI is a good tool for "service objects"
as in stuff that does something heavy, esp with side-effects
and you may want to replace it, or decorate it, or sutin
Tim Riley
@timriley
Jun 06 2016 22:14
Yeah
I hear you
Oskar Szrajer
@gotar
Jun 06 2016 22:19
ok all looks to work (basic skeleton), but a little magic to drop in next step
^ magic here ;]
@timriley your blog posts and repos was a HUGE help
it's so kard to glue everything together for the first time, a lot more blog posts and docs needed
Tim Riley
@timriley
Jun 06 2016 22:21
@gotar oh cool! So you've got it now?
@gotar yeah, I hope I can write some more stack-specific docs over the next 2 weeks. And my blog posts... Well, they'll get there eventually. They have a plodding pace :)
Oskar Szrajer
@gotar
Jun 06 2016 22:23
I manage it somehow but not happy how ;]
Tim Riley
@timriley
Jun 06 2016 22:24
Hah, so have you had to use a hack or something? Or it just took longer than you hoped to get to the solution?
because ROM::Relation do not works with basic one - Container::Inject
or hack root for rom::repo, to have base class to limit code repetition, like: https://github.com/gotar/dry-web-skeleton/blob/master/lib/persistence/repo/base.rb#L15
probably other places too, like class around dry-v schema to make it AutoInjectable
Oskar Szrajer
@gotar
Jun 06 2016 22:30
if you guys have time, any comments welcome, trying to build as simple skeleton as possibe. Your @timriley is great but to complex to just teach/explain/show different dry-web pieces
Piotr Solnica
@solnic
Jun 06 2016 22:31
I'd call dry-web stuff as a pretty advanced thingie (at least for now)
so it's gonna be tough to explain to people who mostly know rails
Oskar Szrajer
@gotar
Jun 06 2016 22:32
yeap i will try 3-4h workshops for good devs but rails ways devs
we will see
I already told them something about roda and rom, but they never wrote any app outside rails
then I plan to write some basic roda + rom app, and then go deeper and deeper inside container, auto-inject ...
we will see
Piotr Solnica
@solnic
Jun 06 2016 22:34
it's gonna be interesting for sure :D
hanami will be a much much better "entry point" for people, I think
Oskar Szrajer
@gotar
Jun 06 2016 22:34
the goal is not to teach dry-w, but maybe someone will pick roda or rom or dry-container for next project
Piotr Solnica
@solnic
Jun 06 2016 22:35
yeah defo lots of interesting stuff to learn for people
Oskar Szrajer
@gotar
Jun 06 2016 22:36
yeap but it;s special event for *RUG, on TRUGs for last 1-2y I try to explain rom and roda, and they ask for a workshops to sit together and write app in those technologies to learn
hard for them to force themself to try at home
then will will try this way, evangelistaion all the time ;]
ok time to sleep, bye and thx for great support as always :)
Piotr Solnica
@solnic
Jun 06 2016 22:40
sure that's a really awesome initiative, thanks for doing that :)
:wave:
Tim Riley
@timriley
Jun 06 2016 22:44
@gotar this sounds great, nice work!
What you are doing with that AutoInject hack is actually a lot nicer with dry-component's injector. But I'll see if we can improve the base AutoInject too
With dry-component you can just switch strategies ad-hoc
e.g. include MyComponent::Inject.args["foo"]
Piotr Solnica
@solnic
Jun 06 2016 22:47
:heart_eyes:
Tim Riley
@timriley
Jun 06 2016 22:49
MyComponent::Inject.args.hash.kwargs.args[“foo”] if you really want
;)
I’ll add an issue to remind me to do that to dry-auto_inject directly
And I’ll release dry-component today :)
@gotar I think I have a fix for your repo issue
And changed class Posts to be class Posts < Base[:posts]
and change class Base to be class Base < ROM::Repository::Root
Piotr Solnica
@solnic
Jun 06 2016 22:53
@timriley did you figure out that complex stuff with lazy-booting components on demand?
Tim Riley
@timriley
Jun 06 2016 22:54
@solnic Indeed I did.
Piotr Solnica
@solnic
Jun 06 2016 22:55
:scream_cat:
Oskar Szrajer
@gotar
Jun 06 2016 22:55
Hmm I will try tmr for sure. Thx for advice.
Tim Riley
@timriley
Jun 06 2016 22:55
Well, I think I did, @solnic! haha
Piotr Solnica
@solnic
Jun 06 2016 22:56
can't wait to try this stuff out
but that has to wait until rom is out with dry-v/t/l upgrades
Tim Riley
@timriley
Jun 06 2016 22:57
:)
Piotr Solnica
@solnic
Jun 06 2016 23:06
:zzz: time :wave:
Tim Riley
@timriley
Jun 06 2016 23:06
:wave: