havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
jenrzzz has quit [Ping timeout: 245 seconds]
RiPuk has quit [Ping timeout: 248 seconds]
reaVer has joined #ruby
jenrzzz_ has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
elphe has joined #ruby
skryking has quit [Ping timeout: 245 seconds]
elphe has quit [Ping timeout: 244 seconds]
skryking has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
<regedit> why is this error: NoMethodError - undefined method `sanitize_sql_like'
<regedit> within an an ActiveRecord model
<regedit> oh maybe i should ask in #ror...
Swyper has quit [Ping timeout: 245 seconds]
wildtrees has quit [Quit: Leaving]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
RiPuk has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
sapphyrus has joined #ruby
sapphyrus has quit [Client Quit]
dviola has quit [Quit: WeeChat 2.5]
sapphyrus has joined #ruby
sapphyrus has quit [Client Quit]
elphe has joined #ruby
sapphyrus has joined #ruby
bmurt has joined #ruby
sapphyrus has quit [Client Quit]
AJA4350 has quit [Quit: AJA4350]
baojg has joined #ruby
drnerdius has quit [Quit: Konversation terminated!]
drnerdius has joined #ruby
sapphyrus has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
_whitelogger has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
ElFerna has joined #ruby
drnerdius has quit [Ping timeout: 268 seconds]
ElFerna has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
code_zombie has quit [Quit: Leaving]
bitwinery has joined #ruby
bruce_lee has quit [Ping timeout: 245 seconds]
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
sapphyrus has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
elphe has quit [Ping timeout: 258 seconds]
sapphyrus has joined #ruby
elphe has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
poontangmessiah_ has quit [Remote host closed the connection]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kyrylo has joined #ruby
jenrzzz has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
Azure has joined #ruby
Swyper has joined #ruby
DTZUZO has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
polishdub has joined #ruby
_whitelogger_ has joined #ruby
_whitelogger has quit [Remote host closed the connection]
iNs has joined #ruby
PaulePanter has quit [Ping timeout: 245 seconds]
PaulePanter has joined #ruby
<ixti> Re my error on Array#each (if anybody curious) - it was my mistake. Didn't saw that error was coming from the different place (just happened that var name was the same)
sapphyrus has quit [Quit: ZNC 1.6.3+deb1ubuntu0.2 - http://znc.in]
sapphyrus has joined #ruby
ixti has quit [Quit: WeeChat 2.3]
grilix has quit [Read error: Connection reset by peer]
grilix has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 244 seconds]
Swyper has joined #ruby
duderonomy has joined #ruby
Swyper has quit [Ping timeout: 244 seconds]
duderonomy has quit [Client Quit]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
Nicmavr has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
Nicmavr has joined #ruby
jenrzzz has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 246 seconds]
aphprentice__ has quit [Quit: Connection closed for inactivity]
mochiyoda has quit [Ping timeout: 276 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
k0mpa has quit [Quit: k0mpa]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
brool has quit [Ping timeout: 264 seconds]
polishdub has quit [Quit: leaving]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
cthulchu has joined #ruby
cthu| has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
_whitelogger has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
Swyper has joined #ruby
greengriminal has joined #ruby
lalitmee has joined #ruby
Swyper has quit [Ping timeout: 248 seconds]
dbugger has joined #ruby
dbugger has quit [Remote host closed the connection]
glosoli has joined #ruby
glosoli has quit [Ping timeout: 246 seconds]
tsujp has joined #ruby
Frobozz has quit [Read error: Connection reset by peer]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsujp has joined #ruby
noodle has quit [Ping timeout: 250 seconds]
ur5us has quit [Remote host closed the connection]
dhollinger has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
sauvin has joined #ruby
ur5us has quit [Ping timeout: 258 seconds]
ramfjord has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
jenrzzz has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
greengriminal has quit [Quit: This computer has gone to sleep]
cthulchu has quit [Ping timeout: 250 seconds]
Furai has quit [Quit: WeeChat 2.5]
dhollinger has joined #ruby
Furai has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
zapata has joined #ruby
twoone has joined #ruby
twoone has quit [Client Quit]
jenrzzz has joined #ruby
deepredsky has joined #ruby
reber has joined #ruby
deepredsky has quit [Ping timeout: 268 seconds]
fphilipe_ has quit [Ping timeout: 272 seconds]
DTZUZO has quit [Ping timeout: 248 seconds]
UncleCid__ has quit [Read error: Connection reset by peer]
noodle has joined #ruby
deepredsky has joined #ruby
rainmanjam has joined #ruby
fphilipe_ has joined #ruby
bitwinery has quit [Quit: Leaving]
deepredsky has quit [Ping timeout: 246 seconds]
troulouliou_dev has joined #ruby
tdy has quit [Remote host closed the connection]
lxsameer has joined #ruby
ljarvis has joined #ruby
gix has quit [Ping timeout: 245 seconds]
regedit has quit [Quit: Connection closed for inactivity]
tbisker8 has joined #ruby
titanbiscuit has quit [Ping timeout: 245 seconds]
englishm has quit [Excess Flood]
deepredsky has joined #ruby
tbisker8 has quit [Client Quit]
englishm has joined #ruby
titanbiscuit has joined #ruby
deepredsky has quit [Ping timeout: 248 seconds]
elphe has quit [Ping timeout: 245 seconds]
suukim has joined #ruby
planigan has quit [Ping timeout: 272 seconds]
planigan has joined #ruby
alem0lars has joined #ruby
lalitmee has quit [Ping timeout: 268 seconds]
TomyWork has joined #ruby
suukim has quit [Quit: Konversation terminated!]
elphe has joined #ruby
aupadhye has joined #ruby
Tuor has joined #ruby
Tuor has joined #ruby
Tuor has quit [Changing host]
Flyingdog has quit [Read error: Connection reset by peer]
suukim has joined #ruby
quazimodo has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
quazimodo has quit [Ping timeout: 248 seconds]
elphe has joined #ruby
jmcgnh has quit [Ping timeout: 268 seconds]
drnerdius has joined #ruby
jmcgnh has joined #ruby
lalitmee has joined #ruby
deepredsky has joined #ruby
deepredsky has quit [Ping timeout: 268 seconds]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
corellian has joined #ruby
kyrylo has joined #ruby
stan has quit [Ping timeout: 258 seconds]
stan has joined #ruby
mniip has quit [Quit: This page is intentionally left blank.]
deepredsky has joined #ruby
suukim has quit [Ping timeout: 245 seconds]
mniip has joined #ruby
tsujp has joined #ruby
DTZUZO has joined #ruby
tsujp has quit [Client Quit]
stan has quit [Ping timeout: 268 seconds]
deepredsky has quit [Ping timeout: 246 seconds]
DTZUZO has quit [Ping timeout: 268 seconds]
stan has joined #ruby
tsujp has joined #ruby
tsujp has quit [Read error: Connection reset by peer]
Tuor has quit [Read error: Connection reset by peer]
tsujp has joined #ruby
Tuor has joined #ruby
Tuor has quit [Changing host]
Tuor has joined #ruby
Swyper has joined #ruby
xco has joined #ruby
<xco> hello beutiful people!! :P
<xco> i have a string that’s always in this format “some@email.com#s30823ufadafxx”
<xco> i want to extract just the email out so i’d get “some@email.com”
<xco> i know i can do
Swyper has quit [Ping timeout: 272 seconds]
<xco> “some@email.com#s30823ufadafxx”.split....
<xco> or “some@email.com#s30823ufadafxx”.partition.....
<xco> but i want to ask if perhaps someone has a better (maybe efficient) way to extract emails out of such strings?
<xco> i’m always on the look out for a better* way and i know there is (might be)
MrCrackPot has quit [Quit: Something went wrong again oh the joys]
<phaul> .sub(/#.*/, '') can give you a more direct result, but whether it's better or more efficient is up to debate
<NL3limin4t0r> xco: You could use a regex.
<NL3limin4t0r> &>> 'some@email.com#s30823ufadafxx'[/[^#]+/]
<rubydoc> stderr: /home/carcin/carcin/sandboxes/ruby/sandboxed_ruby2.6.0: error while loading shared libraries:... check link for more (https://carc.in/#/r/7ed5)
<phaul> NL3limin4t0r: yeah. carc.in got broken. &24>> works still
<NL3limin4t0r> &24>> 'some@email.com#s30823ufadafxx'[/[^#]+/]
<rubydoc> # => "some@email.com" (https://carc.in/#/r/7ed6)
<xco> phaul: thank you
<NL3limin4t0r> phaul: Ah, been away for a while
<xco> phaul: that’s sexy actually
<xco> NL3limin4t0r: thanks for that too… that looks very simple
<xco> less noise
<xco> "noise"
suukim has joined #ruby
<NL3limin4t0r> Keep in mind the regex provided matches from the start of the string until the first '#' character (assuming a string never starts with '#')
ramfjord has joined #ruby
<xco> yeah that i’m aware of
<NL3limin4t0r> If the string can contain newline characters you might want to add the "m" flag to the regex of phaul.
<xco> right
MrCrackPot has joined #ruby
<xco> NL3limin4t0r: how can i use this 'some@email.com#s30823ufadafxx'[/[^#]+/] with URI::MailTo::EMAIL_REGEXP?
<NL3limin4t0r> &24>> require 'uri'; 'some@email.com#s30823ufadafxx'[URI::MailTo::EMAIL_REGEXP]
<rubydoc> # => nil (https://carc.in/#/r/7ed7)
<NL3limin4t0r> nvm
<xco> :P
ramfjord has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> What do you mean by "use" with URI::MailTo::EMAIL_REGEXP ? Do you want to test if the email is valid?
<xco> nope
<xco> the EMAIL_REXEXP is /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\z/
<xco> so i’m assuming you could just put that in 'some@email.com#s30823ufadafxx’[regex_here] to grab the email
<xco> in this case any email that matches the EMAIL_REGEXP
<xco> no?
<NL3limin4t0r> Yeah. Meaning you can't extract an email from existing string. Since /\A...\z/ always checks if the whole string matches (\A matches the start of string and \z matches the end of string).
<xco> riiiiiight!
<xco> shit!
<NL3limin4t0r> You could remove those and create your own version.
<xco> i tend to miss those little details
elphe has quit [Ping timeout: 246 seconds]
<NL3limin4t0r> &24>> 'some@email.com#s30823ufadafxx'[/[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/]
<rubydoc> # => "some@email.com" (https://carc.in/#/r/7eda)
elphe has joined #ruby
<NL3limin4t0r> &24>> require 'uri'; 'some@email.com#s30823ufadafxx'[RegExp.new URI::MailTo::EMAIL_REGEXP.to_s.gsub(/\\A|\\z/, '')]
<rubydoc> stderr: -e:2:in `<main>': uninitialized constant RegExp (NameError) (https://carc.in/#/r/7edb)
<NL3limin4t0r> &24>> require 'uri'; 'some@email.com#s30823ufadafxx'[Regexp.new URI::MailTo::EMAIL_REGEXP.to_s.gsub(/\\A|\\z/, '')]
<rubydoc> # => "some@email.com" (https://carc.in/#/r/7edc)
<xco> this looks good but it’s getting out of hands now hahhahha
<NL3limin4t0r> ^ removing \A and \z from the regex works like you see
<xco> NL3limin4t0r: but thanks for teaching how to do it :D
<NL3limin4t0r> Have a look at String#[] for more info. https://ruby-doc.org/core-2.6.3/String.html#method-i-5B-5D
<al2o3-cr> &24>> require 'uri'; URI('some@email.com#s30823ufadafxx').path
<rubydoc> # => "some@email.com" (https://carc.in/#/r/7edd)
<al2o3-cr> maybe? lol
<NL3limin4t0r> didn't know that one, nice
mlt- has quit [Read error: Connection reset by peer]
poontangmessiah has joined #ruby
<al2o3-cr> :p
mlt- has joined #ruby
<xco> al2o3-cr: whaaat?!?!?
<xco> 😅
baojg has quit [Remote host closed the connection]
baojg has joined #ruby
xco has quit [Quit: xco]
ur5us has joined #ruby
DaRock has joined #ruby
Swyper has joined #ruby
gregf_ has joined #ruby
cd has quit [Quit: cd]
Swyper has quit [Ping timeout: 248 seconds]
drnerdius has quit [Quit: Konversation terminated!]
drnerdius has joined #ruby
poontangmessiah has quit [Remote host closed the connection]
poontangmessiah has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
ElFerna has joined #ruby
ElFerna has quit [Remote host closed the connection]
elphe has quit [Ping timeout: 244 seconds]
mniip_ has joined #ruby
mniip has quit [Ping timeout: 600 seconds]
noobster42 has joined #ruby
<noobster42> Hi
tpanarch1st has joined #ruby
<noobster42> I'm probably approaching the situation incorrectly, but I'm looking for a regular for (initializer; condition; statement) loop in Ruby.
<noobster42> I have a while loop which executes a statement at the beginning of each iteration, but it should not be executed on the first iteration
gregf_ has quit [Remote host closed the connection]
<noobster42> is there a clean way to solve this? Currently I'm just artificially setting the value of the variable this statement changes to -= 1 before the loop, so that the first iteration (which ++'s it) effectively nullifies that again
cgfbee has joined #ruby
queip has quit [Quit: bye, freenode]
mniip_ is now known as mniip
ramfjord has joined #ruby
also_uplime has left #ruby ["/me scurries away"]
drnerdius has quit [Read error: No route to host]
ramfjord has quit [Ping timeout: 272 seconds]
qbit has quit [Quit: leaving]
chalkmonster has joined #ruby
tsujp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elphe has joined #ruby
AJA4350 has joined #ruby
Swyper has joined #ruby
tsujp has joined #ruby
grilix has quit [Ping timeout: 244 seconds]
DTZUZO has joined #ruby
DTZUZO has quit [Client Quit]
queip has joined #ruby
tsujp has quit [Ping timeout: 244 seconds]
elphe has quit [Ping timeout: 245 seconds]
lucasb has joined #ruby
eber has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
donofrio has quit [Remote host closed the connection]
tsujp has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
tsujp has quit [Ping timeout: 248 seconds]
tsujp_ has joined #ruby
tsujp_ has quit [Client Quit]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
Yxhuvud has quit [Remote host closed the connection]
deepredsky has joined #ruby
noobster42 has quit [Remote host closed the connection]
deepredsky has quit [Ping timeout: 244 seconds]
lalitmee has quit [Ping timeout: 248 seconds]
Swyper has quit [Ping timeout: 268 seconds]
chalkmonster has quit [Quit: WeeChat 2.5]
tsujp has joined #ruby
impermanence has joined #ruby
elphe has joined #ruby
grilix has joined #ruby
involans has joined #ruby
elphe has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
sh7d has quit [Read error: Connection reset by peer]
sh7d has joined #ruby
mat_bug has joined #ruby
Skarlso has quit [Quit: The Lounge - https://thelounge.chat]
hutch has joined #ruby
Skarlso has joined #ruby
aupadhye has quit [Remote host closed the connection]
chunkypuffs has quit [Remote host closed the connection]
k0mpa has joined #ruby
desperek has joined #ruby
desperek has quit [Changing host]
desperek has joined #ruby
<desperek> hi, what's better, (2**3)<<4 or 2**8-2**4, (how does that work btw haha) i assume the first one?
<desperek> ok now why is (~2).to_s(2) -11
<desperek> oh nvm i know the latter question answer
elphe has joined #ruby
alem0lars has quit [Ping timeout: 258 seconds]
hrhsh has joined #ruby
hrhsh has quit [Client Quit]
tsujp has quit [Quit: Textual IRC Client: www.textualapp.com]
millerti has joined #ruby
greengriminal has joined #ruby
brool has joined #ruby
deepredsky has joined #ruby
mat_bug has quit []
iNs has quit [Remote host closed the connection]
Swyper has joined #ruby
<desperek> [1,7,8,...,x].map {|e| ("A".."Z").to_a[e % 26]}, does ruby recreate the range in the block or is it smart?
iNs has joined #ruby
hrhsh has joined #ruby
ElFerna has joined #ruby
hrhsh has quit [Client Quit]
vondruch_ has joined #ruby
Swyper has quit [Ping timeout: 272 seconds]
tsujp has joined #ruby
chunkypuffs has joined #ruby
vondruch has quit [Ping timeout: 245 seconds]
vondruch_ is now known as vondruch
deepredsky has quit [Ping timeout: 272 seconds]
Rapture has joined #ruby
involans has quit [Quit: involans]
<NL3limin4t0r> desperek: 2**3 << 4 and 2**8 - 2**4 produce different results.
<desperek> NL3limin4t0r, :thinking: ok, then 2**3-1 << 4
<desperek> s/3/4/
<desperek> well actually nvm i think ive found a simpler solution to my problem, tho the question's still there hm
<NL3limin4t0r> `2**something` is the same as `1 << something`
<NL3limin4t0r> &24>> 2**3 << 4
<rubydoc> # => 128 (https://carc.in/#/r/7eej)
<NL3limin4t0r> &24>> 1 << 7
<rubydoc> # => 128 (https://carc.in/#/r/7eek)
<desperek> well i dont meean that
<desperek> im about like 111000 thing
<NL3limin4t0r> Than you should add a -1 to the whole thing.
<desperek> i did .w.
<desperek> im more about math tho
<NL3limin4t0r> &24>> ((1 << 9) - 1).to_s(2)
<rubydoc> # => "111111111" (https://carc.in/#/r/7eel)
sgen has joined #ruby
ElFerna has quit [Ping timeout: 248 seconds]
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
ElFerna has joined #ruby
<desperek> NL3limin4t0r, but generally bitwise shift is more performant than multiplication, right?
Tuor has quit [Quit: Konversation terminated!]
lalitmee has joined #ruby
AJA4351 has joined #ruby
code_zombie has joined #ruby
AJA4350 has quit [Ping timeout: 268 seconds]
AJA4351 is now known as AJA4350
Technodrome has joined #ruby
corellian has quit [Quit: leaving]
greengriminal has quit [Quit: This computer has gone to sleep]
TomyWork has quit [Ping timeout: 246 seconds]
rippa has joined #ruby
sgen has quit [Ping timeout: 250 seconds]
Swyper has joined #ruby
ellcs has quit [Ping timeout: 272 seconds]
wildtrees has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
involans has joined #ruby
ellcs has joined #ruby
greengriminal has joined #ruby
deepredsky has joined #ruby
deepreds1 has joined #ruby
vondruch has quit [Quit: vondruch]
deepredsky has quit [Ping timeout: 258 seconds]
vondruch has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
tdy has joined #ruby
Nicmavr has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
vondruch has quit [Quit: vondruch]
kyrylo has joined #ruby
sh7d has quit [Ping timeout: 248 seconds]
vondruch has joined #ruby
sh7d has joined #ruby
fphilipe_ has quit [Read error: Connection reset by peer]
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
ElFerna has quit [Quit: Konversation terminated!]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
skryking has quit [Quit: WeeChat 2.4]
deepreds1 has quit [Ping timeout: 258 seconds]
Swyper has joined #ruby
cthulchu_ has joined #ruby
deepreds1 has joined #ruby
Swyper has quit [Ping timeout: 248 seconds]
s3nd1v0g1us has joined #ruby
<leftylink> &>> :t
<rubydoc> stderr: /home/carcin/carcin/sandboxes/ruby/sandboxed_ruby2.6.0: error while loading shared libraries:... check link for more (https://carc.in/#/r/7ef5)
leitz has joined #ruby
<leftylink> ok
dhollinger has quit [Ping timeout: 245 seconds]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
chalkmonster has joined #ruby
pepone has joined #ruby
englishm has quit [Excess Flood]
englishm has joined #ruby
<pepone> Hi, trying to debug a problem with a ruby extension where a object created with Data_Wrap_Struct is gc befor it should, is there a way to get enable GC trace to see why this happens
<pepone> so far this only occurs with OPTIMIZED builds of the extension and python 2.6.3p62
ljarvis has quit [Quit: WeeChat 2.4]
SeepingN has joined #ruby
ElFerna has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.5]
duderonomy has joined #ruby
spiette has quit [Ping timeout: 272 seconds]
desperek has quit [Quit: mew wew]
deepredsky has joined #ruby
dhollinger has joined #ruby
<pepone> I see the free method register with Data_Wrap_Struct is called but the mark method that was supposed to keep the object alive is not
deepreds1 has quit [Ping timeout: 248 seconds]
ravenous_ has joined #ruby
<pepone> If I manually call GC.start I see the expected calls to mark free methods and there is no crash
ElFerna has quit [Ping timeout: 258 seconds]
spiette has joined #ruby
gix has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
s3nd1v0g1us has quit [Quit: WeeChat 2.4]
Yxhuvud has joined #ruby
Swyper has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eber has quit [Quit: WeeChat 2.5]
Swyper has quit [Ping timeout: 258 seconds]
DaRock has quit [Ping timeout: 258 seconds]
sameerynho has joined #ruby
codefriar has quit [Ping timeout: 268 seconds]
lalitmee has quit [Quit: Leaving]
nius has joined #ruby
<nius> How can Object be an instance of Class, a sub-class of Object?
<nius> (same goes for Module, BasicObject, etc)
<phaul> each object knows who its class is. For Object it's Class. Apart from that classes also know who their super class is. For Object it's BasicObject, for Class it's Module, for Module it's Object. Imagine .class and .superclass being a pointer between objects of object space and these guys are pointing at each other.
<phaul> also the .class and .superclass are very different because .class is in every object, .superclass is only in classes
<havenwood> &>> Module.class
<rubydoc> stderr: /home/carcin/carcin/sandboxes/ruby/sandboxed_ruby2.6.0: error while loading shared libraries:... check link for more (https://carc.in/#/r/7efm)
<phaul> &24>> Module.class # havenwood
<rubydoc> # => Class (https://carc.in/#/r/7efn)
Rapture has quit [Ping timeout: 258 seconds]
<havenwood> &24>> Class.superclass
<rubydoc> # => Module (https://carc.in/#/r/7efo)
<havenwood> &24>> Module.superclass
<rubydoc> # => Object (https://carc.in/#/r/7efp)
<havenwood> &24>> Object.superclass
<rubydoc> # => BasicObject (https://carc.in/#/r/7efq)
<havenwood> &24>> BasicObject.superclass
<rubydoc> # => nil (https://carc.in/#/r/7efr)
<havenwood> nius: It's ^ a chain.
<havenwood> &24>> Class.ancestors
<rubydoc> # => [Class, Module, Object, Kernel, BasicObject] (https://carc.in/#/r/7efs)
<havenwood> &24>> Object.include? Kernel
<rubydoc> # => true (https://carc.in/#/r/7eft)
ramfjord has joined #ruby
<phaul> we had a diagramm of this among the factoids.. iirc. I am trying to find it..
SeepingN has joined #ruby
<havenwood> phaul: That one ^ or another?
<NL3limin4t0r> &24>> Class.ancestors
<rubydoc> # => [Class, Module, Object, Kernel, BasicObject] (https://carc.in/#/r/7efu)
<phaul> I couldn't find it, maybe I confused it with the method_lookup diagramm...
codefriar has joined #ruby
leitz has quit [Quit: Leaving]
<NL3limin4t0r> nius: I get the confusion. In plain Ruby you wouldn't be able to recreate the same structure. But Ruby core is written in C which can bend the rules.
<NL3limin4t0r> Object is an instance of Class which inherits from Object (resulting in a circular dependencies)
<phaul> but the ancestry chain is flat, no circles. As I tried to emhasise the difference between .class vs .superclass.
dinfuehr has joined #ruby
<teardown> termbin.com/6og0
<teardown> my require is false. how do i use this gem
poontangmessiah has quit [Ping timeout: 246 seconds]
<teardown> then the require succeeds i get the same error 'uninitialized costant NetAddr::CIDR'
<leftylink> &24>> end; p :okay; begin
<rubydoc> # => nil (https://carc.in/#/r/7efv)
<leftylink> okay
<teardown> if i require 'netaddr' in an irb session, is there a way to reflectively get a list of methods from the library
<leftylink> if I wanted to get rid of the nil... maybe I'll use ||
<leftylink> &24>> end || :okay; begin
<rubydoc> # => :okay (https://carc.in/#/r/7efw)
<leftylink> hooray
<leftylink> &25>> :yes
<rubydoc> stderr: /home/carcin/carcin/sandboxes/ruby/sandboxed_ruby2.5.3: error while loading shared libraries:... check link for more (https://carc.in/#/r/7efx)
<leftylink> NO
<SeepingN> not really a direct answer to your question teardown but: https://buildmedia.readthedocs.org/media/pdf/netaddr/latest/netaddr.pdf
<SeepingN> handy ref
<NL3limin4t0r> teardown: require resulting in a `false` value means that it's already required earlier.
<NL3limin4t0r> &24>> require 'set'
<rubydoc> # => true (https://carc.in/#/r/7efy)
<NL3limin4t0r> &24>> require 'set'; require 'set'
<rubydoc> # => false (https://carc.in/#/r/7efz)
elphe has quit [Ping timeout: 245 seconds]
<NL3limin4t0r> You can still use it. The return value only indicates if anything had to be loaded. Having something incorrectly installed would yield an exception.
<NL3limin4t0r> &24>> require 'some_gem_that_is_not_installed'
<rubydoc> stderr: /usr/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file --... check link for more (https://carc.in/#/r/7eg0)
suukim has quit [Quit: Konversation terminated!]
greengriminal has quit [Ping timeout: 248 seconds]
greengriminal has joined #ruby
<teardown> NL3limin4t0r: cool, thanks. how do i access netaddr's CIDR.create method
chalkmonster has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
<teardown> i have never understood this, why cant i use the full namespace to call a method? NetAddr::CIDR.create('10.0.0.0/24') should work, as long as the library is required, correct?
<teardown> throughout documentation the full namespace is used like that but i have not been able call methods using that full namespace
<al2o3-cr> teardown: you're looking at documentation for netaddr 1.5.0, latest is 2.0.3 which doesn't have CIDR namespace.
<teardown> al2o3-cr: well that explains it. fucking googl
<teardown> thanks al2o3-cr and NL3limin4t0r
<al2o3-cr> teardown: np
cliluw has quit [Read error: Connection reset by peer]
<NL3limin4t0r> teardown: I mostly navigate to documentation from the gem page. https://rubygems.org/ search your gem and click on homepage or documentation.
<teardown> NL3limin4t0r: noted. i'll do the same from here on out.
Swyper has joined #ruby
<teardown> also, https://www.rubydoc.info/gems returns a 503
<teardown> i assume the community is aware
cliluw has joined #ruby
<NL3limin4t0r> I've had problems with rubydoc.info quite often where the documentation for certain gems fails to generate or the complete website lies flat for a few minutes. :-( Hopefully they fix their issues some day.
<teardown> NL3limin4t0r: yeah. at least it hasn't entirely disappeared, eh? (looking at you, ruby forge)
bitwinery has joined #ruby
cd has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
<NL3limin4t0r> ^^
<NL3limin4t0r> I gotta go
<teardown> cool. thanks for the help
NL3limin4t0r is now known as NL3limin4t0r_afk
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
fphilipe_ has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 272 seconds]
bmurt has quit [Ping timeout: 264 seconds]
smithascari has joined #ruby
smithascari has quit [Client Quit]
ElFerna has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe_ has quit [Ping timeout: 264 seconds]
greengriminal has quit [Read error: Connection reset by peer]
greengriminal has joined #ruby
Technodrome has joined #ruby
ElFerna has quit [Ping timeout: 244 seconds]
tdy has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
iNs has quit [Write error: Connection reset by peer]
k0mpa has quit [Write error: Connection reset by peer]
regedit has joined #ruby
hutch has quit [Ping timeout: 246 seconds]
iNs has joined #ruby
involans has quit [Quit: involans]
ElFerna has joined #ruby
cow[moo] has joined #ruby
Swyper has joined #ruby
hutch has joined #ruby
Swyper has quit [Ping timeout: 272 seconds]
chalkmonster has quit [Quit: WeeChat 2.5]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
jenrzzz has joined #ruby
chalkmonster has quit [Client Quit]
hutch has quit [Ping timeout: 246 seconds]
hutch has joined #ruby
LtHummus has quit [Quit: ZNC 1.7.4 - https://znc.in]
deepreds1 has joined #ruby
deepredsky has quit [Ping timeout: 272 seconds]
LtHummus has joined #ruby
grilix has quit [Ping timeout: 272 seconds]
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElFerna has quit [Remote host closed the connection]
Swyper has joined #ruby
jenrzzz_ has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
Swyper has quit [Remote host closed the connection]
sameerynho has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
za1b1tsu has joined #ruby
nowhere_man has joined #ruby
fphilipe_ has joined #ruby
Swyper has joined #ruby
Emmanuel_Chanel has joined #ruby
ur5us has joined #ruby
deepreds1 has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Ping timeout: 250 seconds]
involans has joined #ruby
Eiam has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us_ has joined #ruby
fphilipe_ has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
ramfjord has quit [Ping timeout: 245 seconds]
sagax has quit [Remote host closed the connection]
s3nd1v0g1us has joined #ruby
ramfjord has joined #ruby
poontangmessiah has joined #ruby
za1b1tsu has quit [Ping timeout: 245 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
ramfjord has joined #ruby
greengriminal has quit [Quit: This computer has gone to sleep]
ramfjord has quit [Ping timeout: 245 seconds]
troulouliou_dev has quit [Quit: Leaving]
za1b1tsu has joined #ruby
ramfjord has joined #ruby
ellcs1 has joined #ruby
jenrzzz_ has quit [Ping timeout: 258 seconds]
chalkmonster has joined #ruby
mochiyoda has joined #ruby
<brool> it looks like a regular javascript fetch() is not XHR according to Rack::Request#xhr? -- i guess i could remediate this by fetching a POST request with a key, but is there some other way i could make sure that requests from fetch API are detected as ajax requests?
greengriminal has joined #ruby
yann-kaelig has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
jokke is now known as repo
ramfjord has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
repo is now known as jokke
jokke has left #ruby ["WeeChat 2.5"]
drale2k_ has joined #ruby
ellcs1 has quit [Ping timeout: 264 seconds]
greengriminal has quit [Quit: Leaving]
dionysus69 has quit [Ping timeout: 245 seconds]
chalkmonster has quit [Ping timeout: 268 seconds]
Swyper has quit [Remote host closed the connection]
jenrzzz has joined #ruby
Akuhcap has joined #ruby
<Akuhcap> Hey id like to learn how to script in Ruby. Anyone know any goo resources that are somewhat up to date with newer versions?
<bougyman> have you ever "scripted" in any other language?
<Akuhcap> Very lightly in Python
<bougyman> I'd probably start with https://pine.fm/LearnToProgram/ then
<bougyman> it's a basic progamming lesson, but using ruby.
poontangmessiah has quit [Remote host closed the connection]
<Akuhcap> Ok
<Akuhcap> I'll use it, thank you
englishm has quit [Excess Flood]
ElFerna has joined #ruby
englishm has joined #ruby
x86sk has joined #ruby
fphilipe_ has joined #ruby
elphe has joined #ruby
aphprentice__ has joined #ruby
elphe has quit [Ping timeout: 244 seconds]
fphilipe_ has quit [Ping timeout: 264 seconds]
psmolen has quit [Ping timeout: 245 seconds]
psmolen has joined #ruby
elphe has joined #ruby
englishm has quit [Excess Flood]
englishm has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
involans has quit [Quit: involans]
ramfjord has quit [Ping timeout: 272 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElFerna has quit [Ping timeout: 245 seconds]
nowhere_man has joined #ruby
Akuhcap has quit [Read error: Connection reset by peer]
ramfjord has joined #ruby
reber has quit [Remote host closed the connection]