havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.2, 2.5.4, 2.4.5: 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!
crankharder has joined #ruby
jaddison has quit [Quit: jaddison]
lunarkitty7 has quit [Ping timeout: 252 seconds]
ylshao has quit [Ping timeout: 246 seconds]
thebrianguy has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
thebrianguy has left #ruby [#ruby]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
renich has joined #ruby
semtex has quit [Quit: Leaving]
duderonomy has joined #ruby
bmurt has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
zleap has quit [Quit: WeeChat 2.4]
Dbugger has quit [Ping timeout: 240 seconds]
thebrianguy has joined #ruby
thebrianguy has left #ruby [#ruby]
thebrianguy has joined #ruby
ellcs has quit [Ping timeout: 246 seconds]
zachk has quit [Quit: Leaving]
cthu| has quit [Ping timeout: 252 seconds]
ams__ has quit [Quit: Connection closed for inactivity]
Devalo has joined #ruby
Devalo has quit [Ping timeout: 246 seconds]
renich_ has joined #ruby
orbyt_ has joined #ruby
bhaak has quit [Ping timeout: 268 seconds]
renich has quit [Ping timeout: 272 seconds]
sandfish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DaRock has joined #ruby
houhoulis has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t0x has joined #ruby
r3m has quit [Quit: WeeChat 2.5-dev]
r3m has joined #ruby
donofrio has joined #ruby
gnufied has quit [Remote host closed the connection]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
r3m has quit [Client Quit]
r3m has joined #ruby
ylshao has joined #ruby
ylshao has quit [Client Quit]
Krebsgewehr has joined #ruby
renich has joined #ruby
renich_ has quit [Ping timeout: 246 seconds]
cd has quit [Ping timeout: 256 seconds]
esrse has joined #ruby
cd has joined #ruby
unreal has joined #ruby
crankharder has joined #ruby
ansraliant has joined #ruby
laaron has joined #ruby
xaxisx has quit [Ping timeout: 245 seconds]
laaron- has quit [Ping timeout: 256 seconds]
Swyper has quit [Remote host closed the connection]
xaxisx has joined #ruby
renich_ has joined #ruby
Krebsgewehr has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich has quit [Ping timeout: 246 seconds]
mniip has quit [Ping timeout: 608 seconds]
TvL2386 has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
xaxisx has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
Krebsgewehr has joined #ruby
bmurt has joined #ruby
Swyper has joined #ruby
xaxisx has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
gix has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
FernandoBasso has joined #ruby
FernandoBasso has quit [Remote host closed the connection]
Swyper has joined #ruby
Fernando-Basso has quit [Ping timeout: 246 seconds]
crankharder has quit [Ping timeout: 246 seconds]
mangold has joined #ruby
Swyper has quit [Remote host closed the connection]
crankharder has joined #ruby
xaxisx has quit [Read error: Connection reset by peer]
crankharder has quit [Ping timeout: 272 seconds]
Swyper has joined #ruby
Devalo has joined #ruby
mniip has joined #ruby
code_zombie has quit [Quit: Leaving]
TvL2386 has joined #ruby
Devalo has quit [Ping timeout: 246 seconds]
TvL2386 has quit [Ping timeout: 255 seconds]
mangold has quit [Quit: This computer has gone to sleep]
DTZUZO has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
ubuntuisloved has joined #ruby
tiogrand_ has quit [Ping timeout: 255 seconds]
arekushi has joined #ruby
xuanrui has joined #ruby
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tau has quit [Remote host closed the connection]
xuanrui has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Krebsgewehr has quit [Quit: Textual IRC Client: www.textualapp.com]
eckhardt has joined #ruby
braincrash has quit [Quit: bye bye]
cthulchu has quit [Ping timeout: 250 seconds]
maryo has joined #ruby
grilix has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
maryo has quit [Quit: Leaving]
cam27 has joined #ruby
Dounx has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dounx has left #ruby [#ruby]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
thebrianguy has quit [Quit: Leaving]
hahuang65 has quit [Ping timeout: 255 seconds]
facest has joined #ruby
devil_tux has quit [Ping timeout: 246 seconds]
faces has quit [Ping timeout: 246 seconds]
mangold has joined #ruby
dellavg__ has joined #ruby
claw has quit [Ping timeout: 252 seconds]
claw has joined #ruby
stan has quit [Ping timeout: 252 seconds]
stan has joined #ruby
tdy1 has quit [Ping timeout: 246 seconds]
dellavg__ has quit [Ping timeout: 272 seconds]
jud has joined #ruby
jud has quit [Changing host]
jud has joined #ruby
jud^ has quit [Ping timeout: 255 seconds]
crankharder has joined #ruby
ricekrispie2 has joined #ruby
tdy1 has joined #ruby
Swyper has quit [Remote host closed the connection]
jud has quit [Quit: Leaving]
nowhere_man has quit [Ping timeout: 252 seconds]
devil_tux has joined #ruby
devil_tux has quit [Ping timeout: 252 seconds]
TvL2386 has joined #ruby
imadper is now known as iMadper|MTG
iMadper|MTG has quit [Remote host closed the connection]
bhaak has joined #ruby
Inline has quit [Quit: Leaving]
devil_tux has joined #ruby
sauvin has joined #ruby
conta has joined #ruby
hahuang65 has joined #ruby
Ai9zO5AP has joined #ruby
hahuang65 has quit [Ping timeout: 245 seconds]
<sagax> hi all!
<sagax> what different between dot notation `.` and `::`
<sagax> ?
houhoulis has quit [Ping timeout: 252 seconds]
devil_tux has quit [Ping timeout: 246 seconds]
am0123 has joined #ruby
e3 has quit [Read error: Connection reset by peer]
Fusl has quit [Ping timeout: 256 seconds]
reber has joined #ruby
imadper has joined #ruby
Fusl has joined #ruby
t0x has quit [Quit: Connection closed for inactivity]
<zenspider> rawr
<zenspider> sagax: :: is super old notation meant for class constant access X::Y or for calling class methods, but nobody ever does the latter
crankharder has quit [Ping timeout: 246 seconds]
Devalo has joined #ruby
Devalo has quit [Ping timeout: 245 seconds]
e3 has joined #ruby
<sagax> thanks
am0123 has quit [Ping timeout: 268 seconds]
devil_tux has joined #ruby
crankharder has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
cam27 has quit [Quit: cam27]
luminousnine has joined #ruby
luminousnine has quit [Changing host]
luminousnine has joined #ruby
cyberarm has quit [Ping timeout: 250 seconds]
devil_tux has quit [Ping timeout: 255 seconds]
mangold has joined #ruby
D9 has quit [Read error: Connection reset by peer]
schleppel has joined #ruby
Echo has joined #ruby
aufi has joined #ruby
clemens3_ has joined #ruby
gix has joined #ruby
eckhardt has joined #ruby
<sagax> if i need all without first element - it's normal way?
<sagax> f=[1,2,3,4,5]; f.slice(1, f.length)
eckhardt has quit [Client Quit]
clemens3_ has quit [Ping timeout: 252 seconds]
andikr has joined #ruby
<leftylink> sagax: consider `f.drop(1)`
<leftylink> f[1..-1] might also be appropriate as well
<sagax> not bad
gix- has joined #ruby
gix has quit [Disconnected by services]
<sagax> thanks
<Yxhuvud> or f.shift if you just want to modify it.
vondruch has joined #ruby
<sagax> no, without modified
teclator has joined #ruby
<leftylink> hmm
<leftylink> wrong window
gix- has quit [Ping timeout: 244 seconds]
devil_tux has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
suukim has joined #ruby
clemens3_ has joined #ruby
imadper is now known as iMadper|MIGA
am0123 has joined #ruby
tdy1 has quit [Ping timeout: 246 seconds]
_joes_ has joined #ruby
andikr has quit [Ping timeout: 246 seconds]
ansraliant has quit [Quit: My planet needs me]
crankharder has quit [Ping timeout: 246 seconds]
andikr has joined #ruby
_joes_ has quit [Ping timeout: 255 seconds]
conta1 has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta1 is now known as conta
lxsameer has joined #ruby
mangold has joined #ruby
dhollin3 has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
devil_tux has quit [Ping timeout: 255 seconds]
dhollinger has quit [Ping timeout: 268 seconds]
andikr has quit [Quit: No Ping reply in 180 seconds.]
andikr has joined #ruby
cyberarm has joined #ruby
al2o3-cr has joined #ruby
marcoecc has joined #ruby
<ryouba> good morning rubyists
qual has joined #ruby
ur5us has quit [Remote host closed the connection]
qual has quit [Client Quit]
claudiuinberlin has joined #ruby
Eiam has quit [Read error: Connection reset by peer]
renich has joined #ruby
renich_ has quit [Ping timeout: 252 seconds]
renich has quit [Remote host closed the connection]
devil_tux has joined #ruby
matthewd has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
matthewd has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
qual has joined #ruby
hahuang65 has joined #ruby
crankharder has joined #ruby
apparition has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
<sagax> hi
kapil____ has joined #ruby
am0123 has quit [Ping timeout: 272 seconds]
hahuang65 has quit [Ping timeout: 250 seconds]
TomyWork has joined #ruby
devil_tux has quit [Ping timeout: 252 seconds]
ua has quit [Excess Flood]
Brian-W-Gray has joined #ruby
ua has joined #ruby
yqt has joined #ruby
BrianWGray has quit [Ping timeout: 246 seconds]
qual has quit [Quit: qual]
xuyuheng has joined #ruby
Echo has quit [Remote host closed the connection]
Echo has joined #ruby
qual has joined #ruby
Echo has quit [Ping timeout: 255 seconds]
qual has quit [Client Quit]
GreyHame has quit [Remote host closed the connection]
am0123 has joined #ruby
dar123 has joined #ruby
iMadper|MIGA has quit [Remote host closed the connection]
iMadper|MIGA has joined #ruby
AJA4350 has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
_joes_ has joined #ruby
andikr has quit [Ping timeout: 246 seconds]
esrse has quit [Ping timeout: 246 seconds]
sphenxes has joined #ruby
dante has quit [Ping timeout: 246 seconds]
Devalo has joined #ruby
sphenxes has quit [Client Quit]
dante has joined #ruby
Devalo has quit [Ping timeout: 246 seconds]
devil_tux has joined #ruby
e3 is now known as e2
GreyHame has joined #ruby
za1b1tsu has joined #ruby
claudiuinberlin has quit [Read error: Connection reset by peer]
stimpy_ has joined #ruby
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz?]
stimpy_ has quit [Quit: Leaving]
stimpy_ has joined #ruby
stimpy_ has quit [Client Quit]
stimpy_ has joined #ruby
_joes_ has quit [Ping timeout: 246 seconds]
GreyHame has quit [Ping timeout: 252 seconds]
qual has joined #ruby
devil_tux has quit [Ping timeout: 246 seconds]
devil_tux has joined #ruby
hhzza has joined #ruby
ldnunes has joined #ruby
xrexeon has joined #ruby
TomyWork has quit [Ping timeout: 246 seconds]
za1b1tsu has quit [Remote host closed the connection]
ubuntuisloved has joined #ruby
TomyWork has joined #ruby
qual has quit [Quit: qual]
jim4 has joined #ruby
<jim4> Hello
bmurt has joined #ruby
<jim4> regarding publishing a gem, i wish to publish a library, do i need to use a class or a module ? do i need to use a namespace ? ; it is a single file .rb
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> class vs module is an orthogonal question, it's a design decision not a packaging one. Namespacing you code is a good idea.
jim4 has quit [Quit: Page closed]
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cam27 has joined #ruby
stryek has joined #ruby
_joes_ has joined #ruby
dar123 has joined #ruby
<sagax> what the best? [].append or [] << ?
tiogrand_ has joined #ruby
asio has joined #ruby
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ruby
conta has quit [Ping timeout: 245 seconds]
<phaul> << saves 4 bytes of source code
devil_tux has quit [Ping timeout: 246 seconds]
galaxie has quit [Quit: ircII EPIC4-2.10.6 -- Are we there yet?]
houhoulis has joined #ruby
qual has joined #ruby
_joes_ has quit [Quit: _joes_]
_joes_1 has joined #ruby
devil_tux has joined #ruby
hahuang65 has joined #ruby
cam27 has quit [Quit: cam27]
<sagax> [] << some_value
ubuntuisloved has joined #ruby
dhollin3 is now known as dhollinger
tau has joined #ruby
<al2o3-cr> sagax: bear in mind, append is variadic whilst << is not. so, if you appending multilple values use append/push as you see fit.
xrexeon has quit [Ping timeout: 240 seconds]
andikr has joined #ruby
devil_tux has quit [Ping timeout: 252 seconds]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Macrobiotic has left #ruby [#ruby]
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xrexeon has joined #ruby
ricekrispie has joined #ruby
ubuntuisloved has joined #ruby
ricekrispie2 has quit [Ping timeout: 250 seconds]
apparition has quit [Quit: Bye]
mangold has joined #ruby
Devalo has joined #ruby
Devalo has quit [Ping timeout: 245 seconds]
griffindy has joined #ruby
tiogrand__ has joined #ruby
krawchyk has joined #ruby
tiogrand_ has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
yqt has quit [Ping timeout: 255 seconds]
ams__ has joined #ruby
qual has quit [Quit: qual]
suukim has quit [Quit: Konversation terminated!]
lucasb has joined #ruby
vondruch has quit [Ping timeout: 250 seconds]
mangold has quit [Ping timeout: 240 seconds]
cam27 has joined #ruby
snk is now known as snk_
Swyper has joined #ruby
gnufied has joined #ruby
xco has joined #ruby
<xco> Hi everyone! is there a method in Rails/Ruby that does this? ‘Time.now.to_i.to_s’
Inline has joined #ruby
<bhaak> depends on what you want it to do. this is a valid chain of methods in Ruby
<xco> yeah it’s valid but i was wondering if there could be a short cut because it looks like something people might want to do often
<bhaak> it's pretty short already. if you use String interpolation, you don't need to to_s: "something #{Time.now.to_i} something else"
<xco> bhaak: thanks :)
houhoulis has quit [Remote host closed the connection]
grilix has joined #ruby
krawchyk has quit [Quit: krawchyk]
krawchyk has joined #ruby
laaron has quit [Remote host closed the connection]
alem0lars has joined #ruby
Swyper has quit [Remote host closed the connection]
polishdub has joined #ruby
Swyper has joined #ruby
marcoecc has quit [Remote host closed the connection]
marcoecc has joined #ruby
Swyper has quit [Remote host closed the connection]
laaron has joined #ruby
Swyper has joined #ruby
rippa has joined #ruby
alanmaxwell has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
alanmaxwell has quit [Client Quit]
SeepingN has joined #ruby
cam27 has quit [Quit: cam27]
za1b1tsu has joined #ruby
DaRock has quit [Ping timeout: 252 seconds]
mangold has joined #ruby
jaddison has joined #ruby
mangold has quit [Client Quit]
wallace_mu has joined #ruby
xrexeon has quit [Ping timeout: 250 seconds]
lord4163 has quit [Quit: Gotta go cya!]
Swyper has quit [Remote host closed the connection]
dar123 has joined #ruby
krawchyk has quit [Quit: krawchyk]
dar123 has quit [Client Quit]
_joes_1 has quit [Ping timeout: 252 seconds]
devil_tux has joined #ruby
apparition has joined #ruby
Swyper has joined #ruby
<robotcars> with httparty, how do I get the :id into the URL instead of the query string?
<robotcars> I have, /courses?course_id=123&courses[event]=offer
krawchyk has joined #ruby
<robotcars> i need, /courses/123?courses[event]=offer
<robotcars> using class > self.class.put()
krawchyk has quit [Client Quit]
xrexeon has joined #ruby
am0123 has quit [Ping timeout: 246 seconds]
t0x has joined #ruby
mangold has joined #ruby
dar123 has joined #ruby
krawchyk has joined #ruby
xrexeon has quit [Ping timeout: 240 seconds]
renich has joined #ruby
krawchyk has quit [Client Quit]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has joined #ruby
krawchyk has quit [Quit: krawchyk]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
aufi has quit [Ping timeout: 272 seconds]
qual has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
cthulchu_ has joined #ruby
[Butch] has joined #ruby
grilix has quit [Ping timeout: 252 seconds]
grilix has joined #ruby
asdf23redf345gfd has joined #ruby
qual has quit [Quit: qual]
renich_ has joined #ruby
canurabus has joined #ruby
Swyper has joined #ruby
renich has quit [Ping timeout: 255 seconds]
tdy1 has joined #ruby
<canurabus> Hi. I'm looking for some help in understanding a line of code. I'm lost in what is going on here: "matches = text.to_enum(:scan, MatchRegExp).map { Regexp.last_match }"
Swyper has quit [Remote host closed the connection]
<canurabus> I don't get what 'to_enum' does to text (which is a String)
bmurt has quit [Ping timeout: 245 seconds]
tdy1 has quit [Read error: Connection reset by peer]
asdf23redf345gfd has left #ruby [#ruby]
Swyper has joined #ruby
tdy1 has joined #ruby
wallace_mu has quit [Quit: Page closed]
wallace_mu has joined #ruby
<canurabus> Actually I think I get that to_enum(:scan, MatchRegExp) creates an enumerator that will generate an enumeration of all the matches from the RegExp? ie basically an enumeration of 'text.scan(MatchRegExp)'. But I don't get why calling map on that enumeration with Regexp.last_match works
<al2o3-cr> canurabus: to_enum takes a method (defaults to :each) and variable amount of args. in your case you're passing :scan which is an instance method of String class with a regex argument.
<al2o3-cr> and returns an enumerator instead of an array.
<canurabus> Right. And calling scan on the string will generate an array of matches (of type string). But the final result is a set of matches (of type MatchData). I guess I don't get the 'trick'. Is it that because its an enumerable the map block is executed once after each match is found rather than after all matches are found?
<al2o3-cr> Regexp.last_match with give you Matchdata objects
krawchyk has joined #ruby
<al2o3-cr> &>> "foo $ bar £ baz".to_enum(:scan, /\p{S}/).to_a
hahuang65 has quit [Quit: ZNC - https://znc.in]
<rubydoc> stderr: -e:2: invalid multibyte char (US-ASCII) (https://carc.in/#/r/6hr2)
bmurt has joined #ruby
<al2o3-cr> &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).to_a
<rubydoc> # => ["1", "2"] (https://carc.in/#/r/6hr3)
<al2o3-cr> &>> "foo 1 bar 2 baz".to_enum(:scan, /\d+/).map { Regexp.last_match }
<rubydoc> # => [#<MatchData "1">, #<MatchData "2">] (https://carc.in/#/r/6hr4)
<canurabus> Yeah, but I get a different set of results if I do this: 'matches = text.scan(MatchRegExp); mds = matches.map { Regexp.last_match }'
hahuang65 has joined #ruby
KeyJoo has joined #ruby
<al2o3-cr> you will do
Swyper has quit [Remote host closed the connection]
<al2o3-cr> matches.map { Reg... } will just give you same Matchdata object to the size of matches array
orbyt_ has joined #ruby
krawchyk has quit [Quit: krawchyk]
vondruch has joined #ruby
noboruma has quit [Remote host closed the connection]
<canurabus> I don't clearly understand why that is the case. Is it because in the latter case I am passing the 'already complete' Array to map, whereas before its an Enumerator whcih will call yield after each single regexp match?
<al2o3-cr> canurabus: in effect, yes.
<canurabus> Ok, thanks. Still a bit fuzzy on enumerators, will do more reading.
<al2o3-cr> canurabus: you'll get the hang soon enough.
<al2o3-cr> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/) # this returns a enumerator
<al2o3-cr> &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next # next in enumerator == "1"
<rubydoc> # => "1" (https://carc.in/#/r/6hr6)
<al2o3-cr> &>> "foo 1 bar 2 baz 3".to_enum(:scan, /\d+/).next.next # next in enumerator == "2" and so on
<rubydoc> # => "2" (https://carc.in/#/r/6hr7)
noboruma has joined #ruby
orbyt_ has quit [Read error: Connection reset by peer]
<al2o3-cr> when you map an enumerator each element in that enumerator will be processed.
<al2o3-cr> sequentially, i should add.
stimpy_ has quit [Remote host closed the connection]
krawchyk has joined #ruby
krawchyk has quit [Client Quit]
apparition has quit [Ping timeout: 252 seconds]
n13z has quit [Ping timeout: 246 seconds]
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
krawchyk has joined #ruby
krawchyk has quit [Client Quit]
crankharder has quit [Ping timeout: 250 seconds]
<sagax> hi all!
<sagax> we have some like as `filter` from array?
<al2o3-cr> exactly that.
<al2o3-cr> or if your using ruby < 2.6 select
<al2o3-cr> or find_all
<sagax> yes, 2.5.1 ruby
<al2o3-cr> sagax: Array#select or Enumerable#find_all
orbyt_ has quit [Ping timeout: 246 seconds]
code_zombie has joined #ruby
<al2o3-cr> &>> [1,2,3,4].select { |n| n.even? } # filters all even numbers
<rubydoc> # => [2, 4] (https://carc.in/#/r/6hrp)
andikr has quit [Remote host closed the connection]
<al2o3-cr> &>> [1,2,3,4].filter { |n| n.odd? } # filters all odd numbers ruby (2.6)
<rubydoc> # => [1, 3] (https://carc.in/#/r/6hrq)
Swyper has joined #ruby
grilix has quit [Ping timeout: 245 seconds]
Dbugger has joined #ruby
gix has joined #ruby
n13z has joined #ruby
grilix has joined #ruby
reber has quit [Read error: Connection reset by peer]
ellcs has quit [Ping timeout: 250 seconds]
mello has joined #ruby
<sagax> `if not` it's normal way? or better write `!=` ?
clemens3_ has quit [Ping timeout: 252 seconds]
RougeR has joined #ruby
jcarl43 has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
aufi has joined #ruby
kapil____ has joined #ruby
dionysus70 has joined #ruby
xrexeon has joined #ruby
aufi has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ravenousmoose has joined #ruby
grilix has quit [Ping timeout: 246 seconds]
marcoecc has quit [Ping timeout: 245 seconds]
MyMind has joined #ruby
Sembei has quit [Ping timeout: 244 seconds]
postmodern has joined #ruby
grilix has joined #ruby
tau is now known as wayfaring-soldie
wayfaring-soldie is now known as wayfaringsoldier
cam27 has joined #ruby
dar123 has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
cam27 has quit [Client Quit]
tdy2 has joined #ruby
tdy1 has quit [Ping timeout: 246 seconds]
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
tdy2 has quit [Ping timeout: 255 seconds]
Devalo has joined #ruby
KeyJoo has quit [Quit: KeyJoo]
ubuntuisloved has joined #ruby
tdy has joined #ruby
RougeR has quit [Ping timeout: 268 seconds]
iMadper|` has joined #ruby
grilix_ has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
iMadper|MIGA has quit [Ping timeout: 252 seconds]
grilix has quit [Ping timeout: 250 seconds]
Justine5 has joined #ruby
<Justine5> Hello guyes
<Justine5> guys
PeterNewbie has joined #ruby
<PeterNewbie> Hi
xco has left #ruby [#ruby]
<PeterNewbie> I wish to build a method that will check if an email is like *@*.*
<PeterNewbie> so here is what i tried :
<PeterNewbie> def email?(e) ; rgx=Regexp.new('^*@*\.*$') ; rgx.match?(e) ; end;
cd has quit [Quit: cd]
Justine5 has quit [Ping timeout: 256 seconds]
<PeterNewbie> if i try : email('test') => True
<Swyper> hm
<PeterNewbie> anyone can help me ?
hahuang65_ has joined #ruby
<Swyper> if email?.contain?('@') return true ?
<Swyper> or the regex you just posted o-o
<PeterNewbie> i need this shape : localpart@domain.extension
eddof13 has quit [Ping timeout: 252 seconds]
dar123 has quit [Quit: Textual IRC Client: www.textualapp.com]
<phaul> try rubular.com, PeterNewbie
<leftylink> recall from https://rubular.com/ or a regexp tutorial that * matches zero-or-more occurrences
<phaul> leftylink: :) 1 second diff
hahuang65 has quit [Ping timeout: 272 seconds]
<al2o3-cr> &>> require 'uri'; def valid_email?(email) URI::MailTo::EMAIL_REGEXP.match? email end; valid_email? "localpart@domain.extension"
<rubydoc> # => true (https://carc.in/#/r/6htt)
<leftylink> o
<leftylink> very interesting.
orbyt_ has joined #ruby
clemens3_ has joined #ruby
gix has quit [Quit: Client exiting]
<PeterNewbie> al2o3-cr: what is the 'p begin' ?
<leftylink> &ri Kernel#p PeterNewbie
<leftylink> that is p
<phaul> PeterNewbie: that's just the bots way of ensuring that broken user input can be printed
alem0lars has quit [Remote host closed the connection]
<PeterNewbie> thanks so much guys!
rindolf has joined #ruby
<rindolf> hi all
tdy1 has joined #ruby
tdy has quit [Ping timeout: 255 seconds]
gix has joined #ruby
tdy1 has quit [Read error: Connection reset by peer]
tdy1 has joined #ruby
lektrik has joined #ruby
PeterNewbie has quit [Quit: Page closed]
tdy2 has joined #ruby
sameerynho has joined #ruby
tdy1 has quit [Ping timeout: 252 seconds]
MyMind has quit [Ping timeout: 246 seconds]
xrexeon has quit [Remote host closed the connection]
hahuang65 has joined #ruby
crankharder has joined #ruby
hahuang65_ has quit [Ping timeout: 246 seconds]
crankharder has quit [Ping timeout: 272 seconds]
gaussblurinc1 has joined #ruby
<gaussblurinc1> HI! Is there any build-in method to iterate over array by n elements without overlap?
sansi has joined #ruby
<al2o3-cr> gaussblurinc1: each_slice
<gaussblurinc1> al2o3-cr: thanks!
<al2o3-cr> np
clemens3_ has quit [Ping timeout: 255 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy2 is now known as tdy
sansi has quit [Quit: Page closed]
sanscoeur has joined #ruby
t0x has quit [Quit: Connection closed for inactivity]
cam27 has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
oncall-pokemon has joined #ruby
bjpenn has joined #ruby
bjpenn has quit [Changing host]
bjpenn has joined #ruby
<bjpenn> trying to run spec, and im getting a weird warning WARN: Unresolved specs during Gem::Specification.reset: minitest (~> 5.1)
<bjpenn> i did a gem list and there are two versions of minitest, but when i do gem uninstall minitest --version <older version>, the output says uninstalled, but when i do a gem list again, it remains in there
<bjpenn> when i do a bundle exec gem list, only the newer version is listed
<bjpenn> any clues on how to resolve?
gaussblurinc1 has quit [Quit: Leaving.]
orbyt_ has joined #ruby
lord4163 has joined #ruby
cam27 has quit [Quit: cam27]
<bjpenn> finally found something online that helped!
<bjpenn> i did a bundle cleanup --force, followed by a bundle install, i think the idea here was to get my gem list in a clean state
<bjpenn> i got the error message saying a bunch of gems belonging to groups are not installed
<bjpenn> there was no such thing as ~/.bundle/config file, so i was wondering why it was not installing, so i happened to come across this command bundle config . Actually my bundle config was located in an rvm directory, so i went in there, and removed hardcoded entries which prevented gems from installing within a group
<bjpenn> this fixed it :D
<bjpenn> (after running bundle install again) it fixed it
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjpenn has quit [Ping timeout: 255 seconds]
Eiam has joined #ruby
ur5us has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
orbyt_ has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
ubuntuisloved has joined #ruby
laaron has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
stan has quit [Quit: No Ping reply in 180 seconds.]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
tiogrand__ has quit [Ping timeout: 246 seconds]
tpanarch1st has joined #ruby
stan has joined #ruby
bjpenn has joined #ruby
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
Devalo has quit [Remote host closed the connection]
Swyper has quit [Remote host closed the connection]
jcalla has quit [Remote host closed the connection]
crawler has joined #ruby
unreal has quit [Ping timeout: 252 seconds]
Swyper has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
unreal has joined #ruby
Fernando-Basso has joined #ruby
ldnunes has quit [Quit: Leaving]
ravenousmoose has joined #ruby
ubuntuisloved has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grilix_ has quit [Ping timeout: 245 seconds]
crawler has quit [Ping timeout: 255 seconds]
ams__ has quit [Quit: Connection closed for inactivity]
wallace_mu has quit [Quit: Page closed]
dionysus70 has quit [Ping timeout: 272 seconds]
marmotini_ has joined #ruby
sanscoeur has quit []
marmotini_ has quit [Ping timeout: 255 seconds]
Ai9zO5AP has quit [Quit: WeeChat 2.4]
Swyper has quit [Remote host closed the connection]
cthu| has joined #ruby
rbdr has joined #ruby
Swyper has joined #ruby
cthulchu_ has quit [Ping timeout: 250 seconds]
Swyper has quit [Ping timeout: 255 seconds]
Swyper has joined #ruby
Devalo has joined #ruby
marmotini_ has joined #ruby
unreal has quit [Ping timeout: 246 seconds]
eddof13 has joined #ruby
Devalo has quit [Ping timeout: 246 seconds]
bjpenn has quit [Ping timeout: 252 seconds]
oncall-pokemon has quit [Quit: Connection closed for inactivity]
<uplime> is there any difference memory/perforance wise between double and single quotes? I remember (vaguely) hearing about this at a meetup from a while ago, and can't quite recall what was said
<c-c> Ok, I got to another gold spike. Spawning processes and their messaging abstracted to (read)next_msg/send https://gist.github.com/csmr/ffc1c691c24cc9bf7b0f2e9bd729c471
<c-c> It spawns 3 processes that helo each other with loop n
<c-c> (as you can read in the logfile, don't forget to $ killall ruby
<c-c> +)
<c-c> its still pretty ugly, input welcome
canurabus has quit [Quit: Page closed]
<c-c> uplime: maybe the string in single quotes is literal and the double quotes is interpolated?
<uplime> hm, good point
<c-c> uplime: that was a question
ur5us_ has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
<havenwood> &>> require 'ripper'; Ripper.sexp("'uptime'") == Ripper.sexp('"uptime"')
<rubydoc> # => true (https://carc.in/#/r/6hxl)
<c-c> Hmm, next I'll have to write the engine-from-rules -thing. I still think the rules should be possible to write in yml
<havenwood> uplime: there's difference in how they're parsed, but they create the same Ruby AST - so they get evaluated identically by the VM.
<c-c> engine-genny
<havenwood> uplime: the parsing speed difference should be negligible, if any
<havenwood> uplime: there's no IR evaluation speed difference
<uplime> thanks, i figured as much. i like to use a consistent quoting "scheme", but rubocop wasn't too happy about that
<c-c> rubocop would retire if it saw my code
<uplime> haha
<c-c> have to clean up first
t0x has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has quit [Quit: leaving]
cam27 has joined #ruby
cam27 has quit [Client Quit]
sanscoeur has joined #ruby
Swyper_ has joined #ruby
Swyper has quit [Remote host closed the connection]
<zenspider> uplime: there are (were?) performance differences in PERL... not in ruby
orbyt_ has joined #ruby
<zenspider> uplime: I wrestled with rubocop to implement "seattle style" which includes only using double quoted strings (or % forms)... eventually decided it wasn't worth it
Swyper_ has quit [Remote host closed the connection]
Fernando-Basso has quit [Remote host closed the connection]
bjpenn has joined #ruby
<baweaver> zenspider: evil me is writing in only double-quotes for the book
<baweaver> It feels like a bad idea to teach newbies otherwise, too much potential for confusion for very little gain.
marmotini_ has quit [Ping timeout: 250 seconds]
<zenspider> I don't see how or why that is "evil"
<baweaver> Fair. Trying not to add a ton of nuance to the book, and more of just "do it this way"
ravenousmoose has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> &>> x = ?y; [%q(#{x}), %Q(#{x}), *%w(#{x}), *%W(#{x}), *%i(#{x}), *%I(#{x}), %r(x), %r(#{x}), %s(x), %s(#{x})]
<rubydoc> # => ["\#{x}", "y", "\#{x}", "y", :"\#{x}", :y, /x/, /y/, :x, :"\#{x}"] (https://carc.in/#/r/6hyi)
<uplime> zenspider: yeah, i just stoppped using rubocop all together for now
<uplime> i'll probably turn it (and reek) back on soon though
orbyt_ has quit [Quit: Textual IRC Client: www.textualapp.com]
Swyper has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
sameerynho has quit [Ping timeout: 250 seconds]
<al2o3-cr> even %x() interpolates
schleppel has quit [Quit: Konversation terminated!]
<al2o3-cr> %()
Swyper has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
Swyper has quit [Ping timeout: 272 seconds]
ellcs has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
orbyt_ has joined #ruby
Swyper has joined #ruby
<al2o3-cr> &>> %(#{%r{#{%w(1 2 3)}}})
<rubydoc> # => "(?-mix:[\"1\", \"2\", \"3\"])" (https://carc.in/#/r/6i0o)
sanscoeur has quit []
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
daed has joined #ruby
elcontrastador has joined #ruby
Eiam has quit [Ping timeout: 252 seconds]
Dbugger has quit [Ping timeout: 240 seconds]