baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: 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!
cthu| has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
kurko_ has joined #ruby
dogweather has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dogweather has quit [Remote host closed the connection]
Logico has quit [Quit: Leaving]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
cthulchu_ has quit [Ping timeout: 244 seconds]
dviola has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
uplime has joined #ruby
dmitch has quit [Quit: Textual IRC Client: www.textualapp.com]
mynameisdebian has joined #ruby
<mynameisdebian> Suppose I have an e-mail “na@something.com”, and I want to see if some text contains na@something.com, but not “ana@something.com”, and not “banana@something.com”. However, there could be not alphanumeric characters in front of the e-mail. How can I search for this with Ruby?
<mynameisdebian> non-alphanumeric I meant
<havenwood> mynameisdebian: Regexp is one way.
<Radar> regexp: /\Ana@something.com\z/
<Radar> If all your text was just that email
<Radar> mynameisdebian: example input and output would be helpful here
<mynameisdebian> yeah, I just need to verify I’m on the right page
<mynameisdebian> I have some text. If the text contains a string variable eMail I do something. However, if it contains any string concatenated with eMail I do nothing.
<mynameisdebian> unless the “connecting” characters to a concatenated string are non-alphanumeric
<havenwood> mynameisdebian: /\A[^[[:alnum:]]]*na@something.com\z/
<mynameisdebian> thank you, one moment plz
<havenwood> mynameisdebian: That's ^ beginning of string, zero or more non-alnums, followed by that emails address and end of string.
<mynameisdebian> how can I search a string for that regex and get a bool?
<havenwood> mynameisdebian: string.match? //
<mynameisdebian> thx
<mynameisdebian> one sec
nielsk has quit [Ping timeout: 246 seconds]
<mynameisdebian> thank you very much, still working on this
troulouliou_div2 has quit [Read error: Connection reset by peer]
dviola is now known as Guest54440
Guest54440 has quit [Ping timeout: 252 seconds]
cyberRodent has quit [Ping timeout: 250 seconds]
cagomez has joined #ruby
cyberRodent has joined #ruby
dviola has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fluxAeon has joined #ruby
mynameisdebian has quit [Quit: mynameisdebian]
mynameisdebian has joined #ruby
mynameisdebian has quit [Client Quit]
dviola has quit [Quit: WeeChat 2.2]
mynameisdebian has joined #ruby
mynameisdebian has left #ruby [#ruby]
duderonomy has joined #ruby
ivanskie has joined #ruby
fluxAeon has quit [Ping timeout: 268 seconds]
ajsharma has joined #ruby
gheegh has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has joined #ruby
fluxAeon has joined #ruby
duderonomy has joined #ruby
braincrash has quit [Quit: bye bye]
Dimik has quit [Ping timeout: 245 seconds]
braincrash has joined #ruby
podlech has quit [Quit: WeeChat 1.9.1]
za1b1tsu has joined #ruby
Fusl has quit [Remote host closed the connection]
Fusl has joined #ruby
darkhanb has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LiftLeft2 is now known as LiftLeft
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang6- has joined #ruby
hahuang65 has quit [Ping timeout: 260 seconds]
weaksauce has quit [Ping timeout: 268 seconds]
nadir has joined #ruby
c0ncealed3 has quit [Remote host closed the connection]
c0ncealed3 has joined #ruby
cagomez has quit [Remote host closed the connection]
ajsharma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
armyriad has joined #ruby
asphyxia has joined #ruby
MoritaShinobu has joined #ruby
orbyt_ has joined #ruby
sauvin has joined #ruby
tdy has quit [Ping timeout: 244 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has quit [Remote host closed the connection]
reber has joined #ruby
kapil____ has joined #ruby
orbyt_ has joined #ruby
internetfriend has joined #ruby
<internetfriend> hello
<internetfriend> friends
<internetfriend> <3
internetfriend has quit [Client Quit]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MyMind has joined #ruby
Sembei has quit [Ping timeout: 250 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
vonfry has joined #ruby
Nicmavr has joined #ruby
vonfry has quit [Remote host closed the connection]
vonfry has joined #ruby
vonfry has quit [Quit: WeeChat 2.2]
vonfry has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
za1b1tsu has quit [Ping timeout: 252 seconds]
dogweather has joined #ruby
desperek has joined #ruby
erratic has quit [Quit: this server has gone to sleep]
za1b1tsu has joined #ruby
braincrash has quit [Ping timeout: 272 seconds]
elcontrastador has quit [Ping timeout: 245 seconds]
Exagone313 has quit [Ping timeout: 272 seconds]
aloy has quit [Ping timeout: 272 seconds]
aloy has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
Exagone313 has joined #ruby
zapata_ has joined #ruby
zapata has quit [Ping timeout: 252 seconds]
dogweather has quit [Quit: dogweather]
phaul has joined #ruby
rubydoc has joined #ruby
nowhereman_ has quit [Ping timeout: 250 seconds]
Mike11 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
Mike11 has quit [Quit: Leaving.]
nowhereman_ has joined #ruby
DarthGandalf has quit [Quit: Bye]
AKPWD has quit [Quit: じゃね。]
DarthGandalf has joined #ruby
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
varesa has quit [Ping timeout: 250 seconds]
AKPWD has joined #ruby
fribmendes has quit [Quit: Ping timeout (120 seconds)]
fribmendes has joined #ruby
za1b1tsu has joined #ruby
conta has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
varesa has joined #ruby
sameerynho has joined #ruby
TomyLobo has joined #ruby
<phaul> baweaver: still here? how would I match against a mixed structure like [?a, {b: ?c}] in Qo? ?c should be with Any, but I want to assert ?a and :b.
<baweaver> What's the actual data look like?
<phaul> I have a [String, Hash] just like [?a, {b: ?c}]
<phaul> and I know that the first key in the hash is the one I want to match on
<baweaver> Likely: Qo[Any, Qo[b: Any]]
<phaul> ok but I need ?a would this work then : Qo[?a, Qo[b: Any]] ?
<baweaver> phaul: Don't use ?a
<baweaver> use 'a'\
<baweaver> ? is too esoteric for common use
<phaul> ok but I need ?a would this work then : Qo['a', Qo[b: Any]] ? :)
<baweaver> ?a and 'a' are the same thing
<ruby[bot]> baweaver: I don't see no and, whom should I tell about a?
<baweaver> odd bot
<baweaver> Why does your data look like that?
<phaul> ok this worked Qo[?a, Qo[b: Any]]. Thanks for your help.
<baweaver> phaul: stop using ?a
<baweaver> It's really a bad habit to get into
<phaul> would you care to elaborate why
<baweaver> It's esoteric and hard to find what it does
<baweaver> So for any newer Rubyist it's an instant headache trying to find what it is
<baweaver> Though I'm still curious why your data is basically a nested hash unfolded into Array tuples
<phaul> baweaver: ASTs sometimes tend to look like that :)
roshanavand has joined #ruby
c0ncealed3 has quit [Remote host closed the connection]
<phaul> anyways thanks for the Qo help. You might want to add such examples to the readme, at least one where a Qo[] embeds an other Qo[]. I guess it falls out of most Qos matching if the sub thingy itself matches with ===, but it jjust didn't occure to me to embed Qos in each other.
c0ncealed3 has joined #ruby
postmodern has quit [Quit: Leaving]
roshanavand has quit [Quit: leaving]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
conta has quit [Quit: conta]
roshanavand has quit [Client Quit]
roshanavand has joined #ruby
nowhereman_ has quit [Ping timeout: 244 seconds]
roshanavand has quit [Client Quit]
ta_ has quit [Remote host closed the connection]
apeiros_ is now known as apeiros
venmx has joined #ruby
za1b1tsu has joined #ruby
reber__ has joined #ruby
reber has quit [Ping timeout: 250 seconds]
DTZUZO_ has quit [Ping timeout: 252 seconds]
za1b1tsu has quit [Ping timeout: 244 seconds]
venmx has quit [Remote host closed the connection]
ta_ has joined #ruby
troulouliou_div2 has joined #ruby
venmx has joined #ruby
venmx has quit [Ping timeout: 244 seconds]
graphene has joined #ruby
ta_ has quit [Ping timeout: 252 seconds]
troulouliou_div2 has quit [Remote host closed the connection]
themsay has joined #ruby
nowhereman_ has joined #ruby
ellcs has joined #ruby
vonfry has quit [Quit: WeeChat 2.2]
nowhereman_ has quit [Ping timeout: 252 seconds]
ellcs has quit [Ping timeout: 252 seconds]
kapil____ has quit [Quit: Connection closed for inactivity]
za1b1tsu has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
dbugger_ has joined #ruby
dbugger_ is now known as Dbugger
Puffball has quit [Remote host closed the connection]
Puffball has joined #ruby
clemens3 has joined #ruby
gheegh has joined #ruby
leah2 has quit [Ping timeout: 252 seconds]
dbz has joined #ruby
za1b1tsu has joined #ruby
dbz has quit [Ping timeout: 244 seconds]
GodFather has joined #ruby
P1RATEZ has joined #ruby
Dimik has joined #ruby
<za1b1tsu> regarding ruby and cli input. I would like to be able to be able to right multiple lines as input, but leave Enter for when it's finished. Something like Ctrl+[ (or other keybind) for new line. Is it possible? Any tips?
<phaul> za1b1tsu: what are you using to get cli input? there is gets. there are gems to do smart cl interfaces etc
<za1b1tsu> I wanted to have the ability to edit some default input, so I am using some readline hack, I don't really understand how it works. Does something with the hook. I'm trying to keep my gem usage limited for now.
<phaul> &list readline
<rubydoc> ARGF#readline, IO#readline, Kernel#readline
<za1b1tsu> phaul: this is the hack I found
<za1b1tsu> but is it possible to have a newline on a key mapping and without ending the input?
<phaul> I really don't know gnu readline, but Ive googling gave me C-v C-j (C being Ctrl) does that work?
jhass has quit [Ping timeout: 252 seconds]
<za1b1tsu> wow
jhass has joined #ruby
leah2 has joined #ruby
krawchyk has joined #ruby
<za1b1tsu> phaul: where did you find that keybind?
<phaul> googled something like "gnu readline newline in input", sorry closed the link. why it did work ? :) I was half expecting it not to..
<za1b1tsu> it's weird, it only works when I use that readline hack, it does not work with gets
<phaul> well it's a feature of gnu readline used by Ruby stdlib Readline (the library FFI). other IO functions don't rely on GNU readline.
<phaul> gets is in core:
<phaul> &list gets
<rubydoc> ARGF#gets, IO#gets, Kernel#gets
<za1b1tsu> oh, I see, thanks
nowhereman_ has joined #ruby
desperek has quit [Quit: xoxo]
za1b1tsu has quit [Ping timeout: 245 seconds]
GodFather has quit [Ping timeout: 244 seconds]
krawchyk has quit [Quit: krawchyk]
fluxAeon has quit [Ping timeout: 246 seconds]
ajsharma has joined #ruby
GodFather has joined #ruby
RougeR has joined #ruby
fluxAeon has joined #ruby
Xiti has quit [Quit: Xiti]
cagomez has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Xiti has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
ajsharma has quit [Read error: Connection timed out]
MoritaShinobu has quit [Quit: Leaving]
venmx has joined #ruby
GodFather has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
cagomez has quit [Remote host closed the connection]
venmx has quit [Remote host closed the connection]
cagomez has joined #ruby
cagomez has quit [Ping timeout: 272 seconds]
gheegh has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
GodFather has joined #ruby
GodFather has quit [Ping timeout: 252 seconds]
rippa has joined #ruby
Dbugger has quit [Remote host closed the connection]
dbz has joined #ruby
dbz has quit [Ping timeout: 245 seconds]
wnd has quit [Remote host closed the connection]
wnd has joined #ruby
cd has quit [Quit: cd]
reber has joined #ruby
reber__ has quit [Ping timeout: 252 seconds]
themsay has quit [Ping timeout: 272 seconds]
marahin has quit [Ping timeout: 264 seconds]
marahin has joined #ruby
orbyt_ has joined #ruby
za1b1tsu has joined #ruby
dellavg_ has joined #ruby
nowhereman_ has quit [Ping timeout: 252 seconds]
goez has quit [Ping timeout: 252 seconds]
jetchisel has quit [Ping timeout: 252 seconds]
RougeR has quit [Ping timeout: 272 seconds]
jetchisel has joined #ruby
goez has joined #ruby
dbz has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Nicmavr has joined #ruby
orbyt_ has joined #ruby
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
Eiam has quit [Ping timeout: 276 seconds]
dbz has joined #ruby
djellemah has joined #ruby
dbz has quit [Ping timeout: 244 seconds]
ziggylazer has quit [Read error: Connection reset by peer]
ziggylazer has joined #ruby
za1b1tsu has quit [Ping timeout: 246 seconds]
sgen has joined #ruby
conta has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
spiette has joined #ruby
Xeago_ has joined #ruby
spiette has quit [Quit: ZNC 1.7.1 - https://znc.in]
Xeago has quit [Ping timeout: 246 seconds]
Xeago_ is now known as Xeago
spiette has joined #ruby
dviola has joined #ruby
zapata_ has quit [Quit: WeeChat 2.2]
thejs has joined #ruby
thejs has quit [Client Quit]
LiftLeft2 has joined #ruby
LiftLeft has quit [Ping timeout: 260 seconds]
LiftLeft2 has quit [Ping timeout: 276 seconds]
sgen has quit [Remote host closed the connection]
LiftLeft2 has joined #ruby
LiftLeft2 is now known as LiftLeft
weaksauce has joined #ruby
jdawgaz has joined #ruby
beefjoe has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
beefjoe has quit [Remote host closed the connection]
conta has quit [Quit: conta]
rikkipitt has joined #ruby
desperek has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
uplime has quit [Ping timeout: 245 seconds]
gheegh has joined #ruby
clemens3_ has joined #ruby
djellemah has quit [Ping timeout: 245 seconds]
MyMind has quit [Max SendQ exceeded]
MyMind has joined #ruby
MyMind has quit [Max SendQ exceeded]
MyMind has joined #ruby
LiftLeft has quit [Ping timeout: 276 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
MyMind has quit [Ping timeout: 268 seconds]
shenghi has quit [Ping timeout: 268 seconds]
shenghi has joined #ruby
LiftLeft has joined #ruby
djellemah has joined #ruby
reber has quit [Remote host closed the connection]
MyMind has joined #ruby
MyMind has quit [Max SendQ exceeded]
uplime has joined #ruby
MyMind has joined #ruby
MyMind has quit [Max SendQ exceeded]
MyMind has joined #ruby
MyMind has quit [Max SendQ exceeded]
dbz has joined #ruby
DTZUZO_ has joined #ruby
MyMind has joined #ruby
dbz has quit [Ping timeout: 246 seconds]
MyMind has quit [Ping timeout: 244 seconds]
dellavg_ has quit [Ping timeout: 272 seconds]
clemens3_ has quit [Remote host closed the connection]
QpQ4 has joined #ruby
QpQ4 has quit [Remote host closed the connection]
desperek has quit [Quit: xoxo]
rikkipitt has quit [Quit: Leaving...]
jamesaxl has quit [Quit: WeeChat 2.2]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
dbz has joined #ruby
dbz has quit [Remote host closed the connection]
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
nowhereman_ has joined #ruby
cagomez has joined #ruby
jdawgaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jdawgaz has joined #ruby
uplime has quit [Ping timeout: 268 seconds]
jdawgaz has quit [Ping timeout: 246 seconds]
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
cyberRodent has quit [Ping timeout: 244 seconds]
MyMind has joined #ruby
cyberRodent has joined #ruby
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
MyMind has quit [Max SendQ exceeded]
ta_ has joined #ruby
ta_ has quit [Remote host closed the connection]
moei has quit [Quit: Leaving...]
MyMind has joined #ruby
mahlon has quit [Ping timeout: 252 seconds]
MyMind has quit [Max SendQ exceeded]
MyMind has joined #ruby
MyMind has quit [Max SendQ exceeded]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MyMind has joined #ruby
MyMind has quit [Excess Flood]
cagomez has quit [Remote host closed the connection]
orbyt_ has joined #ruby
MyMind has joined #ruby
orbyt_ has quit [Ping timeout: 272 seconds]
graphene has quit [Remote host closed the connection]
jetchisel has quit [Ping timeout: 245 seconds]
graphene has joined #ruby
mahlon has joined #ruby
jetchisel has joined #ruby
ta_ has joined #ruby
dbz has joined #ruby
noobineer has quit [Ping timeout: 245 seconds]