havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.3, 2.4.5, 2.3.8, 2.6.0-preview3: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
sanscoeur has quit [Ping timeout: 250 seconds]
dbz has joined #ruby
keden has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
\void has quit [Ping timeout: 250 seconds]
dbz has quit [Remote host closed the connection]
\void has joined #ruby
venmx has quit [Ping timeout: 250 seconds]
graphene has quit [Remote host closed the connection]
keden has quit [Ping timeout: 268 seconds]
graphene has joined #ruby
elphe has joined #ruby
<cthu|> my lovely folks!
gix has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
awkwords has quit [Quit: sleepy time]
awkwords has joined #ruby
keden has joined #ruby
crankhar1er has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
nchambers has joined #ruby
keden has quit [Ping timeout: 250 seconds]
crankhar1er has quit [Ping timeout: 268 seconds]
<Radar> uh oh
<cthu|> my folks, help me with getting the last modified file in a directory
<cthu|> would this do the trick? target_file = Dir[File.expand_path("~/.Genymobile/Genymotion/deployed/#{device_name}/logcat-*.txt").glob("logcat-*.txt").max_by {|f| File.mtime(f)}
<cthu|> oops. forgot to close the ]
<cthu|> anyhow
keden has joined #ruby
brkkyk has quit [Read error: Connection reset by peer]
tectonic has quit []
keden has quit [Ping timeout: 250 seconds]
jaddison has quit [Quit: jaddison]
keden has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
tdy has quit [Ping timeout: 246 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
keden has quit [Read error: Connection reset by peer]
<SeepingN> `ls -lT | head -1` ;)
orbyt_ has joined #ruby
SeepingN has quit [Ping timeout: 250 seconds]
SeepingN has joined #ruby
Renich_ has joined #ruby
Renich has quit [Ping timeout: 246 seconds]
Renich_ is now known as Renich
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
<nchambers> you shouldn't parse ls though :/
awkwords has quit [Quit: sleepy time]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
bmurt has joined #ruby
cd has quit [Quit: cd]
eckhardt_ has joined #ruby
Renich_ has joined #ruby
awkwords has joined #ruby
Renich has quit [Ping timeout: 250 seconds]
Renich_ is now known as Renich
awkwords has quit [Quit: sleepy time]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
dviola has quit [Quit: WeeChat 2.3]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 268 seconds]
nchambers has quit [Ping timeout: 268 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beeman has quit [Quit: Connection closed for inactivity]
<SeepingN> can't you just do Dir...oh I see, you wanted the expand_path in there. nevermind
keden has joined #ruby
nchambers has joined #ruby
maslen has left #ruby [#ruby]
keden has quit [Ping timeout: 250 seconds]
arescorpio has joined #ruby
phaul has quit [Ping timeout: 250 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elphe has quit [Ping timeout: 272 seconds]
Tom-_ has joined #ruby
elphe has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
crankhar1er has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gigetoo has quit [Ping timeout: 268 seconds]
crankhar1er has quit [Ping timeout: 268 seconds]
orbyt_ has joined #ruby
gigetoo has joined #ruby
esrse has joined #ruby
RougeR has quit [Ping timeout: 268 seconds]
\void has quit [Quit: So long, and thanks for all the fish.]
arescorpio has quit [Remote host closed the connection]
Renich_ has joined #ruby
Renich_ has quit [Client Quit]
Renich has quit [Ping timeout: 246 seconds]
keden has joined #ruby
Fridtjof has quit [Ping timeout: 252 seconds]
keden has quit [Ping timeout: 244 seconds]
Exuma has joined #ruby
Fridtjof has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
keden has joined #ruby
keden has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
jaddison has joined #ruby
keden has joined #ruby
nadir has joined #ruby
darkhanb has joined #ruby
AJA4350 has quit [Quit: AJA4350]
keden has quit [Ping timeout: 246 seconds]
braincrash has quit [Quit: bye bye]
impermanence has quit [Quit: Ping timeout (120 seconds)]
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 250 seconds]
braincrash has joined #ruby
keden has joined #ruby
Fusl has quit [Ping timeout: 256 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Fusl has joined #ruby
keden has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
keden has joined #ruby
fifi-v has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
keden has quit [Ping timeout: 268 seconds]
jaddison has quit [Quit: jaddison]
keden has joined #ruby
keden has quit [Ping timeout: 250 seconds]
eckhardt_ has joined #ruby
Inline has quit [Quit: Leaving]
keden has joined #ruby
keden has quit [Ping timeout: 268 seconds]
fifi-v has quit [Ping timeout: 246 seconds]
chussenot has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
keden has joined #ruby
keden has quit [Read error: Connection reset by peer]
dellavg_ has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
eckhardt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
johnny56 has joined #ruby
reber has joined #ruby
reber has quit [Remote host closed the connection]
perique has joined #ruby
aupadhye has joined #ruby
fluxAeon has quit [Ping timeout: 246 seconds]
sauvin has joined #ruby
akem__ has quit [Ping timeout: 246 seconds]
chussenot has quit [Quit: chussenot]
segy has quit [Ping timeout: 240 seconds]
segy has joined #ruby
conta has joined #ruby
keden has joined #ruby
chris349 has quit [Ping timeout: 245 seconds]
keden has quit [Ping timeout: 246 seconds]
themsay has joined #ruby
fluxAeon has joined #ruby
fluxAeon has quit [Ping timeout: 245 seconds]
agent_white has quit [Quit: later]
dbz has joined #ruby
dbz has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
aupadhye is now known as aupadhye|food
perique has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sepp2k has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
keden has joined #ruby
keden has quit [Ping timeout: 268 seconds]
DTZUZO has joined #ruby
clemens3 has joined #ruby
hiroaki has joined #ruby
Puffball has joined #ruby
r0B-O has joined #ruby
aupadhye|food is now known as aupadhye
hiroaki has quit [Remote host closed the connection]
hiroaki has joined #ruby
r0B-O has quit [Remote host closed the connection]
r0b0 has joined #ruby
asphyxia has joined #ruby
r0b0 has quit [Remote host closed the connection]
r0B-O has joined #ruby
r0B-O has quit [Client Quit]
Burgestrand has joined #ruby
r0B-O has joined #ruby
themsay has quit [Ping timeout: 245 seconds]
r0B-O has quit [Remote host closed the connection]
r0B-O has joined #ruby
keden has joined #ruby
r0B-O has quit [Remote host closed the connection]
r0B-O has joined #ruby
r0B-O has quit [Remote host closed the connection]
r0B-O has joined #ruby
Dbugger has joined #ruby
r0B-O has quit [Read error: Connection reset by peer]
icantc has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 268 seconds]
Dbugger has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
Sembei has quit [Read error: Connection reset by peer]
Sembei has joined #ruby
kapil____ has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
conta has quit [Ping timeout: 268 seconds]
fluxAeon has joined #ruby
DTZUZO has quit [Quit: WeeChat 2.0]
DTZUZO has joined #ruby
waheedi has joined #ruby
venmx has joined #ruby
danguita has quit [Quit: Connection closed for inactivity]
Burgestrand has quit [Quit: Good bye and have a nice day!]
lomex has joined #ruby
Burgestrand has joined #ruby
TheBloke has quit [Read error: Connection reset by peer]
TheBloke has joined #ruby
asphyxia has quit [Ping timeout: 250 seconds]
conta has joined #ruby
Guest21835 has joined #ruby
dbz has joined #ruby
bhaak has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 250 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
nchambers has quit [Ping timeout: 250 seconds]
keden has quit [Ping timeout: 244 seconds]
dbz has quit [Ping timeout: 250 seconds]
ua has quit [Remote host closed the connection]
teclator has joined #ruby
keden has joined #ruby
keden has quit [Ping timeout: 246 seconds]
dhollinger has quit [Read error: Connection reset by peer]
dhollinger has joined #ruby
druonysus has quit [Ping timeout: 268 seconds]
LinuxKnight has quit [Remote host closed the connection]
LinuxKnight has joined #ruby
keden has joined #ruby
Snowy has joined #ruby
keden has quit [Ping timeout: 245 seconds]
Snowy has quit [Client Quit]
ua has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 244 seconds]
phaul has joined #ruby
hiroaki has joined #ruby
asphyxia has joined #ruby
keden has joined #ruby
esrse has quit [Ping timeout: 268 seconds]
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
tjbp has quit [Ping timeout: 268 seconds]
lomex has joined #ruby
Burgestrand has quit [Quit: Closing time!]
conta has quit [Ping timeout: 268 seconds]
lomex has quit [Ping timeout: 252 seconds]
r0B-O has joined #ruby
r0B-O has quit [Remote host closed the connection]
Burgestrand has joined #ruby
Puffball has quit [Remote host closed the connection]
tjbp has joined #ruby
hahuang6- has quit [Ping timeout: 250 seconds]
hahuang65 has joined #ruby
jlebrech has joined #ruby
<jlebrech> hi, i have a bunch of stubs that just return a [] can i specify those as a one liner somehow?
asphyxia has quit [Ping timeout: 250 seconds]
elphe has quit [Ping timeout: 268 seconds]
<phaul> %i(foo bar baz).each { |sym| allow(object).to receive(sym).and_return([]) } ?
<jlebrech> ooh, yeah make's sense. might put that in spec helper
<jlebrech> makes*
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
nolanv has joined #ruby
<jlebrech> phaul: will call it any_instance_empty :)
<phaul> jlebrech: ok
conta has joined #ruby
asphyxia has joined #ruby
asphyxia has quit [Client Quit]
Ca1us is now known as Caius
Burgestrand has quit [Quit: Good bye and have a nice day!]
roshanavand has joined #ruby
piks3l has joined #ruby
InfinityFye has joined #ruby
Burgestrand has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
chussenot has joined #ruby
roshanavand has quit [Ping timeout: 245 seconds]
phaul has quit [Quit: bye]
chussenot has left #ruby [#ruby]
mangold has joined #ruby
phaul has joined #ruby
roshanavand has joined #ruby
<jlebrech> phaul: works nicely :)
bmurt has joined #ruby
rann has joined #ruby
akem__ has joined #ruby
cd has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
Guest21835 has quit [Ping timeout: 246 seconds]
Guest21835 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
hiroaki has quit [Ping timeout: 244 seconds]
AJA4350 has joined #ruby
Guest21835 has quit [Ping timeout: 245 seconds]
conta has quit [Ping timeout: 250 seconds]
beeman has joined #ruby
jgpawletko has joined #ruby
Guest21835 has joined #ruby
mangold has quit [Quit: Leaving]
jgpawletko has quit [Client Quit]
Guest21835 has quit [Ping timeout: 246 seconds]
szulak_ has joined #ruby
Guest21835 has joined #ruby
elphe has joined #ruby
aufi has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
Burgestrand has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
Guest21835 has quit [Ping timeout: 250 seconds]
aufi has quit [Remote host closed the connection]
aufi has joined #ruby
Azure|dc has quit [Ping timeout: 246 seconds]
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
crankharder has joined #ruby
Guest21835 has joined #ruby
dbz has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
dbz has quit [Ping timeout: 246 seconds]
conta1 has joined #ruby
GodFather has joined #ruby
akem__ has quit [Remote host closed the connection]
akem__ has joined #ruby
jlebrech has quit [Remote host closed the connection]
kaleido has quit [Remote host closed the connection]
kaleido has joined #ruby
akem__ has quit [Remote host closed the connection]
roshanavand has joined #ruby
akem__ has joined #ruby
graphene has quit [Remote host closed the connection]
reber has joined #ruby
jottr has joined #ruby
graphene has joined #ruby
roshanavand has quit [Read error: Connection reset by peer]
polishdub has joined #ruby
bambanx has joined #ruby
wildermind has joined #ruby
elphe has joined #ruby
fredmorcos has joined #ruby
rippa has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
GodFather has quit [Ping timeout: 268 seconds]
Inline has joined #ruby
dinfuehr has joined #ruby
Renich has joined #ruby
dinfuehr_ has quit [Ping timeout: 250 seconds]
roshanavand has joined #ruby
code_zombie has joined #ruby
Burgestrand has quit [Quit: Closing time!]
fredmorcos has quit [Remote host closed the connection]
lypsis_ has quit [Ping timeout: 246 seconds]
roshanavand1 has joined #ruby
Renich_ has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
roshanavand1 is now known as roshanavand
Renich has quit [Ping timeout: 245 seconds]
Renich_ is now known as Renich
SeepingN has joined #ruby
lypsis has joined #ruby
SeepingN has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
akem__ has quit [Quit: Leaving]
elphe has joined #ruby
za1b1tsu has joined #ruby
bambanx has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
leitz has joined #ruby
eclm has joined #ruby
nchambers has joined #ruby
bambanx has joined #ruby
<leitz> Not trying to start a flame war, just building my 2019 learning plan. Are there things that Cucumber does that RSPEC 3 does not?
roshanavand has quit [Read error: Connection reset by peer]
roshanavand has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.2]
Azure has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
conta1 has quit [Ping timeout: 244 seconds]
<jhass> cucumber specs are actually meant to be written by your buisness people, basically a formal format for user stories that you also happen to be able to write code for so they could be executed as tests
<jhass> if you don't need that, don't use it
troulouliou_div2 has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
nchambers has quit [Quit: WeeChat 2.2]
<jhass> as providing this abstraction is all it does
<leitz> jhass, thanks! I'm trying to build more tests, to include "is my DB up?" and things like that.
<leitz> Learning more RSPEC is high on my "to do" list but I was not sure if I needed to add Cucumber.
<jhass> tests should test your code not your environment ;)
<leitz> I support the environment, having automated tests helps. :)
roshanavand has quit [Read error: Connection reset by peer]
nowhere_man has quit [Remote host closed the connection]
roshanavand has joined #ruby
Aqo has quit [Ping timeout: 250 seconds]
jaddison has joined #ruby
nowhere_man has joined #ruby
clemens3 has quit [Remote host closed the connection]
jaddison has quit [Client Quit]
Yxhuvud has joined #ruby
jaddison has joined #ruby
Aqo has joined #ruby
bambanx has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 268 seconds]
conta1 has joined #ruby
sanscoeur has joined #ruby
roshanavand has quit [Ping timeout: 250 seconds]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has quit [Ping timeout: 246 seconds]
jaddison has quit [Quit: jaddison]
jaddison has joined #ruby
bhaak has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 268 seconds]
szulak_ has joined #ruby
joast has quit [Quit: Leaving.]
joast has joined #ruby
dviola has joined #ruby
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 250 seconds]
hutch has joined #ruby
GodFather has joined #ruby
sanscoeur has quit [Remote host closed the connection]
sanscoeur has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
Azure has quit [Read error: Connection reset by peer]
darkhanb has joined #ruby
Azure has joined #ruby
jottr has quit [Read error: Connection reset by peer]
jottr has joined #ruby
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
Azure has quit [Ping timeout: 250 seconds]
bambanx has joined #ruby
houhoulis has joined #ruby
venmx has quit [Ping timeout: 245 seconds]
SuperLag has quit [Remote host closed the connection]
sanscoeur has quit [Remote host closed the connection]
SuperLag has joined #ruby
sanscoeur has joined #ruby
Azure has joined #ruby
akem has joined #ruby
Exuma has joined #ruby
szulak_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Renich has quit [Remote host closed the connection]
dinfuehr has joined #ruby
dinfuehr_ has quit [Ping timeout: 250 seconds]
Renich has joined #ruby
Renich_ has joined #ruby
Exuma has quit [Client Quit]
za1b1tsu has joined #ruby
sanscoeur has quit [Remote host closed the connection]
piks3l has quit [Quit: piks3l]
sanscoeur has joined #ruby
Renich has quit [Ping timeout: 246 seconds]
Renich_ is now known as Renich
za1b1tsu has quit [Client Quit]
za1b1tsu has joined #ruby
i4 has joined #ruby
sanscoeur has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
<i4> Hi all. I have a Hash named 'hash_one' = {:a {a1: 1, a2: 2}, :c {c1: 1, c2: 2},:b {b1: 1, b2: 2}... How can I split the Hash by keyset? For example: ':a' and ':b' to get the new hash_two = {one: {:a{}, :c{}}, two: {:b{}}} ?
mikecmpbll has quit [Quit: inabit. zz.]
jcutrell has joined #ruby
<jcutrell> Hi folks.
<jcutrell> Dealing with an interesting issue, wondering if anyone has seen something similar - we’ve got OmniAuth set up in a Sinatra app. We’re using OmniAuth Builder twice for the same provider. Would this cause issues?
sanscoeur has joined #ruby
jottr has quit [Read error: Connection reset by peer]
Exuma has joined #ruby
dbz has joined #ruby
bambanx has quit [Ping timeout: 272 seconds]
Dreamer3_ has quit [Quit: Computer has gone to sleep.]
elphe has quit [Ping timeout: 268 seconds]
za1b1tsu has quit [Remote host closed the connection]
tdy has joined #ruby
beeman has quit [Quit: Connection closed for inactivity]
aupadhye has quit [Ping timeout: 268 seconds]
\void has joined #ruby
aufi has quit [Remote host closed the connection]
aufi has joined #ruby
GodFather has quit [Ping timeout: 246 seconds]
sanscoeur has quit [Remote host closed the connection]
<al2o3-cr> i4: you could group by the key.
<i4> into hash?
<al2o3-cr> al2o3-cr: let me check.
Guest21835 has quit [Ping timeout: 250 seconds]
<al2o3-cr> i4: maybe something like this could work for you? `hash_one.group_by { |k, _| k == :b ? :two : :one }.transform_values(&:to_h)'
<i4> and if I need do this each 3 keys in hash>
<i4> ?
jcutrell has quit [Quit: jcutrell]
sepp2k has joined #ruby
<havenwood> hash_one.map { |k, v| [k, v.values] }.each_with_object(Hash.new { |h, k| h[k] = [] }) { |(k, values), h| values.each { |value| h[value] << k } }
szulak_ has joined #ruby
<al2o3-cr> or you could use Hash#slice and rebuild if you need too.
<havenwood> hash_one.each_with_object(Hash.new { |h, k| h[k] = [] }) { |(k, v), h| v.values.each { |value| h[value] << k } }
<al2o3-cr> havenwood: nice solution :)
sanscoeur has joined #ruby
<i4> Hmmm
<havenwood> al2o3-cr: thanks!
robscomputer has joined #ruby
dbz has quit [Remote host closed the connection]
szulak_ has quit [Client Quit]
<i4> And if I need 5 or 6 hashes?
<i4> Group is better? yes
<havenwood> i4: Why would group be better for more hashes?
sanscoeur has quit [Remote host closed the connection]
<i4> I try to understand - let me check
<i4> This solution is hard for undeestanding for me now
<i4> I try to solve how it working
aufi has quit [Ping timeout: 244 seconds]
<havenwood> i4: Are you familiar with this pattern?: Hash.new { |h, k| h[k] = [] }
<i4> it's creates new hash right?
<havenwood> i4: Yes, it's a Hash, but unlike a regular Hash with a default value of nil, this Hash has a default value of a fresh Array.
<havenwood> i4: In your REPL, try: hash = Hash.new { |h, k| h[k] = [] }; hash[:any_value] #=> ?
gix has joined #ruby
conta1 has quit [Quit: conta1]
<havenwood> i4: Alternatively, you could write: hash = {}; hash.default_proc = -> h, k { h[k] = [] }
<al2o3-cr> &>> {a: {a1: 1, a2: 2}, c: {c1: 1, c2: 2},b: {b1: 1, b2: 2}, d: {d1: 1, d2: 2}, e: {e1: 1, e2: 3}}.group_by { |k, _| [:a, :e, :c].include?(k) ? :one : :two }.transform_values &:to_h
<rubydoc> # => {:one=>{:a=>{:a1=>1, :a2=>2}, :c=>{:c1=>1, :c2=>2}, :e=>{:e1=>1, :e2=>3}}, :two=>{:b=>{:b1=>1, :b2=> ...check link for more (https://carc.in/#/r/5nmq)
keden has quit [Ping timeout: 244 seconds]
<al2o3-cr> i4: is this output intended?
<al2o3-cr> otherwise i don't follow.
beeman has joined #ruby
mikecmpbll has joined #ruby
elphe has joined #ruby
<i4> Oh
<i4> yes
szulak_ has joined #ruby
<havenwood> al2o3-cr: I didn't follow, heh. You interpret i4's pseudo code better than I do.
<havenwood> i4: Giving real input and expected output make it way easier for us to help!
sepp2k has quit [Quit: Leaving.]
patr0clus has joined #ruby
<al2o3-cr> i don't always get it right =P
sanscoeur has joined #ruby
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
szulak_ has quit [Ping timeout: 250 seconds]
<i4> how I can get the index of any key in hash? is it possible?
<havenwood> i4: check methods on Hash (yes, it's possible)
<i4> HBut how?
houhoulis has quit []
<al2o3-cr> i4: the clue is your question :)
<i4> did you mean each_with_index?
sanscoeur has quit [Remote host closed the connection]
<havenwood> i4: yup - that's a way
<jhass> i4: also think about whether you actually got your hash the right way around (the right things as keys and the right things as values) if you want to operate that much on the keyset
<i4> Can I get first second third and etc order keys without .each do |x|
<i4> ?
<havenwood> i4: you can turn a Hash into an Array
<jhass> or maybe you actually want an array of two element arrays
<i4> hm
<havenwood> i4: like jhass said ^, consider if your data structure here is what it should be
<i4> I have hash and I want to print first item form it, then two items from it and then by 3 items untill the end of hash
<al2o3-cr> ah.
<havenwood> i4: when you say "items" do you mean key/value pairs or something else?
akem has quit [Remote host closed the connection]
akem has joined #ruby
<i4> keys
<jhass> do you ever do your_hash[:something]?
sepp2k has joined #ruby
CrazyEddy has joined #ruby
<i4> hm?
<al2o3-cr> i4: could you produce a little gist/paste desired input/output? it would benefit you massively.
<i4> ok
<havenwood> i4: Do you use your Hash to find values by key?
<i4> yes
salasrod has quit [Quit: /quit]
<i4> which pastebin resource i must use?
salasrod has joined #ruby
<al2o3-cr> ?paste i4
<havenwood> i4: gist.github.com or dpaste.de are good options.
<al2o3-cr> does the bot have a trigger for a list of decent pastebins?
<havenwood> al2o3-cr: not an updated on, non
<havenwood> ?factoids
<al2o3-cr> ah, thanks havenwood.
<al2o3-cr> oh, it was ?gist i was thinking about.
sanscoeur has joined #ruby
<i4> I do the select from nested hash to obtain for every first leveled key the inner key :bod that present or not
sanscoeur has quit [Remote host closed the connection]
Exuma has joined #ruby
chouhoulis has joined #ruby
<i4> Then I want to print some rows... first with :am, second with :dr and :as and other rows with each 3 first leveled keys as :ke etc
lxsameer has joined #ruby
aufi has joined #ruby
jaddison has quit [Quit: jaddison]
sanscoeur has joined #ruby
<jhass> are you abusing the i18n gem as a yaml loader there...?
<havenwood> i4: For fun, here's an "incrementing slice" implementation: https://gist.github.com/havenwood/5fb0e5e7b0f3244ce979f0a817113584
<i4> jhass yes
<i4> There is another true way?
<jhass> just call YAML.load_file?
<i4> hm
eckhardt_ has joined #ruby
<jhass> do you actually ever have keys not matching the pattern in the select? Do you actually ever make use of the anchors you define in your YAML?
<i4> In this example with select on => I get all I need
<i4> only keys with values where is the :bod present
<i4> and not null
Puffball has joined #ruby
<i4> havenwood, this is example for incremental
<jhass> I'm talking about the first select, not the second
<jhass> btw there's never time wasted on proper variable/key names, abreviations you will not remember yourself in half a year
sanscoeur has quit [Remote host closed the connection]
<i4> But I need #=> [1], #=> [2], [3], #=> [4], [5], [6], #=> [7], [8], [9]
<i4> etc
crankharder has quit [Quit: Lost terminal]
<i4> maybe you right
<i4> yes, you right
krawchyk has joined #ruby
InfinityFye has quit [Quit: Leaving]
chouhoulis has quit [Ping timeout: 268 seconds]
sanscoeur has joined #ruby
<i4> that's why I want to undrstand how to enumerate keys in hashes
<i4> to get keys by number like a first or third or four and slice or split
sanscoeur has quit [Remote host closed the connection]
keden has joined #ruby
<jhass> I'd probably keep it simple, extract all redundant code to a partial/helper method and then do data[0], data[1], data[2], data[3..-1].each_slice(3) do |item|
<jhass> and make it into an array first
akem__ has joined #ruby
patr0clus has quit [Ping timeout: 264 seconds]
hutch has quit [Ping timeout: 246 seconds]
akem has quit [Ping timeout: 250 seconds]
keden has quit [Ping timeout: 268 seconds]
<jhass> btw you can define an array of objects in yaml like so https://p.jhass.eu/75.txt
patr0clus has joined #ruby
ua has quit [Ping timeout: 250 seconds]
graphene has quit [Remote host closed the connection]
Nicmavr has quit [Read error: Connection reset by peer]
graphene has joined #ruby
Nicmavr has joined #ruby
aufi has quit [Ping timeout: 246 seconds]
i4 has quit [Quit: Leaving]
ua has joined #ruby
akem has joined #ruby
akem__ has quit [Ping timeout: 268 seconds]
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
perique has joined #ruby
akem has quit [Remote host closed the connection]
<al2o3-cr> did they want something like this jhass/havenwood https://carc.in/#/r/5no6 ?
akem has joined #ruby
aufi has joined #ruby
<al2o3-cr> i got confused half way through.
<jhass> I guess it's akin to what they wanted. Not sure about what they needed :P
<jhass> I mean not sure akin to what they needed
<jhass> why do you use psych directly vs yaml?
<al2o3-cr> don't know just habit really.
<jhass> they usually don't come out of nowhere :P
elphe has quit [Ping timeout: 250 seconds]
<al2o3-cr> sometimes i do use yaml ;)
irdr has quit [Ping timeout: 250 seconds]
havenwood has joined #ruby
RougeR has joined #ruby
Dreamer3 has joined #ruby
irdr has joined #ruby
Dreamer3 has quit [Client Quit]
nadir has joined #ruby
roses-r-red has joined #ruby
<roses-r-red> join #regex
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
za1b1tsu has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
jaddison has joined #ruby
za1b1tsu has joined #ruby
Dreamer3 has joined #ruby
aufi has quit [Ping timeout: 250 seconds]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
za1b1tsu has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dellavg_ has quit [Ping timeout: 268 seconds]
brandonkal has joined #ruby
sanscoeur has joined #ruby
jaddison has quit [Quit: jaddison]
GodFather has joined #ruby
jaddison has joined #ruby
za1b1tsu has quit [Quit: Leaving]
za1b1tsu has joined #ruby
roses-r-red has quit [Quit: WeeChat 1.9.1]
roshanavand has joined #ruby
reber has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
<iamdevnul> wooo
<iamdevnul> ruby is now a native option for aws lambda
<iamdevnul> oh nm
<iamdevnul> someone linked it already
keden has joined #ruby
roshanavand has joined #ruby
patr0clus is now known as s3nd1v0g1us
roses-r-red has joined #ruby
cd has quit [Quit: cd]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
keden has quit [Quit: WeeChat 2.3]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robscomputer has quit [Ping timeout: 250 seconds]
robscomputer has joined #ruby
tdy has quit [Ping timeout: 250 seconds]
jcalla has quit [Quit: Leaving]
shenghi has quit [Ping timeout: 250 seconds]
shenghi has joined #ruby
_whitelogger has joined #ruby
hurricanehrndz has joined #ruby
elphe has joined #ruby
chussenot has joined #ruby
graphene has quit [Remote host closed the connection]
za1b1tsu has quit [Remote host closed the connection]
graphene has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
tdy has joined #ruby
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cd has joined #ruby
Renich has quit [Ping timeout: 245 seconds]
Renich has joined #ruby
s3nd1v0g1us has quit [Quit: WeeChat 2.2]
Renich has quit [Client Quit]
Renich has joined #ruby
roshanavand has quit [Ping timeout: 260 seconds]
robscomputer has joined #ruby
polishdub has quit [Quit: leaving]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
elphe has joined #ruby
GinoMan2440 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Renich_ has joined #ruby
elphe has quit [Ping timeout: 250 seconds]
Renich has quit [Ping timeout: 244 seconds]
Renich_ is now known as Renich
elphe has joined #ruby
robscomputer has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robscomputer has joined #ruby
robscomputer has quit [Client Quit]
krawchyk has quit [Ping timeout: 244 seconds]
krawchyk has joined #ruby
leitz has quit [Quit: Leaving]
mikecmpbll has quit [Quit: inabit. zz.]
houhoulis has joined #ruby
<cthu|> Who loves Ruby!
* cthu| loves Ruby!
<cthu|> I'm doing a lot of magic with it
<cthu|> you would be amazed
<cthu|> (no you wouldn't)
roshanavand has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
akem__ has joined #ruby
akem has quit [Ping timeout: 268 seconds]
galaxie has quit [Read error: Connection reset by peer]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
roshanavand has quit [Remote host closed the connection]
code_zombie has quit [Quit: Leaving]
akem has joined #ruby
roshanavand has joined #ruby
akem__ has quit [Ping timeout: 246 seconds]
gix has quit [Ping timeout: 268 seconds]
SeepingN has joined #ruby
<baweaver> Magic?
* baweaver perks up
Dreamer3 has quit [Quit: Computer has gone to sleep.]
beeman has quit [Quit: Connection closed for inactivity]
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
jenrzzz has joined #ruby
houhoulis has quit [Remote host closed the connection]