willharrison has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Juanchito has quit [Quit: Connection closed for inactivity]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Yzguy has quit [Quit: Zzz...]
jjasonclark has quit [Quit: jjasonclark]
deg_ has joined #ruby
segfalt has quit [Quit: segfalt]
einarj has joined #ruby
einarj has quit [Read error: Connection reset by peer]
allcentury has joined #ruby
cb_ has quit [Remote host closed the connection]
freerobby has quit [Quit: Leaving.]
atomical has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
segfalt has joined #ruby
benlieb has quit [Quit: benlieb]
mary5030 has joined #ruby
willharrison has joined #ruby
<pontiki>
wat
Technodrome has joined #ruby
ICantCook has joined #ruby
cb_ has joined #ruby
pecpec has joined #ruby
postmodern has joined #ruby
<jt__>
is there a documentation/resource I can find more about Proxy class pattern? I'm on my last Koan and don't want a spoiler from good but I need something to read more about Proxy classes
ckuhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
vdamewood has joined #ruby
moeabdol has quit [Ping timeout: 240 seconds]
freerobby has joined #ruby
havenwood has joined #ruby
chills42 has quit [Read error: Connection reset by peer]
chills42 has joined #ruby
pecpec has quit [Ping timeout: 246 seconds]
yfeldblum has quit [Ping timeout: 240 seconds]
<Ox0dea>
pontiki: BubbleBabble is like MD5 with aliens.
A124 has quit [Read error: Connection reset by peer]
<Ox0dea>
jt__: It might help to think of a proxy class as a sort of middleman.
<pontiki>
i think i'll start using that GUIDs!
Guest37085 has joined #ruby
bb010g has quit [Quit: Connection closed for inactivity]
workmad3 has quit [Ping timeout: 255 seconds]
Guest37085 is now known as gmci
<jt__>
why/when do we need it?
<Ox0dea>
jt__: When you can't/would rather not modify the object being proxied.
<Ox0dea>
Your proxy class, for all intents and purposes, *is* the object it's proxying, except you have free reign to inject extra behavior as and where appropriate.
A124 has joined #ruby
<jt__>
that helped clear things up. Is it like the decorator in Python?
<Ox0dea>
jt__: No, not quite; that's for tacking additional behavior onto methods, not objects.
cb__ has joined #ruby
cb__ has joined #ruby
<rgb-one>
Hey
cb_ has quit [Read error: Connection reset by peer]
Rodya_ has quit [Remote host closed the connection]
<rgb-one>
Ox0dea: Better formulated, What have you found symbols most useful for?
vF3hNGxc47h8 has quit [Ping timeout: 250 seconds]
<Ox0dea>
rgb-one: If you ever see the same String more than once or twice in your code, it should almost certainly be a Symbol.
<Ox0dea>
They're much more "computationally effective", so to speak, in both time and space.
jjasonclark has joined #ruby
<Ox0dea>
When you compare two Strings, Ruby has to walk each one and compare every single character until it runs out or realizes they can't possibly match.
ledestin has joined #ruby
<Ox0dea>
That could translate to hundreds or even thousands of CPU instructions.
<Ox0dea>
Symbols, on the other hand, are Strings with a secret: they have ID numbers, and comparing two numbers is typically a single CPU instruction.
<rgb-one>
O(1)?
<Ox0dea>
Aye, O(1).
<Ox0dea>
O(1) is love, O(1) is life.
<rgb-one>
lol
<rgb-one>
is there an alternative to \w but for symbols?
<Ox0dea>
rgb-one: There is \W, which is the exact opposite of \w, which might be what you want.
<rgb-one>
Interesting
<Ox0dea>
There's also the [:punct:] character class for strictly matching those characters which the current locale defines to be punctuation.
<Ox0dea>
I'm going to stop oversaturating now; I wanna see this sentence get properly slangified.
<Ox0dea>
I'm gonna roll. One more drink if I don't get all Strings.
<Ox0dea>
>> [*ObjectSpace.each_object].sample 3
<ruboto>
Ox0dea # => [<RubyVM::InstructionSequence:block in reset@/execpad/interpreters/ruby-2.2.0/lib/ruby/2.2.0/rubygem ...check link for more (https://eval.in/436441)
<rgb-one>
The slang is indeed inserted but all the content from the original sentence is removed
<Ox0dea>
rgb-one: Update the Gist?
<rgb-one>
Ox0dea: all the other content that is. what remains is the content of the hash
Rickmasta has joined #ruby
jjasonclark has joined #ruby
<Ox0dea>
We're nearly there, and I think you'll like this next part. :)
<Ox0dea>
Yep, you got it. So... what's happening?
xcesariox has joined #ruby
<rgb-one>
only "4 Y U" is in the slang
<Ox0dea>
rgb-one: Look at it the other way.
<rgb-one>
"4 U Y" i meant
nofxx has quit [Ping timeout: 244 seconds]
<rgb-one>
Ox0dea: what do you mean?
<Ox0dea>
It's the keys that matter, since that's what #gsub is using to find replacements.
nofxx has joined #ruby
dreadnought8971 has quit [Remote host closed the connection]
mondayrain has joined #ruby
<rgb-one>
I see so it disregards all else, ie. NOW and ASK
<Ox0dea>
rgb-one: Nope, it isn't disregarding them.
<Ox0dea>
So you see, #gsub is replacing "NOW" and "ASK" with "".
vdamewood has quit [Ping timeout: 240 seconds]
<headius>
duncan_bayne: the thread pooling was mostly to reduce the cost of spinning up Ruby Threads a long time ago, but it was never really much better than just starting a new native thread each time
<headius>
so it has been removed in 9k
eminencehc has joined #ruby
agent_white has joined #ruby
<rgb-one>
I would have to try a different method in order for show NOW and ASK, where hash doen't use NOW and ASK as values it seems.
pecpec has joined #ruby
<Ox0dea>
rgb-one: And now for the piece de résistance!
<Ox0dea>
You can tell Hashes to "do something" in order to return something other than nil for nonexistent keys.
<rgb-one>
Ox0dea: I see
mrtomme has quit [Ping timeout: 264 seconds]
<Ox0dea>
Note well that this "default proc" will only be invoked for missing keys; those with explicit values will respond as usual.
mrtomme has joined #ruby
rushed has joined #ruby
gener1c_ has joined #ruby
pecpec has quit [Ping timeout: 260 seconds]
umgrosscol has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
linuxboytoo has joined #ruby
<rgb-one>
so I would include something in the hash = {} function that would return the word instead of nil
gener1c has quit [Ping timeout: 255 seconds]
shinnya has quit [Ping timeout: 246 seconds]
dreadnought8971 has joined #ruby
<rgb-one>
as the key
<rgb-one>
as the value*
<Ox0dea>
rgb-one: `hash = {}` just defines a regular ol' Hash.
<Ox0dea>
You'll have to use Hash.new with a block to get this special behavior.
braincras has quit [Quit: bye bye]
<Ox0dea>
The block receives two arguments, the Hash being queried, and the specific key being requested.
<Ox0dea>
You're not particularly interested in the Hash itself, since you don't intend to modify it in any way.
chills42 has quit [Remote host closed the connection]
linuxboytoo has quit [Ping timeout: 250 seconds]
weemsledeux has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
linuxboytoo has joined #ruby
<Ox0dea>
You just want to capture the key and respond with, well, that same key, since you're only interested in preventing non-slangable words from returning nil and becoming "" in the replacement string.
voxxit has quit [Remote host closed the connection]
dreadnought8971 has quit [Remote host closed the connection]
<Ox0dea>
So you can define your slang transformation is a nice Hash literal as you were, and then tack on that "lie about your existence, non-slangable words" behavior afterwards.
<Ox0dea>
*in a nice
voxxit has joined #ruby
gix has quit [Ping timeout: 246 seconds]
<rgb-one>
cool :)
tkuchiki has quit [Ping timeout: 240 seconds]
rurik has quit [Ping timeout: 246 seconds]
swgillespie has joined #ruby
rurik has joined #ruby
rurik has quit [Changing host]
rurik has joined #ruby
<rgb-one>
ruboto is an irb session right?
<Ox0dea>
rgb-one: No, it starts a new Ruby process each time.
roxtrongo has quit [Remote host closed the connection]
<shevy>
hehehe
<shevy>
write once, abandon always
roxtrongo has joined #ruby
<shevy>
it would be nice if gems could have some tags on rubygems.org like "hey people, I wrote this in 2010 but I don't have time to maintain it; if anyone wants to maintain it, send an email"
j4cknewt has quit [Read error: Connection reset by peer]
banjara has quit [Quit: Leaving.]
<Nilium>
Closest you can really get to that is checking the gem release date. The better thing would be to make the search feature on rubygems.org not awful.
agent_white has left #ruby [#ruby]
<Nilium>
i.e., allow pruning results based on last release time, whether there's ever been a non-1.x.y or greater release, whether the author is a deranged lunatic, etc.
j4cknewt has joined #ruby
pecpec has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
alexUaN has joined #ruby
pecpec has quit [Ping timeout: 240 seconds]
joufflu has quit [Read error: Connection reset by peer]
tomphp_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
BlackCoyote has quit [Remote host closed the connection]
bweston92 has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
bweston92 has joined #ruby
cb_ has quit [Remote host closed the connection]
Meow-J has joined #ruby
Igorshp has quit [Remote host closed the connection]
terlar has joined #ruby
iamdevnul has joined #ruby
aswen has quit [Ping timeout: 260 seconds]
flughafen has quit [Remote host closed the connection]
j4cknewt_ has joined #ruby
j4cknewt_ has quit [Remote host closed the connection]
Lloyd has joined #ruby
poguez_ has quit [Quit: Connection closed for inactivity]
flughafen has joined #ruby
j4cknewt has quit [Ping timeout: 240 seconds]
DoYouKnow has joined #ruby
codeitagile has joined #ruby
joaomdmoura has joined #ruby
<flughafen>
hey shevy certainty
Igorshp has joined #ruby
pontiki has joined #ruby
arup_r_ has joined #ruby
khebbie has joined #ruby
<platzhirsch>
flughafen.. really?
<flughafen>
hi platzhirsch
jabreity has joined #ruby
<yorickpeterse>
platzhirsch: ᕕ(ᐛ)ᕗ
<platzhirsch>
Has anyone of you used a fuzzy searcher? I installed fzf yesterday and integrated it into Vim for Ruby and I must have wetted myself several times on that evening
<pontiki>
you mean in an editor, not in a ruby program?
<shafire>
is there any way to get a "static" type system into ruby?
<darix>
shafire: what do you mean?
<yorickpeterse>
shafire: no
<yorickpeterse>
Ruby is dynamically typed with no way to chance that. There are some Gems that implement runtime contracts for methods, but that's about it
Pumukel has quit [Quit: ChatZilla 0.9.92 [Firefox 40.0.3/20150826023504]]
arup_r has joined #ruby
elperdut has joined #ruby
ldnunes has joined #ruby
elperdut has quit [Client Quit]
y0da has joined #ruby
but3k4 has quit [Ping timeout: 250 seconds]
tjbiddle has joined #ruby
<platzhirsch>
Is Crystal the PHP of Ruby?
suchness has joined #ruby
<apeiros>
more like the hack of ruby
roxtrongo has quit [Remote host closed the connection]
<apeiros>
at least if I remember correctly what hack is
aswen has joined #ruby
<[k->
what do you mean by php :o
<platzhirsch>
something offensive
<platzhirsch>
like an insult
drewvanstone has joined #ruby
<[k->
supporters of crystal wouldn't be happy
Igorshp has quit [Remote host closed the connection]
<[k->
jhass has worked very hard
<platzhirsch>
I have no clue, don't mind me
syath has joined #ruby
<jhass>
platzhirsch: why would you say so :(
tjbiddle has quit [Ping timeout: 250 seconds]
<platzhirsch>
oh no
<platzhirsch>
I don't know.. I just wanted to stir
<jhass>
even if, what's PHP's Ruby then?
bodie_ has joined #ruby
atzorvas has quit [Quit: leaving]
strcmp1 has quit [Ping timeout: 246 seconds]
<platzhirsch>
More like Ruby's PHP?
khebbie has joined #ruby
elperdut has joined #ruby
drewvanstone has quit [Ping timeout: 252 seconds]
<jhass>
"Crystal is to Ruby like PHP is to ???"
ndrei has quit [Ping timeout: 250 seconds]
<platzhirsch>
HTML5
<jhass>
that makes even less sense
<jhass>
what did you drink and where can I get my share of it?
<shevy>
doesn't facebook use some compiled php variant?
<apeiros>
jhass: you want to damage your brain? o0
<[k->
so mean
<jhass>
apeiros: seems easier than dealing with the brain damaged all the time
tjbiddle has joined #ruby
<elaptics>
if you can't beat 'em, join 'em?
<apeiros>
shevy: yes, that'd be hack. which is why I mentioned it before
arup_r_ has joined #ruby
<apeiros>
i.e., "crystal is to ruby like hack is to php". not sure that truly applies, though.
<jhass>
elaptics: old zombie apocalypse truth. Just not appealing to watch hence you won't see it in the movies
Igorshp has joined #ruby
<platzhirsch>
jhass: fair enough, when you asked the question I thin my face melted
devoldmx has joined #ruby
<[k->
this is why we cant have nice things in the world
nateberkopec has joined #ruby
Kallis has joined #ruby
arup_r has quit [Ping timeout: 246 seconds]
ndrei has joined #ruby
Kallis has quit [Max SendQ exceeded]
<shevy>
apeiros omg... what a horrible name...
<shevy>
on a brighter note, that automatically upgrades the name halsbe :>
<apeiros>
shevy: indeed
Kallis has joined #ruby
<apeiros>
"go" is just about as terrible a name for a language, though
<apeiros>
shevy: na, I'll rename it to "the".
DrCode has quit [Remote host closed the connection]
devoldmx has quit [Ping timeout: 240 seconds]
<[k->
how dare you choose the most commonly used word in the English language!
<tobukiah>
how dare you choose the / most commonly used word in / the English language!
<apeiros>
that'll make for some hilarious dialogues: "do you use the?" - "the what?"
<apeiros>
"the, the language" - "are you stuttering?"
futilegames has joined #ruby
<[k->
what the hell!
<jhass>
I should name a project "" (that's a zero width space)
<shevy>
yeah go is also a strange way... they seem to like to pick action-able names... like apple with "swift"
Ropeney has joined #ruby
<shevy>
*name
<apeiros>
jhass: nonbreaking, I hope?
<jhass>
lol, no
<jhass>
not that fancy
toretore has quit [Quit: This computer has gone to sleep]
<apeiros>
aw come on
<apeiros>
where's the fun in that?
<jhass>
is there even a non-breaking zero width space?
<shevy>
I know there is invisible unicode out there
<shevy>
it's like dark matter in physics
<apeiros>
yes, eam was going on about it just a few days ago :)
davedev24 has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
<apeiros>
and reading the WP article I now know why it looked like a BOM
<[k->
WP is workers party or wordpress
Ropeney has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
<shevy>
wikipedia!
futilegames has quit [Client Quit]
abyss_ is now known as abyss
pravee___ has quit [Read error: Connection reset by peer]
<apeiros>
washington post, of course
praveen__ has joined #ruby
meatherly has joined #ruby
<[k->
> of course
dionysus69 has joined #ruby
skullcrasher_ has joined #ruby
skullcrasher has quit [Ping timeout: 246 seconds]
strcmp1 has joined #ruby
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
ruurd has quit [Read error: Connection reset by peer]
pwnd_nsfw has joined #ruby
hmnhf has joined #ruby
allomov_ has quit [Remote host closed the connection]
<[k->
who follows ("subscribes") to /r/ruby
youngbaks has quit [Ping timeout: 250 seconds]
strcmp1 has quit []
ValicekB has joined #ruby
<maloik>
I do
rurik has quit [Ping timeout: 264 seconds]
DrCode has joined #ruby
fllll has joined #ruby
<fllll>
hey
yardenbar has quit [Ping timeout: 240 seconds]
allomov_ has joined #ruby
DrCode has quit [Remote host closed the connection]
<apeiros>
hi fllll
<[k->
i don't even read it anymore though
<maloik>
why do you ask?
<[k->
these days i just read /r/programming
allomov_ has quit [Remote host closed the connection]
<[k->
it's a poll to see how interesting /r/ruby is
allomov has joined #ruby
<maloik>
I dunno I just browse to it once a day or something, see if anything interesting pops up
<[k->
but does anything pop up,m
<[k->
?*
iceyec has joined #ruby
<fllll>
can you recommend me any book/tutorials/videos to start with ruby? I'm python programmer, I know how to code (like I don't wanna waste my time on reading how loops/conditions/classes work, just wanna learn syntax and some advanced conspect of programming in ruby)
<maloik>
yea from time to time
<fllll>
what would you recommend to learn for a person who has a good background in programming
ericjphillips has quit [Quit: Leaving.]
<jhass>
fllll: tryruby.org to get familiar with the base syntax, then head to the rubykoans
<jhass>
fllll: then have the docs open (ruby-doc.org / devdocs.io / ri for CLI), get pry (pryrepl.org) and try to port some of your simpler python scripts. If you succeeded with that post it here for review
<[k->
codewars, exercism.io, etc, etc
allomov has quit [Ping timeout: 268 seconds]
strcmp1 has joined #ruby
startupality has joined #ruby
<fllll>
[k-: didn't know that codewars and exercism; what's 'etc'? Do you know more websites like that?
<[k->
etc is an expression that generally means "and others"
<fllll>
yup, that's what I mean, can you list other websites like that (if you know more)
<[k->
well, there is project euler, codingames
<jhass>
I still don't think project euler is any helpful in learning any language
strcmp1 has quit [Remote host closed the connection]
<jhass>
it trains your algorithm skills maybe, but not your language skills
sgambino has joined #ruby
umgrosscol has joined #ruby
<[k->
im sure jhass knows a lot more
<jhass>
actually I don't
<[k->
:(
<jhass>
well, there's ruby warrior
<[k->
but you python to ruby!
shadeslayer has quit [Remote host closed the connection]
<[k->
well there are a lot of *code and code* sites
strcmp1 has joined #ruby
<[k->
i just don't know them
rurik has joined #ruby
exadeci has joined #ruby
umgrosscol has quit [Read error: Connection reset by peer]
shadeslayer has joined #ruby
dgutierrez1287 has joined #ruby
victortyau has joined #ruby
bronson has quit [Remote host closed the connection]
<fllll>
ok guys thanks for help!
<jhass>
?guys fllll
<ruboto>
fllll, Though inclusion was probably intended, not everyone relates to being "one of the guys". Maybe consider using "folks", "all", "y'all", or "everyone" instead?
CloCkWeRX has left #ruby [#ruby]
fllll has quit [Quit: Page closed]
Igorshp has quit [Remote host closed the connection]
zenguy_pc has quit [Read error: Connection reset by peer]
p0wn3d__ has joined #ruby
pawnbox_ has quit [Ping timeout: 265 seconds]
Salehi has quit [Quit: Leaving]
meatherly has joined #ruby
Jardayn has joined #ruby
zenguy_pc has joined #ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #ruby
<[k->
such Ox0dea
<[k->
much interesting
ckuhn has joined #ruby
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
allomov has joined #ruby
freezevee has joined #ruby
<[k->
if you are only using %w for one letters, it is actually easier to do this: "abcdefg".chars
elperdut has joined #ruby
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
meatherly has quit []
startupality_ has joined #ruby
startupality has quit [Ping timeout: 240 seconds]
startupality_ is now known as startupality
stardiviner has quit [Ping timeout: 255 seconds]
DrCode has joined #ruby
rushed has quit [Quit: rushed]
DrCode has quit [Remote host closed the connection]
stardiviner has joined #ruby
JoshL has joined #ruby
<strcmp1>
jhass: dude.. :|
bruno- has joined #ruby
<strcmp1>
jhass: is 'guys' not gender neutral to begin with?
JDiPierro has joined #ruby
<jhass>
?guys2 strcmp1
<ruboto>
strcmp1, it doesn’t matter if it’s "normal"/gender neutral to say "guys" in your idiolect. "You guys" to refer to a mixed group is erasure. All we ask from you is to be a decent channel member and respect that. If you want to further discuss this, join #ruby-offtopic.
praveen__ has quit [Remote host closed the connection]
mission712[AFK] is now known as mission712
allcentury has quit [Ping timeout: 272 seconds]
startupality has quit [Quit: startupality]
<strcmp1>
i don't want to discuss it, believe me, but this is getting just a tad bit ridiculous
pawnbox has quit [Ping timeout: 256 seconds]
jmignault has joined #ruby
kedare has quit [Ping timeout: 244 seconds]
<strcmp1>
your attempts to be inclusive seem to alienate and disrupt so far, to be honest
Kendos-Kenlen has joined #ruby
* ckuhn
so confused
<apeiros>
strcmp1: if somebody considers this to be difficult to do, I have not much problems alienating them. I prefer supporting the others in this equation.
<[k->
confuseeeeeeeezaaaaaaaallllllll
DrCode has joined #ruby
darwingr has quit [Ping timeout: 246 seconds]
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
amystephen has joined #ruby
<strcmp1>
apeiros: it's not a word in my vocabulary, however, i think you are misguided if you believe this type of policing of words is actually a good thing. it's the other extreme. no extreme is good.
<apeiros>
strcmp1: #ruby-offtopic
blackmesa has joined #ruby
sanjayu has quit [Ping timeout: 264 seconds]
<strcmp1>
not interested. lets leave it there.
<ckuhn>
is this the yt comment section?
bruno- has quit [Ping timeout: 244 seconds]
<apeiros>
ckuhn: yt?
<[k->
yt comment section is much much worse
Igorshp has joined #ruby
<strcmp1>
yt = youtube
<[k->
a gazillion times worse
* [k-
laughs at apeiros
<ckuhn>
true true
workmad3 has joined #ruby
<apeiros>
surprised it isn't abbreviated as ut
DrCode has quit [Remote host closed the connection]
<[k->
we now know apeiros is very old and only engages in newspapers
UtkarshRay has joined #ruby
<apeiros>
[k-: news*paper*? what's that? some newfangled thingyism attempting to replace papyrus?
strcmp1 has quit [Remote host closed the connection]
yardenbar has joined #ruby
<[k->
yes, it is in wide production today
strcmp1 has joined #ruby
allcentury has joined #ruby
* apeiros
pondering to just straight kick people voicing from the off on "?guys"
centrx has joined #ruby
<apeiros>
that is, people whom never said a word before
<apeiros>
who?
<[k->
whom
<[k->
(i believe)
<ckuhn>
we could all say "you peeps"?
<[k->
people whom had never?
davidt has joined #ruby
<[k->
i forgot how to use whom :/
<strcmp1>
say the words that flow naturally
<strcmp1>
nothx for thought police
<strcmp1>
if i wanted that id join #northkorea
<apeiros>
!locl strcmp1 not the place
<apeiros>
!kick strcmp1 not the place
strcmp1 was kicked from #ruby by ruboto [not the place]
pawnbox has joined #ruby
strcmp1 has joined #ruby
<strcmp1>
sigh
Rollabunna has quit [Quit: Leaving...]
<strcmp1>
sad state of affairs indeed
Melpaws has quit [Quit: Leaving.]
workmad3 has quit [Ping timeout: 246 seconds]
JDiPierro has quit [Remote host closed the connection]
jgt1 has quit [Ping timeout: 250 seconds]
DrCode has joined #ruby
<strcmp1>
apeiros: I won't return to this channel anymore. I think this is just unbelievably ridiculous. I am came here to discuss ruby, that's it. I do not care if people used words towards me that are in no way derogatory unless you take an extreme position which considers 'guys' to be a derogatory word. females use that word to describe a group of females, and males do the same. i know this, because i am a native english speaker, and you are not.
<apeiros>
!ban strcmp1 good bye
<apeiros>
!ban strcmp1 !P good bye
strcmp1 was banned on #ruby by ChanServ [strcmp1!*@*]
strcmp1 was kicked from #ruby by ChanServ [Banned: good bye]
shredding has joined #ruby
ndrei has quit [Ping timeout: 240 seconds]
DrCode has quit [Remote host closed the connection]
segfalt has joined #ruby
minimalism has quit [Quit: leaving]
benlieb has joined #ruby
benlieb has quit [Client Quit]
decoponio has joined #ruby
lkba_ has quit [Ping timeout: 255 seconds]
ruurd has joined #ruby
ndrei has joined #ruby
pawnbox has quit [Ping timeout: 265 seconds]
jgt1 has joined #ruby
andikr has quit [Remote host closed the connection]
s00pcan has joined #ruby
khebbie has quit [Remote host closed the connection]
khebbie has joined #ruby
beauby has joined #ruby
y0da has quit [Read error: Connection reset by peer]
but3k4 has joined #ruby
andyrs has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
KnownSyntax_ has joined #ruby
ckuhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
aswen has quit [Ping timeout: 260 seconds]
icbm has quit [Quit: Computer sleeping]
UtkarshRay has quit [Ping timeout: 240 seconds]
UtkarshRay has joined #ruby
ckuhn has joined #ruby
KnownSyntax has quit [Read error: Connection reset by peer]
toretore has joined #ruby
dhjondoh has quit [Quit: dhjondoh]
kstuart has joined #ruby
marr has joined #ruby
tkuchiki has joined #ruby
kstuart has quit [Client Quit]
chills42 has quit [Remote host closed the connection]
allomov has quit [Remote host closed the connection]
nfk|laptop has joined #ruby
allomov has joined #ruby
UtkarshRay has quit [Ping timeout: 240 seconds]
deg__ has joined #ruby
bruno- has joined #ruby
kgirthofer has left #ruby [#ruby]
bruno- is now known as Guest80990
bkulbida has joined #ruby
khebbie has quit [Remote host closed the connection]
ndrei has quit [Ping timeout: 246 seconds]
tkuchiki has quit [Ping timeout: 240 seconds]
UtkarshRay has joined #ruby
havenwood has joined #ruby
chills42 has joined #ruby
djcp has joined #ruby
jgpawletko has joined #ruby
allomov has quit [Read error: Connection reset by peer]
deg_ has quit [Ping timeout: 255 seconds]
moeabdol has quit [Quit: WeeChat 1.3]
allomov has joined #ruby
ruby0nrails_ has joined #ruby
<ruby0nrails_>
hi.
<ruby0nrails_>
Can someone explain how ||= works?
<apeiros>
ruby0nrails_: `a ||= b` expands to `a || a = b`
<apeiros>
ruby0nrails_: in other words, if a is falsy (nil or false), b will be assigned to a.
<ruby0nrails_>
How does the || operator work?
bronson has joined #ruby
<apeiros>
logical "or". returns the first truthy value
<adaedra>
Hi
<ruby0nrails_>
Right so if a isn't defined, it'll be false, so it'll return the right value?
<shevy>
its undeadra
s00pcan_ has joined #ruby
<apeiros>
ruby0nrails_: there's no undefined in ruby.
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<adaedra>
So it can't be a function.
<apeiros>
if `a ||= b` is the first occurrence of a, it'll be set to nil
<DylanJ>
apeiros: what's defined?() for then?
<ruby0nrails_>
how does ruby apply || on "a" and "a=b" if a isn't defined?
<ckuhn>
if a is undefined it is a falsy value
<apeiros>
DylanJ: to test for existence
<apeiros>
DylanJ: unlike e.g. JS where a variable can indeed have the value `undefined`
<ruby0nrails_>
but then why can't i do "if a; puts true; end"
<ruby0nrails_>
when a isn't defined
<apeiros>
once a variable exists, it does reference an object, always.
inteq has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 240 seconds]
nzst has joined #ruby
<ruby0nrails_>
NameError: undefined local variable or method `a' for main:Object
iceyec has quit [Ping timeout: 240 seconds]
<nzst>
Hi, does anyone know how to cleanly upgrade ruby for the server and app running rails in production?
<nzst>
I asked in #rubyonrails
nettoweb has joined #ruby
<ckuhn>
>> if a; puts 'true'; end
<ruboto>
ckuhn # => undefined local variable or method `a' for main:Object (NameError) ...check link for more (https://eval.in/436749)
linuxboytoo has quit [Remote host closed the connection]
s00pcan_ has quit [Ping timeout: 264 seconds]
<ruby0nrails_>
If an undefined variable is false, then why am I getting an error?
<jhass>
so it's merely about finding the best analogy
ckuhn has joined #ruby
Guest6844 has joined #ruby
<ruby0nrails_>
Do I have to know what a ||= b gets converted to internally? or can I just know that a gets set to b unless a is defined?
benlieb has joined #ruby
<jhass>
ruby0nrails_: s/defined/is false or nil/, then best just remember that
<jhass>
well actually defined, nil or false
moeabdol has joined #ruby
iamninja has quit [Read error: Connection reset by peer]
iamninja has joined #ruby
banister has joined #ruby
ruby0nrails_ has quit [Quit: Page closed]
<waxjar>
I'm dealing with an external server that does not do HTTP very well. This server returns some HTML when it encounters a 500 Internal Server Error but does not indicate so in it's status code, nor does it always indicate it's sending HTML in its Content-Type header. Is there a lightweight way to check if the response body is valid JSON, so I can consider the response a success?
rurik has quit [Read error: Connection reset by peer]
chouhoulis has quit [Remote host closed the connection]
tatsuo has joined #ruby
<yorickpeterse>
You can check if the first character (minus whitespace) starts with a <
<yorickpeterse>
If so, then it's not JSON
rodfersou has quit [Read error: Connection reset by peer]
<yorickpeterse>
I'd also suggest sending angry Emails to whoever provides the service :P
<waxjar>
Hmm, I think that'll do :p
devoldmx has joined #ruby
<yorickpeterse>
so basically `if input.strip[0] == '<' .... end`
Igorshp has quit [Remote host closed the connection]
Igorshp has joined #ruby
rodfersou has joined #ruby
kristofferR has joined #ruby
Igorshp has quit [Remote host closed the connection]
kristofferR has quit [Client Quit]
bigmac has joined #ruby
startupality has joined #ruby
devoldmx has quit [Ping timeout: 246 seconds]
bluOxigen has quit [Ping timeout: 240 seconds]
bluOxigen has joined #ruby
<adaedra>
.start_with?
tesuji has quit [Ping timeout: 250 seconds]
<yorickpeterse>
yeah that works too, still need the .strip though
Igorshp has joined #ruby
Igorshp has quit [Remote host closed the connection]
Luming has quit [Ping timeout: 256 seconds]
ckuhn has quit [Ping timeout: 246 seconds]
Luming has joined #ruby
<jhass>
.lstrip
<jhass>
:P
<jhass>
.match /\s*</
<jhass>
eh \A
platzhirsch has left #ruby [#ruby]
pawnbox_ has joined #ruby
rurik has joined #ruby
<waxjar>
meh, regexpes :p
<yorickpeterse>
Yeah, because a regular expression isn't a total overkill for this
pawnbox has quit [Ping timeout: 240 seconds]
<yorickpeterse>
might as well write a fully blown JSON+HTML parser while you're at it
dcarmich has joined #ruby
drewvanstone has joined #ruby
<yorickpeterse>
if input.strip.start_with?('<'); Oga.parse_html(input); else; JSON.load(input); end
<yorickpeterse>
ᕕ(ᐛ)ᕗ
casadei_ has joined #ruby
<waxjar>
lol
beauby has joined #ruby
meatherly has joined #ruby
ndrei has joined #ruby
chills42 has quit [Remote host closed the connection]
kobain has joined #ruby
ericjphillips has joined #ruby
prestorium has quit [Quit: Konversation terminated!]
karapetyan has quit [Remote host closed the connection]
hmnhf has quit [Ping timeout: 265 seconds]
nfk|laptop has quit [Ping timeout: 252 seconds]
drewvanstone has quit [Ping timeout: 256 seconds]
tomphp has joined #ruby
<[k->
sanitise!
dopie has quit [Ping timeout: 240 seconds]
freezevee has quit [Remote host closed the connection]
<hostess>
So I'm trying to write a simple caesar cipher which has been done 100 times, but I seem to be having a problem with backslashes in my alphabet. Can anyone tell me why in this simple code, the backslash is shifting? http://pastebin.com/D2XumDNP
<ruboto>
pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
Igorshp has joined #ruby
Hrorek has joined #ruby
hashrocket has joined #ruby
dopamean_ has quit [Ping timeout: 268 seconds]
rurik has quit [Ping timeout: 246 seconds]
nickjj_ has joined #ruby
pecpec has joined #ruby
bluOxigen has quit []
khebbie has quit [Remote host closed the connection]
Mars__ has joined #ruby
<Mars__>
Wut is this place
<Mars__>
Free Mason?
Zai00 has joined #ruby
<Mars__>
Illuminati's nest
nickjj has quit [Ping timeout: 244 seconds]
Rickmasta has joined #ruby
Mars__ has quit [Client Quit]
<havenwood>
Mars__: This is for the Ruby programming language.
Newtonianb has joined #ruby
drewvanstone has joined #ruby
JoshL has quit [Read error: Connection reset by peer]
emilkarl has quit [Quit: emilkarl]
JoshL has joined #ruby
<adaedra>
Interesting.
emilkarl has joined #ruby
emilkarl has quit [Client Quit]
sepp2k has quit [Quit: Leaving.]
mary5030 has joined #ruby
<shevy>
lol
mary5030 has quit [Remote host closed the connection]
<shevy>
when I join #ruby I essentially wait and expect free beer, as the name of the channel implies
d10n-work has joined #ruby
drewvanstone has quit [Ping timeout: 250 seconds]
<apeiros>
hostess: that's a peculiar one, the answer is in the docs:
nickjj__ has joined #ruby
<adaedra>
?beer shevy
<ruboto>
shevy, I don't know anything about beer
<adaedra>
aw.
mary5030 has joined #ruby
<apeiros>
hostess: „The backslash character </code> can be used to escape ^ or - and is otherwise ignored unless it appears at the end of a range or the end of the from_str or to_str“
<adaedra>
Is ruboto under 18? :)
nsuke has joined #ruby
nickjj__ is now known as nickjj
<apeiros>
hostess: in other words: you must place the \ and the corresponding translation char at the end of from_str and to_str (I wonder how that's supposed to work, though - maybe the wording is bad?)
tenderlove has joined #ruby
stardiviner has joined #ruby
kies^ has joined #ruby
krisquigley has quit [Remote host closed the connection]
nickjj_ has quit [Ping timeout: 265 seconds]
dionysus69 has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
freerobby1 has joined #ruby
freerobby has quit [Read error: Connection reset by peer]
<gregf_>
rofl.... 'hostess'
who_ has joined #ruby
mikecmpbll has joined #ruby
delianides has joined #ruby
SOLDIERz has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<hostess>
i like snack cakes ;)
<gregf_>
heh
<who_>
i like beluga whales ;)
<hostess>
apeiros: I'm not sure I follow what you're saying, and it's making me feel dumber
Aztec has joined #ruby
axl_ has joined #ruby
Aztec is now known as Guest40690
<apeiros>
hostess: from the docs it seems like \ may not just occur at any place in from_/to_str
Guest40690 is now known as Aztec__
juanpablo_ has joined #ruby
tomphp has quit [Max SendQ exceeded]
<hostess>
apeiros: at runtime, the string seems to be fine...
chills42 has joined #ruby
who_ has quit [Client Quit]
<Aztec__>
has anyone ever tried to react to redis messages by writing to a PTY's STDIN?
beast has joined #ruby
Hrorek has quit [Ping timeout: 250 seconds]
tomphp has joined #ruby
<Aztec__>
aka spawn a PTY, subscribe to a redis channel and, when a certain message comes flying in, write to the PTY's STDIN
dgutierrez1287 has quit [Remote host closed the connection]
<NeverDie>
What.
<gregf_>
heh. dont worry. i was joking ;)
<ruby-lang165>
;)
Guest6844 has quit [Ping timeout: 268 seconds]
<ruby-lang165>
I'm the originator of the mixup though
cschneid_ has joined #ruby
<apeiros>
ruby-lang165: you should not abort() in your methods, only raise
bluOxigen has joined #ruby
<ruby-lang165>
I'll take note of that, the abort was just so I could get a message on exit, I'll replace it
CloCkWeRX has joined #ruby
<apeiros>
@loader.words.map { |w| w if w[filter] && w != word } + .compact --> use .select
<ruby-lang165>
apeiros, select faster?
<apeiros>
slightly. it's more about showing intent.
<apeiros>
you can speed it up by preparing your data for the search
dyleted has joined #ruby
dyleted has joined #ruby
chouhoul_ has joined #ruby
chouhoulis has quit [Read error: Connection reset by peer]
<apeiros>
so that you don't have to scan the full dictionary every time
dionysus69 has joined #ruby
<apeiros>
the first way to segment it would be word length, since you never look for words of different lengths
<ruby-lang165>
OK, that's something I can do
radgeRayden has joined #ruby
<apeiros>
then a poor way to segment more would be to actually have a lookup table with all wildcard variants of the word. costs more for preparation but speeds up graphing. the more often you build a graph during the same run, the bigger the gain
SCHAAP137 has quit [Remote host closed the connection]
ebragaparah has quit [Remote host closed the connection]
pulgolino has joined #ruby
bazbing80 has joined #ruby
momomomomo has joined #ruby
Zai00 has left #ruby [#ruby]
meatherly has quit [Ping timeout: 255 seconds]
youngbaks has quit [Read error: Connection reset by peer]
<bazbing80>
okay. I create a module, it doesn't contain a method. I include that module in any totally unrelated class and suddenly it contains that method. Could someone explain? This code hasn't been run but I believe it encapsulates my query https://gist.github.com/anonymous/e8dcad79ded2c4dc35b7
icbm has quit [Quit: Leaving]
<shevy>
bazbing80 but is this not default behaviour? you define a method in a module, you include it in a class, it becomes available
<apeiros>
bazbing80: that's one of the points of modules
<apeiros>
and of including modules
<apeiros>
bazbing80: also, you can't use an instance method of a module without using include/extend
allcentury has quit [Ping timeout: 265 seconds]
<bazbing80>
shevy apeirons: Awesome, I was not aware of this!
<shevy>
apeiros people do not like your nick :)
Cache_Money has joined #ruby
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
bring back apieros!
<apeiros>
?tabnick bazbing80
<ruboto>
bazbing80, pro-tip - use tab completion for nicks. avoids typos in nicks.
linuxboytoo has joined #ruby
codecop has joined #ruby
<bazbing80>
apeiros: I do haha just didnt work with two nicks in one message
<jhass>
shevy: let's code a bot that joins with all the alternations and relays the messages to apeiros
<shevy>
hah
<apeiros>
jhass: I already have most mutilations in my highlight-list
<shevy>
aperos
<havenwood>
levenstein highlights
pawnbox has quit [Remote host closed the connection]
<shevy>
ape-iron
malconis has joined #ruby
linuxboytoo has quit [Client Quit]
ruurd has quit [Read error: Connection reset by peer]
dopie has joined #ruby
Guest80990 has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Ping timeout: 250 seconds]
<jhass>
havenwood: I guess me and jhack would dislike that feature
<havenwood>
jhass: Yeah, no doubt. It's way too broad and not fine-grained enough to be useful.
<shevy>
havenwood has an even longer nick
<shevy>
I think it is the combination of a-e-i-o
<shevy>
that is hard to type by letter :D
<adaedra>
Yeah, who has nicks with so many vowels, and so easy to mess up
<tobukiah>
Yeah, who has nicks with / so many vowels, and so / easy to mess up
<jhass>
I think the issue is that apeiros has more vowels than not
<adaedra>
wat
<shevy>
adedra
<jhass>
tobukiah: ?
<adaedra>
What does this bot do
<shevy>
tokubiah is also a hard nick
danman has joined #ruby
<shevy>
similar to how some assume ruboto to be a real person
<bazbing80>
adaedra: I have to ask, is your nick an Elder Scrolls reference?
pecpec has quit [Ping timeout: 250 seconds]
<adaedra>
bazbing80: no.
Asher has joined #ruby
[Butch] has joined #ruby
ruurd has joined #ruby
Hounddog has quit [Remote host closed the connection]
<bazbing80>
adaedra: oh.. :|
Marsupermammal has joined #ruby
mjuszczak has joined #ruby
JDiPierro has joined #ruby
<adaedra>
But you're not the first to ask.
n008f4g_ has joined #ruby
Guest52550 has joined #ruby
kirun has joined #ruby
Lucky__ has joined #ruby
roxtrongo has joined #ruby
chills42 has quit [Remote host closed the connection]
momomomomo has quit [Quit: momomomomo]
chills42 has joined #ruby
<adaedra>
tobukiah: are you doing haikus? (addressing to the bot, as I don't know who did this.)
skullcrasher_ has quit [Remote host closed the connection]
Caius has quit [Ping timeout: 256 seconds]
<rubyonrails_>
apeiros: It'll stay true until the right side is true but then after that it'll become false?
<adaedra>
yes
<apeiros>
yes
<apeiros>
as said, over multiple times of testing
<rubyonrails_>
apeiros: It is quite obscure though...
mjuszczak has joined #ruby
<adaedra>
in your sample, it will be false by default, until you have something that maches first. then, it will stay true until something matches third. And then, start again, I guess
<apeiros>
i.e. on first evaluation, left side is false -> whole expression is false (right side doesn't matter)
amclain has joined #ruby
<apeiros>
on second evaluation left side is true -> whole expression is true (right side doesn't matter)
<apeiros>
on third evaluation, right side is false -> whole expression is true (left side doesn't matter)
<apeiros>
on 4th evaluation, right side is true -> whole expression is false (left side doesn't matter)
<apeiros>
and now the cycle starts from anew
aswen has quit [Ping timeout: 260 seconds]
<rubyonrails_>
on 4th evaluation, right side becomes true but the whole expression is also true.
Guest52550 has quit [Ping timeout: 264 seconds]
<apeiros>
ah might be that it'll be false only after the 4th evaluation
<apeiros>
(in that example)
<rubyonrails_>
This syntax is borrowed from Perl right?
<rubyonrails_>
No wonder it's so obscure.
<apeiros>
I think so, yes
eminencehc has quit [Remote host closed the connection]
<rubyonrails_>
I heard this might be removed in Ruby 3.0?
davispuh has quit [Remote host closed the connection]
shredding has quit [Ping timeout: 240 seconds]
dgutierrez1287 has joined #ruby
<apeiros>
I wouldn't miss it
Caius has joined #ruby
Caius has joined #ruby
<rubyonrails_>
I'm currently using Ruby 1.9.3. Are there huge differences in Ruby 2.0 or just minor?
naftilos76 has quit [Ping timeout: 244 seconds]
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<adaedra>
First 1.9.3 is not supported anymore
<apeiros>
you should use 2.2.3 unless you have specific reasons not to
<adaedra>
There are the kwargs
<apeiros>
and IMO the differences from 1.9 to 2.2 are not huge, but still valuable
rubyonrails_ has quit []
pen has joined #ruby
SCHAAP137 has joined #ruby
allcentury has joined #ruby
jcoe has joined #ruby
jxv has joined #ruby
eminencehc has joined #ruby
Aztec__ has quit [Ping timeout: 246 seconds]
Ox0dea has left #ruby ["WeeChat 1.3"]
eminencehc has quit [Remote host closed the connection]
tobukiah has quit [Remote host closed the connection]
nfk has joined #ruby
bronson has joined #ruby
timonv has quit [Ping timeout: 240 seconds]
elperdut has joined #ruby
pietr0 has joined #ruby
j4cknewt has joined #ruby
spalenza has joined #ruby
allcentury has quit [Ping timeout: 265 seconds]
spalenza has quit [Client Quit]
NeverDie has joined #ruby
eminencehc has joined #ruby
maletor has joined #ruby
stan has quit [Quit: Leaving]
p0wn3d__ has quit [Ping timeout: 240 seconds]
ndrei has joined #ruby
NuckingFuts has quit [Ping timeout: 240 seconds]
maletor has quit [Ping timeout: 244 seconds]
ndrei has quit [Remote host closed the connection]
einarj has quit [Remote host closed the connection]
petricore has joined #ruby
ndrei has joined #ruby
allcentury has joined #ruby
tomphp has quit [Ping timeout: 265 seconds]
stan has joined #ruby
Rollabunna has joined #ruby
ndrei has quit [Remote host closed the connection]
arturmartins has quit [Quit: Leaving...]
spider-mario has joined #ruby
towski_ has joined #ruby
RandyT has quit [Read error: Connection reset by peer]
tobukiah has quit [Read error: Connection reset by peer]
decoponio has quit [Ping timeout: 240 seconds]
<shevy>
ruboto is lazy
Kricir has joined #ruby
tobukiah has joined #ruby
cb_ has joined #ruby
j4cknewt_ has quit [Remote host closed the connection]
NeverDie has joined #ruby
startupality has joined #ruby
centrx has joined #ruby
iateadonut has quit [Quit: Leaving.]
rakm has joined #ruby
darwingr has quit [Ping timeout: 240 seconds]
benlovel1 has quit [Ping timeout: 240 seconds]
terabytes has joined #ruby
nsuke has quit [Remote host closed the connection]
snsei has quit [Remote host closed the connection]
JoshL has quit [Read error: No route to host]
startupality has quit [Quit: startupality]
havenwood has quit [Ping timeout: 246 seconds]
JoshL has joined #ruby
chthon has quit [Ping timeout: 244 seconds]
startupality has joined #ruby
delianides has quit [Remote host closed the connection]
dionysus69 has joined #ruby
devoldmx has joined #ruby
krisquigley has quit [Remote host closed the connection]
it_tard has joined #ruby
nfk has quit [Disconnected by services]
it_tard is now known as nfk
rubyonrails has joined #ruby
rubyonrails has quit [Client Quit]
Narzew has joined #ruby
devoldmx has quit [Ping timeout: 250 seconds]
DrCode has joined #ruby
nanoz has joined #ruby
platzhirsch has joined #ruby
nanoz has quit [Client Quit]
ramfjord has joined #ruby
cb_ has quit [Remote host closed the connection]
cb_ has joined #ruby
casadei_ has joined #ruby
spider-mario has quit [Ping timeout: 250 seconds]
cb_ has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
tvw has quit [Remote host closed the connection]
spider-mario has joined #ruby
cb_ has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
jgt1 has joined #ruby
pawnbox has joined #ruby
crack_user has joined #ruby
<crack_user>
hello guys
DrCode has quit [Remote host closed the connection]
<crack_user>
somo one here is familiar with nokogiri? I'm trying to parse a xml but the HTML entities in there is missing
<centrx>
?ask
<ruboto>
Don't ask to ask. Just ask your question, and if anybody can help, they will likely try to do so.
workmad3 has joined #ruby
<crack_user>
so that is my question, parse a xml without losing the html entities
<apeiros>
crack_user: provide an example. code, input, expected output, actual output
<apeiros>
preferably on gist.github.com
j4cknewt has joined #ruby
<apeiros>
because right now the answer would be "you're mistaken, html entities don't go lost with nokogiri". and that doesn't help you solve your problem.
hahuang61 has joined #ruby
Kendos-Kenlen has quit [Quit: Konversation terminated!]
wryfi has joined #ruby
tatsuo has quit [Quit: Leaving...]
Hrorek has joined #ruby
<wryfi>
i'm trying to use chruby and bundler together. i have bundler install gems to .gem in my $HOME, but bundler installs them under .gem/ruby/2.2.0, while my ruby version is 2.2.2, and so chruby doesn't see the bundled gems.
<ruboto>
wryfi, Each Ruby release has actually two versions, the interpreter version and the ABI version. The interpreter version is what commonly is referred to, like 2.1.5. The ABI version is for the binary interface used by compiled extensions and it is what you see in your paths. It's shared among one release series, for example for the Ruby versions 2.1.0 to 2.1.5 the ABI version is 2.1.0.
atzorvas has quit [Quit: leaving]
petersaints has quit [Ping timeout: 255 seconds]
<apeiros>
crack_user: interesting
<wryfi>
ok, so why does bundler use the ABI version, while chruby changes the $PATH to the ruby version?
<wryfi>
is this a chruby bug?
<apeiros>
crack_user: simple solution
<wryfi>
ruboto, adaedra: ^
<apeiros>
crack_user: É is not valid XML. use the HTML parser.
<apeiros>
crack_user: i.e., use Nokogiri::HTML.parse instead
dima_ has joined #ruby
<crack_user>
apeiros: do you know if is some major diference between HTML and XML parse beyond that?
workmad3 has quit [Ping timeout: 256 seconds]
petersaints has joined #ruby
howdoico1 has joined #ruby
michaeldeol has joined #ruby
<apeiros>
no idea
<adaedra>
wryfi: can you show: `gem env` `which bundle`
snockerton has joined #ruby
<adaedra>
crack_user: I think HTML is more tolerant, i.e. accept non-closed blocks
hanmac has quit [Ping timeout: 246 seconds]
farn has joined #ruby
<crack_user>
adaedra: I will try that here
<shevy>
we can program in html!
<shevy>
<if>
<adaedra>
don't past in the channel, crack_user
blackmesa has joined #ruby
<adaedra>
paste*
<crack_user>
adaedra: paste what?
<adaedra>
The result of the commands
<adaedra>
Wait, wrong person
<adaedra>
Never mind
banjara has joined #ruby
<crack_user>
adeponte: it's ok
<adaedra>
You have the same nick color as wryfi :)
stan has quit [Ping timeout: 255 seconds]
stamina has quit [Quit: WeeChat 1.3]
rgb-one has quit [Remote host closed the connection]
firevolt has quit [Quit: Updating details, brb]
djbkd has joined #ruby
makufiru has joined #ruby
Igorshp has quit [Remote host closed the connection]
agent_white has joined #ruby
Igorshp has joined #ruby
roxtrongo has quit [Remote host closed the connection]
yfeldblum has joined #ruby
yardenbar has joined #ruby
Igorshp has quit [Remote host closed the connection]
nickjj has quit [Read error: Connection reset by peer]
shadoi has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
<sharkman>
this is in the rails console
<sharkman>
why cant i select the entries this table has
<sharkman>
irb(main):001:0> EspnPbpBaseballSource
<sharkman>
=> EspnPbpBaseballSource (call 'EspnPbpBaseballSource.connection' to establish a connection)
<platzhirsch>
I want to generate a random slug out of [0-9] and [a-z] and it should be unique based on a conesecutive number -> 1, 2, 3, 4.. etc would generate all unique slugs. Any ideas?
<jhass>
platzhirsch: base36=
<jhass>
?
agent_white has quit [Client Quit]
agent_white has joined #ruby
tubuliferous has quit [Ping timeout: 255 seconds]
wldcordeiro has joined #ruby
agent_white has left #ruby [#ruby]
<centrx>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<sharkman>
k thanks
j4cknewt_ has joined #ruby
<platzhirsch>
jhass: ah well it should start with 5 characters
<jhass>
well, gotta get hard to reconstruct then I guess :P
hanmac has joined #ruby
apt-get has joined #ruby
<platzhirsch>
haha
j4cknewt has quit [Ping timeout: 240 seconds]
last_staff has joined #ruby
UtkarshRay has quit [Ping timeout: 240 seconds]
<shevy>
who is going to get hard in here
Jackneill has joined #ruby
nickjj has joined #ruby
oddjob001 has joined #ruby
<oddjob001>
hello all. question. how can I check a string against each/every string inside an array?
<platzhirsch>
dude, better give me a CS solution to my problem shevy
<apeiros>
oddjob001: depends. what do you want to check?
Hrorek has quit [Ping timeout: 244 seconds]
<shevy>
platzhirsch .sample !
<apeiros>
oddjob001: common methods are #include?, #any?, #all?, #none?, #one? etc.
<platzhirsch>
that's just wrong
<oddjob001>
apeiros: ooh might be all. let me go look at that. brb
krisquigley has joined #ruby
<shevy>
platzhirsch can't you generate the whole sample and then just pick one from that?
<platzhirsch>
no it's ongoing for newly generatated table entries
<apeiros>
do we have the complete requirements on the slugs yet? :)
_aeris_ has quit [Ping timeout: 256 seconds]
<platzhirsch>
Random strings consisting of numbers and letters (case-insensitive), length 5 characteres
<oddjob001>
apeiros: basically if i have string = red and i have array = ['red' , 'blue', 'one', 'monkey'] I want that string to be checked against EACH/ALL of those. So it would return false because it doesnt match each of them
The_Phoenix has quit [Read error: Connection reset by peer]
<platzhirsch>
for instance 7Hx53
CDunce has joined #ruby
workmad3 has joined #ruby
<apeiros>
platzhirsch: you omitted the sequential this time :-p
elperdut has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Sou|cutter>
platzhirsch: are you going to generate it and save it so you can look it up, or does the same value have to generate the same slug every time?
dionysus69 has quit [Ping timeout: 272 seconds]
snockerton has quit [Quit: Leaving.]
<platzhirsch>
Sou|cutter: the former one, but I guess the latter one would help to keep it unique
<apeiros>
oddjob001: I'm confused. you want to test whether all items in array are `== string`?
<oddjob001>
whether each/all yes. so if i had a conditional in my example it would fail because the string provided does not match ALL string in the array
sshuff is now known as sshuff|gone
howdoico1 has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
<apeiros>
oddjob001: you should not use "match" to describe "equal"
krisquigley has quit [Ping timeout: 244 seconds]
<apeiros>
oddjob001: well, a) `ary.all? { |item| item == string }`, b) `ary.uniq == [string]`
freerobby1 has quit [Quit: Leaving.]
<oddjob001>
apeiros: %w[string].all? { |word| word.include?('string') } - or would this be way off?
apt-get has quit [Read error: Connection reset by peer]
psy_ has joined #ruby
<apeiros>
that's horrible :)
<oddjob001>
ok lol. its like my 2nd month with ruby :P
<apeiros>
every .include? loops over the whole array
apt-get has joined #ruby
yardenbar has quit [Ping timeout: 250 seconds]
<oddjob001>
ah yes that wouldnt make sense
<apeiros>
oh
<apeiros>
wait
<apeiros>
maybe I misunderstood
workmad3 has quit [Ping timeout: 250 seconds]
freerobby has joined #ruby
<platzhirsch>
Sou|cutter: right it should kinda work like a URL shortener, as seen on bitly or twitter
_aeris_ has joined #ruby
snockerton has joined #ruby
last_staff has quit [Quit: last_staff]
RobertBirnie has joined #ruby
sysx1000 has left #ruby [#ruby]
<oddjob001>
%w[red white blue].all? { |word| word == 'red' } ?
ragingcake has quit [Quit: ragingcake]
<oddjob001>
lol
tvw has joined #ruby
<apeiros>
yes
ericjphillips has joined #ruby
<oddjob001>
that would iterate over each string in the array and return true only if they all matched red ?
howdoico1 has quit [Read error: Connection reset by peer]
Pupeno has joined #ruby
howdoico1 has joined #ruby
dhollinger has joined #ruby
dhollinger has quit [Client Quit]
dhollinger has joined #ruby
dhollinger has quit [Client Quit]
andyrs has joined #ruby
hahuang61 has quit [Ping timeout: 256 seconds]
youngbaks has quit [Quit: WeeChat 1.3]
dhollinger has joined #ruby
kirun has quit [Quit: Client exiting]
luksaur has quit [Ping timeout: 240 seconds]
marr has quit []
andyrs has quit [Client Quit]
andyrs has joined #ruby
andyrs has quit [Client Quit]
andyrs has joined #ruby
delianides has quit []
sharkman has quit [Ping timeout: 246 seconds]
darkf has quit [Quit: Leaving]
andyrs has quit [Client Quit]
s2013 has quit [Read error: Connection reset by peer]
cmisenas has joined #ruby
dhollinger has quit [Client Quit]
kirun has joined #ruby
strax has joined #ruby
oitnelis has joined #ruby
strax is now known as sebstrax
willywos has joined #ruby
dmolina has joined #ruby
Musashi007 has quit [Quit: Musashi007]
phutchins has quit [Ping timeout: 255 seconds]
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
solars has quit [Ping timeout: 264 seconds]
dionysus69 has quit [Ping timeout: 264 seconds]
havenwood has quit [Ping timeout: 264 seconds]
VeryBewitching has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
jgpawletko has quit [Quit: jgpawletko]
bluOxigen has quit [Ping timeout: 240 seconds]
marr has joined #ruby
Zai00 has joined #ruby
momomomomo_ has joined #ruby
roxtrongo has quit [Remote host closed the connection]
roxtrongo has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
mprelude has quit [Ping timeout: 246 seconds]
leafybasil has joined #ruby
momomomomo has quit [Ping timeout: 272 seconds]
momomomomo_ is now known as momomomomo
workmad3 has joined #ruby
jottr has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
p0wn3d__ has joined #ruby
oitnelis has quit [Ping timeout: 268 seconds]
SylarRuby has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
SCHAAP137 has quit [Remote host closed the connection]
<Technodrome>
anyone here ever used mechnizee before for scraping web pages?
DoYouKnow has quit []
sharkman has joined #ruby
jgpawletko has joined #ruby
<centrx>
?anyone
<ruboto>
Just ask your question, if anyone has or can, they will respond.
niemcu has quit [Ping timeout: 265 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Stalkr_ has joined #ruby
<Stalkr_>
Is there an easy way to figure out the minimum supported version of Ruby for your app? I just want to specifiy it in Gemfile or should I just use the latest?
DoubleMalt has joined #ruby
OrbitalKitten has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<abyss>
General question;) When you write some script to automate something like some daily sys admin routine or so , you write it using class or just structured language?
<centrx>
either
<centrx>
Stalkr_, depends on what features used in the code
dhollinger has joined #ruby
<Stalkr_>
centrx: There isn't an easy way to check what versions of Ruby is supported?
Kricir has quit [Remote host closed the connection]
<centrx>
Stalkr_, Not that I know of. What's the app for?
ragingcake has quit [Quit: ragingcake]
<Stalkr_>
Just a simple REST API using Grape, it isn't very important
<centrx>
Seems like you're not distributing it to the public then, so just use the latest version
<centrx>
or I guess it's a library?
<centrx>
1.9 and up are very similar
<Stalkr_>
Just a little REST API being used internally for another site
dyleted has joined #ruby
dyleted has joined #ruby
<centrx>
Have to check if the code uses keywords arguments or other things in 2.0 or 2.1 etc
ndrei has quit [Remote host closed the connection]
<Stalkr_>
so just by me, could get by using the latest version, but just curious if I created a library some day
<Stalkr_>
Would be neat with a library that could check it automatically though
vifino has quit [Ping timeout: 246 seconds]
<centrx>
yes it would
ericjphillips has quit [Quit: Leaving.]
cajone has joined #ruby
ndrei has joined #ruby
vifino has joined #ruby
codecop has quit [Remote host closed the connection]
oddjob001 has quit [Read error: Connection reset by peer]
<jhass>
binary complement
rurik has joined #ruby
phutchins has joined #ruby
<dfockler>
ahh haha thanks
jobewan has joined #ruby
baweaver has quit [Remote host closed the connection]
<Sou|cutter>
out of curiousity, is there a way to tell if send(:remove_const, "Foo") will fail? const_defined? can return true if you inherit from a class that defines a constant, but you (rightfully) get a NameError trying to remove it
yardenbar has joined #ruby
<Sou|cutter>
>> class A; B=1; end; class C < A; end; C.const_defined?(:B)
<mwlang>
This library isn’t documented, so I’m wondering if anybody has a clue what this library does.
<adaedra>
The only soap that won't make you clean
KnownSyntax_ has quit [Quit: Leaving]
KnownSyntax_ has joined #ruby
<mwlang>
heh. Definitely getting my hands dirty with this one.
jmignault has quit [Quit: rcirc on GNU Emacs 24.5.1]
karapetyan has quit [Ping timeout: 256 seconds]
KnownSyntax_ has quit [Remote host closed the connection]
jgt1 has quit [Ping timeout: 240 seconds]
KnownSyntax has joined #ruby
allomov has quit [Remote host closed the connection]
<mwlang>
ouch: ASPDotNetHandler is intended to be used for accessing an ASP.NET doc/lit service as an rpc/encoded service. in the situation, local elements should be qualified. propagate parent's namespace to children.
momomomomo has quit [Ping timeout: 240 seconds]
rurik has quit [Read error: Connection reset by peer]
momomomomo has joined #ruby
rurik has joined #ruby
ldnunes has quit [Quit: Leaving]
nzst has quit [Ping timeout: 240 seconds]
bb010g has quit [Quit: Connection closed for inactivity]
Musashi007 has quit [Quit: Musashi007]
Soda has quit [Remote host closed the connection]
solocshaw has joined #ruby
tkuchiki has joined #ruby
FernandoBasso has joined #ruby
workmad3 has joined #ruby
sharkman has quit [Quit: Leaving]
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
troyready has joined #ruby
vipaca has joined #ruby
Pupeno has quit [Remote host closed the connection]
Cache_Money has left #ruby [#ruby]
riceandbeans has joined #ruby
<riceandbeans>
question
umgrosscol has quit [Quit: End of Line]
<riceandbeans>
if array.include(foo) will check for a literal match of exactly foo in an array element, how do I check for a partial match
<riceandbeans>
like....let's say the array is ['foo', 'bar', 'baz']
<apeiros>
riceandbeans: what's a "partial match"?
<riceandbeans>
let's say I want to match against 'ba'
<riceandbeans>
sa bar and baz would pass the true test
workmad3 has quit [Ping timeout: 240 seconds]
<apeiros>
you can use array.any? with a block to test for any predicate of your choice
<riceandbeans>
so if the array contains anything with 'ba'
<apeiros>
.include? doesn't test for a "literal match" btw., it tests against ==
<riceandbeans>
ok, I'm sorry my phrasing was incorrect
<riceandbeans>
so array.any?('ba') should return true?
<adaedra>
any? takes a block
apt-get has quit [Remote host closed the connection]
<adaedra>
so you have to write a block which test what you are looking for
<Ox0dea>
See! #any? and friends need to be more like #grep. :(
tomphp has joined #ruby
Jackneill has quit [Remote host closed the connection]
<ruboto>
adaedra # => /tmp/execpad-424d3e651770/source-424d3e651770:3: syntax error, unexpected keyword_rescue ...check link for more (https://eval.in/437014)
<Ox0dea>
Well done.
<adaedra>
grmbl
<adaedra>
>> %w[foo bar baz].any? { |e| e == 'failure' }
Igorshp has quit [Remote host closed the connection]
AlphaAtom has joined #ruby
dfinninger has joined #ruby
baweaver has quit [Ping timeout: 244 seconds]
<riceandbeans>
in looks like it works here but on my data object it's failing
<riceandbeans>
it's a mysql query result from mysql2
JimmyNeutron has joined #ruby
SylarRuby has quit [Remote host closed the connection]
ragingcake has joined #ruby
<toretore>
riceandbeans: as i said: show us the code.
<riceandbeans>
I have DB queries in the code, I can't copy paste that
kies^ has quit [Ping timeout: 260 seconds]
ebragaparah has quit [Remote host closed the connection]
yfeldblum has joined #ruby
Wolland has joined #ruby
polly_wog has joined #ruby
sharkman has joined #ruby
<sharkman>
whats the name of the rails channel!?
yfeldblum has quit [Read error: Connection reset by peer]
<Ox0dea>
?rails
<ruboto>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<sharkman>
can i ask a question about rails here or would you shoot me
<Ox0dea>
I would burn you.
bender_unit has joined #ruby
yfeldblum has joined #ruby
<riceandbeans>
I would put you incorrectly in a .any? method and let ruby segfault you out
<Ox0dea>
riceandbeans: You're getting segfaults in your attempts to use #any? on some MySQL thing?
<sharkman>
oh shit
<sharkman>
okay
<jhass>
okay I can see why people claim this channel is hostile now I guess
<sharkman>
this channel is SUPER hostile
<riceandbeans>
Ox0dea: no, I was trying to make a funny
<riceandbeans>
I guess I failed
<havenwood>
Hi folk, happy afternoon!
polishdub has quit [Quit: Leaving]
<dfockler>
bring in the jhass! the channel getting crazy
<Ox0dea>
jhass: GIGO, in this case.
<Ox0dea>
I'm usually a very helpful person, but sharkman is a known semi-troll.
nettoweb has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<sharkman>
what does this mean
devoldmx has joined #ruby
<sharkman>
But the original developers had made some poor decisions, and you could see that if the same idioms were followed much more, the system would start to follow what is a common Rails progression, calcifying as heavy coupling starts to make it more and more difficult to make small changes without negatively influencing other parts
rezzack has quit [Ping timeout: 246 seconds]
<sharkman>
why is that a common pattern in ruby? what is heavy coupling?
<riceandbeans>
it means there is more magic than some people like and some people think the extra magic is detrimental
<jhass>
Ox0dea: I see
<sharkman>
well they say that it slows development
<sharkman>
how would magic slow development
<riceandbeans>
I think they mean more that it slows performance
mary5030 has joined #ruby
Wolland_ has joined #ruby
<riceandbeans>
but you shouldn't care about performance of a product that doesn't exist or you don't finish because you had to do too much work
<havenwood>
Ox0dea: Part man, part shark... I guess we should expect it bites. ;)
<sharkman>
yeah but why, what is special about ruby that causes that
<riceandbeans>
it's not
<ragingcake>
sharkman, coupling is measure of dependency betwen modules/classes. Ideally we strive for loose coupling.
<sharkman>
This is all symptomatic of the Rails world only now just coming to terms with some of the Domain Driven Design concepts of Services, and at the same time having the project leader stand behind a really badly thought out approach to handling complex large software projects.
tkuchiki has quit [Remote host closed the connection]
platzhirsch has joined #ruby
benlieb has joined #ruby
<platzhirsch>
Oh dear, 700 more HN headlines to read, please help
djbkd has joined #ruby
[k- has quit [Quit: -a- IRC for Android 2.1.23]
<sharkman>
what is domain driven design concept mean
Pathfinder has joined #ruby
dmolina has quit [Quit: Leaving.]
cmisenas has quit [Quit: cmisenas]
ferz_ has joined #ruby
<toretore>
what does anything mean really
<platzhirsch>
sharkman: It means if you don't own <name of your startup>.com, you should rename your startup
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dfockler has quit [Remote host closed the connection]
centrx has quit [Quit: "You cannot fix a machine by just power-cycling it with no understanding of what is going wrong."]
<glundgren>
and baweaver, you dont look like a very tough guy...
<glundgren>
i believe you never said this kind of stuff face to face to a guy, right?
<glundgren>
i believe you dont have courage
tejasmanohar has quit [Ping timeout: 260 seconds]
<glundgren>
you look weak
<toretore>
$1 and m are not the same
<toretore>
glundgren: stop it with the bs
workmad3 has joined #ruby
<glundgren>
toretore: ok
AlexAltea has quit [Ping timeout: 244 seconds]
shellie_ has joined #ruby
djbkd has quit [Read error: Connection reset by peer]
yqt has quit [Ping timeout: 250 seconds]
jgt1 has quit [Ping timeout: 244 seconds]
djbkd has joined #ruby
weemsledeux has joined #ruby
cantaberry has quit [Ping timeout: 260 seconds]
freerobby has quit [Quit: Leaving.]
<glundgren>
toretore: sorry, but im kind of old school, i dont admit this kind of behaviour with me or my friends, you know
rakm has joined #ruby
Jardayn has quit [Quit: Leaving]
<glundgren>
toretore: and that's something the first world is missing, some balls to fight these spoiled kids that hides behind a curtain of politically correctness
workmad3 has quit [Ping timeout: 244 seconds]
benlovell has joined #ruby
djbkd has quit [Remote host closed the connection]
roxtrongo has quit [Read error: Connection reset by peer]
roxtrong_ has joined #ruby
dyleted has quit [Ping timeout: 244 seconds]
<toretore>
glundgren: so you're a macho dickhead who makes up for lack of self esteem by being an asshole
<Ox0dea>
Headshot.
<glundgren>
toretore: man, my self esteem is great
<glundgren>
its the politically correctness that is killing me
<glundgren>
its a disease spreading through the world
<glundgren>
to hide totalitarian mindsets and makes them protected
<toretore>
your self esteem is not great if it depends on external affirmation
<glundgren>
toretore: im pretty good, yeah
<glundgren>
really :)
chouhoulis has joined #ruby
<glundgren>
but this macho mindset is what lacks
<Ox0dea>
glundgren: Any relation to Dolph?
<toretore>
no, you revealed that you have low self esteem because you were offended
<glundgren>
Ox0dea: hahaha
<Ox0dea>
I wasn't being facetious?
ICantCook has joined #ruby
<glundgren>
toretore: man, morals is something very important for me
<glundgren>
my country is deep in corruption
Newtonianb has quit [Ping timeout: 246 seconds]
benlovell has quit [Ping timeout: 250 seconds]
<glundgren>
its a topic that is very sensitive for most of use
<glundgren>
us
<Ox0dea>
Morality is objective, you say?
<glundgren>
in the last years
nzst has joined #ruby
baweaver has joined #ruby
<glundgren>
morality is the ethic you have to yourself
<glundgren>
when you re alone
tejasmanohar has joined #ruby
<glundgren>
and nobody is wathing you
<glundgren>
:)
<glundgren>
morality, ethic, courage
<Ox0dea>
glundgren: By your logic, we shouldn't do anything we wouldn't do if we were the only sentient being in existence?
<glundgren>
its something that is fading away
<glundgren>
depends on your morality ox
<Ox0dea>
Yes, I'm specifically asking about yours.
circ-user-FkDR0 has quit [Remote host closed the connection]
<glundgren>
but yes, i usually dont do what i doesnt want others do with me
<Ox0dea>
That's not what I asked you.
drewvanstone has quit [Ping timeout: 268 seconds]
<glundgren>
well
<Ox0dea>
> when you re alone... and nobody is wathing you
djbkd has joined #ruby
<glundgren>
if youre the only human being on earth
<glundgren>
morality lost its values
<Ox0dea>
Exactly.
<eam>
glundgren: we are PC bros here, join our frat or get hazed
<Ox0dea>
You concede that your original proposition was retarded.
<glundgren>
absolutely not
<glundgren>
hahaha 7 billion people dont allows it
nzst has quit [Ping timeout: 256 seconds]
<glundgren>
but if you want to live without morality, no problem
<glundgren>
but i want to develope some values
<glundgren>
'macho' values
<glundgren>
its something personal
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
casadei_ has quit [Remote host closed the connection]
<eam>
glundgren: you can be macho and PC -- in fact most are
<glundgren>
what is pc?
<snockerton>
lol, suddenly #ruby has turn into #bash
<eam>
politically correct
<glundgren>
no eam
<eam>
south park recently did an entire episode about it