havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.2, 2.3.5 & 2.2.8: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
jrabe has quit []
jrabe has joined #ruby
al2o3-cr has quit [Quit: WeeChat 1.9]
marr has quit [Ping timeout: 240 seconds]
Slinky_Pete has quit [Ping timeout: 240 seconds]
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
<Algebr`> what does the : mean in if os_type == :unix
<SeepingN> getter read Ruby 101 first
ledestin has joined #ruby
guardianx has joined #ruby
GodFather has quit [Ping timeout: 240 seconds]
laphoraig97 has quit [Ping timeout: 264 seconds]
<Algebr`> yea, looking for a good crash course for existing coders
<xco> on lines 6 and 8 i want to refactor, do i store the “raise ….” in a local variable or make it a method? what’s the best approach?
guardianx has quit []
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
bronson has joined #ruby
brent__ has quit [Ping timeout: 252 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<havenwood> xco: Rails.logger.info '...' if %w(dv tk).include?(target_lang); raise '...'
SteenJobs has quit [Quit: SteenJobs]
bronson has quit [Ping timeout: 264 seconds]
roadt has joined #ruby
<xco> havenwood: something like this i guess https://gist.github.com/xcobar/b5495e36efdfdcb994f68cd329be2efd
zautomata has joined #ruby
marxarelli has quit [Quit: Textual IRC Client: www.textualapp.com]
<havenwood> xco: 👍🏻
<xco> havenwood: :) danke
<havenwood> xco: You can drop the `begin/end`
<xco> yup
<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]
s2013 has joined #ruby
orbyt_ has joined #ruby
sarbs has joined #ruby
harfangk has joined #ruby
Slinky_Pete has joined #ruby
Moosashi has joined #ruby
Moosashi has quit [Client Quit]
howdoi has joined #ruby
Slinky_Pete has quit [Ping timeout: 240 seconds]
gix has quit [Ping timeout: 252 seconds]
mim1k has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
gix has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
jdawgaz has joined #ruby
uZiel has joined #ruby
SteenJobs has quit [Quit: peaceee]
gothicsouth has joined #ruby
vikas027 has quit [Quit: Textual IRC Client: www.textualapp.com]
harai_ has quit [Read error: Connection reset by peer]
marcux has quit [Quit: Mutter: www.mutterirc.com]
eckhardt has joined #ruby
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]
<Burgestrand> soahccc e.g. https://eval.in/864264
<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 :)
<Burgestrand> soahccc Oh, just so you're aware, you might want to check out https://github.com/ruby-concurrency/concurrent-ruby
<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?
<soahccc> depesz: http://bundler.io/
<soahccc> This is basically so "core" I wonder why it's still not shipped with ruby :D
jinie has quit [Ping timeout: 248 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jinie has joined #ruby
<mnemon> depesz: there's many webdrivers for ruby and there's also mechanize port to ruby :)
phaul has joined #ruby
Ishido has joined #ruby
<mnemon> selenium bindings comes to mind ...
nopolitica has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
InfinityFye has quit [Ping timeout: 248 seconds]
<depesz> soahccc: thanks.
jameser has joined #ruby
MarkBilk has joined #ruby
Guest34710 has quit [Remote host closed the connection]
tpendragon has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
duckpupp1 has joined #ruby
eminencehc has joined #ruby
jameser has quit [Ping timeout: 255 seconds]
jameser has joined #ruby
mim1k has joined #ruby
nobitanobi has joined #ruby
<nobitanobi> Why when accessing a class method from within an instace method I need to do `self.class.method`, instead of `class.method`?
<leah2> hm, is pack M* in violation of rfc 2045?
<soahccc> nobitanobi: It's annoying I know but just "class" is a keyword
<nobitanobi> k thanks soahccc
<leah2> > It follows that an octet with decimal value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1.
<leah2> >> ["foo \n"].pack("M*")
<ruby[bot]> leah2: # => "foo =\n\n" (https://eval.in/864330)
<leah2> but rule 1 says =20
<soahccc> nobitanobi: you _could_ (but it's not a convention I guess) define a little helper method like def klass; self.class; end
<nobitanobi> yep, I have seen that :) Thanks!
cdg has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
giraffe has joined #ruby
giraffe is now known as Guest431
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
tpendragon has joined #ruby
swills has joined #ruby
swills has joined #ruby
swills_ has joined #ruby
swills_ has quit [Client Quit]
cdg_ has joined #ruby
FahmeF has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tcopeland has quit [Ping timeout: 248 seconds]
maryo_ has joined #ruby
haylon has quit [Changing host]
haylon has joined #ruby
chouhoulis has joined #ruby
claudiuinberlin has joined #ruby
jameser has quit [Ping timeout: 248 seconds]
Algebr` has joined #ruby
tcopeland has joined #ruby
FrostCandy has joined #ruby
Slinky_Pete has joined #ruby
DLSteve has joined #ruby
Algebr` has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
Slinky_Pete has quit [Ping timeout: 255 seconds]
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
Silthias1 has joined #ruby
marcux has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
jobewan has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
marcux has quit [Remote host closed the connection]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jottr has joined #ruby
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
jameser has quit [Ping timeout: 252 seconds]
Emmanuel_Chanel has joined #ruby
LastWhisper____ has joined #ruby
ForeignBiscuit is now known as ResidentBiscuit
jdawgaz has joined #ruby
jphase has joined #ruby
synthroid has quit [Remote host closed the connection]
jameser_ has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apparition has joined #ruby
ta_ has quit [Remote host closed the connection]
invalidusrname has joined #ruby
aupadhye has quit [Ping timeout: 248 seconds]
invalidusrname has quit [Client Quit]
invalidusrname has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TomyWork has quit [Ping timeout: 240 seconds]
claudiuinberlin has joined #ruby
invalidusrname has quit [Quit: Textual IRC Client: www.textualapp.com]
sylario has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
Algebr` has joined #ruby
jdawgaz has joined #ruby
ecuanaso has joined #ruby
nopolitica has quit [Ping timeout: 248 seconds]
bruno- has quit [Ping timeout: 240 seconds]
laphoraig77 has joined #ruby
Siyfion has quit [Quit: Textual IRC Client: www.textualapp.com]
bronson has joined #ruby
Algebr` has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
oncall-pokemon has joined #ruby
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]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
InfinityFye has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
SteenJobs has joined #ruby
<elomatreb> cjohnson: You can, by using transform_values instead of map (at least if foo is a Hash)
<cjohnson> {"criteria_attributes"=>{"0"=>{"id"=>"538", "value"=>"b"}, "1"=>{"id"=>"539", "value"=>"c"}, "2"=>{"id"=>"", "value"=>"d"}}}
Silthias1 has quit [Ping timeout: 255 seconds]
fChanX has joined #ruby
gheegh has joined #ruby
<fChanX> hi
<cjohnson> I'm doing params[:criteria_attributes].map do |k,v| and v contians what I need
<cjohnson> k is {"0"=>{...}} and v is {"id"=>"538"...}
<cjohnson> So I just want to pull out the ids
<baweaver> Hehehehe
<baweaver> If you give me about 1-2 weeks I'm OSS'ing something which does very close to that
<elomatreb> Oh, sorry
<baweaver> WrapperName(hash).query('>id').end_values
<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
<cjohnson> In a way that doesn't suck lol
<baweaver> Good luck
<baweaver> That's always an annoying one, need to find a good way to do it
<cjohnson> Yeah ok good to know I'm not alone
<cjohnson> I was worried there was a magic way that I was missing
<baweaver> Been busy on some pretty dense projects at work so not around as much
<cjohnson> My work is suffering!
<cjohnson> I need you
<baweaver> There may still be, and matthewd or Radar would know it
oleo has joined #ruby
bronson has joined #ruby
rapha has left #ruby ["WeeChat 2.0-dev"]
uZiel has quit [Ping timeout: 248 seconds]
<fChanX> What does this project do? It seems cool. :D
teatime has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 246 seconds]
bronson has quit [Ping timeout: 248 seconds]
imode has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
cagomez has quit [Remote host closed the connection]
herbmillerjr has quit [Read error: Connection reset by peer]
ben_ has joined #ruby
ben_ is now known as Guest28895
cagomez has joined #ruby
gnufied has quit [Ping timeout: 255 seconds]
herbmillerjr has joined #ruby
ArMedic has quit [Remote host closed the connection]
ferr has quit [Quit: WeeChat 1.9]
bruno-_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
lagweezle_away is now known as lagweezle
cagomez has joined #ruby
alex`` has quit [Quit: WeeChat 1.9]
jottr has quit [Ping timeout: 240 seconds]
herbmillerjr has quit [Remote host closed the connection]
jdawgaz has joined #ruby
_sfiguser has joined #ruby
teatime has joined #ruby
<fChanX> hello
nofxx has quit [Ping timeout: 264 seconds]
nofxx has joined #ruby
SeepingN has quit [Ping timeout: 248 seconds]
SteenJobs has quit [Quit: SteenJobs]
SeepingN has joined #ruby
SteenJobs has joined #ruby
jolamb has quit [Quit: ZNC - http://znc.in]
fChanX has left #ruby ["Leaving"]
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gusrub_ has joined #ruby
Rapture has joined #ruby
gusrub has quit [Ping timeout: 248 seconds]
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
jphase has joined #ruby
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]
jolamb has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
claudiuinberlin has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
gnufied has joined #ruby
jdawgaz has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
[Butch] has quit [Quit: I'm out . . .]
[Butch] has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has joined #ruby
alex`` is now known as alexherbo2
oleo has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
alexherbo2 is now known as alex``
AndBobsYourUncle has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
uZiel has joined #ruby
gusrub has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
jottr has joined #ruby
gusrub_ has quit [Ping timeout: 240 seconds]
tax has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
perniciouscaffei has joined #ruby
biberu has quit []
biberu has joined #ruby
mwdeez has quit [Quit: Page closed]
yokel has quit [Remote host closed the connection]
yokel has joined #ruby
gnufied has quit [Ping timeout: 246 seconds]
jphase has joined #ruby
marxarelli has joined #ruby
ascarter_ has quit [Quit: Textual IRC Client: www.textualapp.com]
gusrub has quit [Remote host closed the connection]
GodFather has quit [Remote host closed the connection]
GodFather_ has joined #ruby
gusrub has joined #ruby
belmoussaoui has quit [Ping timeout: 264 seconds]
Rodya_ has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Rodya_ has quit [Ping timeout: 255 seconds]
jottr has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
jphase has quit [Remote host closed the connection]
Azure has quit [Read error: Connection reset by peer]
Azure has joined #ruby
spt0 has quit [Ping timeout: 240 seconds]
GodFather_ has quit [Ping timeout: 240 seconds]
tsglove has quit [Quit: Leaving]
ShekharReddy has quit [Quit: Connection closed for inactivity]
conta has joined #ruby
Bock has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
cdg has joined #ruby
uZiel has quit [Remote host closed the connection]
bronson has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 246 seconds]
bronson has quit [Ping timeout: 248 seconds]
kus_ubuntui686 has joined #ruby
kus_ubuntui686 has quit [Max SendQ exceeded]
nobitanobi has quit [Remote host closed the connection]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Mighty_Warthog has joined #ruby
spt0 has joined #ruby
Mighty_Warthog has quit [Client Quit]
Mighty_Warthog has joined #ruby
Mighty_Warthog has quit [Client Quit]
hahuang65 has joined #ruby
<hahuang65> what would be the best way to filter out a set of words (case insensitive) from a string
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> hahuang65: What do you want to have in place of the words?
<hahuang65> a void
<elomatreb> >> "lorem ipsum dolor sit amet".gsub /dolor|amet/i, ""
<hahuang65> for example
<ruby[bot]> elomatreb: # => "lorem ipsum sit " (https://eval.in/864579)
<elomatreb> Well, plus something for the trailing/leading space
<hahuang65> what if I have the set of words to filter out in a Set
<havenwood> >> 'hi there sekret words'.gsub Regexp.union(%w[filter these sekret]), ''
<ruby[bot]> havenwood: # => "hi there words" (https://eval.in/864581)
<havenwood> hahuang65: You presumably want to remove the extra space as well?
<hahuang65> beautiful
<hahuang65> thanks
<havenwood> you're welcome
<hahuang65> yeah, possibly
<hahuang65> but I think all my cases are at the end, so I can simply strip maybe
<havenwood> hahuang65: also anchor to the end
<havenwood> >> 'hi there sekret'.gsub /\s#{Regexp.union(%w[filter these sekret])}\z/, ''
<ruby[bot]> havenwood: # => "hi there" (https://eval.in/864582)
<havenwood> hahuang65: But if it's at the end, you can also just #chomp
<hahuang65> havenwood: how would I make that gsub case insensitive
<havenwood> hahuang65: gsub //i, ''
Guest98_ has joined #ruby
<havenwood> hahuang65: (A trailing `i` after the Regexp literal.)
<hahuang65> there's no literal if you do `Regexp.union`
elbuki has joined #ruby
russt has joined #ruby
<elbuki> Hey guys, what do you use to log errors from your applications?
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
gheegh has joined #ruby
<havenwood> hahuang65: one option is to interpolate it inside of a Regexp literal like i showed above
lxsameer has joined #ruby
<hahuang65> dammit, there are actually a lot of caveats here
Dimik has joined #ruby
<hahuang65> I'm basically trying to remove corporate words like `inc` or `llc` or `co`
<hahuang65> and we have those words in a set
<hahuang65> but I cannot purely gsub since there's no non-word delimiters necessarily around them
<havenwood> just a space in front of each, no?
sagax has quit [Quit: Konversation terminated!]
tvw has quit [Ping timeout: 248 seconds]
<hahuang65> Pincus Corp would become Pus (since inc and corp) would both be removed
<havenwood> might it be something other than a space?
conta has quit [Quit: conta]
<havenwood> oh
<hahuang65> could be Acme, Inc. or Acme,Inc
Guest98_ has quit [Quit: Textual IRC Client: www.textualapp.com]
<elomatreb> Anchor at end, and have a \.? ?
AmericanistTimes has joined #ruby
<hahuang65> not necessarily. I guess I think need to change the set to a regex huh?
<hahuang65> I cannot easily change a set into a set of regexs
<elomatreb> That's what havenwoods line did, with the Regexp.union just being a convenience
<havenwood> In Ruby 2.5 you can use #delete_suffix with a glob.
conta has joined #ruby
<hahuang65> elomatreb: right, but I cannot insist that there be any delimiters around any of those words if I use Regexp.union
<hahuang65> not easily at least.
<elomatreb> You can, by interpolating the resulting regex, like in the example
<hahuang65> /\W(inc|corp|co)\W/i is what I would want
<hahuang65> elomatreb: I'mnot really understanding what you mean
<elomatreb> One second
Rodya_ has joined #ruby
<elomatreb> >> /\W(#{Regexp.union %w[inc corp co]})\W/
<ruby[bot]> elomatreb: # => /\W((?-mix:inc|corp|co))\W/ (https://eval.in/864589)
<hahuang65> OHHH
Rodya_ has quit [Remote host closed the connection]
<hahuang65> i'm a derp.
gnufied has joined #ruby
<havenwood> >> 'ermagerd,LLC'.gsub /[,\s]?\s?(?i-mx:llc|inc|corp)\z/, ''
<ruby[bot]> havenwood: # => "ermagerd" (https://eval.in/864590)
<ule> Which method can I use to "inject" a new value to each element inside a hash?
<havenwood> ule: Say more about what you mean.
<havenwood> ule: You want to modify existing values?
jaruga has quit [Quit: jaruga]
<ule> havenwood: I want to add an extra column
<ule> on each element
<havenwood> ule: Give an example.
jenrzzz has quit [Ping timeout: 240 seconds]
<ule> so.. let me exmplain better
<havenwood> ule: Explain with an example.
drcode has joined #ruby
<elomatreb> Example input/expected output is usually a good way
<ule> ok hold on.. I'm gonna write a snippet
jottr has joined #ruby
<havenwood> "it's easier to understand complex data than complex logic" ~ paraphrase of unix philosophy rule of representation
imode has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<hahuang65> havenwood: lol
<ule> havenwood: {"Manager1"=>"America/Toronto", "Manager2"=>"America/Toronto", "User4"=>"America/Toronto", "User3"=>"America/New_York", "User2"=>"Europe/Paris", "User1"=>"America/Vancouver"}
<hahuang65> elomatreb: thanks
<ule> This is what I have. I want to group by timezone_offset
drcode has quit [Remote host closed the connection]
<ule> so I want this final output:
claudiuinberlin has joined #ruby
gothicsouth has joined #ruby
<ule> {"-18000" => ["Manager1", "Manager2"], "43000" => ["User2"]}
<ule> Something like this
drcode has joined #ruby
<ule> so I'm converting "America/New_York" to timezone successfuly with: ActiveSupport::TimeZone.new('America/New_York').utc_offset
<hahuang65> what the hell is `/\W((?-mix:co|corp|corporation|company|llc|ltd|limited|inc|incorporated|dba|fka))\W/i` this ?-mix: thing?
<havenwood> >> {"Manager1"=>"America/Toronto", "Manager2"=>"America/Toronto", "User4"=>"America/Toronto", "User3"=>"America/New_York", "User2"=>"Europe/Paris", "User1"=>"America/Vancouver"}.each_with_object(Hash.new { |h, k| h[k] = []}) { |(user, tz), result| result[tz] << user } # ule
<ule> I messed up.
<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
Slinky_Pete has joined #ruby
<havenwood> that's preserving the absence of those flags
<havenwood> -mix
<havenwood> not m, i or x
<hahuang65> damn, how might I add those flags back in?
mtkd has quit [Ping timeout: 255 seconds]
mson has quit [Quit: Connection closed for inactivity]
mtkd has joined #ruby
dionysus69 has quit [Remote host closed the connection]
<hahuang65> oh I can use Regexp.union().source
<hahuang65> tahnks
dionysus69 has joined #ruby
uZiel has joined #ruby
<hahuang65> really helpful
ledestin has joined #ruby
cagomez has quit [Remote host closed the connection]
herbmillerjr has joined #ruby
cagomez has joined #ruby
jphase has quit [Remote host closed the connection]
orbyt_ has joined #ruby
jphase has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
synthroid has quit [Remote host closed the connection]
lxsameer has quit [Ping timeout: 252 seconds]
enterprisey has joined #ruby
bronson has joined #ruby
synthroid has joined #ruby
oleo has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
BTRE has quit [Read error: Connection reset by peer]
synthroid has quit [Ping timeout: 240 seconds]
Cohedrin_ has joined #ruby
synthroi_ has joined #ruby
jphase has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jphase has joined #ruby
_sfiguser has quit [Ping timeout: 260 seconds]
<elbuki> is there a free error reporting software? like rollbar or honeybadger?
Cohedrin_ has quit [Max SendQ exceeded]
BTRE has joined #ruby
gusrub_ has joined #ruby
Cohedrin_ has joined #ruby
gusrub has quit [Ping timeout: 240 seconds]
marxarelli has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
_sfiguser has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Algebr` has joined #ruby
cagomez has joined #ruby
brw_ has quit [Quit: Off to listen to some tunes...]
<Algebr`> havenwood: yea, i mean to be using 2.1 I am trying to use the traveling-ruby library to package ruby & 1 gem, 'fastlane' for windows.
brw has joined #ruby
claudiuinberlin has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
Rodya_ has joined #ruby
marxarelli has joined #ruby
cdg has joined #ruby
<havenwood> elbuki: Don't those offer a free tier?
<havenwood> elbuki: https://timber.io
goyox86_ has joined #ruby
InfinityFye has quit [Quit: Leaving]
uneeb has joined #ruby
<elbuki> Yeah, but they're free trials...
<havenwood> Rollbar seems to offer $0 for 5,000 events with 30-days retention.
<elbuki> It has a 13 days free trial.
<elbuki> I'm not sure if I can use it after the trial expiration
<havenwood> Isn't that on any tier?
<havenwood> The free one you can. Look at the annual, still $0.
<elbuki> Hmm...
<havenwood> You can do premium for 13 days, then switch to free and it's still free.
<havenwood> Or just start at free and stay at free.
goyox86_ has quit [Read error: Connection reset by peer]
uneeb has quit [Read error: Connection reset by peer]
<elbuki> Ok, I hope I can stay at free.
<elbuki> Thanks!
<havenwood> They mean for it to be free until you need 100k+ log lines or more than 6mo retention.
goyox86_ has joined #ruby
<havenwood> Or, 5k, 30day
gusrub_ has quit [Remote host closed the connection]
<havenwood> I mean
<elbuki> It has to be a very buggy app...
cdg_ has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
Cohedrin_ has quit [Ping timeout: 255 seconds]
<havenwood> elbuki: You can stay at free.
<havenwood> elbuki: It'll just email you when the limit is reached.
Rodya_ has quit [Ping timeout: 255 seconds]
<havenwood> You can limit the lines it logs too. It just counts those you let through.
<havenwood> It lets you use regexp to blacklist lines.
lxsameer has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<elbuki> All right.
cdg has quit [Ping timeout: 240 seconds]
<elbuki> That's awesome/
Cohedrin_ has joined #ruby
<elbuki> I hope I can have it free forever.
workmad3 has joined #ruby
perniciouscaffei has quit [Quit: Textual IRC Client: www.textualapp.com]
<elbuki> Looking forward to implement error log saving without implementing a local database just for that...
perniciouscaffei has joined #ruby
<elbuki> By the way, is there any way to change the RACK_ENV variable?
Azure|dc has joined #ruby
rasca_ has quit [Ping timeout: 240 seconds]
<elbuki> I want to switch production/development environment via rake tasks.
gusrub has joined #ruby
<havenwood> elbuki: ENV['RACK_ENV'] = 'elbuki'
Azure has quit [Ping timeout: 240 seconds]
<elbuki> :+1:
AmericanistTimes has quit [Quit: Textual IRC Client: www.textualapp.com]
AndBobsYourUncle has joined #ruby
jottr has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
s2013 has joined #ruby
selim has quit [Ping timeout: 248 seconds]
gothicsouth has joined #ruby
tvw has joined #ruby
selim has joined #ruby
nobitanobi has joined #ruby
Yzguy has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nobitanobi has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
tax has quit [Ping timeout: 246 seconds]
alex`` has quit [Quit: WeeChat 1.9]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jdawgaz has quit [Client Quit]
jdawgaz has joined #ruby
jdawgaz has quit [Client Quit]
duckpuppy has quit [Ping timeout: 246 seconds]
jdawgaz has joined #ruby
hyperreal 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]
synthroi_ has 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]
enterprisey has joined #ruby
biberu has quit []
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
JD2020X has quit [Ping timeout: 240 seconds]
phinxy has joined #ruby
mikecmpbll has joined #ruby
phinxy has left #ruby [#ruby]
jdawgaz has joined #ruby
Rodya_ has joined #ruby
ur5us has joined #ruby
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?
AgentVenom has quit [Quit: Textual IRC Client: www.textualapp.com]
brent__ has quit [Remote host closed the connection]
bruno-_ has quit [Quit: Lost terminal]
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<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…]
Cohedrin_ has joined #ruby
mson has joined #ruby
<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…]
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
elbuki has joined #ruby
gusrub has quit [Remote host closed the connection]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
pilne has joined #ruby
<ule> [{-18000=>["Manager1", "Manager2", "User4"]}, {-18000=>["User3"]}, {3600=>["User2"]}, {-28800=>["User1"]}]
<ule> how would you group by those keys? I want to merge -18000 so that its contents be: manager1, manager2, user4, user3
cagomez has quit [Remote host closed the connection]
<elomatreb> Can one of the hashes only have a single key?
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ule> elomatreb: yes
<ule> [{-18000=>["Manager1", "Manager2", "User4", "User3"]}, {3600=>["User2"]}, {-28800=>["User1"]}]
<Kanibal> I guess .reduce works for this
<ule> I want this ^
<ule> reduce? let me check
<elomatreb> Are you sure you don't want a solution that has one big hash with multiple keys as a result?
spt0 has quit [Ping timeout: 252 seconds]
jphase has quit [Remote host closed the connection]
<ule> elomatreb: I mean, as long as it keeps a kind of key/value
<ule> because after I need to pass that number and retrieve the value
jphase has joined #ruby
<ule> puts foo[3600] ----> [
<ule> User2
jphase has quit [Remote host closed the connection]
<havenwood> ule: We can show you how to merge but might be nice to unify your timestamps up front so you don't have to regroup them.
jphase has joined #ruby
iszak has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
cagomez has joined #ruby
<havenwood> ule: Are you using Rails or tzinfo at all?
<elomatreb> ule: It won't be winning any beauty prices, but: https://eval.in/864658
iszak has joined #ruby
roonsauce has quit []
orbyt_ has joined #ruby
FrostCandy has quit []
<havenwood> ule: {"Manager1"=>"America/Toronto", "Manager2"=>"America/Toronto", "User4"=>"America/Toronto", "User3"=>"America/New_York", "User2"=>"Europe/Paris", "User1"=>"America/Vancouver"}.each_with_object(Hash.new { |h, k| h[k] = []}) { |(user, tz), result| result[TZInfo::Timezone.get(tz).current_period.utc_offset] << user } #=> {-18000=>["Manager1", "Manager2", "User4", "User3"], 3600=>["User2"], -28800=>["User1"]}
<Kanibal> is there a eval-bot here?
<havenwood> >> true # Kanibal
<ruby[bot]> havenwood: # => true (https://eval.in/864659)
<Kanibal> ah
milardovich has joined #ruby
<Kanibal> >> [{-18000=>["Manager1", "Manager2", "User4"]}, {-18000=>["User3"]}, {3600=>["User2"]}, {-28800=>["User1"]}].inject { |acc, e| acc.merge(e) {|key, oldval, newval| newval.concat(oldval) } }
<ruby[bot]> Kanibal: # => {-18000=>["User3", "Manager1", "Manager2", "User4"], 3600=>["User2"], -28800=>["User1"]} (https://eval.in/864660)
belmoussaoui has quit [Ping timeout: 240 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
<havenwood> Kanibal: That's a nice way
<Kanibal> thanks ;)
<Kanibal> I'm really becoming friends with inject
<havenwood> It reduces things, do doubt.
<havenwood> no doubt*
<Kanibal> ^^
cagomez has quit [Remote host closed the connection]
<havenwood> ule: ^
Yzguy has quit [Quit: Bye]
AndBobsYourUncle has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
milardovich has quit [Ping timeout: 248 seconds]
gusrub has joined #ruby
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
SteenJobs has quit [Quit: SteenJobs]
gbailey has quit [Quit: ZNC - 1.6.0 - http://znc.in]
bronson has quit [Remote host closed the connection]
ben_ has joined #ruby
ben_ is now known as Guest10597
marxarelli is now known as marxarelli|afk
spt0 has joined #ruby
GodFather has joined #ruby
<ule> you guys are awesome
<ule> thank you very much
GodFather has quit [Remote host closed the connection]
elbuki has joined #ruby
_sfiguser has quit [Quit: Leaving]
tvw has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
al2o3-cr has quit [Read error: Connection reset by peer]
jphase has quit [Remote host closed the connection]
orbyt_ has joined #ruby
jphase has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
goyox86_ has quit [Quit: goyox86_]
goyox86_ has joined #ruby
gr33n7007h has joined #ruby
chouhoul_ has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
goyox86_ has quit [Client Quit]
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goyox86_ has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
s3nd1v0g1us has joined #ruby
lagweezle is now known as lagweezle_away
<Kanibal> >> [{-18000=>["Manager1", "Manager2", "User4"]}, {-18000=>["User3"]}, {3600=>["User2"]}, {-28800=>["User1"]}].inject { |acc, e| acc.merge(e) {|key, oldval, newval| oldval.concat newval } }.map {|k,v| {k => v}}
<ruby[bot]> Kanibal: # => [{-18000=>["Manager1", "Manager2", "User4", "User3"]}, {3600=>["User2"]}, {-28800=>["User1"]}] (https://eval.in/864665)
<Kanibal> ule: That is according to your exact specification
<elbuki> >> puts "#{ENV}"
GodFather_ has quit [Ping timeout: 240 seconds]
gbailey has joined #ruby
JD2020X has joined #ruby
<elbuki> >> puts "#{ENV.inspect}"
<elbuki> Nice bot...
<elbuki> Is that hardcode validated?
<Kanibal> >> ENV
<ruby[bot]> Kanibal: # => {"LIBC_FATAL_STDERR_"=>"1", "LANG"=>"en_US.UTF-8", "HOME"=>"/tmp/execpad-eec11920684e"} (https://eval.in/864666)
<Kanibal> ;)
<elbuki> >> "hello"
<elbuki> ???
<Kanibal> Maybe you need to be registered?
elbuki has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
jenrzzz has quit [Ping timeout: 246 seconds]
goyox86_ has quit [Quit: goyox86_]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
mikecmpbll has quit [Quit: inabit.]
<gr33n7007h> i like keys
lagweezle_away is now known as lagweezle
enterprisey has quit [Ping timeout: 240 seconds]
lagweezle is now known as lagweezle_away
elbuki has joined #ruby
LocalAdmin__ has quit [Read error: Connection reset by peer]
jw has quit [Ping timeout: 260 seconds]
tcopeland has joined #ruby
elbuki has quit [Client Quit]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lagweezle_away is now known as lagweezle
chouhoul_ has quit [Remote host closed the connection]
rikai_ is now known as rikai
rikai has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
cagomez has joined #ruby
<gr33n7007h> >> self
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<ruby[bot]> gr33n7007h: # => main (https://eval.in/864667)
<gr33n7007h> >> singleton_class
<ruby[bot]> gr33n7007h: # => #<Class:#<Object:0x413c9344>> (https://eval.in/864668)
GodFather_ has joined #ruby
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]
A124 has quit [Ping timeout: 240 seconds]
halt has joined #ruby
cdg has joined #ruby
troys is now known as troys_
cdg_ has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 240 seconds]
jackjackdripper has quit [Quit: Leaving.]
Algebr` has joined #ruby
raynold has joined #ruby