oliv_____ has quit [Remote host closed the connection]
sarmiena_ has joined #ruby
Pacra has quit [Ping timeout: 255 seconds]
bronson has quit [Ping timeout: 260 seconds]
marr has quit [Ping timeout: 268 seconds]
Moosashi has joined #ruby
raspado has quit [Remote host closed the connection]
raspado has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
forgot has quit [Ping timeout: 258 seconds]
forgot has joined #ruby
raspado has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
dh64 has quit [Quit: Konversation terminated!]
sarmiena_ has quit [Quit: sarmiena_]
brent__ has joined #ruby
guacamol_ has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
oliv_____ has joined #ruby
Pacra has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamol_ has quit [Ping timeout: 240 seconds]
brent__ has quit [Ping timeout: 248 seconds]
oliv_____ has quit [Ping timeout: 248 seconds]
npgm has joined #ruby
ElFerna has joined #ruby
oliv_____ has joined #ruby
ecuanaso has joined #ruby
Moosashi has quit [Quit: Moosashi]
cdg has joined #ruby
raspado has joined #ruby
Puffball has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 255 seconds]
oliv_____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
Puffball has joined #ruby
nacsurte has quit [Ping timeout: 268 seconds]
MtnGoat has joined #ruby
raspado has quit [Remote host closed the connection]
raspado has joined #ruby
shakes has joined #ruby
mim1k has joined #ruby
shakes has quit [Client Quit]
raspado has quit [Ping timeout: 248 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
d^sh has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has quit [Ping timeout: 248 seconds]
olivi____ has quit [Remote host closed the connection]
gizmore|2 has joined #ruby
olivi____ has joined #ruby
d^sh_ has quit [Ping timeout: 255 seconds]
bronson has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 268 seconds]
olivi____ has quit [Ping timeout: 268 seconds]
Dreamer3_ has joined #ruby
jameser has joined #ruby
bruno- has quit [Ping timeout: 248 seconds]
enterprisey has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raul782 has joined #ruby
Moosashi has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
oliv_____ has joined #ruby
<Fire-Dragon-DoL>
anyone aware of the encoding returned by Net::IMAP::FetchData.attr["BODY[]"] (returns the full email)? I see in console it's returning utf-8, but it seems weird since internal charset might contain non-utf8 codes. I would have expected ASCII-8BIT or something along those lines
jackjackdripper has quit [Quit: Leaving.]
milardovich has joined #ruby
uZiel has joined #ruby
kies has quit [Ping timeout: 248 seconds]
oliv_____ has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
tunaBee_ has joined #ruby
olivi____ has joined #ruby
milardovich has joined #ruby
<arahael>
Fire-Dragon-DoL: Unless they specify it, I would assume it could be in any encoding.
AustinIncognito has joined #ruby
<arahael>
Fire-Dragon-DoL: Do you have a Content-Type?
chrisarc1nd has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
Tralin has quit [Ping timeout: 260 seconds]
Didac has quit [Ping timeout: 260 seconds]
hurricanehrndz has quit [Ping timeout: 260 seconds]
tunaBee_2 has quit [Ping timeout: 260 seconds]
AustinMatherne has quit [Ping timeout: 260 seconds]
hkdsun has quit [Ping timeout: 260 seconds]
m27frogy has quit [Ping timeout: 260 seconds]
chrisarcand has quit [Remote host closed the connection]
genpaku has quit [Remote host closed the connection]
Bish has quit [Remote host closed the connection]
KrzaQ has quit [Excess Flood]
Tralin_ has joined #ruby
Guest55145 has quit [Remote host closed the connection]
<arahael>
(And maybe, a Content-Transfer-Encoding?)
freeze has quit [Remote host closed the connection]
Bish has joined #ruby
m27frogy has joined #ruby
genpaku_ has joined #ruby
ule has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
arahael: I might be ignorant but when you use BODY[] you are fetching the whole mail, so I'm talking before even starting the parsing of it
freeze has joined #ruby
ozzloy has quit [Remote host closed the connection]
ule has joined #ruby
<Fire-Dragon-DoL>
infact, I expected something like a raw stream of bytes :p
hkdsun has joined #ruby
genpaku_ is now known as genpaku
Didac has joined #ruby
Guest89848 has quit [Excess Flood]
jolamb has quit [Ping timeout: 260 seconds]
uZiel has quit [Ping timeout: 248 seconds]
<arahael>
Fire-Dragon-DoL: In practice, I think you can at least assume ASCII to get to the headers, but then, you'll need to use the 'correct' encoding for the contents.
bruno- has joined #ruby
<Fire-Dragon-DoL>
I thought that too, but I was wrong, looks like we found email messages with INVALID utf-8 characters
KrzaQ has joined #ruby
<arahael>
Fire-Dragon-DoL: Absolutely.
giraffe has joined #ruby
hurricanehrndz has joined #ruby
konsolebox has joined #ruby
<Fire-Dragon-DoL>
and net/imap was returning BODY[] as utf-8 with headers with invalid characters
giraffe is now known as Guest17892
jolamb has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
bokayio has quit [Ping timeout: 240 seconds]
ansraliant has quit [Ping timeout: 240 seconds]
<Fire-Dragon-DoL>
hence my question, what should I do in those cases? My idea so far is just encode in utf-8 and scrubbing/replacing any invalid character
<Fire-Dragon-DoL>
because I can't really do anything else if the encoding is invalid
<Fire-Dragon-DoL>
(in the headers)
<Fire-Dragon-DoL>
mhhh
<arahael>
Fire-Dragon-DoL: You could hope that Ruby didn't actually convert the encoding, and thus, try changing the underlying encoding.
<Fire-Dragon-DoL>
arahael: acctually that's my fear, but I have no idea what would be the original...
<arahael>
Fire-Dragon-DoL: I think force_encoding does that? (I'm not really a ruby dev - spending more time in other languages)
<Fire-Dragon-DoL>
yes it does that
<arahael>
Fire-Dragon-DoL: Another consideration, is that you will sometimes absolutely have mixed-encoding emails.
bokayio has joined #ruby
govg has joined #ruby
ansraliant has joined #ruby
sts has joined #ruby
mtkd has joined #ruby
ozzloy has joined #ruby
ozzloy has joined #ruby
ozzloy has quit [Changing host]
sts is now known as Guest925
<Fire-Dragon-DoL>
yes but that comes later
<Fire-Dragon-DoL>
see my point
<Fire-Dragon-DoL>
how could net/imap return a utf-8 string
<Fire-Dragon-DoL>
if the email is mixed encoding?
<Fire-Dragon-DoL>
it doesn't make any sense
milardovich has quit [Remote host closed the connection]
raul782 has quit []
olivi____ has quit [Remote host closed the connection]
<Fire-Dragon-DoL>
time to try hard "\xEC\xEE\xF1\xE9\xF8\xE4: Could you help me out?\r\n\r\nbody\u3042\x81\x00\0"
<arahael>
Fire-Dragon-DoL: Maybe it's the default external and internal Encoding?
<arahael>
Fire-Dragon-DoL: Keep in mind that I'm *not* a ruby dev.
<arahael>
Fire-Dragon-DoL: So could be completely wrong w.r.t. ruby. ;)
<Fire-Dragon-DoL>
yes, no problem. I don't know a lot of devs able to answer this. I think it's a matter of checking the source of net/imap
<Fire-Dragon-DoL>
which is something I must do by myself :P
mikeiniowa has quit [Remote host closed the connection]
eljimbo has joined #ruby
<arahael>
Enjoy.
mikeiniowa has joined #ruby
Moosashi has quit [Quit: Moosashi]
rundor has joined #ruby
jnollette has joined #ruby
astrobunny has joined #ruby
oliv_____ has quit [Remote host closed the connection]
rundor has quit [Client Quit]
oliv_____ has joined #ruby
rundor has joined #ruby
astrobun_ has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
bronson has joined #ruby
oliv_____ has quit [Ping timeout: 258 seconds]
rundor has quit [Client Quit]
rundor has joined #ruby
rundor has quit [Client Quit]
Moosashi has joined #ruby
bronson has quit [Ping timeout: 258 seconds]
Eiam_ has joined #ruby
__Yiota has joined #ruby
Moosashi has quit [Quit: Moosashi]
MtnGoat has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
HoierM has quit [Ping timeout: 260 seconds]
marxarelli is now known as marxarelli|afk
patr0clus has joined #ruby
duderonomy has joined #ruby
jinie_ has quit [Ping timeout: 240 seconds]
dviola has quit [Quit: WeeChat 1.9]
duderonomy has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
jinie_ has joined #ruby
nacsurte has joined #ruby
gix has quit [Ping timeout: 240 seconds]
eljimbo has quit [Quit: This computer has gone to sleep]
duderono_ has joined #ruby
duderonomy has quit [Ping timeout: 246 seconds]
gix has joined #ruby
<Fire-Dragon-DoL>
mhhh... this isreally painful
nacsurte has quit [Ping timeout: 260 seconds]
<Fire-Dragon-DoL>
I've been digging through ruby net/imap source but it's hard to understand the encoding type of the string. It LOOKS like they overlooked entirely the encoded fact, but then there are some regexps whcih are for ascii-8bit. It feels like they work with ascii-8bit all time and then forgot to ensure it was encoded properly when sending it to the developer
tacoboy has quit [Remote host closed the connection]
kies has joined #ruby
mim1k has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
bronson has joined #ruby
uZiel has joined #ruby
bronson has quit [Ping timeout: 248 seconds]
madgen has quit [Ping timeout: 246 seconds]
uZiel has quit [Ping timeout: 248 seconds]
patr0clus has quit [Quit: tempusfugit]
MichaelBurge has quit [Remote host closed the connection]
QualityAddict has quit [Quit: Leaving]
MichaelBurge has joined #ruby
jakew has joined #ruby
Dreamer3_ has quit [Quit: Leaving...]
jakew has quit [Client Quit]
jackjackdripper has joined #ruby
jakew has joined #ruby
jakew has quit [Client Quit]
jakew has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jakew has quit [Client Quit]
gusrub has quit [Remote host closed the connection]
drcode has joined #ruby
deep-book-gk_ has joined #ruby
deep-book-gk_ has left #ruby [#ruby]
gnufied has quit [Ping timeout: 240 seconds]
renchan has joined #ruby
cagomez has joined #ruby
mim1k has joined #ruby
elcontrastador has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Dreamer3_ has joined #ruby
bronson has joined #ruby
runescape07rsps has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 260 seconds]
nofxxx has joined #ruby
ramfjord has joined #ruby
tunaBee_ has quit [Ping timeout: 240 seconds]
tunaBee has joined #ruby
zapata has quit [Ping timeout: 276 seconds]
Eiam_ has quit [Ping timeout: 276 seconds]
zapata has joined #ruby
nofxxxx has quit [Ping timeout: 255 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
charliesome_ has joined #ruby
millerti has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
charliesome has quit [Ping timeout: 255 seconds]
nacsurte has joined #ruby
ur5us has quit [Remote host closed the connection]
nacsurte has quit [Ping timeout: 240 seconds]
brent__ has joined #ruby
iceden has quit [Ping timeout: 240 seconds]
iceden has joined #ruby
brent__ has quit [Ping timeout: 240 seconds]
Bock has joined #ruby
rabajaj has joined #ruby
smulverine has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
aufi has joined #ruby
s1kx has joined #ruby
bruno- has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
jenrzzz has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v2.9 Beta Build (2017/07/26) 64 Bit]
grant has joined #ruby
Tempesta has joined #ruby
anisha has joined #ruby
DTZUZO has joined #ruby
bronson has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
howdoi has joined #ruby
dh64 has joined #ruby
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
astrobun_ has quit [Remote host closed the connection]
z0mbee has joined #ruby
nacsurte has joined #ruby
armyriad has quit [Ping timeout: 268 seconds]
jameser_ has joined #ruby
ramfjord has joined #ruby
armyriad has joined #ruby
jameser has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
MrBusiness has quit [Ping timeout: 240 seconds]
nacsurte has quit [Ping timeout: 240 seconds]
z0mbee has quit [Quit: leaving]
ramfjord has quit [Ping timeout: 255 seconds]
z0mbee has joined #ruby
z0mbee has left #ruby [#ruby]
andrzejku has joined #ruby
astrobunny has joined #ruby
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackjackdripper has quit [Quit: Leaving.]
MrBusiness has joined #ruby
muzik has joined #ruby
ramfjord has joined #ruby
grant has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has quit [Ping timeout: 260 seconds]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
moeabdol has quit [Quit: WeeChat 1.9]
Awsy has joined #ruby
astrobunny has quit [Remote host closed the connection]
conta has joined #ruby
astrobunny has joined #ruby
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
radic has joined #ruby
aupadhye has joined #ruby
code_zombie has quit [Quit: Leaving]
djbkd has quit [Remote host closed the connection]
npgm has quit [Quit: Connection closed for inactivity]
vondruch has quit [Quit: vondruch]
antgel has joined #ruby
DoubleMalt has joined #ruby
johnny56 has quit [Ping timeout: 264 seconds]
johnny56_ has joined #ruby
vondruch has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Snowy has quit [Remote host closed the connection]
Snowy has joined #ruby
<dminuoso>
Fire-Dragon-DoL: As far as I can tell, net/imap is not responsible for encoding.
InfinityFye has joined #ruby
DoubleMalt has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
nacsurte has joined #ruby
postmodern has quit [Quit: Leaving]
marr has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
dionysus69 has joined #ruby
nacsurte has quit [Ping timeout: 246 seconds]
moeabdol has joined #ruby
astrobunny has quit [Read error: Connection reset by peer]
astrobunny has joined #ruby
moeabdol has quit [Client Quit]
hurricanehrndz has quit [Quit: Goodbye]
ghr has joined #ruby
ghr has left #ruby [#ruby]
eelster[away] is now known as eelster
eelster is now known as eelster[away]
hurricanehrndz has joined #ruby
moeabdol has joined #ruby
mikecmpbll has joined #ruby
mim1k has joined #ruby
Silthias has joined #ruby
charliesome has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
Silthias2 has joined #ruby
charliesome has quit [Client Quit]
vondruch has quit [Quit: vondruch]
Silthias1 has quit [Ping timeout: 240 seconds]
vondruch has joined #ruby
vondruch has quit [Remote host closed the connection]
vondruch has joined #ruby
Silthias has quit [Ping timeout: 255 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
solrize has joined #ruby
<solrize>
heyall. does it sound feasible to modify ruby to dump and reload images the way emacs lisp and similar systems have done in the past? the idea is to get quicker startup for an application with lots of code (big rails app + some 100s of gems)
<havenwood>
solrize: see the bootsnap gem
<solrize>
thanks, looking
<shmoon>
wanted to understand csrf attack in oauth and how state param prevents it ? :/
ur5us has quit [Remote host closed the connection]
<shmoon>
wow what is that $30m in series C
<shmoon>
havenwood: i understand that article but it doesn't explain how XSRF happens without state token which is what I'm confused about.
jaruga has joined #ruby
moeabdol has quit [Quit: WeeChat 1.9]
<havenwood>
shmoon: you don't want me getting you to follow a link to do something malicious on a service you're authenticated with
<dminuoso>
I do however.
<havenwood>
\o/
Snowy has quit [Quit: ragequit]
<havenwood>
shmoon: or a script to send you there without clicks, however you get there
Beams has joined #ruby
<havenwood>
shmoon: like you login to your bank and then inadvertently follow a link to: schoombank.com/xfer?dollars=all&acct=havenwood
<dminuoso>
Of course that now raises the really important question:
<dminuoso>
Why does havenwood have a schoom account?
<havenwood>
shmoon: it's you asking, but i don't know your sekret
<havenwood>
dminuoso: mmm, the plot thickens
charliesome has joined #ruby
workmad3 has joined #ruby
<havenwood>
shmoon: but if when you authenticate you get a uuid, it can spot the imposter when that uuid can't be repeated back
<havenwood>
shmoon: so some rando can't get you to follow a link to do things
<havenwood>
shmoon: make sense?
<dminuoso>
solrize: Realistically there a couple XSRF vectors in OAuth2. All revolve in the attacker taking control over which service you authorize.
<havenwood>
shhhhmoon*
<solrize>
:)
ltem has joined #ruby
Silthias2 has left #ruby [#ruby]
ur5us has joined #ruby
<dminuoso>
solrize: This can be especially problematic in clickjacking. Imagine a transparent iframe ontop of a regular website that looks familiar to you. Now the "get latest tweets" is actually beneath a transparent "Authorize havenwood to get full details of your bank account" type of button.
<solrize>
dminuoso, that was shmoon asking about oath xsrf
<dminuoso>
solrize, shmoon
<dminuoso>
whats the difference
<solrize>
:)
<havenwood>
one is orange and the other purple, in my world
<dminuoso>
No.
<dminuoso>
Your world is wrong.
<dminuoso>
purple and red.
<dminuoso>
Ah well. And the levenshtein distance between them is 6.
<dminuoso>
So there's that
garathem has joined #ruby
Silthias has joined #ruby
nacsurte has joined #ruby
high_fiver has joined #ruby
nacsurte has quit [Ping timeout: 246 seconds]
bronson has joined #ruby
pandaant has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
bronson has quit [Ping timeout: 268 seconds]
<shmoon>
I know what xsrf is in general. but in relation to oauth2 protocol is where I am getting confused havenwood dminuoso
<shmoon>
but the last point doesn't make sense to me "Voila, press Log In with that OAuth Provider - you are logged in directly to User's account on site.com."
Beams_ has joined #ruby
aupadhye has joined #ruby
Beams has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
domgetter has quit [Ping timeout: 276 seconds]
sysvalve has joined #ruby
_whitelogger has joined #ruby
pizzaops_ has joined #ruby
sarbs has quit [Ping timeout: 276 seconds]
lel has quit [Ping timeout: 268 seconds]
nadir has quit [Ping timeout: 276 seconds]
pizzaops has quit [Ping timeout: 276 seconds]
_whitelogger_ has quit [Remote host closed the connection]
empty_cup has quit [Ping timeout: 276 seconds]
Eiam has quit [Ping timeout: 276 seconds]
caw has quit [Ping timeout: 276 seconds]
solrize has quit [Ping timeout: 276 seconds]
willymox has joined #ruby
willymox has quit [Ping timeout: 240 seconds]
slima_ has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
pecan has joined #ruby
pecan has quit [Ping timeout: 276 seconds]
<tynamite>
I can't figure out how to setup a reverse proxy to link my webrick server with apache like the tutorial says.
yeticry_ has quit [Read error: Connection reset by peer]
<Bish>
i get :ON_OPEN_AND_CLICK, i cant realy change that
naprimer2 has joined #ruby
<ljarvis>
then I don't understand your question
<Bish>
well, third case is a combination of first and senc
<Bish>
i would love to not write that 2 times
<ljarvis>
but it's a different condition
<Bish>
:(
<Bish>
can case when do fancy stuff with arrays?
<ljarvis>
fancy? like what?
<Bish>
well like take an array as parameter for when
<ljarvis>
well sure
<ljarvis>
when array
<Bish>
instead of writing :A,:B
adlerdias_ has joined #ruby
<ljarvis>
right.. you need to be specific
<Bish>
giving it [:A,:B]
<ljarvis>
when *array
<Bish>
oh that works?
<ljarvis>
try it
<Bish>
dont tell me when is a method, i gonna flip
<ljarvis>
it's not a method
ShekharReddy has quit [Quit: Connection closed for inactivity]
<ljarvis>
it just takes a comma separated list of params, and splatting an array returns a comma separated list of params (in a low level sense)
adlerdias has quit [Ping timeout: 248 seconds]
hkdsun has quit [Ping timeout: 240 seconds]
hkdsun has joined #ruby
tacoboy has joined #ruby
tvw has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElFerna has quit [Ping timeout: 276 seconds]
ta_ has quit [Remote host closed the connection]
Ishido has quit [Ping timeout: 240 seconds]
lacuna has joined #ruby
ElFerna has joined #ruby
brent__ has joined #ruby
workmad3 has joined #ruby
ldnunes has quit [Ping timeout: 276 seconds]
kahra has quit [Quit: WeeChat 1.9]
nadir has joined #ruby
sepp2k has joined #ruby
jrs has quit [Remote host closed the connection]
Ishido has joined #ruby
DK2 has quit [Ping timeout: 276 seconds]
jrs has joined #ruby
brent__ has quit [Ping timeout: 255 seconds]
nacsurte has joined #ruby
DK2 has joined #ruby
jrs has quit [Remote host closed the connection]
<Bish>
can i make 2 constants point to the same reference?
<Bish>
can i copy modules?
<Bish>
does const_set(:new,const_get(:old))
<Bish>
do that trick?
<ljarvis>
did you try it?
<Bish>
faster to ask, no
jrs has joined #ruby
mim1k has quit [Ping timeout: 276 seconds]
synthroid has joined #ruby
nacsurte has quit [Ping timeout: 268 seconds]
<ljarvis>
well, not really
<ljarvis>
you'd know if you opened irb and tried it
<Bish>
i dont know if it comes with weird implications
<Bish>
if these 2 constants reference the same thing
<Bish>
or the module gets copied
<Bish>
i expected hints like that
<Bish>
even if it works
<Bish>
thats why i rather ask
<Bish>
not only because of speed
ldnunes has joined #ruby
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
<ljarvis>
you've been here long enough to know how to ask well formed questions, and you're clearly smart enough to do the research quickly yourself, but you still seem to just ask without thinking
<Bish>
thinking is stupid :(
<ljarvis>
so, let me ask, what do you actually want? do you have code to show it?
quobo has joined #ruby
jrs has quit [Remote host closed the connection]
<Bish>
the code is big, wouldnt give you much, i have 2 big modules which act as handler for messages
<Bish>
and i found out that 2 handlers basicially do the same
jrs has joined #ruby
<ljarvis>
you can always provide small examples to help people who are taking their time to help you
<Bish>
and i have a mapping of module name => module
<ljarvis>
a Hash?
<Bish>
yes something like
<Bish>
{:ax_by_cz=>AxByCz}
<Bish>
and AxByCz has a self.call method, which ets called if message :ax_by_cz comes in
ramfjord has joined #ruby
<Bish>
and i noticed 2 of the modules share 90% of the code so i coul DRY it out
truenito has joined #ruby
adlerdias has joined #ruby
gheegh has joined #ruby
<ljarvis>
so, you move that 90% into a new module that's included into the other 2
<Bish>
hm, they both only contain that one method
<Bish>
they dont have something else, so include is not really an option
<ljarvis>
so they share 100% of the code?
<ljarvis>
but there's only 1 method
<Bish>
no the 2 methods are different
<ljarvis>
2 methods? there are now two of them
<Bish>
no, each module has 1 each
<Bish>
and those methods have alot in common
<ljarvis>
how much code belongs to this one method?
<Bish>
100% :D of the module
<ljarvis>
well there's your problem
<ljarvis>
break it down into reusable pieces
<ljarvis>
then extract the bits being reused into a module that's included in both other things
<Bish>
well thats hard, since its basicially a huge database transaction
<ljarvis>
that doesn't tell me why it's hard
<Bish>
and it only uses 1 other class
<Bish>
object* rather
<ljarvis>
now you're just saying words, because i have not a zero clue about how your code works without an example
lacuna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Bish>
;;, yes well, i dont think it would bring us much if i posted that code here
<Bish>
there is so much context
ramfjord has quit [Ping timeout: 276 seconds]
adlerdias_ has quit [Ping timeout: 276 seconds]
<ljarvis>
ok sure, well good luck with your problem
<Bish>
i really didnt want to be a annoying question asker.. i really think it wouldnt give you anything
<Bish>
writing an example for that would take alot of time
<Bish>
but thanks, i appreciate your effort
<ljarvis>
ok, well we wouldn't want to use your time
<Bish>
man.. i really didnt want to be like that im sorry
jrs has quit [Remote host closed the connection]
<Bish>
you really dont need to help me, dont be mean :/
jrs has joined #ruby
jrs has quit [Remote host closed the connection]
ElFerna has quit [Ping timeout: 268 seconds]
jrs has joined #ruby
Didac has quit [Changing host]
Didac has joined #ruby
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
gnufied has joined #ruby
diegobiavati has joined #ruby
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
eelster has joined #ruby
<ljarvis>
Bish: I want to help, but without a well formatted question and some basic code, there's really nothing anyone can do and you're wasting your own precious time as well as others. I'm not expecting to see thousands of lines of code, but you could have created a very basic reproduction in simple terms and then outlaid 1-3 questions very easily with minimal work
howdoi has quit [Quit: Connection closed for inactivity]
umaaji has quit [Ping timeout: 240 seconds]
<Bish>
sorry, i am not good at that, thats why i tried to ask a general question, sorry didnt want to bother you like that
lacuna has joined #ruby
<octomancer>
the perl guys are way better at passive-aggressive entitlement than you lot ;-)
<gheegh>
Bish: There is a good tutorial out there about how to structure code.. i've been programming in Ruby since 2005 and I thought it was interesting/ehlpful.
<gheegh>
let me find it
<gheegh>
(i'm jumping on the tail end of this conversation, if its helpful only.. i might not have the right context)
<ljarvis>
Bish: not being good at it is fine, but lets help you get better at it
<Bish>
gheegh: im coding for long time too i guess i will never be good at it, but ill give it a shot
bronson has joined #ruby
<gheegh>
this is the code notes on Sandi Metz's book "Practical Object Oriented Design with Ruby"
<gheegh>
The net of what i've learned is "don't fear the class"
<gheegh>
something that is complex, should probably be in its own class
jinie_ has quit [Ping timeout: 276 seconds]
<Bish>
ljarvis: thats why i asked a simple question in the beginning.. i didnt want to steal someones time
jinie_ has joined #ruby
<Bish>
since copying the module would do the trick i guess…
stoffus has quit [Ping timeout: 255 seconds]
<ljarvis>
Bish: doing X = Y doesn't copy the Y module to X, it points the X constant to the Y constant which just happens to be the name of a module
bronson has quit [Ping timeout: 240 seconds]
<ljarvis>
when you look at class Foo or module Bar -- Foo and Bar are just constants. They're not even necessary, they're just a helpful way to refer to a class
eelster has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
<ljarvis>
or module
<Bish>
yeah i know that, kinda
<ljarvis>
ok, great
eelster has joined #ruby
<Bish>
it confuses me, but basicially i know all that
jphase has joined #ruby
<ljarvis>
what part confuses you?
<Bish>
i guess B = Module.new(A)
<Bish>
references and stuff
mim1k has joined #ruby
<Bish>
i mean const_set(:B,const_get(:A))
<Bish>
should copy const A to B, wouldnt it?
<ljarvis>
that's just B = A
<Bish>
ah, okay.
Qchmqs__ has joined #ruby
<Bish>
but, basicially that would work, right?
tvw has quit [Remote host closed the connection]
andikr has quit [Ping timeout: 255 seconds]
<Bish>
because B is really the module WhateverParent::B
<ljarvis>
work in what sense? the code would work yes, but it depends what you want it to do
roshanavand has quit [Remote host closed the connection]
<Bish>
yeah as i said, in this case, the module only has a method "call" which doesnt reference other things as much
duderono_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has joined #ruby
lacuna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has joined #ruby
lacuna has joined #ruby
phinxy has quit [Read error: Connection reset by peer]
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eelster has joined #ruby
cdg has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 255 seconds]
Bhootrk_ has quit [Read error: Connection reset by peer]
gnufied has quit [Ping timeout: 255 seconds]
sysvalve has quit [Quit: Leaving]
tacoboy has joined #ruby
Serpent7776 has quit [Quit: Leaving]
amclain has joined #ruby
gusrub has quit [Remote host closed the connection]
barx has quit [Quit: barx]
lacuna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olivi____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
rgtk has quit [Ping timeout: 260 seconds]
olivi____ has quit [Remote host closed the connection]
olivi____ has joined #ruby
eelster has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
haylon has joined #ruby
gusrub has joined #ruby
kwesidev has joined #ruby
gnufied has joined #ruby
futilegames has quit [Quit: futilegames]
herbmillerjr has quit [Quit: Konversation terminated!]
<baweaver>
zmo: If you use Pry most of that comes built in.
<baweaver>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<zmo>
baweaver - TBH, I'm using rails console and I'm connecting to heroku remotely
<baweaver>
Ah, Not immediately sure if you can do that on Heroku but I'd guess you can with pry-rails or similar tools.
sarmiena_ has joined #ruby
moeabdol has quit [Ping timeout: 255 seconds]
<banisterfiend>
if you set pry-rails as your console it'll 'just work' with heroku @zmo
rgtk has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
bronson has quit [Remote host closed the connection]
nowhere_man has joined #ruby
bronson has joined #ruby
FastJack has joined #ruby
Ishido has joined #ruby
cadillac_ has quit [Ping timeout: 246 seconds]
raspado has quit [Quit: Leaving...]
mikecmpbll has quit [Quit: inabit. zz.]
cadillac_ has joined #ruby
rgtk has quit [Read error: Connection reset by peer]
nacsurte has joined #ruby
t-recx has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
rgtk has joined #ruby
ar1a has quit [Ping timeout: 255 seconds]
kies has quit [Ping timeout: 268 seconds]
anisha has quit [Quit: This computer has gone to sleep]
ar1a has joined #ruby
olivi____ has quit [Remote host closed the connection]
eelster has joined #ruby
olivi____ has joined #ruby
Beams_ has quit [Quit: .]
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
BSab has joined #ruby
olivi____ has quit [Ping timeout: 246 seconds]
conta has joined #ruby
uZiel has joined #ruby
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
conta has quit [Remote host closed the connection]
chouhoul_ has joined #ruby
cdg has joined #ruby
conta has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
KeyJoo has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
sarmiena_ has quit [Quit: sarmiena_]
marxarelli|afk is now known as marxarelli
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
barx has joined #ruby
jrs has quit [Remote host closed the connection]
vee_ has quit [Ping timeout: 268 seconds]
barx has quit [Client Quit]
jrs has joined #ruby
alveric1 has quit [Quit: WeeChat 1.9]
jrs has quit [Remote host closed the connection]
renchan has quit [Quit: Leaving...]
oliv_____ has joined #ruby
alveric has joined #ruby
jrs has joined #ruby
jrs has quit [Remote host closed the connection]
mim1k has joined #ruby
jrs has joined #ruby
barx has joined #ruby
rgtk has quit [Ping timeout: 248 seconds]
jackjackdripper has joined #ruby
TomyWork has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 255 seconds]
jackjackdripper has quit [Client Quit]
jackjackdripper has joined #ruby
ColeHub has joined #ruby
BSab has quit [Quit: Leaving]
BSaboia has joined #ruby
roshanavand has joined #ruby
madgen has quit [Quit: Lost terminal]
SteenJobs_ has joined #ruby
bronson has quit [Remote host closed the connection]
code_zombie has joined #ruby
sepp2k has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bruno- has joined #ruby
__Yiota has joined #ruby
haylon has quit [Remote host closed the connection]
ColeHub has joined #ruby
WeiJunLi has joined #ruby
<chrisseaton>
If I have a string A, and want to replace all instances of some other string B, with string C instead, how should I best do that in Ruby? C may contain anything, so String#gsub won't work.
JBlazeCoder21 has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Eiam has joined #ruby
oliv_____ has joined #ruby
<havenwood>
chrisseaton: C isn't a string?
<havenwood>
chrisseaton: What would example values for A, B and C be? I'm not quite sure I follow.
alex`` has quit [Quit: WeeChat 1.9]
<chrisseaton>
I want to do a.gsub(b, c)
<chrisseaton>
All are strings
bronson has joined #ruby
<havenwood>
>> 'xo24xo24xo'.gsub '24', '42'
<chrisseaton>
But c could contain any string at all, so could include back-references, which I don't want evaluated as a regexp
<ruby[bot]>
havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood>
=> "xo42xo42xo"
<havenwood>
ahhh
<chrisseaton>
>> 'foo'.gsub('f', '\0')
<ruby[bot]>
chrisseaton: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
chouhoul_ has quit [Remote host closed the connection]
<ruby[bot]>
havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood>
#=> "xo\\0xo\\0xo"
<havenwood>
Well, bot is down.
* ljarvis
obviously read 0 backlog
<havenwood>
chrisseaton: The best I can think is to Regexp.escape the values.
bronson has quit [Ping timeout: 248 seconds]
<chrisseaton>
I'm sure I must be overlooking some methods... surely there must be a core library method to do something as simple as substitute a string...
[Butch] has quit [Quit: I'm out . . .]
rabajaj has joined #ruby
<havenwood>
String#tr won't work. I'm afraid there isn't.
<havenwood>
Hmm
conta has quit [Ping timeout: 276 seconds]
<havenwood>
Regexp.escape is no good I suppose because of the noise the escaping causes.
<herwin>
that's the only string sub I could think of
<herwin>
but wouldn't be surprised if it used regex under the hood
valkyr2e has quit [Quit: Bye.]
<havenwood>
chrisseaton: how about: 'xo24xo24xo'.gsub('24') { '\0' }
<havenwood>
#=> "xo\\0xo\\0xo"
Bock has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
<chrisseaton>
Ah clever, thanks
<havenwood>
It'd set $1, $2, $`, $&, and $' but if that's okay at least it gets the value right.
AndBobsYourUncle has joined #ruby
<havenwood>
You're welcome
ColeHub has quit [Quit: Snooze.]
valkyr2e has joined #ruby
kwesidev has joined #ruby
jrs has quit [Remote host closed the connection]
jrs has joined #ruby
oliv_____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
eelster has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
ColeHub has joined #ruby
SeepingN has joined #ruby
s1kx has quit [Quit: s1kx]
ColeHub has quit [Client Quit]
ColeHub has joined #ruby
oliv_____ has quit [Ping timeout: 246 seconds]
andrzejku has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lasenna[m] has joined #ruby
cdg has joined #ruby
eelster has joined #ruby
vuoto has quit [Remote host closed the connection]
olivi____ has joined #ruby
cadillac_ has quit [Ping timeout: 268 seconds]
cadillac_ has joined #ruby
ule has quit [Changing host]
ule has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
high_fiver has joined #ruby
runescape07rsps has joined #ruby
high_fiver has quit [Read error: Connection reset by peer]
high_fiver has joined #ruby
anisha has joined #ruby
AndBobsYourUncle has joined #ruby
boto has quit [Quit: boto]
olivi____ has quit [Remote host closed the connection]
_moep_ has quit [Remote host closed the connection]
Tempesta_ has joined #ruby
ElFerna has joined #ruby
Tempesta has quit [Ping timeout: 268 seconds]
dliobom has left #ruby [#ruby]
ColeHub has quit [Quit: Snooze.]
oliv_____ has joined #ruby
rabajaj has quit [Remote host closed the connection]
lacuna has joined #ruby
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
anistor86 has joined #ruby
ForeignBiscuit has joined #ruby
anistor86 has left #ruby ["Ex-Chat"]
enterprisey has joined #ruby
rabajaj has joined #ruby
anistor86 has joined #ruby
<anistor86>
hello everyone!
<havenwood>
anistor86: hi!
<anistor86>
i am new to the ruby world...and I really like it!
<anistor86>
I am currently in London and studying ruby and everything in english, and I was thinking to do something for the italian comunity
<havenwood>
anistor86: welcome!
<havenwood>
anistor86: nice
<anistor86>
does anyone know if the italian community is still alive?
ResidentBiscuit has quit [Ping timeout: 240 seconds]
<havenwood>
anistor86: There is a #ruby-it channel. I'm not sure on its population.
<anistor86>
it's just because I was web developer back in italy (long time ago) and at that time my english wasn't good and I struggled a bit to learn in english...so I wan't to help the italian community for that!
<ule>
Hey guys, I'm getting a nice deprecated warning here when I do assert_equal FOO, BAR when FOO and BAR are nil
<ule>
I can definity replace it to assert_nil and get rid of the deprecated message but I have some tests inside loops so, some of them are nil some of them are not
<ule>
so, What would you do? assert_equal FOO, BAR unless FOO.nil? + assert_nil FOO, BAR if FOO.nil?
cahoots has joined #ruby
ForeignBiscuit has joined #ruby
sleepee has joined #ruby
<ule>
I don't understand why deprecating my nice assert_equal NIL, NIL
<cahoots>
hi, if i run a command with `<command>` and then on the next line call $?.exitstatus, is it guaranteed to return the exit status of that command? or could it be overridden by some command running in parallel?
anistor86 has quit [Quit: Ex-Chat]
<Papierkorb>
ule: there was never a reason for `NIL`.
<yorickpeterse>
cahoots: $? is scoped per thread
ElFerna has quit [Ping timeout: 240 seconds]
<cahoots>
yorickpeterse, thanks :)
<yorickpeterse>
actually, seems behaviour contradicts the source
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<yorickpeterse>
ah no, that was just Pry messing things up
ElFerna has joined #ruby
bronson has joined #ruby
Pacra has quit [Ping timeout: 255 seconds]
mtkd has quit [Ping timeout: 246 seconds]
AndBobsY_ has joined #ruby
ozcanesen has joined #ruby
joast has joined #ruby
mtkd has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
wilbert has quit [Ping timeout: 246 seconds]
vuoto has quit [Remote host closed the connection]
* SeepingN
notes to "stick with wirb"
ElFerna has quit [Ping timeout: 240 seconds]
WeiJunLi has quit [Remote host closed the connection]
JBlazeCoder21 has quit [Remote host closed the connection]
weaksauce has joined #ruby
HoierM has joined #ruby
AndBobsY_ has quit [Ping timeout: 240 seconds]
lacuna has joined #ruby
wilbert has joined #ruby
lacuna has quit [Read error: Connection reset by peer]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr>
yorickpeterse: why do you say this?
<al2o3-cr>
irb is petty !confusing too
ecuanaso has joined #ruby
<al2o3-cr>
*pretty
justicefries has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has joined #ruby
Dry_Lips has quit [Changing host]
Cohedrin_ has quit [Read error: Connection reset by peer]
<SeepingN>
I haven't had irb screw things up too many times though.
Cohedrin_ has joined #ruby
conta has joined #ruby
ElFerna has quit [Ping timeout: 276 seconds]
ElFerna has joined #ruby
conta has quit [Ping timeout: 240 seconds]
t-recx has quit [Quit: t-recx]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has quit [Ping timeout: 258 seconds]
<al2o3-cr>
SeepingN: only human error fucks shit up
<SeepingN>
right
cdg has joined #ruby
<al2o3-cr>
damn right
guacamol_ has joined #ruby
<al2o3-cr>
damn cold
<SeepingN>
and when that human is "some dude who wrote this irb program" and "that other dude that updated the Great XYZ librarie of all rubies", and you discover the hard way that the 2 don't play well together, who's to blame?
<SeepingN>
you, for not writing the whole thing in ASM yourself
eljimbo has quit [Quit: This computer has gone to sleep]
eljimbo has joined #ruby
eljimbo has quit [Client Quit]
uZiel has joined #ruby
eljimbo has joined #ruby
<al2o3-cr>
SeepingN: human error is inevitable
eljimbo has quit [Client Quit]
eljimbo has joined #ruby
eljimbo has quit [Client Quit]
eljimbo has joined #ruby
eljimbo has quit [Client Quit]
JBlazeCoder21 has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
cdg has quit [Remote host closed the connection]
JBlazeCoder21 has quit [Ping timeout: 240 seconds]