havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.3.3; 2.2.6; 2.1.10: https://www.ruby-lang.org || Paste >3 lines of text on https://gist.github.com || Rails questions? Ask on #RubyOnRails || logs @ https://irclog.whitequark.org/ruby/
nofxx has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
saneax is now known as saneax-_-|AFK
QualityAddict has joined #ruby
wilbert has joined #ruby
yeticry has quit [Ping timeout: 246 seconds]
yan__ has quit [Ping timeout: 260 seconds]
yeticry has joined #ruby
Eiam has joined #ruby
Snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
axyjo has joined #ruby
aknagi has quit [Remote host closed the connection]
jhack has joined #ruby
ResidentBiscuit has joined #ruby
jphase-afk is now known as jphase
matp has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
emptyflask has quit [Remote host closed the connection]
h1fuelcell has joined #ruby
marr has quit [Ping timeout: 250 seconds]
last_staff has quit [Quit: *poof*]
pandaant has quit [Remote host closed the connection]
gloscombe has quit [Quit: gloscombe]
arescorpio has joined #ruby
h1fuelcell has quit [Ping timeout: 250 seconds]
madsa has quit [Read error: Connection reset by peer]
madsa_ has joined #ruby
Madplatypus has quit [Quit: Connection closed for inactivity]
ResidentBiscuit has quit []
hahuang61 has quit [Quit: WeeChat 1.5]
hahuang61 has joined #ruby
Olipro_ has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
skweek has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.4]
bihi has quit [Quit: Bye!]
ResidentBiscuit has joined #ruby
dnicole has quit [Remote host closed the connection]
bihi has joined #ruby
charliesome has joined #ruby
postmodern has quit [Remote host closed the connection]
f4_ has joined #ruby
chopin has quit [Remote host closed the connection]
enterprisey has joined #ruby
flashpoint9 has joined #ruby
enterprisey has quit [Remote host closed the connection]
wisn has joined #ruby
hahuang65 has joined #ruby
skweek has quit [Ping timeout: 265 seconds]
wisn has quit [Quit: Leaving]
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skalfyfan has joined #ruby
william3 has joined #ruby
finisherr has left #ruby [#ruby]
bturker has quit [Ping timeout: 256 seconds]
hutch34 has joined #ruby
kireevco has joined #ruby
william3 has quit [Ping timeout: 250 seconds]
Olipro_ is now known as Olipro
buglessdr has quit [Ping timeout: 268 seconds]
jhack has quit [Quit: jhack]
Devalo has joined #ruby
roamingdog has joined #ruby
william3 has joined #ruby
enterprisey has joined #ruby
chouhoulis has joined #ruby
jtdoncas has quit [Ping timeout: 245 seconds]
herbmillerjr has quit [Quit: Konversation terminated!]
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
herbmillerjr has joined #ruby
jhn has joined #ruby
Devalo has quit [Ping timeout: 245 seconds]
jenrzzz_ has quit [Ping timeout: 260 seconds]
flashpoint9 has quit [Remote host closed the connection]
davidt has quit []
wilbert has quit [Ping timeout: 256 seconds]
enterprisey has quit [Ping timeout: 250 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
bauruine has quit [Ping timeout: 256 seconds]
r3vDev has joined #ruby
jhack has joined #ruby
skalfyfan has joined #ruby
SHyx0rmZ has quit [Ping timeout: 256 seconds]
Tempesta has quit [Quit: AdiIRC is updating to v2.7 Beta Build (2016/12/05) 32 Bit]
h1fuelcell has joined #ruby
_br__ has quit [Ping timeout: 256 seconds]
Tempesta has joined #ruby
jaguarmagenta has joined #ruby
_br__ has joined #ruby
jenrzzz has joined #ruby
RobertBirnie has quit [Ping timeout: 245 seconds]
bauruine has joined #ruby
beilabs has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
h1fuelcell has joined #ruby
jaguarmagenta has quit [Ping timeout: 244 seconds]
beilabs_ has quit [Ping timeout: 244 seconds]
emptyflask has joined #ruby
roamingdog has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
emptyflask has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
emptyflask has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
emptyflask has quit [Ping timeout: 250 seconds]
muelleme has quit [Ping timeout: 260 seconds]
tenderlove has quit [Remote host closed the connection]
r3vDev has quit [Quit: Leaving.]
tenderlove has joined #ruby
r3vDev has joined #ruby
Guest43 has joined #ruby
Guest43 has joined #ruby
Guest43 has quit [Changing host]
tvw has quit [Remote host closed the connection]
jphase is now known as jphase-afk
x77686d has joined #ruby
f4_ has quit [Read error: Connection reset by peer]
jhack has quit [Quit: jhack]
jenrzzz has quit [Ping timeout: 265 seconds]
tenderlove has quit [Ping timeout: 260 seconds]
patPAT has joined #ruby
<patPAT> hi
patPAT has quit [Client Quit]
hutch34 has quit [Ping timeout: 244 seconds]
patPAT has joined #ruby
patPAT has quit [Client Quit]
borodin has quit [Ping timeout: 258 seconds]
yqt has quit [Ping timeout: 268 seconds]
gusrub has quit [Remote host closed the connection]
gusrub has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
frozengeek____ has quit [Quit: frozengeek____]
cdg has quit [Remote host closed the connection]
jtdoncas_ has joined #ruby
roamingdog has joined #ruby
kambuchakingpin has quit [Quit: Lost terminal]
jackjackdripper1 has quit [Quit: Leaving.]
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has quit [Read error: Connection reset by peer]
gusrub has quit [Ping timeout: 260 seconds]
bocaneri has quit [Read error: Connection reset by peer]
charliesome has joined #ruby
william3 has quit [Remote host closed the connection]
nankyokusei has joined #ruby
jtdoncas_ has quit [Ping timeout: 260 seconds]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
jeyraof has joined #ruby
bocaneri has joined #ruby
splud has quit [Quit: splud]
SeepingN_ has quit [Client Quit]
nankyokusei has quit [Ping timeout: 268 seconds]
xrlk has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
Guest43 has quit [Quit: Textual IRC Client: www.textualapp.com]
chopin has joined #ruby
tenderlove has joined #ruby
_djbkd has quit [Remote host closed the connection]
jhack has joined #ruby
jhack has quit [Client Quit]
_djbkd has joined #ruby
djbkd has quit [Remote host closed the connection]
_djbkd has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
_djbkd has joined #ruby
GodFather has joined #ruby
djbkd has quit [Ping timeout: 244 seconds]
skalfyfan has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
skalfyfan has quit [Client Quit]
skalfyfan has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ResidentBiscuit has quit [Remote host closed the connection]
skalfyfan has quit [Client Quit]
Devalo has joined #ruby
tenderlove has quit [Remote host closed the connection]
tenderlove has joined #ruby
skalfyfan has joined #ruby
skalfyfan has quit [Client Quit]
allcentury has quit [Ping timeout: 246 seconds]
Emmanuel_Chanel has quit [Ping timeout: 268 seconds]
tenderlove has quit [Ping timeout: 260 seconds]
skalfyfan has joined #ruby
Devalo has quit [Ping timeout: 260 seconds]
jhn has quit [Quit: Textual IRC Client: www.textualapp.com]
gusrub has joined #ruby
x77686d has quit [Quit: x77686d]
maloik has quit [Remote host closed the connection]
maloik has joined #ruby
gusrub has quit [Ping timeout: 260 seconds]
jaguarmagenta has joined #ruby
dnicole has joined #ruby
chouhoulis has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
Hyuk has joined #ruby
someish has joined #ruby
bmurt has joined #ruby
<someish> I’m using ruby 2.2.4 and I’m trying to sort a hash using the key name. How can I place a particular key at the beginning of the sorted hash? See https://gist.github.com/saturday/8738514199a7cb12b47b60b5c65b78bd
<someish> Also, I understand that sort_by converts the has to an array, and that I’ll need to convert it back.
LoneHermit has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skalfyfan has joined #ruby
linuxlite_ has joined #ruby
<linuxlite_> hello
jenrzzz has quit [Ping timeout: 258 seconds]
<linuxlite_> how do i install rails
<linuxlite_> which one is the GUI
<linuxlite_> thanks
GodFather has quit [Quit: Ex-Chat]
jackjackdripper has joined #ruby
GodFather has joined #ruby
<baweaver> &ri Enumerable#sort_by
<baweaver> "...by mapping the values in enum through the given block"
roamingdog has quit []
<baweaver> someish: Also look at sort
xrlk has joined #ruby
<baweaver> >> [1 <=> 0, 0 <=> 0, 0 <=> 1]
<ruby[bot]> baweaver: # => [1, 0, -1] (https://eval.in/692202)
<someish> baweaver: See my comment on the gist. Is that a reasonable solution?
<baweaver> do you care if any other keys are sorted?
<someish> Nope.
<someish> I’m not convinced what I’m doing is optimal.
<baweaver> you can simplify it a bit more by taking out the ternary
<baweaver> though why do you want to do it?
<baweaver> also you can use != and get rid of the reverse
<someish> The reverse was leftover from some other stuff I was trying.
<baweaver> fair.
<someish> I should have removed it.
jaguarmagenta has quit [Remote host closed the connection]
<baweaver> So what's the reasoning behind sorting a hash?
<baweaver> there might be a different solution altogether depending on what it is.
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
<someish> Well, the hash is a return value from some pretty convoluted, and relatively poorly written code, which I do not want to touch for fear of regression.
<baweaver> expand on that a bit because I don't see how this really effects anything
<someish> The hash is iterated through on the client side, and one of the values, given some conditionals, needs to come first.
<baweaver> odd. Any particular reason why one of them needs to come first?
<someish> It’s a business requirement.
* baweaver scratches head
<baweaver> don't suppose you'd tell me why it's a business requirement?
<someish> In short, “I want to see this particular plot first, and all other plots can appear in any order”.
<baweaver> just seems like a really obscure requirement to have is all.
threh has quit [Ping timeout: 245 seconds]
<baweaver> Aha
<baweaver> you could always relay that to the frontend though so you don't have to patch it in ruby
<someish> To be honest, I’d rather do it in ruby.
<baweaver> because it'll end up being a frontend concern
<baweaver> yeah, I know that feeling.
buglessdr has joined #ruby
howdoi has joined #ruby
<baweaver> could always make a concept of a featured plot and pluck that particular kv pair out of the object/hash
<someish> I agree though. It’s certainly a client side concern.
flashpoint9 has quit [Ping timeout: 258 seconds]
<baweaver> If you have Lodash it'd be easier to manage
Hyuk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
<someish> I’ve got underscore.
* baweaver gasps
<someish> All of these libraries are several years old.
<baweaver> na, you're probably fine
<baweaver> yeah, regressions
<baweaver> always fun
<someish> Anyway, back to it. Thanks for your help.
<baweaver> Hm.
<baweaver> &ri Hash#delete
<baweaver> that returns the value, so you could cheat and use that
Hyuk has joined #ruby
<someish> I don’t actually want to modify the hash other than the order.
optiz0r has quit [Ping timeout: 256 seconds]
Hyuk has quit [Client Quit]
threh has joined #ruby
libastral has quit [Ping timeout: 250 seconds]
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
libastral has joined #ruby
Batholith has quit [Ping timeout: 258 seconds]
devster31 has quit [Ping timeout: 250 seconds]
devster31 has joined #ruby
Derperperd has joined #ruby
JoshS has joined #ruby
skalfyfan has joined #ruby
Batholith has joined #ruby
Nicmavr has quit [Quit: ZNC 1.6.3+cygwin3 - http://znc.in]
Nicmavr has joined #ruby
Jameser has joined #ruby
Nicmavr is now known as Guest44696
Guest44696 has quit [Changing host]
Guest44696 has joined #ruby
Guest44696 is now known as Kestrel-029
Derperperd has left #ruby [#ruby]
pilne has quit [Quit: Quitting!]
linuxlite_ has quit [Ping timeout: 265 seconds]
Kestrel-029 has quit [Read error: Connection reset by peer]
Devalo has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
Kestrel-029 has joined #ruby
Kestrel-029 is now known as Guest50746
Guest50746 has quit [Changing host]
Guest50746 has joined #ruby
Devalo has quit [Ping timeout: 258 seconds]
mrsolo has joined #ruby
gbgdev has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Guest50746 is now known as Kestrel-029
Derderderd has joined #ruby
Derderderd has quit [Changing host]
Derderderd has joined #ruby
william3 has joined #ruby
Emmanuel_Chanel has joined #ruby
triangles has joined #ruby
william3 has quit [Remote host closed the connection]
charliesome has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Snowy has quit [Remote host closed the connection]
triangles2 has quit [Ping timeout: 244 seconds]
Snowy has joined #ruby
jaguarmagenta has joined #ruby
ixti has quit [Quit: WeeChat 1.6]
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
beilabs has quit [Remote host closed the connection]
emptyflask has joined #ruby
braincrash has quit [Ping timeout: 258 seconds]
braincrash has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
beilabs has joined #ruby
Snowy has quit [Ping timeout: 248 seconds]
axyjo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emptyflask has quit [Ping timeout: 260 seconds]
Madplatypus has joined #ruby
LoneHermit has quit [Remote host closed the connection]
beilabs has quit [Remote host closed the connection]
jphase-afk is now known as jphase
moei has joined #ruby
perniciouscaffei has joined #ruby
<nchambers> hey guys! I just built a gem and it says it was successful. how can I require that gem?
infernix has quit [Ping timeout: 246 seconds]
flashpoint9 has joined #ruby
julian_ has quit [Ping timeout: 250 seconds]
JoL1hAHN has quit [Ping timeout: 246 seconds]
julian has joined #ruby
Olipro has quit [Ping timeout: 245 seconds]
julian is now known as Guest18400
astrobunny has joined #ruby
Olipro has joined #ruby
JoL1hAHN has joined #ruby
enterprisey has joined #ruby
hanmac has quit [Ping timeout: 260 seconds]
harai has quit [Ping timeout: 258 seconds]
astrobunny has quit [Ping timeout: 260 seconds]
harfangk has joined #ruby
beilabs has joined #ruby
bruce_lee has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
triangles2 has joined #ruby
GodFather has quit [Ping timeout: 265 seconds]
triangles has quit [Ping timeout: 244 seconds]
astrobunny has joined #ruby
nankyokusei has quit [Ping timeout: 246 seconds]
govg has quit [Ping timeout: 250 seconds]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
hanmac has joined #ruby
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ericx2x_ has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
flashpoint9 has joined #ruby
ericx2x_ has quit [Client Quit]
ericx2x_ has joined #ruby
ericx2x_ has quit [Remote host closed the connection]
infernix has joined #ruby
Jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
braincrash has quit [Quit: bye bye]
gix has quit [Ping timeout: 256 seconds]
flashpoint9 has quit [Ping timeout: 258 seconds]
govg has joined #ruby
skalfyfan has joined #ruby
ResidentBiscuit has quit []
wilbert has joined #ruby
antoniobeyah has joined #ruby
gix has joined #ruby
sdwrage has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
threh has quit [Ping timeout: 250 seconds]
skalfyfan has quit [Ping timeout: 256 seconds]
threh has joined #ruby
wilbert has quit [Ping timeout: 245 seconds]
houhoulis has joined #ruby
swills has quit [Ping timeout: 245 seconds]
iMadper has joined #ruby
hutch34 has joined #ruby
swills has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
haraoka has joined #ruby
Snowy has joined #ruby
triangles has joined #ruby
triangles2 has quit [Ping timeout: 260 seconds]
marxarelli|afk is now known as marxarelli
someish has quit [Quit: someish]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
r3vDev has quit [Ping timeout: 265 seconds]
xall has joined #ruby
<llua> did you install it?
etehtsea has joined #ruby
iMadper has quit [Remote host closed the connection]
iMadper has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
NightMonkey has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
h1fuelcell has joined #ruby
akar has joined #ruby
matp has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
h1fuelcell has quit [Ping timeout: 258 seconds]
beilabs_ has joined #ruby
pawnbox has joined #ruby
mastappl has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: Connection reset by peer]
beilabs has quit [Ping timeout: 258 seconds]
william3 has joined #ruby
jhooker has joined #ruby
arescorpio has quit [Quit: Leaving.]
houhoulis has quit [Remote host closed the connection]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
Safouane has joined #ruby
marxarelli is now known as marxarelli|afk
jenrzzz has quit [Ping timeout: 268 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
haraoka has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
govg has quit [Ping timeout: 244 seconds]
Snowy has quit [Ping timeout: 244 seconds]
chouhoulis has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
ruby427 has joined #ruby
jhooker has joined #ruby
hutch34 has quit [Ping timeout: 244 seconds]
enterprisey has quit [Remote host closed the connection]
govg has joined #ruby
ruby427 has quit [Client Quit]
kp666[m] has joined #ruby
axyjo has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
ruby980 has joined #ruby
jhooker has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
kp666 has joined #ruby
jhooker has joined #ruby
<nchambers> llua, yeah I was missing that step
<nchambers> now I've gotten into some weird C errors
chouhoulis has quit [Remote host closed the connection]
optiz0r has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
<nchambers> oh nmd. I'm just stupid
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
infernix has quit [Ping timeout: 260 seconds]
DenSchub has quit [Ping timeout: 260 seconds]
Tony-St4rk has quit [Ping timeout: 260 seconds]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
mikeXsh has quit [Ping timeout: 260 seconds]
electrostat has quit [Ping timeout: 260 seconds]
adgtl has quit [Ping timeout: 260 seconds]
AndyWojo has quit [Ping timeout: 260 seconds]
alem0lars has quit [Ping timeout: 260 seconds]
bounb has quit [Ping timeout: 260 seconds]
jxf has quit [Ping timeout: 260 seconds]
jhill_ has quit [Ping timeout: 260 seconds]
zipkid has quit [Ping timeout: 260 seconds]
jimeh has quit [Ping timeout: 260 seconds]
Klumben has quit [Ping timeout: 260 seconds]
makufiru has quit [Ping timeout: 260 seconds]
bcavileer has quit [Ping timeout: 260 seconds]
Guest98979 has quit [Ping timeout: 260 seconds]
nedbat has quit [Ping timeout: 260 seconds]
rideh has quit [Ping timeout: 260 seconds]
amitchellbullard has quit [Ping timeout: 260 seconds]
zero7 has quit [Ping timeout: 260 seconds]
wsmoak has quit [Ping timeout: 260 seconds]
vcoinminer has quit [Ping timeout: 260 seconds]
Heero has quit [Ping timeout: 260 seconds]
imanc has quit [Ping timeout: 260 seconds]
zipkid_ has joined #ruby
Tony-St4rk has joined #ruby
Devalo has joined #ruby
jxf has joined #ruby
lightstalker has quit [Ping timeout: 248 seconds]
hanmac has quit [Ping timeout: 260 seconds]
Batholith has quit [Ping timeout: 260 seconds]
arooni has quit [Ping timeout: 260 seconds]
tpendragon has quit [Ping timeout: 260 seconds]
znz_jp has quit [Ping timeout: 260 seconds]
Iacobus__ has quit [Ping timeout: 260 seconds]
teotwaki has quit [Ping timeout: 260 seconds]
iooner has quit [Ping timeout: 260 seconds]
cschneid has quit [Ping timeout: 260 seconds]
hayden__ has quit [Ping timeout: 260 seconds]
Diabolik has quit [Ping timeout: 260 seconds]
deepak_ has quit [Ping timeout: 260 seconds]
wsmoak has joined #ruby
Xi[m] has quit [Ping timeout: 260 seconds]
Donalmartin[m] has quit [Ping timeout: 260 seconds]
philidor[m] has quit [Ping timeout: 260 seconds]
velu_aon[m] has quit [Ping timeout: 260 seconds]
aurelien has quit [Ping timeout: 260 seconds]
alexandernst has quit [Ping timeout: 260 seconds]
jokke has quit [Ping timeout: 260 seconds]
saneax-_-|AFK has quit [Ping timeout: 260 seconds]
rflot has quit [Ping timeout: 260 seconds]
[diecast] has quit [Ping timeout: 260 seconds]
eregon has quit [Ping timeout: 260 seconds]
eregon has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
electrostat has joined #ruby
adgtl has joined #ruby
rflot has joined #ruby
vcoinminer has joined #ruby
alexandernst has joined #ruby
deepak_ has joined #ruby
hutch34 has joined #ruby
Heero has joined #ruby
jhooker has joined #ruby
imanc has joined #ruby
zero7 has joined #ruby
[diecast] has joined #ruby
jhill_ has joined #ruby
hayden__ has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
mikeXsh has joined #ruby
amitchellbullard has joined #ruby
jhooker has joined #ruby
AndyWojo has joined #ruby
Devalo has quit [Ping timeout: 260 seconds]
Iacobus__ has joined #ruby
znz_jp has joined #ruby
ghostlight has quit [Ping timeout: 260 seconds]
bounb has joined #ruby
bounb has quit [Changing host]
bounb has joined #ruby
C0deMaver1ck has joined #ruby
Batholith has joined #ruby
cschneid has joined #ruby
rideh has joined #ruby
DenSchub has joined #ruby
C0deMaver1ck is now known as Guest62217
Diabolik has joined #ruby
lightstalker has joined #ruby
bcavileer has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
makufiru has joined #ruby
jhooker has joined #ruby
tau has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
jimeh has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
h1fuelcell has joined #ruby
yeticry has quit [Ping timeout: 265 seconds]
emptyflask has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
dviola has quit [Quit: WeeChat 1.6]
tpendragon has joined #ruby
saneax-_-|AFK has joined #ruby
arooni has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
xall has quit [Ping timeout: 245 seconds]
nofxxx has joined #ruby
yeticry has joined #ruby
Donalmartin[m] has joined #ruby
philidor[m] has joined #ruby
velu_aon[m] has joined #ruby
Xi[m] has joined #ruby
alem0lars has joined #ruby
jhooker has joined #ruby
Klumben has joined #ruby
emptyflask has quit [Remote host closed the connection]
jokke has joined #ruby
emptyflask has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
Guest20053 has quit [Remote host closed the connection]
nofxx has quit [Ping timeout: 258 seconds]
jhooker has joined #ruby
tessi_zz has quit [Ping timeout: 245 seconds]
tessi_zz has joined #ruby
infernix has joined #ruby
ghostlight has joined #ruby
Dimik has joined #ruby
hanmac has joined #ruby
tenderlove has joined #ruby
jhooker has quit [Read error: Connection reset by peer]
yeticry has quit [Ping timeout: 248 seconds]
tenderlove has quit [Read error: Connection reset by peer]
aryaching has joined #ruby
tenderlove has joined #ruby
yeticry has joined #ruby
ariedler has joined #ruby
nedbat has joined #ruby
<ariedler> I am trying to determine if the I am getting a lot of GIL contention in MRI, any recommendations on how to do this?
h1fuelcell has quit [Remote host closed the connection]
hardest has joined #ruby
brendan- has joined #ruby
threh has quit [Ping timeout: 260 seconds]
<ariedler> Is there an easy way to poll for something like the number of threads waiting on the GIL ?
h1fuelcell has joined #ruby
eggshke has joined #ruby
jtdoncas_ has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
jhooker has joined #ruby
bturker has joined #ruby
maattdd has joined #ruby
jenrzzz has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
jhooker has quit [Read error: Connection reset by peer]
jhooker has joined #ruby
kareelee has joined #ruby
jtdoncas_ has quit [Ping timeout: 258 seconds]
nankyokusei has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jhooker has quit [Read error: Connection reset by peer]
jenrzzz has quit [Client Quit]
maattdd has quit [Ping timeout: 256 seconds]
bturker has quit [Ping timeout: 256 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
h1fuelcell has joined #ruby
beilabs_ has quit [Remote host closed the connection]
haraoka has joined #ruby
lxsameer has joined #ruby
Snowy has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
threh has joined #ruby
jaguarmagenta has quit [Remote host closed the connection]
Snowy has quit [Ping timeout: 246 seconds]
dnicole has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
<ariedler> or is the easiest way just to strace and watch for waits / timers?
ascarter has quit [Client Quit]
ariedler has quit [Remote host closed the connection]
jtdoncas has joined #ruby
xberg has joined #ruby
muelleme has joined #ruby
xberg_ has joined #ruby
jtdoncas has quit [Ping timeout: 260 seconds]
xberg has quit [Ping timeout: 245 seconds]
LoneHerm_ has joined #ruby
xberg_ has quit []
Tempesta_ has joined #ruby
akar has quit [Quit: leaving]
LoneHer__ has joined #ruby
jshjsh has joined #ruby
Tempesta has quit [Ping timeout: 256 seconds]
xberg has joined #ruby
jshjsh has quit [Remote host closed the connection]
william3 has quit [Remote host closed the connection]
LoneHerm_ has quit [Ping timeout: 265 seconds]
JoshS has quit [Ping timeout: 268 seconds]
william3 has joined #ruby
Jesuspiece has quit [Ping timeout: 250 seconds]
djbkd has quit [Quit: Leaving...]
joelroa has joined #ruby
x77686d has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
william3 has quit [Ping timeout: 250 seconds]
h1fuelcell has quit [Remote host closed the connection]
ruby980 has quit [Ping timeout: 260 seconds]
nowz has joined #ruby
saneax-_-|AFK is now known as saneax
kareelee has quit [Remote host closed the connection]
kareelee has joined #ruby
LoneHer__ has quit [Read error: Connection reset by peer]
hutch34 has quit [Ping timeout: 248 seconds]
LoneHermit has joined #ruby
NeverTired has quit [Quit: Connection closed for inactivity]
iMadper has quit [Ping timeout: 268 seconds]
chopin_ has joined #ruby
etehtsea has quit [Read error: Connection reset by peer]
greister has quit [Ping timeout: 244 seconds]
x77686d has quit [Quit: x77686d]
chopin has quit [Ping timeout: 244 seconds]
deimos has quit [Ping timeout: 244 seconds]
etehtsea has joined #ruby
_main_ has joined #ruby
Ademan has quit [Ping timeout: 265 seconds]
yeticry has quit [Ping timeout: 244 seconds]
kareelee has quit [Ping timeout: 260 seconds]
ICantCook has quit [Quit: bye]
__main__ has quit [Ping timeout: 244 seconds]
Guest64702 has quit [Ping timeout: 244 seconds]
AustinMatherne has quit [Ping timeout: 244 seconds]
AustinMatherne has joined #ruby
yeticry has joined #ruby
greister has joined #ruby
deimos has joined #ruby
_main_ is now known as __main__
tuxaddicted has quit [Ping timeout: 246 seconds]
Omni_ has joined #ruby
joelroa has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
djbkd has joined #ruby
Ademan has joined #ruby
someish has joined #ruby
Wizznt has joined #ruby
azor has joined #ruby
xall has joined #ruby
balazs has quit [Ping timeout: 248 seconds]
xall has quit [Ping timeout: 246 seconds]
threh has quit [Ping timeout: 244 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Snowy has joined #ruby
adavia has quit [Ping timeout: 245 seconds]
last_staff has joined #ruby
dnicole has joined #ruby
balazs has joined #ruby
lorenzoscalfani has joined #ruby
dnicole has quit [Ping timeout: 245 seconds]
r3vDev has joined #ruby
buglessdr has quit [Ping timeout: 268 seconds]
ignarps has quit [Ping timeout: 260 seconds]
jgnagy has quit [Remote host closed the connection]
ignarps has joined #ruby
Antiarc has quit [Ping timeout: 265 seconds]
jgnagy has joined #ruby
h1fuelcell has joined #ruby
charliesome has joined #ruby
Antiarc has joined #ruby
balazs has quit [Ping timeout: 256 seconds]
amclain has quit [Quit: Leaving]
jgnagy has quit [Ping timeout: 260 seconds]
Devalo has joined #ruby
pawnbox has quit [Remote host closed the connection]
gbgdev has joined #ruby
djbkd has quit []
tom has joined #ruby
aganov has joined #ruby
Devalo has quit [Ping timeout: 265 seconds]
h1fuelcell has quit [Remote host closed the connection]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gbgdev has quit [Ping timeout: 268 seconds]
h1fuelcell has joined #ruby
charliesome has joined #ruby
SpiffTR has joined #ruby
balazs has joined #ruby
aufi has joined #ruby
charliesome has quit [Client Quit]
Coldblackice has joined #ruby
kareelee has joined #ruby
conta has joined #ruby
Coldblackice has quit [Max SendQ exceeded]
Snowy has quit [Ping timeout: 245 seconds]
h1fuelcell has quit [Ping timeout: 260 seconds]
Puffball has quit [Quit: No Ping reply in 180 seconds.]
Coldblackice has joined #ruby
Puffball has joined #ruby
grh has joined #ruby
Tempesta_ is now known as Tempesta
Tempesta has quit [Changing host]
Tempesta has joined #ruby
kp__ has joined #ruby
kp666 has quit [Read error: Connection reset by peer]
emilkarl has joined #ruby
blaxter has joined #ruby
cibs has quit [Ping timeout: 268 seconds]
cibs has joined #ruby
pawnbox has joined #ruby
h1fuelcell has joined #ruby
axyjo has quit [Ping timeout: 250 seconds]
charliesome has joined #ruby
Coldblackice has quit []
h1fuelcell has quit [Remote host closed the connection]
r3vDev has quit [Ping timeout: 256 seconds]
aryaching_ has joined #ruby
SpiffTR has quit [Quit: Leaving.]
aryaching has quit [Ping timeout: 244 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
h1fuelcell has joined #ruby
Coldblackice has joined #ruby
jgnagy has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
Coldblackice has quit [Client Quit]
ropeney has quit [Ping timeout: 260 seconds]
bturker has joined #ruby
minimalism has quit [Quit: minimalism]
andikr has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
agarciava has joined #ruby
<agarciava> hi there
symm- has quit [Ping timeout: 245 seconds]
astrobunny has joined #ruby
<agarciava> Where can I find a large testsuite?
william3 has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 245 seconds]
nankyokusei has joined #ruby
<manveru> agarciava: how large? any preferences for the test lib?
bturker has quit [Ping timeout: 256 seconds]
russt has quit [Ping timeout: 260 seconds]
william3 has quit [Ping timeout: 246 seconds]
nankyokusei has quit [Ping timeout: 244 seconds]
someish has quit [Quit: someish]
jeyraof has quit [Read error: Connection reset by peer]
sarlalian_ has joined #ruby
Emmanuel_Chanel has joined #ruby
sarlalian has quit [Ping timeout: 244 seconds]
russt has joined #ruby
jeyraof has joined #ruby
vondruch_ has joined #ruby
naprimer_2 has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Pongles has quit [Ping timeout: 260 seconds]
Pongles has joined #ruby
vondruch has quit [Read error: Connection reset by peer]
agarciava has quit [Quit: Page closed]
fenre has joined #ruby
fold4 has quit [Ping timeout: 244 seconds]
naprimer has quit [Ping timeout: 260 seconds]
jtdoncas has joined #ruby
fold4 has joined #ruby
Hobbyboy has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
jtdoncas has quit [Ping timeout: 250 seconds]
aryaching_ has quit [Read error: Connection reset by peer]
haraoka has quit [Ping timeout: 250 seconds]
tom has quit []
SpiffTR has joined #ruby
aryaching has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
bigkevmcd has quit [Quit: Outta here...]
h1fuelcell has joined #ruby
jeyraof has quit [Read error: Connection reset by peer]
jeyraof has joined #ruby
SJr has quit [Ping timeout: 260 seconds]
AustinMatherne has quit [Ping timeout: 260 seconds]
SpiffTR1 has joined #ruby
SpiffTR has quit [Ping timeout: 260 seconds]
aufi has quit [Ping timeout: 260 seconds]
AustinMatherne has joined #ruby
eggshke has quit [Remote host closed the connection]
eggshke has joined #ruby
Derderderd has quit [Quit: leaving]
Derderderd has joined #ruby
SJr has joined #ruby
r3vDev has joined #ruby
bigkevmcd has joined #ruby
blackbombay has quit [Ping timeout: 250 seconds]
KnownSyntax has quit [Ping timeout: 268 seconds]
Snowy has joined #ruby
teclator has joined #ruby
Snickers has joined #ruby
Humdai has joined #ruby
User458764 has joined #ruby
emptyflask has quit [Remote host closed the connection]
jtdoncas_ has joined #ruby
Safouane has left #ruby [#ruby]
r3vDev has quit [Read error: Connection reset by peer]
Derderderd has quit [Quit: leaving]
Derderderd has joined #ruby
Derderderd has joined #ruby
Derderderd has quit [Changing host]
lorenzoscalfani has quit [Ping timeout: 265 seconds]
Derderderd has quit [Client Quit]
h1fuelcell has quit [Remote host closed the connection]
TomyWork has joined #ruby
SpiffTR1 has quit [Quit: Leaving.]
aufi has joined #ruby
Derderderd has joined #ruby
Derderderd has joined #ruby
Derderderd has quit [Changing host]
Dimik has quit [Ping timeout: 246 seconds]
Derderderd has quit [Client Quit]
xall has joined #ruby
charliesome has joined #ruby
Derderderd has joined #ruby
muelleme has quit [Ping timeout: 258 seconds]
SuperLag has quit [Ping timeout: 250 seconds]
charliesome has quit [Client Quit]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
SuperLag has joined #ruby
claudiuinberlin has joined #ruby
tom has joined #ruby
tom has quit [Client Quit]
nofxxx has quit [Ping timeout: 250 seconds]
KnownSyntax has joined #ruby
charliesome has joined #ruby
william3 has joined #ruby
aryaching_ has joined #ruby
noodle has quit [Ping timeout: 256 seconds]
aryaching has quit [Ping timeout: 246 seconds]
william3 has quit [Remote host closed the connection]
h1fuelcell has joined #ruby
william3 has joined #ruby
al2o3-cr has quit [Ping timeout: 268 seconds]
d0nn1e has quit [Ping timeout: 258 seconds]
william3 has quit [Remote host closed the connection]
d0nn1e has joined #ruby
h1fuelcell has quit [Ping timeout: 265 seconds]
lorenzoscalfani has joined #ruby
gbgdev has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
SHyx0rmZ has joined #ruby
antoniobeyah has joined #ruby
Trynemjoel has quit [Ping timeout: 260 seconds]
lorenzoscalfani has quit [Ping timeout: 245 seconds]
h1fuelcell has joined #ruby
Guest18400 is now known as alamar
Snowy has quit [Ping timeout: 250 seconds]
william3 has joined #ruby
marr has joined #ruby
mikecmpbll has joined #ruby
buglessdr has joined #ruby
william3 has quit [Ping timeout: 250 seconds]
maattdd has joined #ruby
william3 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nettoweb has joined #ruby
rrawlins has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
biberu has joined #ruby
_joes__ has joined #ruby
Hobbyboy has joined #ruby
Tempesta has quit [Read error: Connection reset by peer]
LoneHerm_ has joined #ruby
Tempesta has joined #ruby
Tempesta has quit [Changing host]
Tempesta has joined #ruby
Derderderd has quit [Quit: leaving]
jtdoncas has joined #ruby
LoneHermit has quit [Ping timeout: 260 seconds]
bayed has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
hfp_work has quit [Ping timeout: 260 seconds]
aryaching_ has quit [Ping timeout: 268 seconds]
h1fuelcell has joined #ruby
aryaching has joined #ruby
hfp_work has joined #ruby
jtdoncas_ has quit [Ping timeout: 256 seconds]
Derderderd has joined #ruby
konsolebox has joined #ruby
ferr1 has joined #ruby
Devalo has joined #ruby
_joes__ has quit [Ping timeout: 250 seconds]
JeanCarloMachado has joined #ruby
emptyflask has joined #ruby
emptyflask has quit [Remote host closed the connection]
tomphp has joined #ruby
bturker has joined #ruby
Devalo has quit [Ping timeout: 260 seconds]
codfection has joined #ruby
charliesome has joined #ruby
vondruch_ is now known as vondruch
toretore has joined #ruby
SpiffTR has joined #ruby
gbgdev has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 258 seconds]
mark_66 has joined #ruby
haraoka has joined #ruby
triangles has quit [Quit: Leaving]
neanderslob has quit [Read error: Connection reset by peer]
jshjsh has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
z3uS has quit [Ping timeout: 250 seconds]
z3uS has joined #ruby
senayar has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
xrlk has quit [Ping timeout: 250 seconds]
h1fuelcell has joined #ruby
pawnbox_ has joined #ruby
Silthias1 has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
Silthias has quit [Ping timeout: 245 seconds]
bturker has quit [Ping timeout: 256 seconds]
h1fuelcell has quit [Remote host closed the connection]
h1fuelcell has joined #ruby
tvw has joined #ruby
r3vDev has joined #ruby
mg^ has quit [Ping timeout: 268 seconds]
pandaant has joined #ruby
dnicole has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
rodfersou has joined #ruby
nankyokusei has joined #ruby
ishe_ua has joined #ruby
al2o3-cr has joined #ruby
mg^ has joined #ruby
flying has joined #ruby
astrobunny has quit [Ping timeout: 268 seconds]
pandaant has quit [Remote host closed the connection]
h1fuelcell has quit [Remote host closed the connection]
nankyokusei has quit [Ping timeout: 250 seconds]
h1fuelcell has joined #ruby
jaruga___ has joined #ruby
aryaching has joined #ruby
Beams has joined #ruby
aknagi has joined #ruby
jeyraof has quit [Quit: This computer has gone to sleep]
kp__ has quit [Ping timeout: 260 seconds]
eggshke has quit []
xall has quit [Ping timeout: 260 seconds]
faces has quit [Read error: Connection reset by peer]
faces has joined #ruby
kp666 has joined #ruby
ConsoleFx has joined #ruby
<ConsoleFx> which I do this operation: > "0x71c033a0".pack('V') I am unable to execute this expression
<ConsoleFx> it returns an error
SpiffTR has quit [Quit: Leaving.]
workmad3 has joined #ruby
<ConsoleFx> it shows error like, NoMethodError: undefined method `pack' for "0x71c033a0":String
<ConsoleFx> do i call something like require 'String' or something?
bturker has joined #ruby
<ConsoleFx> i dont have rb coding idea
<ConsoleFx> thus this silly question
<apeiros> pack is Array#pack
<apeiros> unpack is on String
<apeiros> and I don't think that does what you want it to
<apeiros> V | Integer | 32-bit unsigned, VAX (little-endian) byte order
<apeiros> (from the pack docs)
<apeiros> "0x71c033a0" is not an integer, 0x71c033a0 is
<ConsoleFx> apeiros, so basically in buffer 0xa0 0x33 0xc0 0x71 would be stored right?
<apeiros> I don't know what you mean by that
<ConsoleFx> lets say i store the value in a variable
<ConsoleFx> of the above i.e. abc = "0x71c033a0".pack('V')
<al2o3-cr> ConsoleFx: you basically want this then [0x71c033a0].pack('V')
<ConsoleFx> abc would return 0xa0 0x33 0xc0 0x71 right?
z3uS has quit [Ping timeout: 268 seconds]
<ConsoleFx> al2o3-cr, oo yeah exactly...
<ConsoleFx> how can i print its corresponding hex values?
<ConsoleFx> i mean the return value (in hex)
workmad3_ has joined #ruby
bturker has quit [Ping timeout: 256 seconds]
djellemah_ has quit [Ping timeout: 258 seconds]
lxsameer has quit [Read error: Connection reset by peer]
<apeiros> ConsoleFx: what do you want to achieve?
workmad3 has quit [Ping timeout: 260 seconds]
<apeiros> because this sounds strongly like an xy problem
lxsameer has joined #ruby
adgtl has quit [Changing host]
adgtl has joined #ruby
adgtl has joined #ruby
<ConsoleFx> apeiros, I basically have an array with some hex streams... i want to know while the data is packed through 'V' what would be the complete hex strings
adgtl is now known as java
java is now known as adgl
h1fuelcell has quit [Remote host closed the connection]
adgl is now known as java
<ConsoleFx> i want to send this in tcp socket
java is now known as adgl
h1fuelcell has joined #ruby
adgl is now known as adgtl
<apeiros> if you pack, you get binary data, not hex
<apeiros> >> [0x71c033a0].pack("V")
<ruby[bot]> apeiros: # => "\xA03\xC0q" (https://eval.in/692372)
<apeiros> >> [0x71c033a0].pack("V")[0].ord.to_s(16)
<ruby[bot]> apeiros: # => "a0" (https://eval.in/692374)
william3 has quit [Remote host closed the connection]
<ConsoleFx> apeiros, yeah true.. what if I want to see what are its hex characters (there would be some non-printable chars).. i want to see their hex representations
<ConsoleFx> apeiros, something like [0x71c033a0].pack('V').hex
<apeiros> >> bindat = [0x71c033a0].pack("V"); ("%02x"*bindat.bytesize) % bindat.unpack("C*")
<ruby[bot]> apeiros: # => "a033c071" (https://eval.in/692375)
<apeiros> >> bindat = [0x71c033a0].pack("V"); ("0x%02x "*bindat.bytesize) % bindat.unpack("C*")
<ruby[bot]> apeiros: # => "0xa0 0x33 0xc0 0x71 " (https://eval.in/692376)
<ConsoleFx> apeiros, awesome!!! this is exactly what I wanted
workmad3 has joined #ruby
<ConsoleFx> sorry to ask the qstn in a different way
h1fuelcell has quit [Remote host closed the connection]
workmad3_ has quit [Ping timeout: 244 seconds]
jaguarmagenta has quit [Remote host closed the connection]
pawnbox has joined #ruby
h1fuelcell has joined #ruby
<ConsoleFx> thanks a lot, apeiros
<ConsoleFx> :)
pawnbox_ has quit [Read error: Connection reset by peer]
h1fuelcell has quit [Remote host closed the connection]
h1fuelcell has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
lenwood has joined #ruby
JeanCarloMachado has joined #ruby
SpiffTR has joined #ruby
djellemah has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
william3 has joined #ruby
iamawesome has joined #ruby
<iamawesome> Hi, is it possible to write website with ruby without using any ruby framework?
bestie has quit []
gbgdev has joined #ruby
bestie has joined #ruby
h1fuelcell has joined #ruby
mg^ has quit [Ping timeout: 258 seconds]
<manveru> iamawesome: sure, you know rack?
tuxaddicted has joined #ruby
lenwood has quit [Ping timeout: 250 seconds]
<manveru> or, if you want to do it without any external library, webrick still exists in stdlib
JeanCarloMachado has quit [Ping timeout: 250 seconds]
william3 has quit [Ping timeout: 250 seconds]
<iamawesome> manveru: Then I've to make something like rack by myself?
<adaedra> yeah, going down to rack looks like your goal
<manveru> the purpose of rack is to provide a common interface to all web servers
<iamawesome> What's the difference between rack and webrick?
<manveru> webrick is a pure ruby webserver
<adaedra> rack is a common interface between web servers and applications, webrick is just a webserver in ruby
JeanCarloMachado has joined #ruby
flashpoint9 has joined #ruby
<iamawesome> Can rack communicate with apache webserver?
<adaedra> Going rack will let you be compatible with multiple ruby web servers, like webrick, but also puma, unicorn, and so many others, as well as many gems providing middleware
<adaedra> I think that's what passenger is for but I don't know it well, but otherwise just do a reverse proxy
<manveru> rack can talk with apache via cgi or fcgi too
kith has quit [Read error: Connection reset by peer]
<manveru> though i don't think that's recommended these days :)
<manveru> and here's hello world on webrick: https://rosettacode.org/wiki/Hello_world/Web_server#Ruby
<adaedra> manveru one thing ticks me with the article you linked, it doesn't use the standard config.ru and instead instantiate the web server directly, which makes changing front-end a code change
william3 has joined #ruby
<manveru> true that
galtgendo has left #ruby [#ruby]
<manveru> i'm sure there are better examples that use rackup :)
fusmu has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
jxf has quit []
aryaching has quit [Ping timeout: 250 seconds]
<manveru> that for example
jxf has joined #ruby
beilabs has joined #ruby
Snowy has joined #ruby
xall has joined #ruby
iamawesome has left #ruby [#ruby]
iooner has joined #ruby
teotwaki has joined #ruby
cardoni has quit []
cardoni has joined #ruby
Cra2yZer0 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mg^ has joined #ruby
hardest has quit [Ping timeout: 245 seconds]
Tony-St4rk has quit []
r3vDev has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
teotwaki has quit [Ping timeout: 258 seconds]
iooner has quit [Ping timeout: 258 seconds]
ghostlight has quit [Ping timeout: 258 seconds]
tsunamie has quit [Ping timeout: 256 seconds]
Tony-St4rk has joined #ruby
Silox| has joined #ruby
kireevco has quit []
kireevco has joined #ruby
ghostlight has joined #ruby
wsmoak has quit []
tuxaddicted_back has joined #ruby
boxrick1 has quit []
wsmoak has joined #ruby
boxrick1 has joined #ruby
al2o3-cr has quit [Read error: Connection reset by peer]
tuxaddicted has quit [Ping timeout: 250 seconds]
al2o3-cr has joined #ruby
blackbombay has joined #ruby
iooner has joined #ruby
discopatrick has quit []
discopatrick has joined #ruby
peteretep has quit []
peteretep has joined #ruby
t-richards has quit []
iooner has quit [Ping timeout: 258 seconds]
t-richards has joined #ruby
blackbombay has quit [Ping timeout: 265 seconds]
teotwaki has joined #ruby
matp has quit [Max SendQ exceeded]
matp has joined #ruby
teotwaki has quit [Ping timeout: 258 seconds]
Devalo has joined #ruby
beilabs has quit [Remote host closed the connection]
beilabs has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
maattdd has quit [Ping timeout: 245 seconds]
Devalo has quit [Ping timeout: 248 seconds]
lenwood has joined #ruby
Tempesta has quit [Quit: See ya!]
beilabs has quit [Ping timeout: 256 seconds]
teotwaki has joined #ruby
last_staff has quit [Quit: last_staff]
yeticry has quit [Ping timeout: 250 seconds]
rann has quit []
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rann has joined #ruby
jtdoncas has quit [Ping timeout: 258 seconds]
tuxaddicted_back is now known as tuxaddicted
yeticry has joined #ruby
pawnbox has quit [Remote host closed the connection]
teotwaki has quit [Ping timeout: 258 seconds]
quoboo has quit []
mikecmpb_ has joined #ruby
mikecmpbll has quit [Ping timeout: 268 seconds]
Madplatypus has quit [Quit: Connection closed for inactivity]
synbit has joined #ruby
Tempesta has joined #ruby
beilabs has joined #ruby
pawnbox has joined #ruby
paralitix has joined #ruby
sparch has joined #ruby
Kestrel-029 has quit [Read error: Connection reset by peer]
kp666 has quit [Ping timeout: 260 seconds]
Nicmavr has joined #ruby
Nicmavr is now known as Guest47960
ndrst has quit [Ping timeout: 246 seconds]
bturker has joined #ruby
matp has quit [Max SendQ exceeded]
cjk101010 has quit [Ping timeout: 246 seconds]
ndrst has joined #ruby
teotwaki has joined #ruby
cjk101010 has joined #ruby
ndrst is now known as Guest97762
ptx0 has quit [Remote host closed the connection]
ptx0 has joined #ruby
matp has joined #ruby
hardest has joined #ruby
GodFather has joined #ruby
h1fuelcell has joined #ruby
h1fuelcell has quit [Remote host closed the connection]
tvw has quit []
kp666 has joined #ruby
SpiffTR has quit [Quit: Leaving.]
quoboo has joined #ruby
dcluna has joined #ruby
<paralitix> Hey, guys... I got a problem I've been trying to work out for hours now, but can't seem to nail it. I've got it to kind of work, but the results are very inconsistant and I'm just stumped. I'd appreciate it if someone could take a quick look at it. It's only about 10 lines of code. https://gist.github.com/paralitix/d5bb48542dc9165b32ec1d862eb2eb8c
fenre has quit [Remote host closed the connection]
SpiffTR has joined #ruby
pawnbox has quit [Read error: Connection reset by peer]
h1fuelcell has joined #ruby
pawnbox has joined #ruby
Snowy has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
Snowy has joined #ruby
uranellus has quit [Ping timeout: 246 seconds]
<toretore> paralitix: firstly, you should wait until you've changed all the lines before you write them back to the file
inoperable has quit [Ping timeout: 246 seconds]
yeticry has quit [Ping timeout: 265 seconds]
bigkevmcd has quit [Quit: Outta here...]
uranellus has joined #ruby
uranellus has quit [Changing host]
uranellus has joined #ruby
<toretore> so you'll have: original_lines = File.readlines('filename'); changed_lines = ...; File.open('filename', 'w'){|f| changed_lines.each{|l| f.write l } }
yeticry has joined #ruby
frozengeek____ has joined #ruby
<paralitix> makes, sense. I'll try messing with this a bit. thanks
nankyokusei has quit [Ping timeout: 248 seconds]
inoperable has joined #ruby
vayan has joined #ruby
<toretore> to begin with, just do `changed_lines = original_lines` to see that it does what you expect (the file doesn't change); then you can figure out how to create changed_lines the way you want
<paralitix> alright, I'll try that. I'll get back to you with results
azor has quit [Quit: Connection closed for inactivity]
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
ferr1 has quit [Read error: Connection reset by peer]
<apeiros> it's also considered good practice to write your changes to a new file, then remove the original, then rename the new file
<apeiros> that way, if your program crashes, you don't lose the original file
Silox| has quit []
jtdoncas has joined #ruby
ixti has joined #ruby
bayed has quit []
bayed has joined #ruby
Silox| has joined #ruby
eggshke has joined #ruby
<paralitix> I create a new textfile every time I run the program so it's no issue
haraoka has quit [Ping timeout: 268 seconds]
jtdoncas has quit [Ping timeout: 248 seconds]
workmad3 has quit [Ping timeout: 268 seconds]
xall has quit [Ping timeout: 244 seconds]
<nowz> is there a way in Ruby to have a variable useable on all my methods class ?! without using @var ?
<tobiasvl> nowz: what do you mean, "all my methods class"
<tobiasvl> all your class's methods, you mean?
<nowz> all methods in my class
<nowz> yes sorry
<tobiasvl> you should probably use @var. why don't you want to use @var?
<nowz> I cant :(
<nowz> Im at school, and it's forbidden
<tobiasvl> forbidden?
muelleme has joined #ruby
SpiffTR has quit [Quit: Leaving.]
<nowz> yes I already have the right to use one @page_name, no more
<tobiasvl> OK…
<nowz> and I set the filename in @page_name
<aknagi> nowz: Perhaps you could pass variables into methods as arguments to avoid setting an instance variable like this...
<nowz> im going to show you my code, wait
<aknagi> nowz: def my_method(my_var) ; puts my_var ; end
<tobiasvl> or you can use "define_method" :D (please don't)
mikecmpb_ has quit [Quit: inabit. zz.]
<aknagi> tobiasvl: :)
claudiuinberlin has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
emilkarl has joined #ruby
mikecmpbll has joined #ruby
<nowz> but it can't works like that :P
<aknagi> nowz: You could avoid setting @file by changing the method signature of the head method to "def head(file)". You'd need to make other modifications but that should hopefully set you of on the right path.
jaguarmagenta has joined #ruby
jtdoncas has joined #ruby
yeticry has quit [Ping timeout: 244 seconds]
claudiuinberlin has quit [Ping timeout: 260 seconds]
yeticry has joined #ruby
byte512 has joined #ruby
<nowz> yes but I cant use param to any other method except for dump one
<nowz> thats exercice is a bit creepy
dnicole has quit [Ping timeout: 258 seconds]
jaguarmagenta has quit [Ping timeout: 244 seconds]
<aknagi> nowz: I don't fully understand what you want to do, but generally you can avoid both parameters AND instance variables by making bigger methods.
dnicole has joined #ruby
<aknagi> nowz: That would mean you were working with "local variables", instead.
jtdoncas has quit [Ping timeout: 260 seconds]
<aknagi> Another option is to use global variables, but that is often considered very bad practice. Sorry if the terminology is a bit scary!
reverberations has joined #ruby
Emmanuel_Chanel has joined #ruby
<apeiros> nowz: you probably should look for what this lesson wants to teach you
<apeiros> pretty sure there's some concept you should be using which was taught recently
<apeiros> even more so since the proper answer to your question really is "use an @ivar", which is - as you said - forbidden.
<nowz> I found a solution, and I understood why I cant use @var ... Im using directly File.open().write() , the exercice is made for using after begin,raise,rescue !
<nowz> Im not supposed to use @var because they want us to make something that can directly write in a File and not in memory ...
<nowz> If im doing it with pry, step by step, and cat -e the file, there is nothing in it
SpiffTR has joined #ruby
<nowz> thats why they dont want us to use @file = File.open() @file.write()
<tobiasvl> huh?
<tobiasvl> @file.close()
<tobiasvl> and it should appear in the file
<tobiasvl> of course it's better to use a block, could that be what they mean?
<nowz> @file.close() i think it sync, but if my main program want to check the same file while my instance class is still used ... nothing in it
aryaching has joined #ruby
<nowz> sorry I know im not really good with english.
ConsoleFx has quit [Ping timeout: 250 seconds]
Cra2yZer0 has quit []
cibs has quit [Ping timeout: 268 seconds]
threh has joined #ruby
cibs has joined #ruby
lenwood has quit [Quit: Konversation terminated!]
workmad3 has joined #ruby
lenwood has joined #ruby
z3uS has joined #ruby
tvw has joined #ruby
<aknagi> nowz: I'm not sure if this helps, but here is a code fragment which writes to a file without a @var:
charliesome has quit [Ping timeout: 250 seconds]
maattdd has joined #ruby
<aknagi> nowz: File.open('/tmp/hi', 'w') { |f| f.write("Hello in file") }
Emmanuel_Chanel has quit [Ping timeout: 246 seconds]
tcpdump has joined #ruby
bigkevmcd has joined #ruby
<tcpdump> hey everyone
h1fuelce_ has joined #ruby
charliesome has joined #ruby
yeticry has quit [Ping timeout: 250 seconds]
<tcpdump> anyone know much about oauth 2.0?
x77686d has joined #ruby
yeticry has joined #ruby
GinoManWorks has joined #ruby
<aknagi> tcpdump: I'm afraid I find it very confusing, but have blundered along in the past. Maybe just shoot and see if anyone knows?
_ZerGabriel_ has joined #ruby
<apeiros> aknagi: that's verbose for File.write("/tmp/hi", "Hello in file") ;-)
h1fuelcell has quit [Ping timeout: 256 seconds]
<tcpdump> aknagi: yea, Im going to have to imploment it. I've been reading that its much easier to impliment using AD.
<aknagi> apeiros: Much better!
<tcpdump> And I've noticed there are a few good looking gems for it.
Emmanuel_Chanel has joined #ruby
<aknagi> tcpdump: What is AD? Active Directory?
<nowz> I made it like that, and Its accepted by my school : https://gist.github.com/jgengo/c115f822fe9d5a492036ffcd9c1904b8
h1fuelce_ has quit [Remote host closed the connection]
<tcpdump> aknagi: yea.
wugy has joined #ruby
<tcpdump> I was reading that If you use AD its takes out most of the manual design things.
<tcpdump> Which sounds appealing. I was hoping to find someone that had done it...
<tcpdump> but its apparently cryptic, and no one has done it outside a few random blogs. :D
charliesome_ has joined #ruby
charliesome has quit [Ping timeout: 245 seconds]
claudiuinberlin has joined #ruby
sdothum has joined #ruby
ryan_notabot has joined #ruby
<aknagi> tcpdump: I'm afraid I didn't integrate with AD. I was always using a combo of Devise and Doorkeeper. If you are working with AD could you avoid OAUTH 2 altogether?
<tcpdump> Well, no, because Im integrating to the Amazon hub and Google Home.
<tcpdump> Which both require it.
SpiffTR has quit [Quit: Leaving.]
livcd has quit [Remote host closed the connection]
<aknagi> tcpdump: But all your users are on MS systems and they have AD user accounts?
<tcpdump> aknagi: no, not at all. Apparently (just reading this - havent done it) if you have an AD server it will basically use the AD as the storage engine for the auth server.
johnmilton has joined #ruby
<tcpdump> My "users" are all consumers.
claudiuinberlin has quit [Ping timeout: 250 seconds]
<tcpdump> Just everyday users that pay for my services.
lxsameer has quit [Quit: WeeChat 1.6]
stoffus_ has joined #ruby
<aknagi> tcpdump: Sounds like a sledge hammer to crack a nut to me. OAUTH only needs a couple of tables to store an app id and app secrets for each app (Amazon Hub, Google Home), and tokens for each users. Not sure I'd want to run a MS Domain controller + set up duplicate users to get that; I must be missing something.
<tcpdump> aknagi: would each user have to be created individually?
<tcpdump> aknagi: you know of any pre-made solutions for it?
<tcpdump> that use SQL?
jtdoncas has joined #ruby
<aknagi> tcpdump: If you have a Ruby web app you should defo checkout Doorkeeper as a potential option.
stoffus has quit [Ping timeout: 246 seconds]
tdump has joined #ruby
eggshke has quit [Remote host closed the connection]
kn330 has joined #ruby
synthroid has joined #ruby
eggshke has joined #ruby
<tdump> Hello. I might be going about this all wrong, but I've written a class, and I want one of the methods I've defined to call another method I've defined in the same class. Is there a special syntax I need to use?
eggshke has quit [Remote host closed the connection]
stoffus has joined #ruby
eggshke has joined #ruby
aryaching has quit [Ping timeout: 260 seconds]
stoffus_ has quit [Ping timeout: 256 seconds]
<toretore> tdump: gist your code?
jtdoncas has quit [Ping timeout: 265 seconds]
<tdump> toretore: what's gist?
<tdump> toretore: oh it's a github code sharing thing. Give me one second
jaguarmagenta has joined #ruby
<tdump> toretore: https://git.io/v1uUC
SpiffTR has joined #ruby
<aknagi> tdump: Are you getting an error message / stack trace? Could you add that to the gist please?
<toretore> tdump: what aknagi said, and describe what you're trying to do
<tdump> alright. it's kinda wierd. This is problem from test first ruby. I'm trying to do the extra credit. I'll add the stuff to the gist...brb
matp_ has joined #ruby
r3vDev has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
Emmanuel_Chanel has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
matp has quit [Ping timeout: 260 seconds]
Devalo has joined #ruby
x77686d has quit [Quit: x77686d]
<paralitix> Hey, I've managed to print out the modified values of the text file the way they should be, but I'm stumped at how I can actually write them to the file, I feel like I can't quite get the synthax down, or I'm not sure what I'm missing really. https://gist.github.com/paralitix/d5bb48542dc9165b32ec1d862eb2eb8c
<tdump> aknagi: comment added
<tdump> toretore: comment added
<toretore> paralitix: ok, so you have changedLines = originalLines, meaning they're the same. what you want to do is `changedLines = something that returns the changed lines`
ryan_notabot has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
<toretore> paralitix: so you have an array, and you want to produce an array of equal size with different values
<toretore> paralitix: this is what map does:
<toretore> >> [1,2,3].map{|n| n + 1 }
<ruby[bot]> toretore: # => [2, 3, 4] (https://eval.in/692460)
Devalo has quit [Ping timeout: 268 seconds]
<toretore> >> original = [1,2,3]; changed = original.map{|n| n + 1 }; changed
<ruby[bot]> toretore: # => [2, 3, 4] (https://eval.in/692461)
CloCkWeRX has quit [Ping timeout: 246 seconds]
<paralitix> hmm, ok I don't know what map is. I'll check it out
<toretore> hint: changedLines = originalLines.map do |line|
<aknagi> tdump: This won't get you all the way there, but you might want to start with...
<aknagi> operations = { :+ => :plus ... etc ...
<tdump> aknagi: ok I'll give it a shot. Thanks. Does the overall approach seem to make sense?
<tdump> aknagi: it made sense to me hahah!
<aknagi> tdump: Looks good at a glance. Note that later if you want to invoke the plus method you could do: "self.send(:plus)"
<tdump> aknagi: ok I'm gonna screw around with it for a bit. thanks again
yeticry has quit [Ping timeout: 244 seconds]
<aknagi> tdump: yw
tyang has joined #ruby
yeticry has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
x77686d has joined #ruby
tuxaddicted has quit [Quit: Leaving]
synthroi_ has joined #ruby
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Chair has joined #ruby
synthroid has quit [Ping timeout: 244 seconds]
Emmanuel_Chanel has joined #ruby
<nchambers> does ruby have anything like python's generators?
<dminuoso> nchambers: What is a generator?
<dminuoso> Oh yes.
<dminuoso> nchambers: Enumerator.
SpiffTR has quit [Quit: Leaving.]
<dminuoso> Same thing.
<nchambers> dminuoso, def foo(): yield 1; yield 2; yield 3; # when doing for item in foo(): it returns 1 then 2 then 3 instead of returning an array then iterating over that
<nchambers> thanks
CloCkWeRX has joined #ruby
hs366 has joined #ruby
gbgdev has quit [Read error: Connection reset by peer]
npgm has quit [Quit: Connection closed for inactivity]
gbgdev has joined #ruby
codfection has quit [Remote host closed the connection]
User458764 has joined #ruby
User458764 has quit [Max SendQ exceeded]
User458764 has joined #ruby
bmurt has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
c355e3b has joined #ruby
last_staff has joined #ruby
omphe has joined #ruby
cdg has joined #ruby
allcentury has joined #ruby
<kke> is there some nice way to do: YAML.dump(value: obj)[/value: (.*)/, 1].chomp ?
h1fuelcell has joined #ruby
<apeiros> YAML.dump(obj) ?
x77686d has quit [Quit: x77686d]
_ZerGabriel_ has quit []
<apeiros> would also be less broken in case of the dump spanning more than 1 line
pandaant has joined #ruby
gbgdev has quit [Ping timeout: 245 seconds]
<kke> >> YAML.dump(true)
<ruby[bot]> kke: # => uninitialized constant YAML (NameError) ...check link for more (https://eval.in/692467)
<kke> >> require 'yaml'; YAML.dump(true)
<ruby[bot]> kke: # => "--- true\n...\n" (https://eval.in/692468)
nankyokusei has joined #ruby
<kke> that won't work if i have something like value: $FOO
<kke> >> require 'yaml'; YAML.dump('"')
<apeiros> why?
<ruby[bot]> kke: # => "--- \"\\\"\"\n" (https://eval.in/692469)
<kke> >> require 'yaml'; puts "value: #{YAML.dump(true)}"
<ruby[bot]> kke: # => value: --- true ...check link for more (https://eval.in/692470)
<apeiros> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
Sammichmaker has quit [Ping timeout: 256 seconds]
<kke> because it will have those three lines and sometimes trailing three dots.
<apeiros> that does not really explain why that won't work.
<apeiros> anyway, resolve the xy first please.
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
h1fuelcell has quit [Ping timeout: 244 seconds]
Ishido has joined #ruby
kp666 has quit [Ping timeout: 245 seconds]
naprimer_3 has joined #ruby
nankyokusei has quit [Ping timeout: 260 seconds]
gbgdev has joined #ruby
naprimer_2 has quit [Ping timeout: 248 seconds]
Hyuk has joined #ruby
kp666 has joined #ruby
hightower2 has quit [Ping timeout: 268 seconds]
hightower2 has joined #ruby
quiller has quit [Ping timeout: 245 seconds]
muelleme has quit [Ping timeout: 246 seconds]
emilkarl has quit [Quit: Textual IRC Client: www.textualapp.com]
quiller has joined #ruby
deadnull has joined #ruby
<tdump> aknagi: I did it! That send method is where it's at!
<apeiros> tdump, aknagi: should use public_send, not send
<apeiros> (unless your methods are private and you're calling from the "inside" of the object, or you want to knowingly bypass visibility)
<dminuoso> apeiros: Can we have ruby[bot] tell people if it detects /\w\.send[ (]/ ?
<apeiros> hm…
<ljarvis> that'll send us all notifications
ramortegui has joined #ruby
<apeiros> is that a good idea?
<ljarvis> ^ meta
<apeiros> ljarvis: publicly!
saneax is now known as saneax-_-|AFK
<tdump> apeiros: Thanks. I'll look at the documentation for that. I think I am calling from "inside" of the object though.
<dminuoso> apeiros: It always makes me smile to see candide in ##c people point out peoples stupidity when they paste "sizeof(char)" :-)
Silox| has quit [Quit: Connection closed for inactivity]
<dminuoso> apeiros: So.. I don't know!
<dminuoso> :-)
synthroid has joined #ruby
<ljarvis> I'd probably just add a factoid
hutch34 has joined #ruby
<ljarvis> ?send
<ruby[bot]> ljarvis: I don't know anything about send
<dminuoso> I'd rather name it public_send
xberg_ has joined #ruby
<ljarvis> but it's longer
<dminuoso> Fair enough
<ljarvis> *cries into my keyboard*
<dminuoso> Speaking of adding things, where is adaedra? Our doc bot is still linking to old docs.
<adaedra> Hello
<aknagi> tdump: Well played! :)
<dminuoso> hello adaedra :)
xberg has quit [Ping timeout: 248 seconds]
iMadper has joined #ruby
<apeiros> !fact add send Favor public_send over send. Use send only if you want to either explicitly bypass visibility, or call the object's own private methods
<ruby[bot]> apeiros: I will remember that send is Favor public_send over send. Use send only if you want to either explicitly bypass visibility, or call the object's own private methods
<_derpy> Hello dminuoso
<apeiros> ?send ljarvis
<ruby[bot]> ljarvis: Favor public_send over send. Use send only if you want to either explicitly bypass visibility, or call the object's own private methods
CloCkWeRX has quit [Quit: Leaving.]
<apeiros> !fact alias send public_send
<ruby[bot]> apeiros: I will remember that send is also called public_send.
<apeiros> ljarvis, dminuoso: ^ good?
synthroi_ has quit [Ping timeout: 246 seconds]
<dminuoso> apeiros: Im unsure how bypassing visibility is different from "objects own private methods" - but sure
<apeiros> one is dynamically call your own private methods
<apeiros> the other is dynamically call another object's private methods
<apeiros> the former does not actually violate visibility. but public_send won't work for that case.
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jhack has joined #ruby
<_derpy> >> RUBY_VERSION
<_derpy> u wot m8
<apeiros> e.g. `def foo; send(:my_own_private_method); end` vs. `def foo; @plerp.send(:foreign_private_method); end`
_derpy is now known as `derpy
<elomatreb> Why don't we just let the bot run everything pasted here through rubocop and paste the output? :P
<aknagi> dminuoso: apeiros: In the context of his code, public_send would be odd; so I'm not sure making a bot would make sense.
<`derpy> >> RUBY_VERSION
<ruby[bot]> `derpy: # => "2.3.0" (https://eval.in/692475)
<`derpy> I'm not the only one lacking versions :o)
<apeiros> aknagi: his code is no longer gisted. why would it be odd?
antoniobeyah has joined #ruby
<aknagi> He was using send inside an instance of a class, to call another method in that instance.
r3vDev has quit [Ping timeout: 244 seconds]
<aknagi> oh god, sorry, did I just message all a people :(
rodfersou is now known as rodfersou|lunch
<apeiros> yes. that's fine?
rrawlins has quit [Remote host closed the connection]
<apeiros> both even. public_send in the instance to call another method in that instance. and messaging all people :)
jenrzzz has quit [Ping timeout: 248 seconds]
<apeiros> if the methods to be called are public, use public_send. always.
deadnull is now known as _deadnull
<apeiros> and if you use send to call private methods, verify that you really have to do so.
<aknagi> Oh dammit. I was hoping I didn't, how embarrassing.
<apeiros> why?
<apeiros> by messaging all people I mean you sent to the channel - just in case that's not what you meant by "message all people"
_deadnull is now known as deadnull
millerti has joined #ruby
Guest47960 has quit [Changing host]
Guest47960 has joined #ruby
Guest47960 is now known as Nicmavr
govg has quit [Ping timeout: 260 seconds]
<aknagi> apeiros: An you see a message from me that list every name beggining with a? Like Able Andrew Adame ... etc
<apeiros> no
<aknagi> Oh phew. My client must have a strange bug.
adavia has joined #ruby
kareelee_ has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
<paralitix> Can I use .map to target only specific indexes in the array?
pawnbox has quit [Remote host closed the connection]
<adaedra> use a condition inside the map
<apeiros> paralitix: you could, but it's probably a poor solution
<apeiros> map.with_index + condition
<`derpy> &ri String dminuoso
<adaedra> (Boo me, the ruby version is hardcoded :d )
william3 has quit [Remote host closed the connection]
<paralitix> So what solution would you recommend
GodFather has quit [Ping timeout: 268 seconds]
kareelee has quit [Ping timeout: 258 seconds]
tdump has quit [Remote host closed the connection]
william3 has joined #ruby
pawnbox has joined #ruby
synthroi_ has joined #ruby
<apeiros> paralitix: explain your full problem. the question whether a better solution exists depends on what your actual problem is.
<paralitix> I have this function here. I want it to change 2 specific values of every line in the text file to rand(100)
<paralitix> I was suggested to use map there... but I'm a little confused about it. I've never used map before either.
synthroid has quit [Ping timeout: 256 seconds]
<apeiros> [3,4].each do |idx| lineValues[idx] = rand(100) end
<apeiros> btw., in that "test print" line, use p, not puts. better for development purposes.
tau has joined #ruby
william3 has quit [Ping timeout: 250 seconds]
stoffus has quit [Quit: leaving]
<paralitix> oh ok, I see... alright lemme mess around a bit with your suggestion
stoffus has joined #ruby
_sfiguser has joined #ruby
GodFather has joined #ruby
workmad3 has quit [Ping timeout: 265 seconds]
<paralitix> Should it be something along the lines of this?
<paralitix> lineValues[3, 4].each do |idx| lineValues[idx.to_i] = rand(100) end
stoffus has quit [Client Quit]
stoffus has joined #ruby
<apeiros> paralitix: what do you think is the difference between 3 and 3.to_i ?
<paralitix> it was throwing me an error without the to_i
<apeiros> ay, yes, I see why
<apeiros> no. it's not that. it's really precisely the code I gave you.
<apeiros> lineValues[3,4] gives you 4 items in lineValues, starting at offset 3
synthroid has joined #ruby
<apeiros> and then you iterate over those items
tdump has joined #ruby
<paralitix> It just replaces the entire line with those 2 values only. And it doesn't even randomize them either
DLSteve_ has joined #ruby
Snowy has quit [Remote host closed the connection]
<paralitix> it looks like it makes it into a hash
synthroi_ has quit [Ping timeout: 250 seconds]
<apeiros> gist your code. tell us how you figure that it makes it into a hash.
rrawlins has joined #ruby
last_staff has quit [Quit: *poof*]
<paralitix> I can't tell you why... the output just looks like a hash, hang on
rippa has joined #ruby
x77686d has joined #ruby
rrawlins has quit [Remote host closed the connection]
<apeiros> that's "I can tell you. the output looks like a hash. here is the output" :-p
govg has joined #ruby
<paralitix> The 2nd one
kp__ has joined #ruby
workmad3 has joined #ruby
<apeiros> ok, explain me how you understand how map works
h1fuelcell has joined #ruby
<paralitix> As I understand it you can use it to change elements in an array
kp666 has quit [Ping timeout: 265 seconds]
Wizznt has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
blackbombay has joined #ruby
bronson has joined #ruby
<apeiros> that's not what it does, no
<paralitix> I just heard about .maps earlier, I haven't managed to get it to work. Honestly I feel like I was coser to my desired result without it.
ramortegui has quit [Quit: Ex-Chat]
<apeiros> map will return a new array. map applies a function (the block you provide to it) to all elements, using it to map the value to a new value.
<apeiros> >> [1,2,3].map { |item| item + 10 }
<ruby[bot]> apeiros: # => [11, 12, 13] (https://eval.in/692486)
<apeiros> the original array is untouched.
kp__ has quit [Ping timeout: 250 seconds]
emilkarl has joined #ruby
<apeiros> so map depends on the *return value* of your block. what is the return value of your map-block in the 2nd file in the gist?
tdump_ has joined #ruby
skalfyfan has joined #ruby
<paralitix> [[3,4], [3,4], [3,4], [3,4], [3,4]]
nopolitica has joined #ruby
<paralitix> Amount of times there are lines in my text file
h1fuelcell has quit [Ping timeout: 260 seconds]
<apeiros> ok, that's not what I meant. what is in general the return value of a block?
tdump has quit [Ping timeout: 258 seconds]
<paralitix> I'm not sure
<apeiros> then either take a shot, or find it out
skalfyfan has quit [Client Quit]
SpiffTR has joined #ruby
jhack has quit [Quit: jhack]
hutch34 has quit [Ping timeout: 258 seconds]
skalfyfan has joined #ruby
tdump has joined #ruby
User458764 has joined #ruby
tdump has quit [Remote host closed the connection]
grh has quit [Ping timeout: 244 seconds]
r3vDev has joined #ruby
<paralitix> ok, thanks.
tdump has joined #ruby
tdump has quit [Remote host closed the connection]
beilabs has quit [Remote host closed the connection]
blackbombay has quit [Ping timeout: 248 seconds]
beilabs has joined #ruby
tdump_ has quit [Ping timeout: 256 seconds]
beilabs has quit [Read error: Connection reset by peer]
beilabs has joined #ruby
stoffus has quit [Quit: leaving]
cdg_ has joined #ruby
TomyWork has quit [Remote host closed the connection]
polishdub has joined #ruby
blackbombay has joined #ruby
TomyWork has joined #ruby
matp_ has quit [Quit: ZZzzzZz...]
beilabs has quit [Ping timeout: 244 seconds]
Snowy has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lenwood has joined #ruby
jhack has joined #ruby
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
kn330 has quit [Ping timeout: 248 seconds]
DLSteve_ has joined #ruby
digitalfiz has quit [Quit: Updating details, brb]
cibs has quit [Ping timeout: 268 seconds]
Fernando-Basso has joined #ruby
cibs has joined #ruby
vaxxon has joined #ruby
fmcgeough has joined #ruby
someish has joined #ruby
Devalo has joined #ruby
pawnbox has quit [Remote host closed the connection]
<guardian> hello, when I do "foo, bar, baz".to_json, why do I get "\""foo, bar, baz\"" ?
sdwrage has quit [Quit: Leaving]
beilabs has joined #ruby
<guardian> the " in "foo, bar, baz" are not part of the string, so why do they get escaped?
SpiffTR has quit [Quit: Leaving.]
digitalfiz has joined #ruby
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
Devalo has quit [Ping timeout: 246 seconds]
ResidentBiscuit has joined #ruby
xberg_ has quit [Remote host closed the connection]
patarr has joined #ruby
littlemyu has joined #ruby
vaxxon has quit [Quit: leaving]
ariedler has joined #ruby
beilabs has quit [Remote host closed the connection]
beilabs has joined #ruby
aryaching has joined #ruby
Burgestrand has joined #ruby
<aknagi> guardian: If you do `puts "foo, bar, baz".to_json`, then you'll see "foo, bar, baz". If you then check that against the rules of JSON on json.org you'll see that it is correct, and without the quotes it would not be valid JSON.
allcentury has quit [Ping timeout: 245 seconds]
<guardian> well the point is, later in Javascript, I'm seeing ""foo, bar, baz""
allcentury has joined #ruby
kareelee_ has quit [Remote host closed the connection]
edwardly has quit [Max SendQ exceeded]
h1fuelcell has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
edwardly has quit [Max SendQ exceeded]
jtdoncas has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
rory has left #ruby [#ruby]
<guardian> I don't want the JSON string to contain enclosing quotes
ascarter has joined #ruby
SesMan has joined #ruby
antoniobeyah has joined #ruby
<aknagi> guardian: That's odd. That implies that if you sent the client "foo,bar,baz" without first calling #to_json on it then that would do what you wanted :/ I've not seen that behavoir before I'm afriad.
emptyflask has joined #ruby
<aknagi> guardian: It sounds like your client is might not be parsing what you sending it as json, and is instead just "eval"ing it; but that's a shot in the dark
jtdoncas has quit [Ping timeout: 258 seconds]
<guardian> it definitely does
<guardian> even in Javascript, JSON.stringify("foo") will produce ""foo""
<toretore> which is correct
<guardian> and I wanted to use .to_json to escape what I don't control in the string that has to be escaped by the JSON spec
<toretore> you are either: 1) confused about representation, or 2) double encoding
ascarter has quit [Ping timeout: 258 seconds]
ascarter_ has joined #ruby
MarkFletcher has joined #ruby
<toretore> guardian: look in your browsers network tab to see what is actually sent from the server
rodfersou|lunch has quit [Ping timeout: 258 seconds]
x77686d has quit [Quit: x77686d]
william3 has joined #ruby
<toretore> if it looks ok, it has something to do with how you're 1) inspecting it, or 2) parsing it in your js
<guardian> I just wanted to sanitize a string
<aknagi> guardian: BTW in addition to that you might note that JSON.parse(JSON.stringify("foo")) === "foo"
toretore has quit [Quit: Leaving]
toretore has joined #ruby
pawnbox has joined #ruby
bturker_ has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
aganov has quit [Remote host closed the connection]
<aknagi> Ok, I just confused myself. JSON.parse("foo".to_json) results in JSON::ParserError. I'm going to throw my computer away and take up gardening.
davidt has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
william3 has quit [Remote host closed the connection]
bturker has quit [Ping timeout: 256 seconds]
<guardian> in fact that's a double encoding issue
antoniobeyah has joined #ruby
<guardian> thanks for pointing me into the right direction
x77686d has joined #ruby
shinnya has joined #ruby
<apeiros> aknagi: ruby's json parser follows an older spec and requires an object or array as root
bturker_ has quit [Ping timeout: 256 seconds]
<aknagi> apeiros: Phew, thanks It's freezing outside, and the garden looks fine anyway.
<antoniobeyah> “foo” is valid json? had no idea
<apeiros> antoniobeyah: newer specs, yes
<apeiros> it used to be invalid
<apeiros> but don't ask me when that changed. I'd have to look it up :)
<antoniobeyah> how would you access it?
<antoniobeyah> i.e. what would a parse retunr
jrafanie has joined #ruby
<apeiros> well, '"foo"' is valid
jrafanie has quit [Client Quit]
<apeiros> try in your browser: JSON.parse('"foo"')
<toretore> it was changed in https://tools.ietf.org/html/rfc7158
<apeiros> the return value is "foo"
<apeiros> same for JSON.parse("123") -> 123
ascarter has joined #ruby
<toretore> i was just looking at it because i thought it still required a map as the root
<apeiros> ok, so 3y ago. wow. that long ago already.
govg has quit [Ping timeout: 250 seconds]
<adaedra> u old
<apeiros> adaedra: no wonder. I existed before the universe. of course I'm old :o)
<antoniobeyah> hmm not sure how I feel about that
<antoniobeyah> feels busted
<toretore> like and share if you remember rfc 4627
ascarter has quit [Read error: Connection reset by peer]
<apeiros> antoniobeyah: IMO that's how it should have been from the beginning
<antoniobeyah> whats the purpose?
<adaedra> xml 4 ever
<apeiros> antoniobeyah: well, what's the purpose of requiring an array or object as root?
ascarter_ has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
<antoniobeyah> to write code like: for x in items
<apeiros> this way you're not artificially limited to 2 out of 7(?) literals as root
<antoniobeyah> i’m just not sure how you would handle it in code, thats all
<toretore> if it was just object i'd be ok with it
<apeiros> antoniobeyah: allowing scalars as root doesn't stop you from doing that?
<apeiros> I mean you can still require your input to be an object or an array at the root. and you can even assert it.
jacksinn has joined #ruby
<antoniobeyah> yeah I suppose
x77686d has quit [Quit: x77686d]
<antoniobeyah> just feels odd to me to not have some sort of object there
antoniobeyah has quit [Quit: antoniobeyah]
fusmu has quit [Ping timeout: 245 seconds]
<apeiros> I remember having had to artificially wrap a scalar into an object like {value: scalar}. that felt odd. (I don't remember the use-case)
ascarter has quit [Read error: Connection reset by peer]
<toretore> i prefer always using objects, that way everything has a name
ascarter has joined #ruby
govg has joined #ruby
<toretore> {status: "ok", errors: [], response: {...}} vs [1, null, {...}]
antoniobeyah has joined #ruby
SesMan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Remote host closed the connection]
<apeiros> yeah, I think the only case where I have an array as root is in my index api's
pawnbox has joined #ruby
<apeiros> actually… even there I have an object: {data: […], offset: N, limit: N, totalCount: N, …}
<antoniobeyah> lol, just return “yes”
<antoniobeyah> get /items -> “yes"
tdump has joined #ruby
<toretore> get /items -> null
<apeiros> get /items -> status: 418, message: "I'm a teapod"
rodfersou|lunch has joined #ruby
dcluna has quit [Ping timeout: 246 seconds]
<toretore> i think the most compelling reason for "always use objects" is that it lets you extend with lower chance of breaking current usage
<apeiros> true
<apeiros> that's also why I like kwargs
<apeiros> besides of them having names
<toretore> yep
_djbkd has quit [Remote host closed the connection]
<toretore> unnamed and positional = bad :(
djbkd has joined #ruby
maattdd has quit [Ping timeout: 245 seconds]
<apeiros> it can be ok for 1-2 arguments
<apeiros> I mean things like io.puts, or array.push - no need to name those args
bronson has quit [Remote host closed the connection]
<toretore> yeah, it's simpler, but i'd be ok if all there was was kwargs
Snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has quit [Ping timeout: 268 seconds]
<toretore> there's not much difference between `def foo(bar:)` and `def foo(bar)`
tdump has quit [Ping timeout: 250 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<toretore> calling is of course different and slightly more tedious
<toretore> anyway, enough rambling, dinner time
anuxivm has joined #ruby
<apeiros> bon apps :)
<paralitix> Hey, guys. I'm at the absolute end of my line here, I can't even think straight anymore, but I feel like I'm so close. Can someone just tell me how to solve this problem I have?
<paralitix> the first gist.
rodfersou|lunch has quit [Ping timeout: 260 seconds]
<paralitix> I don't know how to use .maps , but I gave it a shot, didn't change much, probably because i'm using it wrong
<apeiros> it's .map, not .maps
someish has quit [Quit: someish]
<paralitix> yeah, that's what I means
william3 has joined #ruby
<apeiros> have you found out what a block returns?
<paralitix> no, it just raised more questions. I don't even know what a block is
djbkd has quit [Ping timeout: 260 seconds]
<paralitix> a snippet of code or something? in between the {} ?
rodfersou|lunch has joined #ruby
jrafanie has joined #ruby
<apeiros> ok, I'm not sure whether I want to continue here. I enjoy helping. but I don't want to teach ruby 101 here. IMO you should do that on your own, or try ##new2ruby
<apeiros> and this stuff is understanding ruby basics
<paralitix> So when I grasp the concept of "block", i'll have a clearer picture?
<apeiros> yes
<apeiros> blocks are a very important part of how ruby works
<paralitix> Ok, I'll look better into it. thanks
antoniobeyah has quit [Quit: antoniobeyah]
<apeiros> yw. as said, ##new2ruby probably has people who are willing to also teach ruby 101, if you want to try there.
<paralitix> Alright thanks, I didn't know about that channel
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kareelee has joined #ruby
chouhoulis has joined #ruby
Hyuk has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
Hyuk has joined #ruby
dviola has joined #ruby
someish has joined #ruby
Devalo has joined #ruby
bturker has joined #ruby
Trynemjoel has joined #ruby
c_nick has joined #ruby
c_nick has left #ruby [#ruby]
c_nick has joined #ruby
<c_nick> Hi anyone has any experience on batch jobs and roby copy ?
jenrzzz has joined #ruby
Silthias1 has quit [Ping timeout: 248 seconds]
Silthias has joined #ruby
dunpeal has joined #ruby
brent__ has joined #ruby
<dunpeal> What's the most idiomatic way to write: `val.nil? : 0 ? val`
antoniobeyah has joined #ruby
<apeiros> val || 0
<dunpeal> apeiros: not quite the same, since it will return 0 if val is any falsey value.
<c_nick> how to get the output of robocopy in a batch job
<apeiros> except if `false` is also valid. but if false, nil and 0 are valid, then IMO you have a variable with an identity issue :)
littlemyu has quit [Remote host closed the connection]
synthroi_ has joined #ruby
<apeiros> dunpeal: ^
Burgestrand has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
* apeiros back in ~30min
<dunpeal> thanks.
bronson has joined #ruby
jaruga___ has quit [Quit: jaruga___]
jenrzzz has quit [Ping timeout: 250 seconds]
synthroid has quit [Ping timeout: 268 seconds]
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yqt has joined #ruby
matp has joined #ruby
patarr has quit [Ping timeout: 265 seconds]
aufi has quit [Quit: Leaving]
Ishido has quit [Read error: Connection reset by peer]
chouhoulis has quit [Remote host closed the connection]
kareelee has quit [Remote host closed the connection]
chouhoulis has joined #ruby
xrlk has joined #ruby
flashpoint9 has quit [Remote host closed the connection]
lenwood has quit [Ping timeout: 260 seconds]
Ishido has joined #ruby
theRoUS has quit [Quit: Coyote finally caught me]
kareelee has joined #ruby
npgm has joined #ruby
nettoweb has joined #ruby
chouhoulis has quit [Ping timeout: 244 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
wugy has quit []
deadnull is now known as _deadnull
chouhoulis has joined #ruby
x77686d has joined #ruby
_deadnull has quit [Quit: AFK]
patarr has joined #ruby
konsolebox has quit [Ping timeout: 244 seconds]
kareelee has quit [Ping timeout: 260 seconds]
Dimik has joined #ruby
<nchambers> Hello! I am writing a gem for a project of mine. Most of it is going to be in ruby, but some of it is going to be in C (mostly bindings to some other code). If I just have the C part in there, it compiles fine with `rake compile`, and I can build the gem successfully and use it in IRB. but when I add ruby files (so something like lib/mygem.rb) and put that in the gemspec, then rebuild/reinstall, it doesn't l
<nchambers> extension, only in mygem.rb. Am I missing something?
aknagi has quit [Quit: Leaving]
h1fuelcell has quit [Remote host closed the connection]
andikr has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
Devalo has quit [Remote host closed the connection]
tvw has quit [Remote host closed the connection]
skweek has joined #ruby
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
OTORelic has joined #ruby
william3 has quit [Remote host closed the connection]
william3 has joined #ruby
deadnull has joined #ruby
dionysus69 has joined #ruby
maattdd has joined #ruby
synbit has quit [Quit: Ex-Chat]
blaxter has quit [Quit: foo]
ixti has quit [Ping timeout: 268 seconds]
Snowy has quit [Remote host closed the connection]
konsolebox has joined #ruby
kareelee has joined #ruby
Rutix`away is now known as Rutix
c_nick has quit [Ping timeout: 260 seconds]
<apeiros> nchambers: your message got chomped
<apeiros> "it doesn't l"
flashpoint9 has joined #ruby
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has quit [Ping timeout: 250 seconds]
hutch34 has joined #ruby
flashpoi_ has joined #ruby
frozengeek____ has quit [Quit: frozengeek____]
etehtsea has quit [Quit: Textual IRC Client: www.textualapp.com]
kareelee has quit [Ping timeout: 265 seconds]
frozengeek____ has joined #ruby
x77686d has quit [Quit: x77686d]
flashpoint9 has quit [Ping timeout: 258 seconds]
Chair has quit [Ping timeout: 258 seconds]
hutch34 has quit [Ping timeout: 248 seconds]
rodfersou|lunch has quit [Quit: leaving]
rodfersou has joined #ruby
deadnull is now known as _deadnull
_deadnull has quit [Quit: AFK]
latemus has quit [Quit: leaving]
<nchambers> apeiros, oh thanks
Salih has joined #ruby
Salih has joined #ruby
Salih has quit [Changing host]
tdump has joined #ruby
amclain has joined #ruby
<nchambers> ... rebuild/reinstall, it doesn't let me use any of the functions defined in the C extension, only in mygem.rb. Am I missing something?
<apeiros> you say without the ruby files, it works?
<apeiros> what's the require for the extension, what's the require for the ruby file?
<OTORelic> ^
dbruns has joined #ruby
rodferso1 has joined #ruby
skweek has quit [Ping timeout: 248 seconds]
rodfersou has quit [Ping timeout: 250 seconds]
rodferso1 is now known as rodfersou
Snickers has joined #ruby
tdump has quit [Ping timeout: 258 seconds]
william3 has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 256 seconds]
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Eiam has joined #ruby
Ishido has quit [Read error: Connection reset by peer]
kareelee has joined #ruby
xberg has joined #ruby
patarr has joined #ruby
Ishido has joined #ruby
ascarter has joined #ruby
reverberations has quit [Ping timeout: 250 seconds]
kareelee_ has joined #ruby
<nchambers> apeiros, sorry had to step away
conta has joined #ruby
skweek has joined #ruby
someish has quit [Quit: someish]
<nchambers> without the .rb file, I just do require 'wish' in my program. When I add lib/wish.rb, I add require_relative './wish' in it, then require 'wish' in my code again
kareelee has quit [Ping timeout: 244 seconds]
<apeiros> yeah, that'd be your issue then :)
<nchambers> oh
<apeiros> you're shadowing your native extension
<nchambers> ah
<nchambers> so I need to name the native one something else?
<apeiros> yes
patarr has quit [Ping timeout: 256 seconds]
<nchambers> ok thanks
<apeiros> and require_relative won't find it
skalfyfan has joined #ruby
<nchambers> my native extension?
<apeiros> yes
<nowz> is there a way to pass 2 arguments in a Error Class with raise ?
<nchambers> apeiros, so just require?
<nowz> if File.file?(@page_name + ".html")
<nowz> raise Dup_file, @page_name, file ?
<nchambers> or do I need an include?
<apeiros> nowz: sure. raise FooException.new(arg1, arg2)
<nowz> ok ty
<apeiros> nchambers: just require
<apeiros> include is unrelated to code loading
<nchambers> ok cool
<nchambers> thanks
kareelee_ has quit [Ping timeout: 260 seconds]
frozengeek____ has quit [Quit: frozengeek____]
<apeiros> nchambers: while developing (i.e. gem is not yet installed) you may have to ensure $LOAD_PATH is properly set up
<nchambers> ok
william3 has joined #ruby
<nchambers> what should it contain?
<apeiros> e.g. `irb -Ilib -Iext -rwish`
<apeiros> works the same with pry and ruby
UserJosh has joined #ruby
<nchambers> ok cool
<apeiros> assuming lib/wish.rb contains `require 'wish_ext'` and there's ext/wish_ext.so
benlieb has joined #ruby
<apeiros> note, that's I, capital i, not lowercase L
xall has joined #ruby
MarkFletcher has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit []
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jshjsh has quit [Ping timeout: 268 seconds]
skweek has quit [Ping timeout: 260 seconds]
william3 has quit [Ping timeout: 260 seconds]
xall has quit [Ping timeout: 265 seconds]
jaguarmagenta has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 268 seconds]
skalfyfan has quit [Quit: Textual IRC Client: www.textualapp.com]
mikecmpbll has quit [Quit: inabit. zz.]
skalfyfan has joined #ruby
gusrub has joined #ruby
kareelee has joined #ruby
patarr has joined #ruby
Rodya_ has joined #ruby
User458764 has joined #ruby
tenderlove has quit [Ping timeout: 265 seconds]
c_nick has joined #ruby
jtdoncas has joined #ruby
sp4rrow has joined #ruby
tomphp has quit [Ping timeout: 268 seconds]
kareelee has quit [Ping timeout: 246 seconds]
c_nick has quit [Client Quit]
Silthias has quit [Quit: Leaving.]
Beams has quit [Quit: .]
marr has quit [Ping timeout: 250 seconds]
patarr has quit [Ping timeout: 265 seconds]
flying has quit []
bronson has quit [Remote host closed the connection]
jtdoncas has quit [Ping timeout: 260 seconds]
synthroi_ has quit [Remote host closed the connection]
synthroid has joined #ruby
marr has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
kareelee has joined #ruby
aswen has joined #ruby
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
splud has joined #ruby
synthroid has joined #ruby
SeepingN has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
deadnull has joined #ruby
tenderlove has joined #ruby
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
aeontech has joined #ruby
synthroid has joined #ruby
bronson has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
djbkd has joined #ruby
synthroid has joined #ruby
synthroid has quit [Read error: Connection reset by peer]
lacour has joined #ruby
dunpeal has quit [Read error: Connection reset by peer]
Azure|dc has quit [Ping timeout: 245 seconds]
dunpeal has joined #ruby
flashpoi_ has quit []
senayar has quit []
<nchambers> apeiros, ok, so I've got it mostly working. now its ext/wishsys/wishsys.c. I rake compile that, and end up with lib/{wishsys.so, wish.rb}. I build/install the gem, and run a script that has require 'wish'. It lets me run everything from the wishsys extension (which still has everything in the Wish module) loaded by require 'wish'. But I cannot run anything directly in wish.rb
<nchambers> any ideas?
Azure has joined #ruby
flashpoint9 has joined #ruby
hutch34 has joined #ruby
omphe has joined #ruby
<apeiros> not without the code. but iirc wishsys.so should NOT go into lib. it should stay in ext.
william3 has joined #ruby
Macaveli has joined #ruby
unreal has quit [Ping timeout: 265 seconds]
patarr has joined #ruby
<apeiros> (changing its location won't have any effect on the observed behavior)
xberg has quit [Remote host closed the connection]
nankyokusei has joined #ruby
Humdai has quit [Quit: Leaving]
william3 has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
william3 has joined #ruby
ascarter has joined #ruby
conta has quit [Ping timeout: 246 seconds]
eggshke has quit []
patarr has quit [Ping timeout: 268 seconds]
salut has quit [Quit: salut]
<nchambers> ok
<nchambers> hmm
maattdd has quit [Ping timeout: 268 seconds]
lxsameer has joined #ruby
<nchambers> Its not on github yet, so I'll get it up there when I can and ping you
<apeiros> you can just gist the wish.rb
nankyokusei has quit [Ping timeout: 260 seconds]
MarkFletcher has joined #ruby
<nowz> when im doing @file = myline and change @file, it also change myline why?
RobertBirnie has joined #ruby
<apeiros> nowz: because you have code somewhere doing that
dunpeal_ has joined #ruby
sp4rrow has joined #ruby
<apeiros> oh, wait… what precisely do you mean by "change"?
<nowz> if im doing any modification on @file, it also change myline
<apeiros> same vague
bronson has quit [Remote host closed the connection]
<apeiros> be specific. what modification.
Hyuk has quit [Quit: Textual IRC Client: www.textualapp.com]
<nowz> @file = mylines if i do @file = 4 then mylines take 4
<apeiros> ok. no. that won't happen without additional code.
gusrub has quit [Remote host closed the connection]
<nowz> ow
yqt has quit [Ping timeout: 268 seconds]
dunpeal has quit [Ping timeout: 246 seconds]
<apeiros> >> @x = 1; y = @x; @x = 2; y
<ruby[bot]> apeiros: # => 1 (https://eval.in/692554)
gusrub has joined #ruby
<apeiros> nowz: ^ see, y remains 1
MarkFletcher has quit [Client Quit]
kareelee has quit [Remote host closed the connection]
muelleme has joined #ruby
GodFather has quit [Ping timeout: 268 seconds]
sepp2k has joined #ruby
<nowz> look at this example
kareelee has joined #ruby
<nowz> file at 91
<nowz> change if passing in Error
tdump has joined #ruby
<nowz> in 98
UserJosh is now known as JoshS
gusrub has quit [Ping timeout: 256 seconds]
<apeiros> you said "@file" and "myline". I don't see an @file, I don't see a myline in 91-98. so what are you referring to?
r3vDev has quit [Ping timeout: 250 seconds]
<apeiros> oh, I think I see what you mean.
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
<apeiros> nowz: which method is called when you do Body_closed.new?
<apeiros> (should be named BodyClosed btw.)
<nowz> initialize
<nowz> the subject imposed me Body_closed
<apeiros> which arguments do you pass in line 98?
helpa-bot has joined #ruby
<nowz> @page_name, file, string
helpa has quit [Write error: Broken pipe]
<nowz> I passed file
<apeiros> and which one of those goes into which argument of initialize?
tdump has quit [Ping timeout: 258 seconds]
<apeiros> meh
<apeiros> stop. sorry.
cgfbee has quit [Excess Flood]
<nowz> hrm ok
<nowz> run it you will see each round i use dump it display all the source code
<nowz> except if it pass on Body_close
<apeiros> your naming irritated me. you put lines into file and pass it to mylines
helpa-bot has quit [Remote host closed the connection]
<nowz> yes sorry
<nowz> it's really awful
<nowz> im learning
ishe_ua has quit [Remote host closed the connection]
helpa has joined #ruby
ryan_notabot has joined #ruby
Madplatypus has joined #ruby
<nowz> first day of ruby for me, I use to code C
cgfbee has joined #ruby
lorenzoscalfani has joined #ruby
deadnull has quit [Quit: Bye]
lenwood has joined #ruby
<apeiros> yeah, sure. still my fault for not reading it right.
blackbom1 has joined #ruby
patarr has joined #ruby
dcluna has joined #ruby
blackbombay has quit [Ping timeout: 250 seconds]
<nowz> apeiros, i found !
<nowz> i forget to close after i did a File.open
<apeiros> gotta do some chores. I'll be back in a bit
bronson has joined #ruby
kareelee_ has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
<nchambers> <apeiros> you can just gist the wish.rb
<nchambers> its on my macbook that doesn't have internet right now
<apeiros> that makes it slightly difficult :D
kareelee has quit [Ping timeout: 245 seconds]
enterprisey has joined #ruby
<nchambers> I am working on running a slightly long cable from my house to the github servers
ascarter has joined #ruby
dunpeal has joined #ruby
<apeiros> sounds great. you should get a wlan cable.
RobertBirnie has quit [Quit: Textual IRC Client: www.textualapp.com]
<nchambers> mhmm
lorenzoscalfani has quit [Ping timeout: 245 seconds]
<nchambers> then the only problem is making the port on my macbook
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
someish has joined #ruby
dunpeal_ has quit [Ping timeout: 260 seconds]
someish has quit [Client Quit]
SpiffTR has joined #ruby
mark_66 has quit [Remote host closed the connection]
SeepingN has joined #ruby
ruurd has quit [Ping timeout: 250 seconds]
aryaching_ has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Remote host closed the connection]
machinewar has joined #ruby
manjaro-kde5-- has joined #ruby
aryaching has quit [Ping timeout: 248 seconds]
grh has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
mikecmpbll has joined #ruby
ascarter has joined #ruby
patarr has joined #ruby
emilkarl has joined #ruby
manjaro-kde5-- has quit [Ping timeout: 250 seconds]
enterprisey has quit [Ping timeout: 260 seconds]
ruurd has joined #ruby
pilne has joined #ruby
dionysus69 has quit [Ping timeout: 250 seconds]
aryaching_ has quit [Ping timeout: 256 seconds]
moei has quit [Quit: Leaving...]
patarr has quit [Ping timeout: 245 seconds]
last_staff has joined #ruby
gusrub has joined #ruby
emptyflask has quit [Remote host closed the connection]
emptyflask has joined #ruby
MarkFletcher has joined #ruby
gusrub has quit [Client Quit]
moei has joined #ruby
claudiuinberlin has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
tummy has quit [Quit: Textual IRC Client: www.textualapp.com]
emptyflask has quit [Ping timeout: 245 seconds]
harai has joined #ruby
dionysus69 has joined #ruby
claudiuinberlin has quit [Ping timeout: 260 seconds]
firstdayonthejob has joined #ruby
bronson has joined #ruby
Eiam has joined #ruby
patarr has joined #ruby
gusrub has joined #ruby
synthroid has joined #ruby
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 245 seconds]
maattdd has joined #ruby
jaruga___ has joined #ruby
redpants has joined #ruby
patarr has quit [Ping timeout: 244 seconds]
chrisja has joined #ruby
jtdoncas has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
anuxivm has quit [Quit: ¡Saliendo!]
emptyflask has joined #ruby
muelleme has quit [Ping timeout: 250 seconds]
TomyWork has quit [Remote host closed the connection]
patarr has joined #ruby
h1fuelcell has joined #ruby
redpants has quit [Ping timeout: 250 seconds]
frozengeek____ has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
maattdd has quit [Ping timeout: 260 seconds]
antoniobeyah has joined #ruby
adavia has quit [Ping timeout: 244 seconds]
bronson has quit [Remote host closed the connection]
CVTJNII has quit [Remote host closed the connection]
lorenzoscalfani has joined #ruby
noodle has joined #ruby
h1fuelcell has quit [Ping timeout: 260 seconds]
sdothum has joined #ruby
emilkarl has joined #ruby
radic has quit [Quit: ZNC - http://znc.in]
aryaching has joined #ruby
Amoeba has joined #ruby
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
manjaro-kde5-- has joined #ruby
kareelee has joined #ruby
enterprisey has joined #ruby
marxarelli|afk is now known as marxarelli
ascarter has joined #ruby
claudiuinberlin has joined #ruby
xberg has joined #ruby
kareelee_ has quit [Ping timeout: 244 seconds]
brent__ has quit [Quit: Connection closed for inactivity]
sneakers has joined #ruby
bocaneri has quit [Remote host closed the connection]
zeroDi has joined #ruby
lorenzoscalfani has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
symm- has joined #ruby
emilkarl has quit [Read error: Connection reset by peer]
jaguarmagenta has joined #ruby
ixti has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
centrx has joined #ruby
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
SpiffTR has quit [Quit: Leaving.]
jaguarmagenta has quit [Ping timeout: 258 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lorenzoscalfani has joined #ruby
ramfjord has joined #ruby
dnicole has quit [Remote host closed the connection]
zeroDi has quit [Quit: WeeChat 1.6]
govg has quit [Ping timeout: 246 seconds]
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
zeroDi has joined #ruby
aryaching has quit [Quit: Bye]
SpiffTR has joined #ruby
harai has quit [Quit: WeeChat 1.5]
aryaching has joined #ruby
muelleme has joined #ruby
dunpeal has quit [Quit: leaving]
jyaworski has joined #ruby
Rodya_ has quit [Quit: Leaving...]
Salih has quit [Quit: Leaving]
foxxx0 has quit [Quit: WeeChat 1.6]
Macaveli has quit [Ping timeout: 258 seconds]
foxxx0 has joined #ruby
hahuang61 has quit [Ping timeout: 246 seconds]
Macaveli has joined #ruby
nankyokusei has joined #ruby
johnmilton has quit [Remote host closed the connection]
yeticry has quit [Ping timeout: 248 seconds]
meowzus has joined #ruby
byte512 has quit [Ping timeout: 260 seconds]
meowzus has left #ruby [#ruby]
sparch has quit [Ping timeout: 265 seconds]
xberg has quit [Remote host closed the connection]
sp4rrow has joined #ruby
skweek has joined #ruby
nankyokusei has quit [Ping timeout: 268 seconds]
yeticry has joined #ruby
hahuang61 has joined #ruby
tdump has joined #ruby
bronson has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
millerti has joined #ruby
millerti has quit [Client Quit]
omphe has joined #ruby
VladGh has quit [Remote host closed the connection]
tdump has quit [Ping timeout: 258 seconds]
synthroid has quit [Ping timeout: 246 seconds]
flashpoint9 has quit []
janemba has joined #ruby
gusrub has quit [Remote host closed the connection]
<janemba> hi
brendan- has joined #ruby
<apeiros> hi janemba
VladGh has joined #ruby
bronson has quit [Ping timeout: 245 seconds]
conta has joined #ruby
Synthead has quit [Quit: Synthead]
gusrub has joined #ruby
<janemba> how can I compile a gem ?
<janemba> apeiros: \o/
mwlang has joined #ruby
<janemba> gem install seems to install a package
<apeiros> janemba: what do you mean by "compile a gem"?
<janemba> apeiros: I want "gem install" compile the package
<apeiros> ok. what do you mean by that?
<janemba> apeiros: what do you understand ?
conta has quit [Client Quit]
<apeiros> well, ruby is not a compiled language. so either you have a native extension, or you misunderstand what gems are.
<apeiros> or you misunderstand what the term "compile" means
JeanCarloMachado has quit [Ping timeout: 260 seconds]
conta has joined #ruby
<janemba> "gem install foo" <- how do you call foo ?
<apeiros> the name of the gem
<apeiros> or short "the gem" :)
<janemba> ...
gusrub has quit [Ping timeout: 256 seconds]
<janemba> so I want the gem to be compiled instead of having a binary
<apeiros> ok. I'm quite convinced that you misunderstand that term.
<janemba> when using gem install
patarr has quit [Ping timeout: 245 seconds]
<apeiros> what do you expect as a result of compiling the gem?
<janemba> thats possible
AckZ has joined #ruby
atmosx has joined #ruby
last_staff has quit [Ping timeout: 248 seconds]
<janemba> well the question is not the result of the compilation
AgentVenom has joined #ruby
<apeiros> for me it is, otherwise I don't know how to help you :)
<apeiros> because I need to know what you're after, so I can tell you how to get there.
gusrub has joined #ruby
<janemba> so you misunderstand the questio then :) I care about the compilation of that "gem"
whchien has joined #ruby
<janemba> +n
<apeiros> I understand that. but again: unless your gem has a native extension, there *is no* compilation.
<apeiros> hence I need to know what you mean by that.
<janemba> native extension ? so it means the gem if gem install don't compile the gem there is native extension ?
patarr has joined #ruby
<apeiros> gem install downloads the source, unpacks the archive, copies files to the right places. no compilation.
conta has quit [Ping timeout: 250 seconds]
<janemba> never ?
<apeiros> if the gem has/is a native extension, then there is an added step of compiling.
<janemba> ok so is there any way to make it compile ?
<apeiros> so do you want to keep running in circles or can you finally explain what you mean?
<tobiasvl> janemba: what do you want to achieve? WHY do you want to compile the gem?
<janemba> tobiasvl: achieve ? nothing ! but I want it to compile to link against my libs (the gem seems to use an old version)
MarkFletcher has quit [Ping timeout: 246 seconds]
<apeiros> ok. I'll come back when you ping me with an explanation.
<janemba> apeiros: don't worry I already noticed you didn't understand.
<apeiros> mhm, sure. sure. good luck then.
<janemba> apeiros: thx I will find a solution anyway
dionysus69 has quit [Ping timeout: 258 seconds]
<havenwood> janemba: A gem is Ruby code (unless you have a native extension in another language). You don't compile Ruby code, you run the code with a virtual machine.
<apeiros> havenwood: you think explaining them that a third time will help? :)
jenrzzz has joined #ruby
<havenwood> apeiros: Thought I'd tag in and give it a try! :-P
<apeiros> hehe
<janemba> havenwood: I noticed that the gem end with a library file (.so) so if I understand you the gem should have native extension
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has quit [Ping timeout: 245 seconds]
<havenwood> janemba: `gem install` will compile the native extension if there is one that's applicable
patarr has quit [Ping timeout: 244 seconds]
<janemba> havenwood: ok I see. (I'm reading the article)
jenrzzz has quit [Ping timeout: 246 seconds]
machinewar has quit []
<apeiros> well, you can build gems with precompiled extensions
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<janemba> nice it works ;) thx
<janemba> apeiros: hjey I didn't ping you ;)
LACampbell has joined #ruby
<apeiros> I guess we'll never know what "it" was.
<janemba> apeiros: lol
<LACampbell> how do you group_by equality? ie, ['a', 'a', 'b', 'b', 'c'] => {2 => ['a', 'a'], 2 => ['b', 'b'], 1 => ['c']}
skweek has quit [Ping timeout: 258 seconds]
<LACampbell> I can't find an example that doesn't apply some function to the elementes first
bmurt has joined #ruby
patarr has joined #ruby
<havenwood> LACampbell: A count as a Hash value isn't a good idea because only one thing can have that count.
<apeiros> LACampbell: that result is not really a goup_by result… and it can't work. you can't have 2 as key twice.
<havenwood> LACampbell: The keys would collide.
<LACampbell> right right
<apeiros> you could have {'a' => 2, …}
<apeiros> that'd also make slightly more sense :)
<LACampbell> yeah
whchien has quit [Quit: leaving]
<LACampbell> "AGTCAGTCAGTCTTTCCCAAAT".chars.group_by(&:ord).map{|k,v| [k, v]}
<apeiros> ary.group_by(&:itself).map { |k,v| [k,v.length] }.to_h
<LACampbell> is what I came up with. but why do I need an &:ord ?
<havenwood> LACampbell: group_by(&:itself).map { |k, v| [k, v.size] }.to_h
<LACampbell> ahh. itself. I didn't know that was a thing.
<LACampbell> I tried .id
janemba has left #ruby ["WeeChat 1.5"]
<apeiros> LACampbell: .ord will give you the codepoint (ascii code in your case) of a character.
pawnbox has quit [Remote host closed the connection]
<LACampbell> yeah. which worked
<LACampbell> but I felt it was hacky
<LACampbell> (ie - what if they were numbers, or booleans?)
<apeiros> havenwood: do you remember for which version count_by is slated? I thought 2.4, but I didn't see it there :<
pandaant has quit [Remote host closed the connection]
rodfersou has quit [Quit: leaving]
lorenzoscalfani has quit [Ping timeout: 246 seconds]
<havenwood> apeiros: Hmmmm, I dunno!
polishdub has joined #ruby
kareelee has quit [Remote host closed the connection]
<apeiros> reminds me that I've patches for stringscanner which haven't been added for over 6y :<
<tobiasvl> ouch'
kareelee has joined #ruby
dnicole has joined #ruby
tonytonyjan has joined #ruby
<paralitix> Hey, apeiros. It's me again. I feel like I'm so close, but I can't seem to be able to quite nail it. It writes only the last line to my file, but it writes it the exact way I need it to. Could you take a quick look and tell me what am I overlooking here? (the 1st gist) https://gist.github.com/paralitix/d5bb48542dc9165b32ec1d862eb2eb8c
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has quit []
davidt has quit [Read error: Network is unreachable]
<apeiros> havenwood: nobu already wrote the code. I wonder why it's not in :-/
davidt has joined #ruby
<tobiasvl> paralitix: 'w' as file mode overwrites the file
Yacker has joined #ruby
<tobiasvl> you want 'a'
<paralitix> yeah, I know that's the thing, I tried "a" and it just keeps adding, not replacing
jhack has quit [Quit: jhack]
<tobiasvl> uuh ok, I guess I misunderstood you then, I thought you wanted to add instead of replacing
<apeiros> paralitix: the idea somebody gave you was to do it in 3 steps: read the lines, map them to their new values, write the mapped lines to file
dnicole has quit [Ping timeout: 258 seconds]
kareelee has quit [Ping timeout: 268 seconds]
jhack has joined #ruby
<apeiros> paralitix: a block in ruby will return the value of the last statement
<apeiros> so: changed_lines = original_lines.map { |line| do_stuff; the_string_you_want_your_mapped_line_to_be }
<apeiros> your 2nd file is close. but you have to make the block return that string. at the moment it returns [3,4], because [3,4].each … returns [3,4].
codfection has joined #ruby
Jackneill_ has joined #ruby
<ruurd> "AGTCAGTCAGTCTTTCCCAAAT".chars.group_by(&:itself).map{|k,v| [k, v.length]}.sort.to_h
<ruurd> OCD version
<paralitix> so, I'm closer to what I'm looking for in the 2nd file?
<apeiros> ruurd: I'd have said "proper version". why OCD version? :D
<apeiros> I'd have classified a .chars.each_with_object(Hash.new(0)) as OCD version ;-)
gusrub has quit [Remote host closed the connection]
gbgdev_ has joined #ruby
domgetter has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
LACampbell has quit [Quit: Page closed]
jhack has quit [Ping timeout: 260 seconds]
gbgdev has quit [Ping timeout: 268 seconds]
lorenzoscalfani has joined #ruby
zeroDi has quit [Quit: WeeChat 1.6]
kbdkode has joined #ruby
<ruurd> Sorry. That should be CDO version :-)
<ruurd> SO nasty of doctors to call CDO OCD!!!
<apeiros> CDO?
<ruurd> Yes. The proper version of OCD
<ruurd> Or is it the CDO version of OCD :-) :-)
polishdub has quit [Ping timeout: 268 seconds]
<apeiros> compulsively disordered obsession?
<apeiros> oh
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<apeiros> just alphabetically ordered :D
digitalfiz has quit []
digitalfiz has joined #ruby
<ruurd> Yes. Not disordered in any case. That's important is it?
<apeiros> it's pivotal!
<ruurd> don't be such a lackwit flipflop.
digitalfiz has quit [Client Quit]
<ruurd> pivotal. what do you want?
nofxx has joined #ruby
<ruurd> left? right? up? down?
lorenzoscalfani has quit [Quit: leaving]
digitalfiz has joined #ruby
blackbombay has joined #ruby
<ruurd> come on now. out with it!
brendan- has joined #ruby
<apeiros> pivotal: of utmost importance.
<apeiros> oh, wiktionary uses "crucial": https://en.wiktionary.org/wiki/pivotal
blackbom1 has quit [Ping timeout: 256 seconds]
<ruurd> in an undecided state?
<apeiros> I don't follow?
maattdd has joined #ruby
<ruurd> pivot: the point of rotation in a lever system, More generally, the center point of any rotational system
<ruurd> pivotal - having the attributes of a pivot.
<apeiros> that's another meaning of it, yes
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ruurd> ok i think the casualty is the joke i wanted to make about having to choose a direction if you are pivoting.
<apeiros> oh
<apeiros> sorry. I'm just too slow today :)
Snowy has joined #ruby
konsolebox has quit [Quit: Leaving]
omphe has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<ruurd> yes well sometimes my jokes are a joke
omphe has quit [Client Quit]
tdump has joined #ruby
bronson has joined #ruby
maattdd has quit [Ping timeout: 260 seconds]
<apeiros> naaa, it's not your fault, it's mine!
kbdkode has quit [Quit: * ~ see ya ~ *]
polishdub has joined #ruby
jhack has joined #ruby
<ruurd> bedtime.
<apeiros> naaaaaight!
Cyrus has quit [Quit: Leaving]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<manveru> >> c = "AGTCAGTCAGTCTTTCCCAAAT"; %w[A C G T].map{|e| [e, c.count(e)] }.to_h
<ruby[bot]> manveru: # => {"A"=>6, "C"=>6, "G"=>3, "T"=>7} (https://eval.in/692762)
william3 has quit [Remote host closed the connection]
last_staff has joined #ruby
preyalone has joined #ruby
tdump has quit [Ping timeout: 258 seconds]
<apeiros> manveru: slooooow
tcpdump has left #ruby [#ruby]
<manveru> i just looked now :P
bronson has quit [Ping timeout: 250 seconds]
<manveru> it's not like anyone would use that anyway
SeepingN has joined #ruby
<baweaver> >>require 'benchmark';Benchmark.measure{c = "AGTCAGTCAGTCTTTCCCAAAT"; %w[A C G T].map{|e| [e, c.count(e)] }.to_h}.real
<ruby[bot]> baweaver: # => 4.33214008808136e-05 (https://eval.in/692764)
aryaching has quit [Ping timeout: 265 seconds]
<apeiros> can you test for .unreal?
<baweaver> >>require 'benchmark';Benchmark.measure{100.times{c = "AGTCAGTCAGTCTTTCCCAAAT"; %w[A C G T].map{|e| [e, c.count(e)] }.to_h}}.real
<ruby[bot]> baweaver: # => 0.0008991621434688568 (https://eval.in/692765)
cyberarm has joined #ruby
tyang has quit [Read error: Connection reset by peer]
<manveru> does that use frozen string literals? :P
<baweaver> >>require 'benchmark';Benchmark.measure{100.times{'AGTCAGTCAGTCTTTCCCAAAT'.each_with_object(Hash.new(0)){|c,a|a[c]+=1}}}.real
<ruby[bot]> baweaver: # => undefined method `each_with_object' for "AGTCAGTCAGTCTTTCCCAAAT":String (NoMethodError) ...check link for more (https://eval.in/692766)
aryaching has joined #ruby
<baweaver> >>require 'benchmark';Benchmark.measure{100.times{'AGTCAGTCAGTCTTTCCCAAAT'.chars.each_with_object(Hash.new(0)){|c,a|a[c]+=1}}}.real
<ruby[bot]> baweaver: # => 0.004067558795213699 (https://eval.in/692767)
Definity2 has joined #ruby
<baweaver> >>require 'benchmark';Benchmark.measure{100.times{'AGTCAGTCAGTCTTTCCCAAAT'.chars.reduce(Hash.new(0)){|a,c|a[c]+=1;a}}}.real
<ruby[bot]> baweaver: # => 0.0020278282463550568 (https://eval.in/692768)
jenrzzz has quit [Ping timeout: 260 seconds]
ariedler has quit [Remote host closed the connection]
<baweaver> >>require 'benchmark';Benchmark.measure{100.times{'AGTCAGTCAGTCTTTCCCAAAT'.chars.group_by(&:itself).map{|k,v|[k,v.size]}.to_h}}.real
<ruby[bot]> baweaver: # => 0.002071905881166458 (https://eval.in/692770)
<baweaver> hrm
<baweaver> apeiros: odd
<baweaver> count was faster.
<apeiros> .!spam baweaver
<apeiros> :-p
jpinnix_______ is now known as jpinnix
<apeiros> can happen. big-O is about asymptotes
codfection has quit [Remote host closed the connection]
<manveru> 4 times count on N instead of N times += 1
Ishido has quit [Quit: Roads? Where We're Going We Don't Need Roads.]
<manveru> you'd have to increase the string size quite a bit
<baweaver> you'd also have to uniq that string
nofxxx has joined #ruby
<baweaver> having a predefined letter set is cheating
<manveru> for DNA?
<apeiros> not really
<apeiros> ^
<manveru> well, unless you're analyzing aliens i guess
<apeiros> you can throw a "U" in :D
<baweaver> ah
<manveru> if you cast the string to US-ASCII it might also be a lot faster
nofxx has quit [Ping timeout: 260 seconds]
Eiam has joined #ruby
<ruurd> apeiros if you test for unreal you're doom
<apeiros> I'm only doom half of my life
<paralitix> fricken finally!!! Got it to work exactly the way I need it.
aryaching_ has joined #ruby
<apeiros> paralitix: congrats!
<paralitix> Thanks a lot for the help, and for putting up with me
nowz has quit [Quit: Leaving]
Rodya_ has joined #ruby
<paralitix> Man, I feel like I have no purpose anymore
aryaching has quit [Ping timeout: 244 seconds]
<ruurd> be glad apeiros has at least half his life in keen command
<apeiros> I didn't say that :D
cyberarm has left #ruby ["Leaving"]
fmcgeough has quit [Quit: fmcgeough]
GodFather has joined #ruby
FastJack has quit [Ping timeout: 264 seconds]
<ruurd> unreal. doom. half life. keen...
jaguarmagenta has joined #ruby
<ruurd> or commander keen if you wish
<apeiros> just googled that. didn't know it :<
<ruurd> i'm old
<apeiros> and I existed before the universe. you lose. I say "good day sir!" :D
dnicole has joined #ruby
workmad3 has joined #ruby
Synthead has joined #ruby
brendan- has joined #ruby
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
antoniobeyah has quit [Quit: antoniobeyah]
jaguarmagenta has quit [Ping timeout: 248 seconds]
<manveru> damn, on large strings the chars method is quite crap :(
babblebre has joined #ruby
<apeiros> utf-8 strings?
<apeiros> or others too?
<ruby[bot]> manveru: as I told you already, please use https://gist.github.com
Rodya_ has quit [Remote host closed the connection]
johnmilton has joined #ruby
fbt has quit [Remote host closed the connection]
<manveru> had to reduce iterations to get it to finish before i'm too old
Snowy has quit [Quit: ragequit]
jtdoncas_ has joined #ruby
adavia has joined #ruby
<manveru> but there must be something faster than count, right?
antoniobeyah has joined #ruby
<apeiros> native implementation!
redpants has joined #ruby
<apeiros> inline C!
<apeiros> inline ASM!
<manveru> of course!
workmad3 has quit [Ping timeout: 250 seconds]
<manveru> also how can i teach that bot to let me paste in peace?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> you can't
<apeiros> you have to use one of the 3 sanctioned paste services!
<apeiros> (or actually… just not use one of the 2 we don't like :-p)
emilkarl has joined #ruby
<manveru> you don't like irccloud pastes?
benlieb has quit [Quit: benlieb]
<apeiros> not me
<centrx> it's not us, it's the bot
<manveru> i thought it's your bot
<apeiros> it is. but I'm not the only one deciding what it does :)
<manveru> ok, i'll just add an ignore for that line then :P
jtdoncas_ has quit [Ping timeout: 260 seconds]
<centrx> It might be flagging the word "pastebin", don't see anything wrong with that irccloud pastebin
redpants has quit [Ping timeout: 244 seconds]
ascarter has joined #ruby
<apeiros> no, irccloud was added specifically
skweek has joined #ruby
tdump has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<manveru> the only one who'd come up with such an idea must be zenspider
<apeiros> bzzzt, wrong :D
h1fuelcell has joined #ruby
JeanCarloMachado has joined #ruby
JoshS has quit [Quit: Leaving]
jaruga___ has quit [Quit: jaruga___]
<manveru> maybe someone who only looks at the channel in emacs and has a gist plugin but can't be bothered to write a plugin for irccloud?
last_staff has quit [Quit: poof oof]
d0nn1e has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
synthroid has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Coldblackice has joined #ruby
d0nn1e has joined #ruby
<manveru> let's see if it likes https://www.irccloud.com/pastebin/RVBJ1IgP.raw
<ruby[bot]> manveru: as I told you already, please use https://gist.github.com
manjaro-kde5-- has quit [Ping timeout: 250 seconds]
gusrub has joined #ruby
h1fuelcell has quit [Ping timeout: 246 seconds]
<manveru> well, that's not as much fun, but it works
Madplatypus has quit [Quit: Connection closed for inactivity]
<apeiros> large count is still faster? I'm surprised.
ruby-lang317 has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nopolitica has quit [Ping timeout: 268 seconds]
<ruby-lang317> need a way to check if a string contains dots '.' characters or not. probably a regexp solves it...
gusrub has quit [Ping timeout: 246 seconds]
<ruby-lang317> must validate fqdn ... in a naive way
<ruby-lang317> i could loop through the string and count dots...
nankyokusei has joined #ruby
borei has joined #ruby
ascarter has joined #ruby
<borei> hi all
lxsameer has quit [Quit: WeeChat 1.6]
<borei> im new with ruby, need some advice - what library is recommended to use to generate XML files ?
<borei> i found nokogiri::builder
redpants has joined #ruby
nopolitica has joined #ruby
<apeiros> that's sane
nankyokusei has quit [Ping timeout: 250 seconds]
synthroi_ has joined #ruby
<apeiros> depending on what you want to do, also consider plain string interpolation, erb, haml. slim might also have an xml mode.
<apeiros> ruby-lang317: dots alone don't validate fqdn, though…
<apeiros> String#include? and =~ are your friends
<borei> need to create custom type/provider for puppet
<borei> xml file(s) will be used by libvirt
centrx has quit []
Eiam has quit [Quit: ╯°□°)╯︵ǝpouǝǝɹɟ]
synthroid has quit [Ping timeout: 268 seconds]
blackwind_123 has quit [Ping timeout: 260 seconds]
cyberarm has joined #ruby
cyberarm has left #ruby [#ruby]
<antoniobeyah> nooo, i’m trying to rid nokogiri from the internet
gusrub has joined #ruby
<borei> ???
nopolitica has quit [Ping timeout: 244 seconds]
<ruby-lang317> #apeiros thanx
blackwind_123 has joined #ruby
gusrub has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<antoniobeyah> nokogiri is one of the top frustrations for the people I work with due to its native extensions, consistently causing gem installs to fail, and generally slowing down ruby dev
gusrub has joined #ruby
<borei> ok
<apeiros> antoniobeyah: you're an oganian? :)
<borei> what is the option then ?
<apeiros> does oga have a builder?
skweek has quit [Ping timeout: 246 seconds]
<antoniobeyah> depends on what you need to do. nokogiri is super powerful, i will give it that
ascarter has joined #ruby
bronson has joined #ruby
muelleme has quit [Ping timeout: 244 seconds]
nopolitica has joined #ruby
<antoniobeyah> new-new xml file or inplace manipulation?
<antoniobeyah> net-new*
<antoniobeyah> i don’t have much time atm but imo add a nokogiri dependency to your project with care
solocshaw has joined #ruby
grh has quit [Ping timeout: 246 seconds]
gbgdev_ has quit [Remote host closed the connection]
gloscombe has joined #ruby
william3 has joined #ruby
ascarter has quit [Client Quit]
bronson has quit [Ping timeout: 246 seconds]
nettoweb has quit [Ping timeout: 245 seconds]
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
brendan- has joined #ruby
nettoweb has joined #ruby
chouhoulis has quit [Ping timeout: 258 seconds]
SpiffTR has quit [Quit: Leaving.]
aswen has quit [Quit: WeeChat 1.5]
railssmith has joined #ruby
maattdd has joined #ruby
gusrub has quit [Remote host closed the connection]
emilkarl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has joined #ruby
bronson has quit [Remote host closed the connection]
bronson has joined #ruby
johnmilton has quit [Remote host closed the connection]
ta_ has joined #ruby
polishdub has quit [Quit: Leaving]
cyberarm has joined #ruby
skalfyfan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
synthroid has joined #ruby
skalfyfan has joined #ruby
skalfyfan has quit [Client Quit]
millerti has joined #ruby
bronson has quit [Remote host closed the connection]
ascarter has joined #ruby
Rodya_ has joined #ruby
synthroi_ has quit [Ping timeout: 268 seconds]
AndBobsYourUncle has joined #ruby
nettoweb1 has joined #ruby
nettoweb has quit [Ping timeout: 258 seconds]
ruby-lang317 has quit [Ping timeout: 260 seconds]
solocshaw has quit [Ping timeout: 260 seconds]
bronson has joined #ruby
<AndBobsYourUncle> Hi
<havenwood> AndBobsYourUncle: welcome!
Rodya_ has quit [Ping timeout: 258 seconds]
marxarelli is now known as marxarelli|afk
zapata has quit [Ping timeout: 250 seconds]
toretore has quit [Ping timeout: 245 seconds]
bronson has quit [Remote host closed the connection]
cyberarm has quit [Remote host closed the connection]
biberu has quit []
gusrub has joined #ruby
jhack has quit [Ping timeout: 250 seconds]
AndBobsYourUncle has quit []
willardg has joined #ruby
AndBobsYourUncle has joined #ruby
AndBobsYourUncle has quit [Client Quit]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
AndBobsYourUncle has joined #ruby
william3 has quit [Remote host closed the connection]
atmosx has quit [Quit: Textual IRC Client: www.textualapp.com]
xrlk has quit [Ping timeout: 248 seconds]
atmosx has joined #ruby
antoniobeyah has quit [Quit: antoniobeyah]
willardg has left #ruby [#ruby]
Jackneill_ has quit [Remote host closed the connection]
nettoweb has joined #ruby
maattdd has quit [Ping timeout: 258 seconds]
nettoweb1 has quit [Ping timeout: 260 seconds]
zapata has joined #ruby
gbgdev has joined #ruby
kareelee has joined #ruby
synthroid has quit []
nettoweb has quit [Ping timeout: 260 seconds]
djbkd has quit [Remote host closed the connection]
nettoweb has joined #ruby
koooge has joined #ruby
ixti has quit [Quit: WeeChat 1.6]
djbkd has joined #ruby
kareelee has quit [Ping timeout: 245 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli|afk is now known as marxarelli
ta_ has quit [Remote host closed the connection]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
djbkd has quit [Ping timeout: 248 seconds]
gbgdev has quit []
yeticry has quit [Quit: leaving]
yeticry has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
AndBobsYourUncle has quit [Remote host closed the connection]
enterprisey has quit [Read error: Connection reset by peer]
adavia has quit [Ping timeout: 256 seconds]
patarr has quit [Ping timeout: 256 seconds]
OTORelic has quit [Ping timeout: 256 seconds]
sdothum has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdump has quit [Quit: Leaving...]
omphe has joined #ruby
kareelee has joined #ruby
beilabs_ has joined #ruby
yeticry has quit [Remote host closed the connection]
Guest43 has joined #ruby
yeticry has joined #ruby
Guest43 has quit [Changing host]
Guest43 has joined #ruby
skalfyfan has joined #ruby
beilabs has quit [Ping timeout: 258 seconds]
gusrub has quit [Remote host closed the connection]
Derderderd has quit [Ping timeout: 258 seconds]
kareelee has quit [Ping timeout: 260 seconds]
harai has joined #ruby
Madplatypus has joined #ruby
kareelee has joined #ruby
fmcgeough has joined #ruby
gusrub has joined #ruby
omphe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
maloik29 has joined #ruby
preyalone has quit [Quit: Connection closed for inactivity]
maloik has quit [Remote host closed the connection]
kareelee has quit [Ping timeout: 260 seconds]
domgetter has quit [Ping timeout: 268 seconds]
Guest43 has quit [Quit: Textual IRC Client: www.textualapp.com]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
brent__ has joined #ruby
roshanavand has joined #ruby
jaguarmagenta has joined #ruby
muelleme has joined #ruby
gusrub has quit [Remote host closed the connection]
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
Derderderd has joined #ruby
Sammichmaker has joined #ruby
bronson has joined #ruby
jaguarmagenta has quit [Ping timeout: 260 seconds]
rykou has quit [Ping timeout: 252 seconds]
bayed has quit [Quit: Connection closed for inactivity]
xall has joined #ruby
babblebre has quit [Quit: Connection closed for inactivity]
ResidentBiscuit has quit [Ping timeout: 250 seconds]
kareelee has joined #ruby
xrlk has joined #ruby
emptyflask has quit [Remote host closed the connection]
gloscombe has quit [Quit: gloscombe]
Jon30 has joined #ruby
<Jon30> who is hosting ruby-toolbox and why is it always sooooooooo slooooooooooow? D:
<zenspider> it's pretty out of date too. I have been hoping someone would help out with that
<zenspider> short answer: bitrot
xall has quit [Ping timeout: 256 seconds]
kareelee has quit [Ping timeout: 268 seconds]
exadeci_ has joined #ruby
exadeci_ has quit [Client Quit]
dnicole has quit [Remote host closed the connection]
fmcgeough has quit [Quit: fmcgeough]
gusrub has joined #ruby
ekem is now known as ekuhman
ekuhman is now known as ekduhman
symm- has quit [Ping timeout: 260 seconds]
ekduhman is now known as ekduhmanah
firstdayonthejob has quit [Ping timeout: 250 seconds]
kareelee has joined #ruby
h1fuelcell has joined #ruby
tdump has joined #ruby