<havenwood>
xco: You can just `rescue` inside a method.
<havenwood>
xco: and you can drop the `self.`, if you'd like
<havenwood>
#update_attribute will already be called on self
<xco>
thank you :)
<havenwood>
consider #warn instead of #info
<havenwood>
no prob!
Azure has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 248 seconds]
Azure has joined #ruby
vikas027 has joined #ruby
je0rsh has quit [Ping timeout: 248 seconds]
<vikas027>
Hey Guys, I am looking for a whole word (my_vpc) in a string like this vpc.tags.join(',')[/\bmy_vpc\b/] . How can I use a variable instead of my_vpc. I tried using "#{some_var}", but that didn't worked
GodFather has joined #ruby
marcux has joined #ruby
s3nd1v0g1us has quit [Remote host closed the connection]
ycyclist has quit [Ping timeout: 260 seconds]
Slinky_Pete has joined #ruby
xco has quit [Quit: xco]
gusrub has quit [Remote host closed the connection]
xco has joined #ruby
Slinky_Pete has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
A124 has quit [Ping timeout: 248 seconds]
marcux has quit [Ping timeout: 246 seconds]
marcux has joined #ruby
harai_ has quit [Ping timeout: 240 seconds]
A124 has joined #ruby
nicesignal has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 240 seconds]
d^sh has quit [Ping timeout: 260 seconds]
GodFather has joined #ruby
d^sh has joined #ruby
nicesignal has joined #ruby
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
enterprisey has joined #ruby
brent__ has joined #ruby
SteenJobs has joined #ruby
gizmore|2 has joined #ruby
<vikas027>
Found it, I wanted this vpc.tags.join(',')[/\b(?:#{some_var})\b/]
<Algebr`>
I am getting a "Could not find X in any of the sources"
astrobunny has joined #ruby
<Algebr`>
Can I fix this by changing GEM_PATH environment variable?
<Algebr`>
because BUNDLE_GEMFILE is also set as an env var
gizmore has quit [Ping timeout: 240 seconds]
marcux has quit [Quit: Lost terminal]
brent__ has quit [Ping timeout: 260 seconds]
<Algebr`>
or what can i do to make ruby dump where it is looking for gems?, hopefully something like ruby -e ',.....'
nicesignal has quit [Ping timeout: 264 seconds]
nicesignal has joined #ruby
duckpupp1 has joined #ruby
BTRE has quit [Read error: Connection reset by peer]
<Algebr`>
I got this error: C:/Users/Edgar Aroutiounian/R4/hello-1.0.0-win32/lib/ruby/lib/ruby/2.1.0/rubygems/core_ext/kernel require': cannot load such file -- fastlane (LoadError). I am wondering if this means the file doesn't exist or if there was an issue in actually loading things into memory
<havenwood>
Algebr`: See: gem environment gemdir
<havenwood>
Algebr`: gem environment gempath
<havenwood>
Algebr`: you mean to be using Ruby 2.1?
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
duckpupp1 has quit [Ping timeout: 248 seconds]
<havenwood>
Algebr`: Check that bundler is installed on the Ruby you mean to be using.
harai_ has joined #ruby
BTRE has joined #ruby
cdg has joined #ruby
charliesome has joined #ruby
zachk has quit [Quit: night]
s2013 has joined #ruby
paradisaeidae_ has quit [Read error: Connection reset by peer]
paradisaeidae has quit [Read error: Connection reset by peer]
jdawgaz has joined #ruby
mim1k has joined #ruby
mim1k has quit [Ping timeout: 252 seconds]
xco has quit [Quit: xco]
xco has joined #ruby
jinie has quit [Ping timeout: 255 seconds]
zautomata has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
jakinov has quit [Quit: Page closed]
kies has quit [Ping timeout: 240 seconds]
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
ForeignBiscuit has joined #ruby
ForeignBiscuit has quit [Max SendQ exceeded]
ForeignBiscuit has joined #ruby
ResidentBiscuit has quit [Ping timeout: 248 seconds]
mkali has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
xco has quit [Quit: xco]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
BTRE has quit [Read error: Connection reset by peer]
marcux has joined #ruby
bronson has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
mkali has quit [Ping timeout: 248 seconds]
arescorpio has quit [Quit: Leaving.]
cdg has quit [Remote host closed the connection]
ur5us has quit []
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
A124 has quit [Ping timeout: 240 seconds]
marcux has quit [Quit: Lost terminal]
A124 has joined #ruby
BTRE has joined #ruby
A124 has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 248 seconds]
xco has joined #ruby
A124 has joined #ruby
cadillac_ has quit [Quit: I quit]
paradisaeidae_ has quit [Ping timeout: 240 seconds]
paradisaeidae has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
s3nd1v0g1us has joined #ruby
brent__ has joined #ruby
marcux has joined #ruby
Algebr` has quit [Ping timeout: 246 seconds]
belmoussaoui has quit [Read error: Connection reset by peer]
brent__ has quit [Ping timeout: 240 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
uneeb has joined #ruby
uneeb has quit [Remote host closed the connection]
eminencehc has quit [Remote host closed the connection]
krz has joined #ruby
marcux has joined #ruby
eckhardt has quit [Ping timeout: 246 seconds]
marcux has quit [Client Quit]
cadillac_ has quit [Read error: Connection reset by peer]
dviola has quit [Quit: WeeChat 1.9]
s3nd1v0g1us has quit [Quit: tempusfugit]
bronson has joined #ruby
cadillac_ has joined #ruby
cagomez has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
tuelz has quit [Ping timeout: 255 seconds]
ShekharReddy has joined #ruby
kculpis has quit [Quit: Leaving]
Algebr` has joined #ruby
kies has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
eckhardt has joined #ruby
cdg has joined #ruby
tuelz has joined #ruby
JD2020 has joined #ruby
govg has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
baweaver is now known as baweaver_away
baweaver_away is now known as baweaver
hahuang65 has joined #ruby
mim1k has joined #ruby
hahuang65 has quit [Ping timeout: 264 seconds]
mim1k has quit [Ping timeout: 240 seconds]
eckhardt has quit [Ping timeout: 246 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sarbs has quit [Read error: Connection reset by peer]
xco has quit [Quit: xco]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
elcontrastador has joined #ruby
xco has joined #ruby
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
hahuang65 has joined #ruby
xco has left #ruby [#ruby]
jdawgaz has joined #ruby
moei has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
harfangk has quit [Ping timeout: 240 seconds]
Retronoodle has joined #ruby
nh_cham has quit [Ping timeout: 240 seconds]
rabajaj has joined #ruby
Bock has joined #ruby
Retronoodle has quit [Remote host closed the connection]
ta_ has quit [Remote host closed the connection]
eckhardt has joined #ruby
zautomata has joined #ruby
planigan has quit [Ping timeout: 240 seconds]
krz has quit [Quit: WeeChat 1.7]
aupadhye has joined #ruby
rabajaj has quit [Remote host closed the connection]
DipoleHourglass has joined #ruby
planigan has joined #ruby
rabajaj has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
harai_ has joined #ruby
rabajaj has quit [*.net *.split]
howdoi has quit [*.net *.split]
al2o3-cr has quit [*.net *.split]
spt0 has quit [*.net *.split]
imode has quit [*.net *.split]
sagax has quit [*.net *.split]
mjolnird has quit [*.net *.split]
mikeiniowa has quit [*.net *.split]
m4rCsi has quit [*.net *.split]
tw1sted has quit [*.net *.split]
Xiti has quit [*.net *.split]
lele has quit [*.net *.split]
zapata has quit [*.net *.split]
cout has quit [*.net *.split]
nickjj has quit [*.net *.split]
mbr has quit [*.net *.split]
SHyx0rmZ has quit [*.net *.split]
Hanma[m] has quit [*.net *.split]
torarne has quit [*.net *.split]
aidalgol has quit [*.net *.split]
Bish has quit [*.net *.split]
nchambers has quit [*.net *.split]
Olipro has quit [*.net *.split]
[dmp] has quit [*.net *.split]
kapowaz has quit [*.net *.split]
Apocalypse has quit [*.net *.split]
omninonsense has quit [*.net *.split]
rideh- has quit [*.net *.split]
universa1 has quit [*.net *.split]
jsrn has quit [*.net *.split]
quuxman has quit [*.net *.split]
tekacs has quit [*.net *.split]
aspiers has quit [*.net *.split]
j0bk has quit [*.net *.split]
thejoecarroll has quit [*.net *.split]
epochwolf has quit [*.net *.split]
JStoker has quit [*.net *.split]
EvilJStoker has quit [*.net *.split]
knowtheory has quit [*.net *.split]
zipkid has quit [*.net *.split]
Hobbyboy has quit [*.net *.split]
jnix has quit [*.net *.split]
charles81_ has quit [*.net *.split]
ohcibi has quit [*.net *.split]
matthewd has quit [*.net *.split]
rfv has quit [*.net *.split]
ewilliam_____ has quit [*.net *.split]
ckrailo has quit [*.net *.split]
Meow-J has quit [*.net *.split]
krasnus has quit [*.net *.split]
HalcyonicStorm has quit [*.net *.split]
deimos has quit [*.net *.split]
Travis-42 has quit [*.net *.split]
dmnd has quit [*.net *.split]
tekacs has joined #ruby
epochwolf has joined #ruby
universa1 has joined #ruby
jsrn has joined #ruby
j0bk has joined #ruby
j0bk has quit [Changing host]
j0bk has joined #ruby
quuxman has joined #ruby
matthewd has joined #ruby
SHyx0rmZ has joined #ruby
[spoiler] has joined #ruby
rideh has joined #ruby
nchambers has joined #ruby
EvilJStoker has joined #ruby
JStoker has joined #ruby
imode has joined #ruby
nickjj has joined #ruby
aspiers has joined #ruby
al2o3-cr has joined #ruby
thejoecarroll has joined #ruby
Olipro has joined #ruby
zapata has joined #ruby
dmnd has joined #ruby
Hobbyboy has joined #ruby
ckrailo has joined #ruby
ewilliam_____ has joined #ruby
rfv has joined #ruby
zipkid has joined #ruby
knowtheory has joined #ruby
deimos has joined #ruby
howdoi has joined #ruby
charles81_ has joined #ruby
jnix has joined #ruby
HalcyonicStorm has joined #ruby
Apocalypse has joined #ruby
Meow-J has joined #ruby
voiceftp has joined #ruby
Travis-42 has joined #ruby
nahra has quit [Remote host closed the connection]
Papierkorb has quit [Ping timeout: 240 seconds]
nahra has joined #ruby
jinie has quit [Ping timeout: 240 seconds]
selim has quit [Ping timeout: 240 seconds]
Dimik has joined #ruby
sniffer has quit [Quit: No Ping reply in 180 seconds.]
M107262[m] has quit [Ping timeout: 240 seconds]
haylon has quit [Ping timeout: 246 seconds]
Matt[m]2 has quit [Ping timeout: 252 seconds]
Orbixx[m] has quit [Ping timeout: 246 seconds]
yana[m] has quit [Ping timeout: 255 seconds]
watzon has quit [Ping timeout: 255 seconds]
modin has quit [Ping timeout: 240 seconds]
aviraldg has quit [Ping timeout: 264 seconds]
jonjits[m] has quit [Ping timeout: 240 seconds]
turt2live has quit [Ping timeout: 246 seconds]
A124 has quit [Ping timeout: 260 seconds]
lasenna[m] has quit [Ping timeout: 255 seconds]
Giphy[m] has quit [Ping timeout: 255 seconds]
velu_aon[m] has quit [Ping timeout: 255 seconds]
aagdbl[m] has quit [Ping timeout: 255 seconds]
kua[m] has quit [Ping timeout: 252 seconds]
dman[m] has quit [Ping timeout: 276 seconds]
dtcristo has quit [Ping timeout: 276 seconds]
gokul_mr[m] has quit [Ping timeout: 276 seconds]
Tagami[m] has quit [Ping timeout: 276 seconds]
itmerc[m] has quit [Ping timeout: 264 seconds]
KevinMGranger has quit [Ping timeout: 264 seconds]
swills has quit [Ping timeout: 252 seconds]
selim has joined #ruby
jinie has joined #ruby
Papierkorb has joined #ruby
A124 has joined #ruby
Xiti has joined #ruby
mikeiniowa has joined #ruby
sagax has joined #ruby
m4rCsi has joined #ruby
lele has joined #ruby
mjolnird has joined #ruby
Bish has joined #ruby
[dmp] has joined #ruby
ohcibi has joined #ruby
mbr has joined #ruby
cout has joined #ruby
tw1sted has joined #ruby
kapowaz has joined #ruby
A124 has quit [Changing host]
A124 has joined #ruby
Xiti has quit [Max SendQ exceeded]
VladGh_ has quit [Ping timeout: 264 seconds]
dhollinger has quit [Ping timeout: 252 seconds]
voice_ftp has joined #ruby
Xiti has joined #ruby
spt0 has joined #ruby
dhollinger has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
sniffer has joined #ruby
voice_ftp has quit [Client Quit]
krasnus has joined #ruby
cadillac_ has joined #ruby
brent__ has joined #ruby
voice_ftp_ has joined #ruby
voiceftp has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
swills has joined #ruby
swills has joined #ruby
brent__ has quit [Ping timeout: 248 seconds]
Mortomes|Work has joined #ruby
harai_ has quit [Ping timeout: 246 seconds]
bronson has joined #ruby
swills has quit [Ping timeout: 246 seconds]
tax has quit [Ping timeout: 255 seconds]
bronson has quit [Ping timeout: 255 seconds]
swills has joined #ruby
swills has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
VladGh has joined #ruby
andrzejku has joined #ruby
phaul has joined #ruby
harai_ has joined #ruby
andrzejku has quit [Client Quit]
andrzejku has joined #ruby
eckhardt_ has joined #ruby
jameser has quit [Ping timeout: 246 seconds]
eckhardt has quit [Ping timeout: 255 seconds]
conta has joined #ruby
andrzejku has quit [Quit: WeeChat 1.9]
jameser has joined #ruby
r7c has joined #ruby
swills has quit [Ping timeout: 264 seconds]
npgm has quit [Quit: Connection closed for inactivity]
zautomata has quit [Quit: WeeChat 1.4]
alazred has joined #ruby
alazred has joined #ruby
alazred has quit [Changing host]
ta_ has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Mortomes|Work has quit [Quit: Page closed]
elsevero has joined #ruby
Silthias has joined #ruby
dionysus69 has joined #ruby
harfangk has joined #ruby
alazred has quit [Quit: Leaving]
hs366 has quit [Quit: Leaving]
hs366 has joined #ruby
elsevero has quit [Quit: elsevero]
Mortomes|Work has joined #ruby
spooky_d has joined #ruby
<spooky_d>
Hi there - I'm trying to build ruby and it takes a lot of time. How do I tell it to use multiple threads while building?
<spooky_d>
make -j4 doesn't have the effect for most of the build - only for a very small part.
JD2020 has quit [Quit: Leaving]
swills has joined #ruby
swills has joined #ruby
biberu has joined #ruby
Tagami[m] has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
swills has quit [Ping timeout: 240 seconds]
modin has joined #ruby
mark_66 has joined #ruby
claudiuinberlin has joined #ruby
swills has joined #ruby
swills has joined #ruby
Dimik has quit [Ping timeout: 248 seconds]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has joined #ruby
cdg has joined #ruby
aidalgol has joined #ruby
Hanma[m] has joined #ruby
dtcristo has joined #ruby
yana[m] has joined #ruby
Orbixx[m] has joined #ruby
watzon has joined #ruby
aviraldg has joined #ruby
jonjits[m] has joined #ruby
M107262[m] has joined #ruby
lasenna[m] has joined #ruby
torarne has joined #ruby
Giphy[m] has joined #ruby
dman[m] has joined #ruby
haylon has joined #ruby
velu_aon[m] has joined #ruby
turt2live has joined #ruby
KevinMGranger has joined #ruby
aagdbl[m] has joined #ruby
gokul_mr[m] has joined #ruby
itmerc[m] has joined #ruby
Matt[m]2 has joined #ruby
kua[m] has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
swills has quit [Ping timeout: 246 seconds]
laphoriag75 has quit [Ping timeout: 246 seconds]
swills has joined #ruby
swills has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Silthias has quit [Ping timeout: 246 seconds]
Burgestrand has joined #ruby
Silthias has joined #ruby
hs366 has quit [Quit: Leaving]
hs366 has joined #ruby
mikecmpbll has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
swills has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 264 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
harfangk has quit [Ping timeout: 246 seconds]
govg has quit [Quit: leaving]
DTZUZO has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
mim1k has joined #ruby
swills has joined #ruby
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
Algebr` has quit [Ping timeout: 264 seconds]
aufi has joined #ruby
swills has quit [Ping timeout: 248 seconds]
<mnemon>
spooky_d: there are parts that won't parallelize well
yeticry_ has quit [Ping timeout: 264 seconds]
jaruga has joined #ruby
<mnemon>
also specifically, -j will make make multiple recipes of the makefile, if the makefile is written in one it will have no effect
bronson has joined #ruby
Beams has joined #ruby
<spooky_d>
I see.
<spooky_d>
And there's no way to speed things up?
<spooky_d>
It takes 25 minutes to build my toolchain and an hour to build ruby.
<spooky_d>
It kind of bothers me.
brent__ has joined #ruby
yeticry has joined #ruby
swills has joined #ruby
swills has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
imode has quit [Ping timeout: 246 seconds]
brent__ has quit [Ping timeout: 260 seconds]
PaulCapestany has quit [Ping timeout: 240 seconds]
<mnemon>
faster hardware/system or possibly disabling unused bits ... might have somethign ruby specific but it's a long time since I've built the intepreter itself so don't remember if there's anything relevant already in the make/config
<mnemon>
or if you're happy with bad performance from ruby itself disable gcc optimizations :)
harfangk has joined #ruby
ur5us has joined #ruby
Silthias1 has quit [Ping timeout: 246 seconds]
TomyWork has joined #ruby
Silthias has joined #ruby
<mnemon>
spooky_d: you could try to get better performance out of the compiler itself ... what system are you building on/for?
bruno- has joined #ruby
lxsameer has joined #ruby
Silthias1 has joined #ruby
<spooky_d>
x86_64 for x86_64
<spooky_d>
and also using lto.
Silthias has quit [Ping timeout: 240 seconds]
Silthias1 has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
cagomez has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Algebr` has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
claudiuinberlin has joined #ruby
<mnemon>
march=native for the things you don't need to ship to other systems and using tmpfs etc?
Slinky_Pete has joined #ruby
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
marr has joined #ruby
anisha_ has joined #ruby
Algebr` has quit [Ping timeout: 240 seconds]
anisha has quit [Ping timeout: 246 seconds]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
Slinky_Pete has quit [Ping timeout: 240 seconds]
phinxy has joined #ruby
phinxy has left #ruby [#ruby]
vondruch has quit [Client Quit]
vondruch has joined #ruby
cagomez has joined #ruby
_aeris_ has quit [Ping timeout: 248 seconds]
_aeris_ has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
mkali has joined #ruby
sleetdrop has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
wnd has quit [Excess Flood]
wnd has joined #ruby
Silthias has quit [Ping timeout: 264 seconds]
ferr has joined #ruby
wald0 has joined #ruby
Silthias has joined #ruby
cdg has joined #ruby
swills has quit [Ping timeout: 248 seconds]
mkali has quit [Ping timeout: 240 seconds]
cdg_ has joined #ruby
swills has joined #ruby
swills has joined #ruby
cdg__ has joined #ruby
PaulCapestany has joined #ruby
cdg has quit [Ping timeout: 264 seconds]
cdg_ has quit [Ping timeout: 264 seconds]
cdg__ has quit [Ping timeout: 240 seconds]
Pisuke has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Algebr` has joined #ruby
Serpent7776 has joined #ruby
Slinky_Pete has joined #ruby
cdg has joined #ruby
Algebr` has quit [Ping timeout: 252 seconds]
rabajaj has joined #ruby
Slinky_Pete has quit [Ping timeout: 260 seconds]
Beams_ has joined #ruby
cdg_ has joined #ruby
claudiuinberlin has joined #ruby
Beams has quit [Ping timeout: 240 seconds]
Pisuke has joined #ruby
cdg__ has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
harfangk has quit [Ping timeout: 240 seconds]
cdg_ has quit [Ping timeout: 264 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg__ has quit [Ping timeout: 252 seconds]
S007 has quit [Ping timeout: 246 seconds]
GodFather has joined #ruby
anisha_ has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
astrobunny has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 248 seconds]
Silthias has quit [Ping timeout: 240 seconds]
Beams_ has quit [Quit: .]
S007 has joined #ruby
Beams has joined #ruby
Siyfion has joined #ruby
InfinityFye has joined #ruby
ur5us_ has joined #ruby
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
Silthias has joined #ruby
tcopeland has quit [Quit: tcopeland]
ur5us_ has quit [Ping timeout: 264 seconds]
Algebr` has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Algebr` has quit [Ping timeout: 260 seconds]
raynold has quit [Quit: Connection closed for inactivity]
uZiel has joined #ruby
drcode has quit [Ping timeout: 248 seconds]
hfp_work has quit [Quit: bye]
DTZUZO has joined #ruby
roadt has quit [Ping timeout: 240 seconds]
hfp_work has joined #ruby
<darix>
spooky_d: on what os/arch are you?
bruce_lee has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
ur5us has quit [Remote host closed the connection]
ski7777 has quit [Ping timeout: 248 seconds]
Silthias has quit [Ping timeout: 255 seconds]
konsolebox has quit [Ping timeout: 264 seconds]
jameser has joined #ruby
konsolebox has joined #ruby
charliesome has joined #ruby
aufi has joined #ruby
Silthias has joined #ruby
ldnunes has joined #ruby
nowhereman has quit [Read error: Connection reset by peer]
nowhereman has joined #ruby
claudiuinberlin has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
Mortomes|Work has quit [Ping timeout: 260 seconds]
Algebr` has joined #ruby
mim1k has joined #ruby
<soahccc>
Any idea what could cause multiple threads to never run again after getting stopped? e.g. Thread.stop and then later thr.run or wakeup and it will stay on stop forever
<spooky_d>
darix: on x86_64
<spooky_d>
same target
Slinky_Pete has joined #ruby
modin has quit [Ping timeout: 240 seconds]
phaul has quit [Ping timeout: 255 seconds]
aufi has quit [Ping timeout: 246 seconds]
Algebr` has quit [Ping timeout: 252 seconds]
<soahccc>
I had no problem when not stopping the threads but I need the fiber variables to be set before the thread runs and need it available outside the thread immediately. So I stopped it, set the variables outside the thread and start it again. It has the variables and methods I defined but it wont start (rarely I get one to run). I assume a locking issue but there is no locking going on at this point. Dunno how to debug this
Slinky_Pete has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
tcopeland has joined #ruby
spooky_d has quit [Read error: Connection reset by peer]
ShalokShalom_ has joined #ruby
jaruga has quit [Quit: jaruga]
ShalokShalom has quit [Ping timeout: 255 seconds]
venomoustoad has joined #ruby
<Burgestrand>
soahccc Got a minimal example?
<venomoustoad>
is anybody here
ski7777 has joined #ruby
aufi has joined #ruby
<soahccc>
Burgestrand: I can show you the method I use to create the threads, the app itself is rather complex and it's some timing issue (when I sleep (line 27) or block another way the problem goes away). Also if a thread decides to run, it's not always the same one... https://gist.github.com/2called-chaos/9865817178b1dd208885b9441fae3243
<soahccc>
Burgestrand: I switched from not-stopping and defining the fiber variables inside the Thread.new{} to stopping it and define those variables in the creating thread (as I had issues with the thread not being run yet, hence variables not being there
<Burgestrand>
soahccc Your thread has most likely not executed the sleep yet, which causes your `thr.run` to be a no-op
<soahccc>
Burgestrand: it does #run all of the threads though, that I figured
mim1k has quit [Ping timeout: 252 seconds]
<soahccc>
also tried wakeup since I don't get the difference really
venomoustoad has left #ruby [#ruby]
jdawgaz has joined #ruby
synthroid has joined #ruby
<Burgestrand>
soahccc thread = Thread.new { Thread.stop }; thread.run — this is racy, since Thread.stop might be called before or *after* `thread.run`
<soahccc>
Burgestrand: hmm :/ didn't see the wood for the trees I guess
ShalokShalom_ is now known as ShalokShalom
<soahccc>
It seems that I can't get around a sleep in that case, even the example sleep(0.1) until thr.status == "sleep"
<Burgestrand>
soahccc You can use a semaphore to allow you to do your out-of-thread setup
<Burgestrand>
soahccc Make it start at a count of 0, your new thread does `semaphore.decrement` (or whatever), and once your setup is done outside of the thread you can do `semaphore.increment` which allows it to continue
charliesome has joined #ruby
<Burgestrand>
soahccc I don't really know if Ruby has a regular semaphore, but a Queue works just as well and is what I tend to use :)
VladGh has quit [Remote host closed the connection]
<soahccc>
Burgestrand: yeah I was just looking at Mutex (which I personally don't like as much since Monitor is "reentrant"?) but do you mean a 2-way handshake? Like spawning thread waits for new thread to reach the wait, then do setup and ping back?
<soahccc>
oh well
<Burgestrand>
Yeah, a monitor is reentrant, I tend to use it for that reason too, a lot of the times a Queue is more than enough for my cases
VladGh has joined #ruby
modin has joined #ruby
sniffer has quit [Quit: No Ping reply in 180 seconds.]
<Burgestrand>
soahccc Frankly, I'm not sure why you do your setup in the spawning thread, and not in the thread you just spawned
herbmillerjr has joined #ruby
<soahccc>
Burgestrand: 1st: thank you :) that works and is quite neat (I just thought about mutex but queue is just what I need)
jaruga has joined #ruby
sniffer has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
<soahccc>
2nd: It might not be the cleanest architecture but I have a few status displays which obviously sleep for a while between redrawing/calculating. I had the idea of using conditional variables instead so that they behave like a sleep but can be interupted by a signal from elsewhere. Now if the thread hasn't run yet and I try to use it's fiber variable monitor => boom
<soahccc>
So I wanted the thread to be "fully ready" before it runs and before the spawning method returns
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand>
:)
<Burgestrand>
Fair enough, I guess you kind of need to wait for your setup somehow/somewhere, doesn't matter if your main thread blocks and wait or if your new thread blocks and wait
swills has quit [Ping timeout: 248 seconds]
<soahccc>
But from what I gathered you work with threads and stuff from time to time? I bet you get a stroke when looking at my app then =)
Silthias has quit [Ping timeout: 246 seconds]
<Burgestrand>
You could possibly get around the blocking/waiting by creating your communication channel before you spawn the thread, and pass it in when you spawn the thread, e.g. `Thread.new(channel) { |channel| … }`, and then define your convenience methods outside of it at your own leisure :)
swills has joined #ruby
swills has quit [Changing host]
swills has joined #ruby
Silthias has joined #ruby
venomoustoad has joined #ruby
claudiuinberlin has joined #ruby
<Burgestrand>
soahccc a bit of a mix :) it's both an interest (for fun), I've written a few concurrent/parallel systems in ruby and working with mobile development which forces you to use them even more
venomoustoad has left #ruby [#ruby]
<soahccc>
So GUI stuff on mobile?
<Burgestrand>
(for clarity's sake I'm doing not doing mobile development _in ruby_)
<soahccc>
hehe gotcha :)
claudiuinberlin has quit [Client Quit]
Silthias1 has joined #ruby
<Burgestrand>
soahccc and no, no stroke, code is just code :)
tvw has joined #ruby
<Burgestrand>
(well, frankly, code is a liability so the less the better I guess)
<soahccc>
My first major app that heavily used threads was a process wrapper (for a game) to provide IRC-bot like features, now I'm creating a tool from hell to selectively pull production DB data to dev/staging systems, hence db_sucker :D
InfinityFye has quit [Ping timeout: 240 seconds]
<Burgestrand>
:D
claudiuinberlin has joined #ruby
InfinityFye has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
<soahccc>
It's totally unnecessary but I have my fun with it (reworked it with a curses display)
mson has joined #ruby
<Burgestrand>
Well, if everything had to be necessary then there would be way less fun around ;)
<soahccc>
Oh and I created poor-mans IDS with ruby once... hell this is running forever now, almost forgot about it... https://i.imgur.com/com5eRZ.jpg
voice_ftp_ has quit [Quit: Leaving]
<soahccc>
longest running ruby app of my life :D
voiceftp has joined #ruby
swills has quit [Ping timeout: 260 seconds]
<Burgestrand>
soahccc That's sweet, feels like a great use-case :)
<soahccc>
well I used it to heuristically (captcha)ban malicious hosts and I guess there are better solutions for this but where's the fun in that :D
jameser has quit [Ping timeout: 248 seconds]
jameser_ has joined #ruby
<soahccc>
yeah thanks I know about it but never used it so far, maybe for my next project :) has some nice stuff in it but my current tool has technically no dependencies (net-ssh/sftp and since it was removed from ruby curses)
bronson has joined #ruby
brent__ has joined #ruby
voiceftp has quit [Quit: Leaving]
voiceftp has joined #ruby
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
depesz has joined #ruby
jameser has joined #ruby
<depesz>
hi. what is the sanest library/gem for writing web spider? i'd like something that behaves like simple web browser, handles cookies, and then something that will allow me to easily extract data from fetched html
mtkd has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
Algebr` has joined #ruby
brent__ has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
<soahccc>
depesz: depends on how sophisticated the target page is, you can just get away with httparty (though it handles cookies, I'm not so sure about more complex stuff) or you could go full try-hard and use a selenium integration with capybara (ususally for testing) or something
<soahccc>
the latter can do JS and everything depending on the adapter
<depesz>
no, no. i just need it to get some webpages, and keep track of cookies/redirects on subsequent calls.
<depesz>
in perl i was using WWW::Mechanize and am looking for something similar for Ruby ( I know it doesn't help most of the people, but perhaps you know something about perl)
<depesz>
looking at httparty
<soahccc>
depesz: keep track as in keep track or rather "should just be handled for me"
<depesz>
should just handle it transparently for me.
<soahccc>
then I guess httparty should be your friend, it handles things like session cookies and keeps them on redirects but if you want to login or something it can become a little bit harder
t-recx has joined #ruby
<depesz>
nah, i don't need login. at least for now
<depesz>
thanks, will check it.
<soahccc>
depesz: but looking at mechanize this is more something like capbara (things like "go to that form", "enter this there", "click on this and that")
Algebr` has quit [Ping timeout: 240 seconds]
<depesz>
ok. one more question. please note that I'm very very new when it comes to ruby
<soahccc>
*capybara
<depesz>
i saw something that a person had in a directory with his ruby program, that when he/she ran some command, it automatically installed all required gems. any pointers on what it could be / how to use it?
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
FahmeF has quit [Remote host closed the connection]
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JD2020X has joined #ruby
jnix has quit [Changing host]
jnix has joined #ruby
p0p0pr37_ has joined #ruby
p0p0pr37_ has quit [Changing host]
p0p0pr37_ has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
Rapture has joined #ruby
p0p0pr37 has quit [Ping timeout: 264 seconds]
p0p0pr37_ is now known as p0p0pr37
rabajaj has quit [Quit: Leaving]
bruno- has joined #ruby
r7c has quit [Quit: Leaving]
ta_ has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
Serpent7776 has quit [Quit: Leaving]
gusrub has joined #ruby
claudiuinberlin has joined #ruby
Burgestrand has quit [Quit: Closing time!]
TomyLobo has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
rippa has joined #ruby
cschneid has joined #ruby
duckpupp1 is now known as duckpuppy
polishdub has quit [Quit: leaving]
mikecmpbll has quit [Quit: inabit. zz.]
conta has quit [Ping timeout: 260 seconds]
kculpis has joined #ruby
mikecmpbll has joined #ruby
ams__ has joined #ruby
Hien has joined #ruby
kapil___ has joined #ruby
FahmeF has joined #ruby
GodFather has joined #ruby
sagax has quit [Ping timeout: 240 seconds]
oleo has quit [Quit: Leaving]
s2013 has joined #ruby
aufi has quit [Ping timeout: 264 seconds]
s2013 has quit [Client Quit]
s2013 has joined #ruby
FahmeF has quit [Remote host closed the connection]
polishdub has joined #ruby
ArMedic has joined #ruby
dupondje_ has joined #ruby
dupondje_ has left #ruby [#ruby]
Ouchy has joined #ruby
russt has quit [Quit: That's all, folks!]
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
t-recx has quit [Quit: t-recx]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
dviola has joined #ruby
jphase has quit [Remote host closed the connection]
Rapture has quit [Read error: Connection reset by peer]
jphase has joined #ruby
claudiuinberlin has joined #ruby
mwdeez has joined #ruby
DTZUZO has joined #ruby
gregf_ has joined #ruby
joelroa has joined #ruby
joelroa has quit [Client Quit]
apparition has quit [Quit: Bye]
<mwdeez>
Hey gang, I've got something that is hopefully an easy-ish fix for someone more experienced than me :) I've got a rails app running that I'd like to add a JSON API to. I'm writing the API in Sinatra and have the Sinatra app mounted in my Rails routes.rb and routing works properly except for the lack of auto-reloading. When I make changes to any of my Sinatra files the new files aren't served until restarting the Rails app (which takes
<mwdeez>
Is there a canonical solution to fixing autoreloading of Sinatra apps mounted inside a Rails project? I know the no auto-reload is expected with Sinatra, but I'm not sure which autoreload method would work best inside a rails app
jphase has quit [Ping timeout: 255 seconds]
charliesome has joined #ruby
jphase has joined #ruby
[Butch] has joined #ruby
orbyt_ has joined #ruby
gheegh has joined #ruby
sagax has joined #ruby
FastJack has quit [Read error: Connection reset by peer]
chouhoulis has quit [Remote host closed the connection]
FastJack has joined #ruby
jphase has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
jphase has joined #ruby
t-recx has joined #ruby
<cjohnson>
If I've got an array of hashes whose keys are symbols, is there some way to use .map(&:id) like you might if the symbols weren't strings?
<cjohnson>
Oh I see the issue, I need it to use the second arg to map
hahuang65 has quit [Ping timeout: 240 seconds]
<cjohnson>
Here's what I've got: foo.map do |k,v| v[:id] end
<cjohnson>
Is there a way to use & here to shorten the map?
gheegh has quit [Read error: Connection reset by peer]
<baweaver>
>id being a deep dive until it finds something that matches 'id'
<cjohnson>
baweaver: :P
<baweaver>
Buuuuut until then...
<baweaver>
Not much on shorthand, basically a lot of map/flat_map/reduce
<cjohnson>
Yeah then I'll just stick with what I got
<cjohnson>
no worries
Rodya_ has joined #ruby
<baweaver>
What's nice is I can basically do this to Swagger: hash.query('requests.*.GET.params.created_at')
<baweaver>
Any request type of get with a param of created_at
SeepingN has joined #ruby
<baweaver>
(note it has nodes like requests.people.method, requests.places.method, etc.)
Beams has quit [Quit: .]
cadillac_ has quit [Ping timeout: 248 seconds]
<cjohnson>
I like those sorts of query things but also it would be overkill here
cadillac_ has joined #ruby
<baweaver>
but what's really nice is I support regex keys / values in there too :D - hash.query('/criteria/./\n+/.id=/^1/)
<cjohnson>
baweaver: Not sure if you saw my post in #ROR but I'm trying to implement mark_for_destruction on missing children when saving a parent+child records
<ruby[bot]>
havenwood: # => {"America/Toronto"=>["Manager1", "Manager2", "User4"], "America/New_York"=>["User3"], "Europe/Paris" ...check link for more (https://eval.in/864595)
<ule>
havenwood: "each_with_object"
gnufied has quit [Ping timeout: 246 seconds]
<ule>
awesome
<havenwood>
hahuang65: the `i` is insensitive, and it's after the `-` so it's not insensitive, etc
<ule>
lemme try here
<ule>
havenwood: thank you very much!!
<havenwood>
hahuang65: like this one is case insensitive: 'ermagerd,LLC'.gsub /[,\s]?\s?(?i-mx:llc|inc|corp)\z/, ''
<havenwood>
hahuang65: (The `i` is before the `-`.)
<havenwood>
ule: you're welcome!
<havenwood>
ule: You can alternatively up front define: result = Hash.new { |h, k| h[k] = [] }
<havenwood>
ule: then return `result` at the end
<havenwood>
ule: or each_with_object works too
<ule>
havenwood: I'm still digesting all the informating you sent to me
<ule>
lol
conta1 has joined #ruby
<ule>
those enumerables always freeze my brain
<havenwood>
ule: they're worth learning! handy things
<ule>
havenwood: what's your recommendation to learn these stuff? going method by method and replicating what the doc says?
<havenwood>
ule: yes, I'd recommend learning every Enumerable method
<ule>
I really need to this.. gonna set a persinal goal.. one method per day
jdawgaz has joined #ruby
<havenwood>
nice
<ule>
awesome, but first let me learn really well what you sent me. thanks again!
<havenwood>
any time
zachk has joined #ruby
<ule>
havenwood: now I'm gonna merge some of those results. Since America/Toronto == America/New_York
conta has quit [Ping timeout: 240 seconds]
conta1 has quit [Ping timeout: 248 seconds]
* havenwood
plots to liberate Toronto.
<havenwood>
Oh, right, timezones.
<hahuang65>
havenwood: any thoughts on why that would be generated with Regexp.union?
<havenwood>
hahuang65: generated regexp include their flags, so you can add them together and not lose flags
ur5us has quit [Remote host closed the connection]
ur5us_ has joined #ruby
GodFather_ has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
<Algebr`>
is `:f => false` a function? What is this
<Algebr`>
a tuple?
<Papierkorb>
a hash pair
<elomatreb>
Algebr`: It's inside a Hash literal, a `key => value` pair
<Algebr`>
is that something that can stand on its own or it must be in side a hashtable
<elomatreb>
You can omit the braces in certain situations, but it only occurs in a Hash
<Papierkorb>
You could just tell us you saw it inside a method call as argument.
ldnunes has quit [Quit: Leaving]
montyboy has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has joined #ruby
Cohedrin_ has quit [Read error: Connection reset by peer]
<teatime>
He's asking a reasonable question. In e.g. Perl6, => is the literal Pair constructor, and then the Hash constructor takes a list of Pair's, but you are free to use Pair's for other things unrelated to hashes. It's general-purpose. It's fair to ask if Ruby's => works similarly. But, I think it does not, it's pretty much special-cased in the interpreter, only available in specific limited cirumstances.
Cohedrin_ has joined #ruby
jackjackdripper has joined #ruby
Cohedrin_ has quit [Read error: Connection reset by peer]
Cohedrin_ has joined #ruby
orbyt_ has joined #ruby
<Algebr`>
so you can ombit parens on functions only when that function doesn't take any arguments? Or just 1?
<elomatreb>
Algebr`: You can omit the parens no matter how many arguments it takes, but it can be confusing when an argument is another method call (since you need to know the precedence to know which arguments now belong to which call)
<elomatreb>
Or did you mean the curly braces for Hash literals? Those can only be omitted if they're the last argument in a call
bruno- has joined #ruby
<Algebr`>
yea, first one
hahuang65 has quit [Quit: WeeChat 1.9]
<Algebr`>
and .collect is map everywhere else right
Cohedrin_ has quit [Read error: Connection reset by peer]
<havenwood>
Algebr`: #collect is typically an alias for #map, and #map won
jottr has quit [Quit: WeeChat 1.9]
<havenwood>
We use map, since that's what modern languages use.
<havenwood>
Ruby has some alias for folk coming from Lisp or Smalltalk, and the Lisp terms have proliferated.
elbuki has joined #ruby
brent__ has joined #ruby
<havenwood>
We use `reduce` instead of `inject` and `map` instead of `collect`, etc.
jw has joined #ruby
<havenwood>
Soon we'll have filter. ;-)
<teatime>
same ^^. having the aliases adds a bit of cognitive load / stuff to learn, but ultimately I like having the choice.
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<teatime>
not so much with map/reduce, but with some others sometimes I use different aliases in different places depending on the context / topic / to make the code read more like English.
<elomatreb>
So, when do we get a #fold instead of inject/reduce? :P
<teatime>
hrm, thought that already existed
mim1k has joined #ruby
<teatime>
doesn't look like it though.
Slinky_Pete has quit []
roonsauce has joined #ruby
Guest28895 has quit [Remote host closed the connection]
ben_ has joined #ruby
ben_ is now known as Guest4601
mim1k has quit [Ping timeout: 240 seconds]
imode has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Guest4601 has quit [Ping timeout: 240 seconds]
[Butch] has quit [Quit: I'm out . . .]
gothicsouth has joined #ruby
troys has joined #ruby
milardovich has quit [Remote host closed the connection]
orbyt_ has quit [Read error: Connection reset by peer]
phaul has quit [Ping timeout: 255 seconds]
tcopeland has quit [Quit: tcopeland]
BTRE has quit [Read error: Connection reset by peer]
maryo_ has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
halt has quit [Ping timeout: 248 seconds]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has quit [Remote host closed the connection]
milardovich has joined #ruby
<yuppie>
hello can someone help me out with mechanize?
<yuppie>
im scraping a page but the tables dont seem to be expanding
<yuppie>
the tr/td stuff
cschneid has joined #ruby
<yuppie>
i can see it when i do to_yaml though
gheegh has joined #ruby
SteenJobs has joined #ruby
SteenJobs has quit [Client Quit]
naquad has joined #ruby
<naquad>
hi
Algebr` has quit [Ping timeout: 260 seconds]
<naquad>
i've got [[1, [1,2,3,4,5]], [2, [2,3,4,5]]] can i somehow quickly make from it [[1, 1], [1, 2], [1, 3], [1, 4], [1, 5], [2, 2], [2, 3], ...]? (that is produce pairs like <key> <value from array>)
cschneid has quit [Ping timeout: 248 seconds]
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ta_ has quit [Remote host closed the connection]
laphoraig77 has quit [Ping timeout: 248 seconds]
<naquad>
i've got to that: x.map {|k ,v| v.zip([k].cycle)}.flatten(1)
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<naquad>
but it doesn't look very elegant :/
jphase has quit [Ping timeout: 252 seconds]
bruce_lee has quit [Read error: Connection reset by peer]
moei has quit [Quit: Leaving...]
enterprisey has joined #ruby
gheegh has joined #ruby
<teatime>
naquad: what you're looking for is a cartesian product (which takes [a, b, c...] X [1, 2, 3...] and produces [a1, a2, a3, b1, ...])
<teatime>
naquad: I'm looking for it in Ruby. but what you have isn't *that* bad compared to my initial thoughts.
gheegh has quit [Client Quit]
enterprisey has quit [Remote host closed the connection]
<teatime>
yours may even be a little clearer than what I came up with, since your first element is never a list, always a scalar :)
zachk has quit [Quit: night]
JD2020X has quit [Ping timeout: 240 seconds]
<teatime>
I was thinking of, e.g., x.map{|a| [a[0]] X a[1]}.flatten(1)
<elomatreb>
naquad: x.flat_map {|a, b| [a].product b }
Guest39164 is now known as IceDragon
<teatime>
there it is, .product. elomatreb++
<naquad>
awezome! thank you :)
jenrzzz has joined #ruby
TomyLobo has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
polishdub has quit [Quit: leaving]
<gr33n7007h>
elomatreb: +1
enterprisey has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
jobewan has quit [Quit: jobewan]
bruno- has quit [Ping timeout: 264 seconds]
mim1k has quit [Ping timeout: 260 seconds]
montyboy has joined #ruby
lagweezle is now known as lagweezle_away
mson has quit [Quit: Connection closed for inactivity]
webguynow has quit [Ping timeout: 248 seconds]
harfangk has joined #ruby
lagweezle_away is now known as lagweezle
marr has quit [Ping timeout: 240 seconds]
gheegh has joined #ruby
<naquad>
elomatreb++
brent__ has quit [Remote host closed the connection]