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')
<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>
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…]
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)]
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.
<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.
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]
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"]
<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]
<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  
<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]