havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.3, 2.5.5, 2.7.0-preview1: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
AJA4350 has joined #ruby
xco has quit [Quit: xco]
brool has joined #ruby
mistergibson has quit [Ping timeout: 248 seconds]
ricekrispie has joined #ruby
DaRock has joined #ruby
Nowaker has quit [Remote host closed the connection]
Nowaker has joined #ruby
mistergibson has joined #ruby
zlogan85 has joined #ruby
rgrant has joined #ruby
rgrant is now known as [rg]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit [Remote host closed the connection]
[rg] has quit [Ping timeout: 272 seconds]
mistergibson has quit [Quit: mistergibson]
fphilipe_ has joined #ruby
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
rgrant has joined #ruby
xco has joined #ruby
rokra has quit [Ping timeout: 258 seconds]
AJA4350 has quit [Quit: AJA4350]
rokra has joined #ruby
CCDelivery has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
rgrant is now known as [rg]
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
seaef has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
xco has quit [Quit: xco]
octos has quit [Read error: Connection reset by peer]
octos has joined #ruby
fphilipe_ has quit [Ping timeout: 248 seconds]
CCDelivery has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
jenrzzz has quit [Ping timeout: 246 seconds]
Swyper has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
theRoUS has quit [Ping timeout: 246 seconds]
CCDelivery has quit [Read error: Connection reset by peer]
daniel has joined #ruby
daniel is now known as Guest23857
<Guest23857> hi
Guest23857 is now known as daniel123
Swyper has quit [Remote host closed the connection]
LiamW has joined #ruby
Roupi has joined #ruby
<LiamW> is there a way to do the equivalent of String#start_with? at any arbitrary index in a String, without using a regexp?
_dbugger has joined #ruby
dbugger has quit [Ping timeout: 248 seconds]
daniel123 has quit []
fphilipe_ has joined #ruby
CCDelivery has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
theRoUS has quit [Ping timeout: 248 seconds]
<mozzarella> > 'hello my friend'[6..].start_with?('my')
<mozzarella> >> 'hello my friend'[6..].start_with?('my')
<ruby[bot]> mozzarella: # => /tmp/execpad-d26a898cc6c4/source-d26a898cc6c4:2: syntax error, unexpected ']' ...check link for more (https://eval.in/1113324)
<mozzarella> 2.6.3>> 'hello my friend'[6..].start_with?('my')
<mozzarella> 2.6>> 'hello my friend'[6..].start_with?('my')
<mozzarella> 2.6.3> 'hello my friend'[6..].start_with?('my')
<mozzarella> jesus
CCDelivery has quit [Read error: Connection reset by peer]
<mozzarella> >> 'hello my friend'[6..-1].start_with?('my')
<ruby[bot]> mozzarella: # => true (https://eval.in/1113325)
<mozzarella> ^ for older rubies
<mozzarella> [6..] works here and I have 2.6.3
<mozzarella> LiamW: ^
CCDelivery has joined #ruby
<LiamW> oops, forgot to put in the original question: can you do it without allocating another string?
<LiamW> I want to keep string allocations down in my lexer
hutch1 has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
Tempesta has quit [Ping timeout: 248 seconds]
CCDelivery has quit [Read error: Connection reset by peer]
CCDelivery has joined #ruby
[rg] has quit [Quit: [rg]]
esrse has joined #ruby
hutch1 has quit [Ping timeout: 268 seconds]
CCDelivery has quit [Remote host closed the connection]
[rg] has joined #ruby
fphilipe_ has quit [Ping timeout: 258 seconds]
<mozzarella> LiamW: if you don't mind mutating your string or creating an iterator, you could do it using some methods from the standard library, otherwise I think you will have to create your own method
<LiamW> mutating the string is fine
<LiamW> I suppose it's fine to slice off a chunk each time
budonyc has quit [Quit: Leaving]
Tempesta has joined #ruby
hutch1 has joined #ruby
[rg] has quit [Quit: [rg]]
seaef has quit [Quit: I am functioning within established parameters.]
<mozzarella> LiamW: you could do that: i = 6; 'hello my friend'.index('my', i) == i
<mozzarella> obviously it won't be as efficient as it could be
duderonomy has joined #ruby
<LiamW> I might have to potentially deal with pathological inputs
<LiamW> so that may not be ideal
<LiamW> I'll just mutate the string
fredolinhares has joined #ruby
daniel123 has joined #ruby
<LiamW> That's probably not going to work out very well for you
<LiamW> What you can much more easily get is the bytecode, through RubyVM
mcspud has quit [Remote host closed the connection]
mcspud has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
brool has quit [Ping timeout: 248 seconds]
daniel123 has quit []
Roupi has quit [Quit: Leaving]
rsh has joined #ruby
rsh has quit [Ping timeout: 248 seconds]
tpanarch1st has quit [Ping timeout: 272 seconds]
fphilipe_ has joined #ruby
orbyt_ has joined #ruby
jenrzzz has joined #ruby
bambanx has joined #ruby
galeido has quit [Ping timeout: 272 seconds]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
LiamW has left #ruby ["WeeChat 2.3"]
galeido has joined #ruby
podlech has joined #ruby
fredolinhares has quit [Quit: WeeChat 1.9.1]
regedit has joined #ruby
morozovm has joined #ruby
morozovm has quit [Client Quit]
jenrzzz has quit [Ping timeout: 248 seconds]
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
jenrzzz has joined #ruby
podlech has quit [Ping timeout: 244 seconds]
zlogan85 has quit [Read error: Connection reset by peer]
matheusmoreira has quit [Remote host closed the connection]
matheusmoreira has joined #ruby
kyrylo has joined #ruby
sezuan has quit [Read error: Connection reset by peer]
sezuan has joined #ruby
sezuan has quit [Read error: Connection reset by peer]
silviu has joined #ruby
sezuan has joined #ruby
silviu has quit [Ping timeout: 248 seconds]
sezuan has quit [Ping timeout: 252 seconds]
Inline has quit [Quit: Leaving]
sezuan has joined #ruby
conta has joined #ruby
cthulchu_ has joined #ruby
ur5us has quit [Remote host closed the connection]
cthulchu_ has quit [Ping timeout: 248 seconds]
sauvin has joined #ruby
rsh has joined #ruby
Rudd0 has joined #ruby
rsh has quit [Ping timeout: 245 seconds]
reber has joined #ruby
Synthead has joined #ruby
hutch1 has quit [Ping timeout: 272 seconds]
<Synthead> I want to parse markdown and get links and their attributes to iterate through. I found redcarpet, but it seems to just convert markdown to other languages. Can I use it to simply parse markdown and read its data?
podlech has joined #ruby
podlech has quit [Client Quit]
fphilipe_ has quit [Ping timeout: 258 seconds]
code_zombie has quit [Quit: Leaving]
schne1der has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
envex has joined #ruby
xco has joined #ruby
fphilipe_ has joined #ruby
conta has quit [Ping timeout: 244 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snickers has joined #ruby
Synthead has quit [Read error: Connection reset by peer]
Synthead has joined #ruby
conta has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
cgfbee has quit [Remote host closed the connection]
aupadhye has joined #ruby
jenrzzz has joined #ruby
andikr has joined #ruby
fphilipe_ has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
fphilipe_ has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cgfbee has joined #ruby
mayurvpatil has joined #ruby
lxsameer has joined #ruby
reber has quit [Remote host closed the connection]
cats has quit [Ping timeout: 272 seconds]
prestorium has joined #ruby
ur5us has joined #ruby
queip has quit [Ping timeout: 258 seconds]
schne1der has joined #ruby
Synthead has quit [Remote host closed the connection]
ur5us has quit [Ping timeout: 246 seconds]
queip has joined #ruby
rsh has joined #ruby
rsh has quit [Ping timeout: 258 seconds]
Mutsuhito is now known as Dio
cats has joined #ruby
Dio is now known as Diavolo
bambanx has quit [Quit: Leaving]
Diavolo is now known as Mutsuhito
teclator_home has quit [Ping timeout: 258 seconds]
mayurvpatil has quit [Quit: This computer has gone to sleep]
conta has quit [Ping timeout: 245 seconds]
conta has joined #ruby
mikecmpbll has joined #ruby
Jonopoly has joined #ruby
jenrzzz has joined #ruby
queip has quit [Ping timeout: 258 seconds]
jefffrails35 has joined #ruby
jefffrails35 has quit [Remote host closed the connection]
ellcs has joined #ruby
ellcs has quit [Max SendQ exceeded]
ellcs has joined #ruby
queip has joined #ruby
crankharder has joined #ruby
ellcs has quit [Ping timeout: 246 seconds]
bradleyprice has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
mayurvpatil has joined #ruby
drale2k_ has joined #ruby
ur5us has joined #ruby
_whitelogger has joined #ruby
bradleyprice has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bradleyprice has quit [Ping timeout: 248 seconds]
NL3limin4t0r_afk is now known as NL3limin4t0r
ellcs has joined #ruby
ricekrispie has quit [Read error: Connection reset by peer]
ricekrispie has joined #ruby
mayurvpatil has quit [Ping timeout: 258 seconds]
themsay has quit [Ping timeout: 268 seconds]
mosh has quit [Ping timeout: 245 seconds]
mayurvpatil has joined #ruby
alem0lars has joined #ruby
cd has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
SigizMG has joined #ruby
ellcs has quit [Ping timeout: 248 seconds]
alem0lars has quit [Remote host closed the connection]
esrse has quit [Ping timeout: 248 seconds]
themsay has joined #ruby
conta has quit [Ping timeout: 272 seconds]
rsh has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rsh has quit [Ping timeout: 258 seconds]
themsay has quit [Ping timeout: 268 seconds]
themsay has joined #ruby
alem0lars has joined #ruby
alem0lars has quit [Max SendQ exceeded]
alem0lars has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
tdy has joined #ruby
cd has quit [Remote host closed the connection]
cd has joined #ruby
drale2k_ has joined #ruby
rsh_ has joined #ruby
goldbox has joined #ruby
conta has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goldbox has quit [Client Quit]
goldbox has joined #ruby
tdy has quit [Remote host closed the connection]
queip has quit [Ping timeout: 245 seconds]
goldbox has quit [Client Quit]
drale2k_ has joined #ruby
goldbox has joined #ruby
goldbox has quit [Client Quit]
rsh_ has quit [Ping timeout: 268 seconds]
Swyper has joined #ruby
goldbox has joined #ruby
queip has joined #ruby
rsh has joined #ruby
goldbox has quit [Client Quit]
Ai9zO5AP has joined #ruby
goldbox has joined #ruby
Matadoer has quit [Ping timeout: 272 seconds]
goldbox has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
goldbox has joined #ruby
conta has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
AJA4350 has joined #ruby
goldbox55 has joined #ruby
ur5us has quit [Remote host closed the connection]
conta has joined #ruby
kyrylo has joined #ruby
Swyper has quit [Remote host closed the connection]
kyrylo has quit [Read error: Connection reset by peer]
kyrylo has joined #ruby
goldbox has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
goldbox55 is now known as goldbox
Swyper has joined #ruby
powerbit has quit [Ping timeout: 245 seconds]
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
queip has quit [Ping timeout: 245 seconds]
snickers has quit [Quit: Textual IRC Client: www.textualapp.com]
queip has joined #ruby
mayurvpatil has quit [Quit: This computer has gone to sleep]
mayurvpatil has joined #ruby
arooni_team_b has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
arooni has quit [Ping timeout: 264 seconds]
Jonopoly has quit [Quit: WeeChat 2.4]
conta has quit [Ping timeout: 272 seconds]
mikecmpbll has quit [Quit: inabit.]
miskatonic has joined #ruby
conta has joined #ruby
goldbox has quit [Remote host closed the connection]
marz_d`ghostman has joined #ruby
Swyper has quit [Remote host closed the connection]
<marz_d`ghostman> Anyone using the country_select gem? How do validate that the value passed to the attribute of a model is within the values defined in the gem?
griffindy has joined #ruby
Mike11 has joined #ruby
griffindy has quit [Remote host closed the connection]
griffindy has joined #ruby
jenrzzz has joined #ruby
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
hutch1 has joined #ruby
<havenwood> The latest commit on Ruby trunk is exciting! https://github.com/ruby/ruby/commit/f169043d81524b5b529f2c1e9c35437ba5bc3a7a
donofrio has quit [Remote host closed the connection]
conta has quit [Ping timeout: 258 seconds]
<livcd> guilds would be more exciting
doodlebug has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
<kyrylo> But nobody calls foo() like foo(). It would be just 'foo'
conta has joined #ruby
reber has joined #ruby
<havenwood> kyrylo()
Jonopoly has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
vondruch has quit [Ping timeout: 272 seconds]
budonyc has joined #ruby
jenrzzz has joined #ruby
schne1der has quit [Ping timeout: 246 seconds]
mayurvpatil has quit [Quit: This computer has gone to sleep]
mayurvpatil has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
asat has quit [Ping timeout: 268 seconds]
asat has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
apparition has joined #ruby
morozovm has joined #ruby
morozovm has quit [Remote host closed the connection]
conta has quit [Ping timeout: 245 seconds]
dbugger has joined #ruby
_dbugger has quit [Ping timeout: 252 seconds]
<NL3limin4t0r> &>> [[:gcd, 60], :to_s].map { |method, *args| ->(value) { value.public_send(method, *args) } }.reduce(:>>).call(36)
<rubydoc> # => "12" (https://carc.in/#/r/72ew)
morozovm has joined #ruby
gnufied has joined #ruby
morozovm has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving]
gnufied has joined #ruby
iffraff has joined #ruby
iffraff_2 has joined #ruby
doodleb4 has joined #ruby
jenrzzz has joined #ruby
<adam12> Can't mute the commenting on that thread apparently. I guess RIP Inbox today if it's just going to be a bunch of -1'ers.
Bish has quit [Ping timeout: 248 seconds]
doodleb4 has quit [Read error: Connection reset by peer]
doodleb83 has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
<RougeR> hello
<RougeR> curious why i am having issues here
Esa_ has joined #ruby
<RougeR> eh nvm got it
xco has quit [Quit: xco]
matheusmoreira has quit [Ping timeout: 245 seconds]
iffraff_2 has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
iffraff has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
matheusmoreira has joined #ruby
jeremycw has joined #ruby
cek has joined #ruby
Bish has joined #ruby
iliaskarim has joined #ruby
doodleb83 has quit [Read error: Connection reset by peer]
shtirlic has quit [Read error: Connection reset by peer]
aupadhye has quit [Ping timeout: 272 seconds]
shtirlic has joined #ruby
SigizMG has quit [Quit: Textual IRC Client: www.textualapp.com]
jenrzzz has quit [Ping timeout: 248 seconds]
doodlebug has joined #ruby
morozovm has joined #ruby
mistergibson has joined #ruby
themsay has quit [Ping timeout: 245 seconds]
themsay has joined #ruby
Inline has joined #ruby
apparition has quit [Quit: Bye]
mayurvpatil has quit [Quit: This computer has gone to sleep]
queip has quit [Ping timeout: 248 seconds]
conta has joined #ruby
dbugger has quit [Remote host closed the connection]
dbugger has joined #ruby
themsay has quit [Ping timeout: 245 seconds]
queip has joined #ruby
dviola has joined #ruby
miskatonic has joined #ruby
moei has joined #ruby
marz_d`ghostman has quit [Ping timeout: 256 seconds]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
miskatonic has joined #ruby
<vdl> I'm wondering why Ruby designers did not plan to make "and" and "or" simple synonyms for "&&" and "||" yet, since everyone complains about and the former would make the code even more readable.
bradleyprice has joined #ruby
AJA4350 has quit [Quit: AJA4350]
miskatonic has quit [Remote host closed the connection]
alem0lars has quit [Ping timeout: 248 seconds]
miskatonic has joined #ruby
jenrzzz has joined #ruby
<darix> vdl: there is "and" and "or" in ruby?
xco has joined #ruby
AJA4350 has joined #ruby
<vdl> darix: for flow control, yes
<ule> Kind of Railsish question. How would you architecture your system if you need to convert data from one format to another one? In my case, I need to convert Rails User Objects to a specific crazy json format (SCIM schema)
<ule> Would you use somehting like DTO (data transfer objects)?
<ule> Maybe a different pattern like: builder?
<ule> bring the system architecture that lives in your brain to here and please help this little programmer
<ule> :P
yasumi2136 has joined #ruby
RiPuk has quit [Ping timeout: 248 seconds]
john__ has joined #ruby
dar123 has joined #ruby
dar123 has quit [Client Quit]
themsay has joined #ruby
<darix> vdl: && and || boolean operations too?
RiPuk has joined #ruby
<vdl> darix: && and || can be used for flow control as well, but and/or mustn't be used for boolean operations. Hence the hate for them.
donofrio has joined #ruby
SeepingN has joined #ruby
donofrio has quit [Remote host closed the connection]
rippa has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
gnufied has quit [Ping timeout: 245 seconds]
dar123 has joined #ruby
john__ has quit [Remote host closed the connection]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
jenrzzz has quit [Ping timeout: 245 seconds]
mikecmpbll has joined #ruby
teclator_ has joined #ruby
donofrio has joined #ruby
conta has quit [Quit: conta]
brendan- has quit [Ping timeout: 245 seconds]
molly has joined #ruby
molly is now known as Guest83989
agrecascino has quit [Ping timeout: 258 seconds]
teclator_ is now known as teclator_home
octos has quit [Read error: Connection reset by peer]
agrecascino has joined #ruby
fphilipe_ has quit [Ping timeout: 248 seconds]
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
jenrzzz has joined #ruby
bradleyprice_ has joined #ruby
bradleyprice has quit [Ping timeout: 245 seconds]
drale2k_ has joined #ruby
morozovm has quit [Remote host closed the connection]
DaRock has quit [Ping timeout: 268 seconds]
SuperLag has joined #ruby
drale2k_ has quit [Client Quit]
<NL3limin4t0r> vdl: The hate is undeserved. The `and` and `or` operators have their place. For example `some_variable = some_method or return`. This would otherwise be written as `(some_variable = some_method) || return` or as `return unless (some_variable = some_method)` which are both pretty ugly.
Guest83989 has quit [Remote host closed the connection]
Guest83989 has joined #ruby
SuperLag has quit [Client Quit]
SuperLag has joined #ruby
Jonopoly has quit [Quit: WeeChat 2.4]
<vdl> NL3limin4t0r: unless and if already provide inline flow control. and/or being synonyms for &&/|| would avoid confusion and make code more readable IMO.
<NL3limin4t0r> ule: The builder pattern might indeed be a good fit. You could also considder wraping the other class with an adapter, that handles the data transformation. That way you can simply provide an instance of you model.
shtirlic has quit [Quit: ZNC - http://znc.in]
themsay has quit [Ping timeout: 258 seconds]
<NL3limin4t0r> vdl: Different tools are for different needs. As long as you understand that and/or have lower precedence than most other operators you're good to go. It's the same as saying that two wranches of different sizes are both wrenches, so therefor you should make them the same size.
bradleyprice_ has quit [Remote host closed the connection]
bradleyprice has joined #ruby
shtirlic has joined #ruby
bradleyprice has quit [Ping timeout: 258 seconds]
orbyt_ has joined #ruby
goldbox has joined #ruby
dbugger has quit [Quit: Leaving]
mikecmpbll has quit [Quit: inabit. zz.]
<NL3limin4t0r> ule: The builder pattern is meant to have a more customizable output than the factory method or abstract factory. But it deepends on your needs.
duderonomy has joined #ruby
morozovm has joined #ruby
NL3limin4t0r is now known as NL3limin4t0r_afk
queip has quit [Ping timeout: 268 seconds]
goldbox has quit [Remote host closed the connection]
morozovm has quit [Ping timeout: 245 seconds]
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has joined #ruby
conta has joined #ruby
queip has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goldbox has joined #ruby
themsay has joined #ruby
bradleyprice has joined #ruby
Xiti has quit [Quit: Xiti]
brendan- has joined #ruby
bradleyprice has quit [Ping timeout: 244 seconds]
Xiti has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
Exuma has joined #ruby
gnufied has joined #ruby
<Exuma> is Time.now.utc ever wrong if it's called during a time with/without DST? Similar to how DateTime.parse will say -5:00 even though it should be -4:00 because of DST
prestorium has quit [Quit: prestorium]
brendan- has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
snickers has joined #ruby
andikr has quit [Remote host closed the connection]
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
snickers has quit [Ping timeout: 248 seconds]
tdy has joined #ruby
dar123 has quit [Ping timeout: 250 seconds]
RougeR has quit [Ping timeout: 258 seconds]
renich has joined #ruby
duderonomy has joined #ruby
dviola has quit [Quit: WeeChat 2.5]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
salerace has quit [Quit: salerace]
brendan- has joined #ruby
yoshie902a has joined #ruby
jenrzzz has joined #ruby
<yoshie902a> I am trying to get my ruby seen in text mate, if anyone has any ideas, I could use some help! https://stackoverflow.com/questions/56585935/please-add-the-directory-containing-users-me-rvm-bin-rvm-auto-ruby
kyrylo has quit [Quit: Textual IRC Client: www.textualapp.com]
crankharder has quit [Read error: Connection reset by peer]
crankharder has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
kyrylo has joined #ruby
bradleyprice has joined #ruby
n13z has quit [Ping timeout: 245 seconds]
cek has left #ruby [#ruby]
conta has quit [Quit: conta]
jenrzzz has joined #ruby
bradleyprice has quit [Ping timeout: 245 seconds]
queip has quit [Ping timeout: 248 seconds]
hutch1 has quit [Quit: WeeChat 2.4]
bradleyprice has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
rikkipitt has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
queip has joined #ruby
dante has joined #ruby
bradleyprice has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 258 seconds]
snickers has joined #ruby
lucasb_ has joined #ruby
bradleyprice has joined #ruby
rikkipitt has quit [Quit: Leaving...]
bradleyprice has quit [Remote host closed the connection]
bradleyprice_ has joined #ruby
<havenwood> !crosspost yoshie902a
<havenwood> (Answered in #rvm.)
<havenwood> ?crosspost
<ruby[bot]> Please do not crosspost without at least telling so and mentioning provided suggestions and their outcome in all channels. Experience shows that people don't do either, and not doing so is considered rude.
<yoshie902a> Sorry! Which would be preferred IRC?
<yoshie902a> Will address in RVM
<yoshie902a> Thank you
<havenwood> It's fine to ask in multiple channels, just mention you're doing it so someone who's thinking of answering doesn't waste their time.
brendan- has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
koala_man has left #ruby ["I'm gonna win SETI@home"]
yokel has quit [Ping timeout: 258 seconds]
<havenwood> 2016: HTTP/2 will kill WebSockets
<havenwood> 2019: Introducing HTTP/2 WebSockets
yokel has joined #ruby
Mike11 has quit [Quit: Leaving.]
yoshie902a has left #ruby [#ruby]
iliaskarim has quit [Quit: leaving]
jenrzzz has joined #ruby
GodFather has quit [Ping timeout: 245 seconds]
queip has quit [Ping timeout: 268 seconds]
<havenwood> And the Async::WebSocket gem supports HTTP/2 mode :)
codefriar has quit [Ping timeout: 248 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
queip has joined #ruby
Onwarion has left #ruby ["Leaving"]
hiroaki has joined #ruby
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
jeremycw has quit [Ping timeout: 258 seconds]
jeremycw has joined #ruby
codefriar has joined #ruby
kjhaidl has joined #ruby
retromode has joined #ruby
queip has quit [Ping timeout: 245 seconds]
<retromode> is there a way to check if a collection is an Array of object A? i.e. foo.is_a?(Array(ObjectA))?
DTZUZO has quit [Ping timeout: 248 seconds]
<havenwood> retromode: foo.instance_of?(Array) && foo.all?(ObjectA)
<retromode> thanks!
brendan- has quit [Ping timeout: 272 seconds]
DTZUZO has joined #ruby
fphilipe_ has joined #ruby
shtirlic has quit [Quit: ZNC - http://znc.in]
infernix has quit [Ping timeout: 245 seconds]
retromode has quit [Ping timeout: 256 seconds]
shtirlic has joined #ruby
shtirlic has quit [Client Quit]
shtirlic has joined #ruby
infernix has joined #ruby
queip has joined #ruby
budonyc has quit [Quit: Leaving]
<havenwood> #instance_of? is strict that it's an Array exactly, not something that subclasses Array but #all? allows subclasses of ObjectA, fwiw
<havenwood> for consistency:
<havenwood> foo.is_a?(Array) && foo.all?
<havenwood> or:
<havenwood> foo.instance_of?(Array) && foo.all? { |item| item.instance_of? ObjectA }
<havenwood> Or mix and match if that makes sense in your case!
<havenwood> the lax version is shortest ¯\_(ツ)_/¯
<adam12> #instance_of? isn't something I see that often in the wild.
<adam12> Ironically I thought it was an alias of #is_a? before you mentioned it.
<havenwood> #kind_of? is an #is_a? alias
<havenwood> On GitHub: {instance_of: 7_324, kind_of: 15_1111, is_a: 789_824}
<havenwood> #is_a? is the popularity winner
<adam12> I gag a little when I see is_a?(Array) tho. I completely forgot about #kind_of?
<havenwood> adam12: Yeah, I agree on the type checking.
* havenwood mutters something about ducks.
<ytti> intuitively i think anyone not knowing would guess is_a is instance_of not kind_of
bradleyprice_ has quit [Remote host closed the connection]
<havenwood> &>> [].is_a? Enumerable
<ytti> and i think lot of people who use is_a, assume it is exact
<rubydoc> # => true (https://carc.in/#/r/72gs)
bradleyprice has joined #ruby
<ytti> i'd use instance_of? by default, and kind_of? when i have to
<havenwood> &>> module Kernel; alias quacks_like_a? is_a?; end; ''.quacks_like_a? String
<rubydoc> # => true (https://carc.in/#/r/72gt)
<havenwood> It's a shame #parameters only shows explicit &blocks.
mosh has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
d^sh has joined #ruby
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ruby
mochiyoda has joined #ruby
reber has quit [Remote host closed the connection]
infernix has quit [Ping timeout: 258 seconds]
lord4163 has quit [Quit: Gotta go cya!]
kjhaidl has quit [Quit: Textual IRC Client: www.textualapp.com]
lord4163 has joined #ruby
gix has joined #ruby
yasumi2136 has quit [Quit: Konversation terminated!]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
doodlebug has joined #ruby
bradleyprice_ has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
LtHummus has quit [Quit: ZNC 1.7.3 - https://znc.in]
dviola has joined #ruby
nowhereman has joined #ruby
bradleyprice has quit [Ping timeout: 248 seconds]
Fusl has quit [Quit: K-Lined]
LtHummus has joined #ruby
morozovm has joined #ruby
Fusl has joined #ruby
kyrylo has quit [Ping timeout: 272 seconds]
AndreYuhai has joined #ruby
<AndreYuhai> Hello there, I am using mysql2 gem. I want to insert NULLs when the string is empty. How to achieve this? I mean if I do string interpolation in my INSERT query then I will have quotes but when NULL put in quotes it is not treated as NULL.
<AndreYuhai> I couldn't come up with a good way of implementing this idea and I couldn't find anything on the Internet.
kyrylo has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
jcalla has quit [Ping timeout: 246 seconds]
morozovm has quit [Ping timeout: 268 seconds]
<AndreYuhai> the default is already NULL. but then if I skip that in my INSERT query then what if in a case where the string is not empty. Because INSERT query is hard coded.
<AndreYuhai> Oh, maybe I could just put strings in quotes before interpolating them in insert query so that I can also convert empty strings to NULL! I will try that and see.
powerbit has joined #ruby
kyrylo has quit [Ping timeout: 245 seconds]
tdy has joined #ruby
hightower2 has joined #ruby
hightower2 has quit [Changing host]
hightower2 has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
fphilipe_ has joined #ruby
Creatornator has joined #ruby
schne1der has joined #ruby
Azure|dc has quit [Read error: Connection reset by peer]
Azure has joined #ruby
vjacob has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
orbyt_ has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
cerulean has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
AndreYuhai has joined #ruby
rsh has quit [Ping timeout: 258 seconds]
alem0lars has quit [Ping timeout: 245 seconds]
spiette has quit [Quit: ZNC 1.7.3 - https://znc.in]
doodlebug has joined #ruby
goldbox has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
hightower2 has quit [Ping timeout: 272 seconds]
spiette has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
cerulean_ has joined #ruby
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vjacob has quit [Ping timeout: 248 seconds]
ellcs has joined #ruby
cerulean has quit [Ping timeout: 248 seconds]
joshuacronemeyer has joined #ruby
fphilipe_ has joined #ruby
hightower2 has joined #ruby
ellcs has quit [Ping timeout: 268 seconds]
queip has quit [Ping timeout: 272 seconds]
dostoyevsky has quit [Ping timeout: 252 seconds]
vjacob has joined #ruby
dostoyevsky has joined #ruby
dostoyevsky has quit [Ping timeout: 246 seconds]
queip has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
greypack has quit [Quit: All your IRC are belong to ZNC]
bradleyprice_ has quit [Remote host closed the connection]
queip has quit [Ping timeout: 248 seconds]
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
schne1der has quit [Ping timeout: 245 seconds]
fphilipe_ has quit [Ping timeout: 252 seconds]
greypack has joined #ruby
queip has joined #ruby
jenrzzz_ has joined #ruby
hightower2 has quit [Ping timeout: 268 seconds]
rsh has joined #ruby
envex has quit []
jenrzzz has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
code_zombie has joined #ruby
rsh has quit [Ping timeout: 244 seconds]
greypack has quit [Quit: All your IRC are belong to ZNC]
greypack has joined #ruby
bradleyprice has joined #ruby
AndreYuhai has quit [Remote host closed the connection]
AndreYuhai has joined #ruby
rsh has joined #ruby
Eiam has quit [Quit: Textual IRC Client: www.textualapp.com]
r3m has quit [Quit: brb]
Fr4n has quit [Quit: Fr4n]
Eiam has joined #ruby
doodlebug has quit [Ping timeout: 258 seconds]
r3m has joined #ruby
doodleb28 has joined #ruby
doodleb28 has quit [Read error: Connection reset by peer]
<AndreYuhai> How to check if a string is just containing white space? Strip does not help.
<phaul> match a regexp that is whitespace from start to end
<AndreYuhai> phaul: oh, that's right. Thanks.
<phaul> np
rsh has quit [Ping timeout: 268 seconds]
moei has quit [Quit: Leaving...]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
Swyper has joined #ruby
nowhereman has quit [Ping timeout: 257 seconds]
nowhere_man has joined #ruby
dostoyevsky has joined #ruby
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
Esa_ has quit []
sameerynho has joined #ruby
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
tdy has quit [Ping timeout: 245 seconds]
gix has quit [Quit: Client exiting]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
jeremycw has quit [Ping timeout: 268 seconds]
gix has joined #ruby
Swyper has quit [Remote host closed the connection]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
fphilipe_ has joined #ruby
Swyper has joined #ruby
gix has quit [Quit: Client exiting]
Ai9zO5AP has quit [Quit: WeeChat 2.4]
Swyper has quit [Remote host closed the connection]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
xco has quit [Quit: xco]
<havenwood> AndreYuhai: BLANK = /\A[[:space:]]*\z/.freeze
<havenwood> AndreYuhai: Use #match? for great speed. :)
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
<havenwood> When Rails switched from =~ to #match? it got a huge speedup. It went from a lot slower than the #blank? C-extension to about the same speed.
<AndreYuhai> havenwood: This is actually what I was looking for just now. I guess using this regexp : /\A\s*\Z/ does not work for &nbsp
infernix has joined #ruby
<mozzarella> it should
<havenwood> mozzarella: but it doesn't!
<havenwood> &>> "\u00A0".match? /\A[[:space:]]*\Z/
<rubydoc> # => true (https://carc.in/#/r/72hb)
<havenwood> &>> "\u00A0".match? /\A\s*\Z/
<rubydoc> # => false (https://carc.in/#/r/72hc)
<havenwood> mozzarella: /\s/ - A whitespace character: /[ \t\r\n\f\v]/
<AndreYuhai> I don't know why it does not work but I just figured it out. Hopefully the first string I got had this &nbsp. :D
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
kristofferR has joined #ruby
tdy has joined #ruby
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
doodlebug has joined #ruby
doodlebug has quit [Excess Flood]
doodlebug has joined #ruby
gbristol has quit [Quit: leaving]
tdy has quit [Ping timeout: 248 seconds]
fphilipe_ has quit [Ping timeout: 248 seconds]
AJA4351 has joined #ruby
kristoff_ has joined #ruby
AJA4350 has quit [Ping timeout: 258 seconds]
AJA4351 is now known as AJA4350
kristofferR has quit [Ping timeout: 246 seconds]
kristofferR has joined #ruby
kristoff_ has quit [Ping timeout: 244 seconds]
snickers has quit [Quit: Textual IRC Client: www.textualapp.com]
<AndreYuhai> How can I check a value or change it before I assign it to my instance variable that is declared with attr_accessor? Should I override variable_name= ?
sameerynho has quit [Ping timeout: 258 seconds]
bradleyprice has quit [Remote host closed the connection]
<phaul> yes, kind of. override would happen in the child class, but given a single class, just use attr_reader, and just define def variable_name=(val) method
bradleyprice has joined #ruby
bradleyprice has quit [Remote host closed the connection]
<phaul> &>> class X; attr_reader :blah; def blah=(val); @blah = 2 * val; end; end; x = X.new; x.blah = 13; x.blah
<rubydoc> # => 26 (https://carc.in/#/r/72hd)
fphilipe_ has joined #ruby
<AndreYuhai> phaul: oh that looks better, thank you. :)
gix has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ricekrispie has quit [Quit: YEET]
queip has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
kristofferR has quit [Quit: Textual IRC Client: www.textualapp.com]
queip has joined #ruby
gbristol has joined #ruby
solars has quit [Quit: Connection closed for inactivity]
bambanx has joined #ruby
rsh has joined #ruby
ricekrispie has joined #ruby