These are chat archives for dry-rb/chat

8th
Dec 2015
Piotr Solnica
@solnic
Dec 08 2015 09:10
@AMHOL wdyt about creating a website for dryrb org?
oh and good morning :joy:
Andy Holland
@AMHOL
Dec 08 2015 09:12
Good morning :)
I'd love to
But I fall flat on the design aspect
Piotr Solnica
@solnic
Dec 08 2015 09:13
I’ll ask some designer friends for help
Andy Holland
@AMHOL
Dec 08 2015 09:13
That would be cool :)
Piotr Solnica
@solnic
Dec 08 2015 09:14
first step is the logo, maybe a desert with a ruby gem in the sand LOL
Hannes Nevalainen
@kwando
Dec 08 2015 09:14
:thumbsup:
Andy Holland
@AMHOL
Dec 08 2015 09:14
lol it definitely fits
We need a mirage
Piotr Solnica
@solnic
Dec 08 2015 09:15
totally
btw we gotta look into rom-support and see what could be extracted
esp wrt Options API and some nice way to get super lightweight DI for libs
Andy Holland
@AMHOL
Dec 08 2015 09:18
DI as in Dependency Injection or Dependency Inversion?
Piotr Solnica
@solnic
Dec 08 2015 09:18
good question :joy:
Andy Holland
@AMHOL
Dec 08 2015 09:18
lol
Tim Riley
@timriley
Dec 08 2015 10:23
An interesting thing I discovered today: when using dry-v with i18n, to allow my app to override the default translations, I need to load dry-v’s i18n integration explicitly first, and then add my app’s locale files to the load path.
e.g. icelab/alpinist@b73da78
Piotr Solnica
@solnic
Dec 08 2015 10:23
@timriley please report an issue
Tim Riley
@timriley
Dec 08 2015 10:23
@solnic will do!
Piotr Solnica
@solnic
Dec 08 2015 11:38
dryrb/dry-validation@0bde77d /cc @timriley
could you try that out?
Tim Riley
@timriley
Dec 08 2015 11:40
Sure thing. So I need to provide a specific path to an i18n yml file now?
Piotr Solnica
@solnic
Dec 08 2015 11:41
it’s the interface for providing customized messages for both i18n and plain yaml
Tim Riley
@timriley
Dec 08 2015 11:41
Right. Seems like it’d work for the file-based i18n backends only, then, but I guess that’s a whole different kettle of fish.
will pull it down and try now.
Piotr Solnica
@solnic
Dec 08 2015 11:43
@timriley this should work fine for a single schema, not sure how to solve this globally
maybe I should tweak config.path in messages to be an array
and concat with i18n rather than append
so you’ll be able to add your messages there, before the defaults
Tim Riley
@timriley
Dec 08 2015 11:47
Right, so that works.
But I guess the problem is that people can organise their locale files in so many different ways.
If I wanted to provide en and es translations, I might have them in e.g. locales/es/errors.yml and locales/en/errors.yml
Which I suppose wouldn’t fit here.
Tim Riley
@timriley
Dec 08 2015 11:59
Maybe Messages actually needs to have its own internal cache of translations, which are added to as needed, first looking up from the i18n backend, falling back to its own defaults
Which would mean that it could use whatever i18n config the app has already supplied (file-based or otherwise)
Piotr Solnica
@solnic
Dec 08 2015 12:02
@timriley I solved it, but just need to deal with bloody global mutable state that I18n is
I mean in specs...
Piotr Solnica
@solnic
Dec 08 2015 12:09
ok this was silly, since I18n is global
so we can’t have it per-schema
in case of i18n
it’s gonna set it to global
what a nice example how typical ruby way of writing gems with global mutable state is horrible
Andy Holland
@AMHOL
Dec 08 2015 12:14
lol
Tim Riley
@timriley
Dec 08 2015 12:15
Let this be today’s lesson for you, kids
Piotr Solnica
@solnic
Dec 08 2015 12:21
this is a clusterf*ck, esp when it comes to testing this
blah, next step : dry-i18n :joy:
Hunter Madison
@hmadison
Dec 08 2015 12:23
Soon solnic you will end up rewriting ruby
Piotr Solnica
@solnic
Dec 08 2015 12:23
funny!
Andy Holland
@AMHOL
Dec 08 2015 12:25
Rewriting ruby is easy
class String
  def blank?
    'Are you f*****g kidding?'
  end
end
Hannes Nevalainen
@kwando
Dec 08 2015 12:31
class Numeric
  def +(other)
    super(other) + (rand < 0.1 ? 1 : 0)
  end
end
Andy Holland
@AMHOL
Dec 08 2015 12:32
lol nice, :shipit:
Piotr Solnica
@solnic
Dec 08 2015 12:34
I already lost an hour
this is frustrating
Tim Riley
@timriley
Dec 08 2015 12:40
Sorry :grimacing:
Andy Holland
@AMHOL
Dec 08 2015 12:44
dry-i18n, coming soon
:joy:
Piotr Solnica
@solnic
Dec 08 2015 12:44
This Winter…Prepare. dry-i18n is coming O_o
Andy Holland
@AMHOL
Dec 08 2015 12:45
lol
literally lol
We could make Dry::HashWithDotSeparatedStringAccess first?
Piotr Solnica
@solnic
Dec 08 2015 12:47
:D