easbarbosa has quit [Remote host closed the connection]
ecso has quit [Ping timeout: 252 seconds]
lad has quit [Remote host closed the connection]
lad has joined #ruby
ecso has joined #ruby
sri19 has joined #ruby
lunarkitty has joined #ruby
raw-bean has joined #ruby
raw-bean has quit [Ping timeout: 276 seconds]
raw-bean has joined #ruby
raw-bean has quit [Ping timeout: 268 seconds]
sri19 has quit [Remote host closed the connection]
fossdd has quit [Ping timeout: 252 seconds]
fossdd has joined #ruby
raw-bean has joined #ruby
Bounga has joined #ruby
raw-bean has quit [Ping timeout: 268 seconds]
raw-bean has joined #ruby
<rapha>
hi all
<rapha>
i there an elegant way to use Array#map to only modify the first element and return all others verbatim? or is a.each_with_index.map{|x,i| i==0 ? func(x) : x} the only way?
fossdd has quit [Ping timeout: 250 seconds]
fossdd has joined #ruby
<leftylink>
it seems difficult for map to know it's only the first element. of course, the block could use a variable (one external to the block) to determine whether it has been run before?
jsaito has joined #ruby
<nakilon>
I won't use map
lad has quit [Ping timeout: 258 seconds]
fossdd has quit [Ping timeout: 252 seconds]
fossdd has joined #ruby
TomyWork has joined #ruby
lunarkitty has quit [Quit: Connection closed for inactivity]
fossdd has quit [Ping timeout: 265 seconds]
fossdd has joined #ruby
raw-bean has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jsaito has quit [Quit: Leaving]
raw-bean has joined #ruby
mrkz_c has quit [Quit: Connection closed for inactivity]
<jhass[m]>
yeah, what's wrong with a[0] = func(a[0])
pwnd_sfw9 has quit [Read error: Connection reset by peer]
pwnd_sfw has joined #ruby
drincruz_ has joined #ruby
<rapha>
huh! thx jhass[m], it did feel like i was missing something :-P
<weaksauce>
i mean it does error reporting in the object
<nakilon>
yeah I don't see neat error messages in json-schema
<nakilon>
I already did similar schema check in my old project that was checking if data are collected correctly before putting it as noSQL values -- it was telling where and what went wrong, but I don't want to make the wheel again
<nakilon>
or do I...
<weaksauce>
that dry library looks pretty solid tbh
<nakilon>
and not DRY at all
<nakilon>
they are just piling together dozens of non-related gems under the dry-* namespace because they are the company of friends
<nakilon>
that's how I see it
fossdd has quit [Ping timeout: 276 seconds]
fossdd has joined #ruby
<oz>
these are more utils/oop support libs, than "DRY" as in "Dont' Repeat Yourself"
<oz>
but it's a pretty cool project. :)
<weaksauce>
yeah does it need to be dry for you to use it?
<weaksauce>
though it is somewhat dry in the sense that your validations are all in one place
<nakilon>
does is it to add "dry-" prefix in every gem name? it's like ads banners
<nakilon>
so it took only 20 minutes to implement most of it, now only needs Array checks and maybe something else
<nakilon>
more complex assertions will be harder to make, like "this one hash keys should be equal to this one .map{ ... }", but probably possible
<weaksauce>
seems kinda brittle for what you gain
<weaksauce>
but you do you
<nakilon>
either put callback in some common ancestor or using some kinds of anchors
qunzhong_luxian has quit [Quit: leaving]
ur5us has joined #ruby
fossdd has quit [Ping timeout: 245 seconds]
fossdd has joined #ruby
gcd has quit [Ping timeout: 255 seconds]
fossdd has quit [Ping timeout: 276 seconds]
fossdd has joined #ruby
motherr has quit [Quit: zzz]
fossdd has quit [Ping timeout: 256 seconds]
fossdd has joined #ruby
drincruz has joined #ruby
drincruz_ has quit [Ping timeout: 258 seconds]
fossdd has quit [Ping timeout: 265 seconds]
fossdd has joined #ruby
<rg>
maybe dry isn't for you but it provides much needed diversity in an ecosystem dominated by rails, i dont hate rails or anything but competition is healthy.