narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
<banisterfiend>
davidcelis i use it left - right and ------------ CENTER --------------
bluebie has joined #ruby
gstamp has quit [Ping timeout: 256 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
tgraham|away is now known as tgraham
<bluebie>
how the heck do floats work in mri ruby? I thought stuff like r = 2.5; [r >= 2.5, r > 2.5] #=> [true, false] wouldn't work, because floats are imprecise.. but it works fine in MRI. Do I totally misunderstand the limitations of floats in general or is ruby doing something weird/cool?
<zastern>
What happens with def initialize functions, when you inherit a class that has one?
<volty>
bluebie: ruby does as every other language on the earth does: use the processor for comparing numbers
gstamp has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
<volty>
zastern: you, usually, have to call 'super'
<bluebie>
zastern: nothing magic. If you want the parent class's initialize to run, use the super keyword
<volty>
zastern: though you can omit the initialize if you don't need one for the subclassed
lukec has quit [Ping timeout: 264 seconds]
<zastern>
Well, I'm writing some "commands", and the commands will all need to get the api endpoint, api key, etc, so I was going to write a base class to get them and inherit it in the other "commands"
<volty>
(and then it calls, implicitly, the parent's one)
<zastern>
maybe that's a bad way of doing it?
zarubin has quit [Ping timeout: 264 seconds]
<bluebie>
fwiw here's how new works: def self.new *args, &proc; instance = self.alloc; instance.initialize(*args, &proc); return instance; end
<bluebie>
I don't think it does any other stuff in ruby-land
brennanMKE has quit [Remote host closed the connection]
cdelo has joined #ruby
<bluebie>
if you want to be strange you could override .new and do other initializey stuff in there.
<bnagy>
zastern: don't use a class just to hold data
<zastern>
bnagy: what's the right way?
<bnagy>
dunno :)
<zastern>
lol ok
<zastern>
so why not?
<bluebie>
zastern: whatever you like
<bnagy>
I'd probably mix in a module which had a credentials method or something
<bnagy>
all that stuff should probably sit in ENV though, otherwise it's hard to share your code
<bnagy>
which is not an argument against using a module, just a note
Xiti` has quit [Ping timeout: 240 seconds]
Xiti has joined #ruby
zarubin has joined #ruby
lukec has joined #ruby
<bnagy>
but just because I have an opinion about an approach being Wrong, doesn't mean I have a prescriptive one about what's Right
<volty>
bnagy will pardon me, but the idea of writing a base class that holds the common variables is nice
<volty>
later, but only later, zastern can refactor the base class and move somewhere else (module or else) - if needed
Tearan has joined #ruby
<bnagy>
volty: you're talking crap again
<volty>
why?
<bnagy>
because that's not how people write idiomatic ruby
<volty>
and again respect to which case?
Davey has quit [Quit: Computer has gone to sleep.]
thesheff17 has quit [Remote host closed the connection]
<Andrevan>
inheritance vs. composition, volty
<bnagy>
we don't have multiple inheritance, it's stupid to waste it on being a data container when there are a bunch of other ways
<Andrevan>
ruby would favor a module over a base class
<volty>
idiomatic vs just-do-it
<Andrevan>
in what way is a module harder to implement than a base class?
thesheff17 has joined #ruby
<bnagy>
it's actually easier, as well as cleaner
<volty>
in a way that when you WORK you go strait and refine later - IF NEEDED
emergion has joined #ruby
<volty>
no mix-max
<bnagy>
yeah but that's not 'straight' it's just Wrong
<volty>
no, you are just too pedantic, people
zarubin has quit [Ping timeout: 256 seconds]
<bnagy>
you always seem to talk about your view as if it's the expedient one and we're all just overcomplicating things
freerobby has joined #ruby
<volty>
there are infinite style and approaches in programming
<volty>
styles
<bnagy>
whereas you're just Wrong
<volty>
whereas i'm just right - if you have common variables (and, maybe, values) you move it to the base - WITH or WITHOUT modules
<bnagy>
and honestly I don't really care how you write code, but I do care when you give people bad advice
* Nilium
is confused by this discussion
<Nilium>
Mainly 'cause volty doesn't appear to actually be saying anything of substance
<bnagy>
this has happened before
<Nilium>
It's like watching someone talk to emacs
<volty>
you forget, dear, that he is novice
<Nilium>
Are you Indian?
vxxr has joined #ruby
<Nilium>
Have to ask 'cause you used 'dear'
<volty>
Nilium: antithetic
<volty>
Nilium: say something of substance, or, at least, point out the substance of other's comments
<Nilium>
For some reason a lot of Indian folks use "dear" in ways that'd be considered weird and/or offensive in the US and probably most other countries.
<volty>
i didn't begin to offend
<volty>
i just gave my OWN advice to zastern
maletor has joined #ruby
tgraham is now known as tgraham|away
<Nilium>
I'm not saying you did. I'm just asking if your use of "dear" is an Indian English dialect thing or a case of you being patronizing
<volty>
it was bnagy that started, but later switched to "respect to other styles and ideas..."
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Nilium>
I don't care about your previous conversation, I'm only interested in your use of "dear" now.
martin_work has joined #ruby
<volty>
i know how to use the words, if I use "dear" I know why I'm using it
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Nilium>
I don't know why you're avoiding answering the question.
<volty>
i don't know why are you insisting on that
<zastern>
guys guys
<zastern>
Don't fight over lil old me
<Nilium>
Because it's interesting.
<volty>
« <bnagy> volty: you're talking crap again »
nari has joined #ruby
<bluebie>
hey guys
<volty>
Nilium: for me not :)!
<bluebie>
you're on the internet
<bluebie>
having an argument
<bluebie>
over literally nothing
<Nilium>
I like studying language, particularly differences in dialect, and if you're using "dear" because it's common in your dialect, I want to ask you about it.
<Nilium>
If it's just to be patronizing, though, then I'm not really interested because that's boring.
slyv has joined #ruby
slyv has quit [Max SendQ exceeded]
<volty>
I use 'dear' when I feel offended. Enough?
<bnagy>
you see it in some of the African english as well
<Nilium>
Ok, then it's to be patronizing.
<Nilium>
Didn't know that, but now I'm going to watch out for it.
<bluebie>
my grandma used 'dear' all the time in a positive affectionate way
<volty>
ahah
<Nilium>
Yeah, but that's the normal usage
<bluebie>
on that side english origin, living in australia
quoin has joined #ruby
<Nilium>
You typically only hear it used by people who are very close, like from relatives or spouses or parents or what have you
<bnagy>
but you need to have at least 40 years on someone to use it like that
<Nilium>
The other common use is just to be patronizing, which is what happens to a lot of words that sound nice
<bnagy>
like little old ladies can go around 'dear'ing anyone they like, just about
<Nilium>
That said, I've seen it a _lot_ from Indian folks and that just interests me for whatever reason
<volty>
look, back to the topic of contrast: i remember well when I was novice in ruby (though experienced in other langs), I remember when I have to do something and I am tired ---- save me from your pedantic modules, i prefer modules but I do it, very often, right in the class when implementing
<volty>
got it?
dcunit3d has quit [Ping timeout: 240 seconds]
<bnagy>
whereas volty is not a native english speaker
<bnagy>
so I don't get upset by phrasing
<bnagy>
just by the stupid advice and poor attitude
<volty>
ah! :)
<volty>
yes, dear!
zetaspartan2552 has joined #ruby
<bluebie>
gosh I remember when I first was getting over my ideas that PHP wasn't a bad language, and came in to #ruby and found such a nice amazing positive community
<volty>
as you please
<bluebie>
it made me feel at home
<Nilium>
I've seen folks get upset by differences in dialect, but usually 'cause they don't realize there's a difference
zetaspartan2552 has left #ruby [#ruby]
<bluebie>
Why The Lucky Stiff would later advise me that #ruby was where I wanted to be, not #ruby-lang
<bluebie>
He was right
<bluebie>
the positivity and excitement was wonderful
<popl>
good drugs
peregrine81 has joined #ruby
<popl>
:P
<bluebie>
It encouraged me to learn and do lots of interesting fun things :)
hanmac1 has joined #ruby
<Nilium>
I need good drugs.
<popl>
I need to pass tests. :P
<Nilium>
I have enough problems now that I'm actually trying to find a counselor and possibly medication to make me less insane.
marius has quit [Quit: oh nooo]
quoin has quit [Ping timeout: 240 seconds]
<volty>
bluebie remembered me about theorists that brought down our chess circle - where we used to laugh and play
narcan has joined #ruby
<Nilium>
I should start learning French again.
hogeo has joined #ruby
<bluebie>
In my experience dealing with Bipolar (misdiagnosed several times - depression, adhd, psychopathy), psychiatrists were often insane and often dangerously abusive. Psychologists were better but their solutions were largely the same, so after six months or so they had nothing new for me, and they all said the same stuff. Councellors were the most helpful, most engaged
<popl>
but, ruby
<bluebie>
So that's my little bit of experience. Councellors are the best thing, and use psychiatrists only to get drugs
<bluebie>
mm yes ruby :)
<volty>
psychologists are the most useless - imho
<banisterfiend>
bluebie u are sharing too much bb
<popl>
bb?
<Nilium>
That's more or less why I decided to go with counseling before seeing a doctor, 'cause otherwise I'd just get fast-forwarded to medication, and that just makes things worse for me 'cause I have more anxiety issues than my lawn has specks of dirt.
jamesaanderson has joined #ruby
<popl>
what's bb?
Aryasam has joined #ruby
<Nilium>
Bulletin boards?
<moli>
what's a good book (in paperback) for ruby beginners?
hanmac1 has quit [Ping timeout: 260 seconds]
DonRichie has quit [Ping timeout: 252 seconds]
<Nilium>
Bullet bill, maybe.
vipjun has joined #ruby
julweber has quit [Remote host closed the connection]
<bnagy>
moli: most common recommendations are Learn To Program, or, if you're already fluent in another language The Ruby Programming Language
Mars` has joined #ruby
DonRichie has joined #ruby
hellome has quit [Remote host closed the connection]
<bnagy>
first one is not as basic as it sounds
freerobby has quit [Quit: Leaving.]
mrsolo has quit [Quit: This computer has gone to sleep]
anotherwise has quit [Quit: anotherwise]
<moli>
by David Flanagan?
Ox6abe has joined #ruby
zarubin has joined #ruby
tgraham|away is now known as tgraham
<Nilium>
It's been so long since I learned to program that I have no idea how to learn to program
<bnagy>
moli: heh, yeah although I think of Programming Ruby as Matz' book :)
<bluebie>
or if you don't want to actually learn ruby but you like cartoons, there's the (poignant) guide
<moli>
bnagy: ya
<bnagy>
hey the poignant guide has a couple of killer sections
Monie has joined #ruby
<bluebie>
heh yeah
<havenwood>
be sure to listen to the soundtrack while you read the poignant guide
martin_work has quit [Quit: martin_work]
<bluebie>
I'm not much of a book learner, but every now and then I read a chapter of the poignant guide just to enjoy it as it's own thing
<bluebie>
totally
<bnagy>
I really loved dwemthy and the introspection chapter
<bnagy>
but it's certainly not a rounded approach
<bluebie>
there's a project on github to update the guide so it stays relevent - including little syntax updates and things like that
<bluebie>
the poignant guide spends a lot of time introducing programming concepts, which will be kinda boring if you know any other programming languages
<moli>
the soundtrack?
kvirani has quit [Remote host closed the connection]
Aryasam_ has quit [Read error: Connection reset by peer]
Senjai has joined #ruby
Jun_ has joined #ruby
Jun_ has quit [Client Quit]
<zastern>
Here's a stupid question: Why is it that I can 'gem install httparty' and just include HTTParty anywhere, but I have to require 'json' and then include JSON
<zastern>
especially given that httparty is a gem and json is a builtin as I understand it
petey has quit [Remote host closed the connection]
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<bluebie>
What? you don't have to require gems now?
<bluebie>
how the heck..
<bluebie>
When I try to use my own rubygems I just get uninitialized constant Whatever
Aryasam has quit [Read error: Connection reset by peer]
Aryasam has joined #ruby
<bluebie>
zastern: maybe you're using some other library which likes to use HTTParty when it's available but falls back to Net::HTTP when it isn't, so it's requiring it for you?
<BradND>
im stuck at where it says to run the call in my app
apeiros has quit [Remote host closed the connection]
<BradND>
ruby is pretty unknown to me, so any pointers?
Aryasam has quit [Read error: Connection reset by peer]
<popl>
BradND: learn ruby? :)
<BradND>
:(
<popl>
what?
<popl>
you want to use a ruby gem but don't want to learn ruby?
<popl>
How would you reasonably expect to do that? :)
lfox has joined #ruby
<bluebie>
BradND: If you're not keen to learn, this channel probably isn't too helpful. You could try commissioning a ruby developer to write a program for you, via rentacoder or some similar thing
cpruitt has joined #ruby
KobraKao has quit [Ping timeout: 260 seconds]
<volty>
BradND: I would give you a hand if it was, e.g., about parsing to find how many trees each country has, but not for league of legends :)
ziyadb has joined #ruby
mrsolo has quit [Quit: This computer has gone to sleep]
<BradND>
haha, i'm working on a weekend hack project and i didnt want to rewrite this thing in php or C since it's already built.. ;D
<popl>
sure
Aryasam_ has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
mrsolo has joined #ruby
Kricir has joined #ruby
jamesaanderson has joined #ruby
<bluebie>
BradND: Okay, so you're familliar with programming. What is it you want to do with this library exactly? Ruby isn't that complicated
peregrine81 has quit []
Cyrus has joined #ruby
<BradND>
Man ruby has been busting my balls ever since I tried to get into it, i literally just want to return the output to a file or even the terminal window
jamesaanderson has quit [Client Quit]
<popl>
what have you tried?
Michael__ has joined #ruby
<bluebie>
The readme on github shows you how to use it. Install the loldata gem, then require 'loldata' in a file named whatever.rb, then write 'p LolData::Champion.all' and save that file, and run it with 'ruby whatever.rb' in your terminal
<bluebie>
that will give you the data
Aryasam has joined #ruby
narcan has quit [Quit: -[AppDelegate installMalware]: unrecognized selector sent to instance 0x156109c0]
Aryasam has quit [Read error: Connection reset by peer]
robbyoconnor has joined #ruby
Aryasam_ has quit [Ping timeout: 248 seconds]
justsee has joined #ruby
<volty>
« just want to return the output to a file or even the terminal window » // if you output to a file you can see it, on the terminal, with cat <filename> // if you output to a terminal you can redirect with '>' <filename> // you know php, c, but, seems, miss bash
Bry8Star{T2_ has joined #ruby
Aryasam has joined #ruby
<zaltekk>
volty: i read that to mean he didn't know how to make ruby output whatever info he is after
<volty>
zaltekk: it seems ... :)
Bry8Star{T2 has quit [Ping timeout: 240 seconds]
<popl>
funny, I read it as coming from yet another whiny girly man who wants to blame $technology for laziness
<popl>
maybe I need to clean my glasses
<bluebie>
Ah there it is. That freenode sexism. Delightful.
<popl>
(that was a joke, furriners)
<popl>
bluebie: I even said it in an Arnold voice.
vlad_starkov has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<popl>
s/freenode //
Aryasam has quit [Read error: Connection reset by peer]
<popl>
sexism is at the root of our dear patriarchal hegemony
zarubin has quit [Ping timeout: 256 seconds]
<pontiki>
nah, it's just pure, basic selfishness and greed
cads has quit [Read error: Operation timed out]
<popl>
pontiki: I wonder if one begets the other
<pontiki>
of course it does
<zastern>
Sexism, greed, patriarchy all are linked.
<popl>
(I mean sexism -> selfishness)
<volty>
you forgot the matriarchy
<pontiki>
everyone forgets the matriarchy!
<volty>
the most damaging one
<popl>
just as the matriarch wants
<zaltekk>
wtf is this, tumblr?
BraddPitt has joined #ruby
<popl>
zaltekk: No, I don't have this blacklisted.
<pontiki>
no, there's no unattributed pictures stolen from elsewhre
Xanderby has quit [Quit: Xanderby]
mercwithamouth has quit [Ping timeout: 248 seconds]
<popl>
pontiki: only in my mind
<popl>
pontiki: you're in yellow polka-dots
jamesaanderson has joined #ruby
a1ph4g33k has joined #ruby
Aryasam has joined #ruby
<BradND>
hurr the gem is installed but rvm won't find it
<BradND>
:
<BradND>
:X
<popl>
that's not a helpful diagnostic message
<volty>
now, with BradND, I recollect a story from many, many years ago // 8086, 80286, 80386 // a client, he needed a driver, we told him that he needs 80286.sys but he insisted he was going to fix the problem renaming the file from 8086.sys to 80286.sys
<popl>
do you get an error? what's it say?
<popl>
there's a pastebin URL in the topic, BradND
mengu has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
theRoUS has joined #ruby
Spleeze has joined #ruby
anotherwise has quit [Quit: anotherwise]
Monie has joined #ruby
intuxicated has joined #ruby
snovak has quit [Ping timeout: 246 seconds]
dawkirst has joined #ruby
h_kon has joined #ruby
Kricir has joined #ruby
Kricir has quit [Remote host closed the connection]
mengu has joined #ruby
justsee has quit [Ping timeout: 245 seconds]
cina has joined #ruby
pranny has quit [Quit: Leaving.]
Guest85894 has joined #ruby
predator217 has quit [Ping timeout: 264 seconds]
SkuliOskarsson has quit [Quit: SkuliOskarsson]
Liothen has quit [Quit: System of a down……]
nomenkun has joined #ruby
xk_id has joined #ruby
DrCode has quit [Remote host closed the connection]
ciziar has joined #ruby
SkuliOskarsson has joined #ruby
cads has quit [Ping timeout: 245 seconds]
svector has joined #ruby
freerobby has joined #ruby
mistertim has joined #ruby
predator117 has joined #ruby
yfeldblum has quit [Ping timeout: 245 seconds]
graydot has quit [Quit: graydot]
kaosx has joined #ruby
xk_id has quit [Quit:
cody-- has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jaynewstrom has joined #ruby
tgraham has quit [Quit: Leaving...]
vpretzel has joined #ruby
failshell has quit [Remote host closed the connection]
shredding has quit [Quit: shredding]
kil0byte has joined #ruby
breakingthings has joined #ruby
DrCode has joined #ruby
kil0byte_ has quit [Ping timeout: 260 seconds]
Beoran_ has joined #ruby
sjltaylo_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
drumsrgr8forn8 has quit [Ping timeout: 240 seconds]
polaco_zZz is now known as polaco
vpretzel has quit [Ping timeout: 245 seconds]
soba_ has quit [Ping timeout: 240 seconds]
BRMatt has joined #ruby
Beoran__ has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
narcan has quit [Ping timeout: 260 seconds]
jerius has joined #ruby
sjltaylor has joined #ruby
Hanmac has quit [Quit: Leaving.]
jbpros has quit [Quit: jbpros]
vpretzel has joined #ruby
mlpinit has joined #ruby
cpruitt has joined #ruby
rickmasta has joined #ruby
sailias has joined #ruby
kvirani has joined #ruby
krawchyk has joined #ruby
ferr has joined #ruby
Hanmac has joined #ruby
adkron has joined #ruby
cody-- has quit [Quit: derp]
awarner has joined #ruby
vlad_starkov has joined #ruby
butblack has joined #ruby
boxmein has joined #ruby
heftig has quit [Quit: Quitting]
xcv has joined #ruby
greengriminal has joined #ruby
cmarques has joined #ruby
heftig has joined #ruby
DrCode has quit [Remote host closed the connection]
havenwood has joined #ruby
krz has quit [Quit: krz]
siwica has joined #ruby
siwica has quit [Client Quit]
yfeldblum has joined #ruby
fijimunkii has joined #ruby
sailias has quit [Quit: Leaving.]
krz has joined #ruby
thesheff17 has quit [Read error: Connection reset by peer]
krz has quit [Client Quit]
kil0byte_ has joined #ruby
sailias has joined #ruby
Uranio has joined #ruby
Emmanuel_Chanel_ is now known as Emmanuel_Chanel
kevind has joined #ruby
fijimunkii has quit [Quit: leaving]
gyre007 has joined #ruby
Aryasam has joined #ruby
kil0byte has quit [Ping timeout: 264 seconds]
thesheff17 has joined #ruby
pyrac has joined #ruby
kaldrenon has joined #ruby
mneorr has joined #ruby
DrCode has joined #ruby
svector has quit [Ping timeout: 240 seconds]
rickmasta has quit [Ping timeout: 245 seconds]
aryaching has joined #ruby
Aryasam has quit [Quit: Bye]
kaspergrubbe has quit [Ping timeout: 246 seconds]
devdazed has joined #ruby
jlebrech has joined #ruby
oddalot has joined #ruby
<Hanmac>
i wonder why no one is posting? are all ruby problems solved? ;D
<workmad3>
hanmac: yup
<workmad3>
hanmac: I solved them all in 20 minutes of downtime this morning, then sent everyone home
mmitchell has joined #ruby
ferr has quit [Ping timeout: 260 seconds]
Ziarkaen has joined #ruby
iamjarvo has joined #ruby
iamjarvo has quit [Read error: Connection reset by peer]
<wuest>
hanmac - actually, I think I saw you post an interesting one liner last week, wherein you converted String#% to a block to pass to Array#reduce. How was that done, again?
iamjarvo has joined #ruby
_maes_ has joined #ruby
interactionjaxsn has joined #ruby
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
zerofive has left #ruby [#ruby]
mmitchell has quit [Read error: Connection reset by peer]
<Hanmac>
you mean something like that? [*8..16].map(&"%x".method(:%)).inject(:+)
joofsh has joined #ruby
<vpretzel>
I solved my ruby problem by wiping my system. Oh joy.
mmitchell has joined #ruby
nomenkun has quit [Remote host closed the connection]
<wuest>
hanmac: that's the one. I've generally not used .method, so forgot it when it was appropriate. Thanks :)
hogeo has quit [Ping timeout: 256 seconds]
ganeshran has joined #ruby
aryaching has quit [Ping timeout: 240 seconds]
bl4ckdu5t has joined #ruby
sectionme has quit [Ping timeout: 248 seconds]
<bl4ckdu5t>
I'm new to ruby! Should I download ruby1.8 or ruby1.9.1 ?
fijimunkii has joined #ruby
<vpretzel>
Ruby 2.0
quoin has quit [Remote host closed the connection]
codecop has quit [Quit: Išeinu]
<bl4ckdu5t>
I'll like to know if there are differences btw them like we have in python2 and python3
<vpretzel>
bl4ckdu5t: What operating system are you on? If OSx it already comes with ruby
browndawg has quit [Ping timeout: 240 seconds]
<bl4ckdu5t>
I'm on Ubuntu
quoin has joined #ruby
<havenwood>
bl4ckdu5t: The apt package ruby1.9.1 is really 1.9.3. For sure don't use 1.8.
<vpretzel>
Too many to list to be honest. v1.9.3-p125 is the one I see on many production environments still as that was the stable version for a long time. However Ruby 2.0 got released last year.
aryaching has joined #ruby
<arturaz>
I solved ruby problems by switching from ruby
schaerli has quit [Remote host closed the connection]
<bl4ckdu5t>
ok thanks
<Hanmac>
bl4ckdu5t: ruby1.8 is offical dead, ruby1.9.1 is the 1.9.3 version, (i have 2.1dev on my systems)
allanm has joined #ruby
<vpretzel>
BTW bl4ckdu5t I would suggest a ruby package manager before you dive in
siwica has joined #ruby
<vpretzel>
Such as rvm
coderhs has quit [Quit: Leaving]
mansi has joined #ruby
tgraham has joined #ruby
quoin has quit [Ping timeout: 245 seconds]
browndawg has joined #ruby
lfox has joined #ruby
<bl4ckdu5t>
What does that do?
<bl4ckdu5t>
Like an IDE?
gwb3 has joined #ruby
jbpros has joined #ruby
gwb3 has quit [Remote host closed the connection]
<vpretzel>
No - it's a slick system to allow you to have multiple ruby versions on your machine as well as gemsets - if you only plan on doing ruby development purely for leisure I would strongly suggest ruby 2.0.0
<Hanmac>
oO no … an version manager like rvm let you switch between different ruby versions … ubuntu has a buildin system for that, but only has 1.8 and 1.9.*
h_kon has quit [Remote host closed the connection]
wchun has joined #ruby
bean_ has joined #ruby
<vpretzel>
bl4ckdu5t: If you must have an IDE - Rubymine is probably the way to go
<shevy>
bl4ckdu5t basically the linux distributions are too stupid to allow you multiple versions of a given program side by side, with exceptions such as nixOS or GoboLinux
shredding has joined #ruby
nwertman has joined #ruby
<vpretzel>
It's one of the popular ones - I use vim
luckyruby has joined #ruby
* Hanmac
prefers IDEs that can do more than one language
* vpretzel
did not intend to start the IDE flame wars.
<shevy>
vim sucks
<vpretzel>
lol.
<luckyruby>
Is there a way to create an Infinity or NaN object in ruby or rails?
<bl4ckdu5t>
Whatever it is, I think I should download it then
kil0byte has joined #ruby
<luckyruby>
nm, figured it out. Had to divide float by 0
<Hanmac>
luckyruby: there is Float::INFINITY and Float::NAN
<luckyruby>
hanmac: even better
<luckyruby>
thanks
<bl4ckdu5t>
shevy: I use python 2.7 and python 3.3 and they both work fine
Kricir has joined #ruby
mrsolo has joined #ruby
<shevy>
bl4ckdu5t because the binary name has the version
<Hanmac>
luckyruby: but dont use == on NAN or your progamm will die
colonolGron has quit [Quit: Lost terminal]
<shevy>
bl4ckdu5t what does: stat /usr/bin/python tell you
<shevy>
the answer should have been that /usr/bin/python is a symlink pointing to the actual python version in use right now. I am quite sure there is a /usr/bin/python3.3 as well, so in order to change the default version, one just changes the symlink to point to python3.3 - this is about as much as one can do on classical linux distributions. on debian/ubuntu, they have versioned ruby to ruby1.8 or ruby1.9 etc...
<shevy>
so that this also works
cina has joined #ruby
<shevy>
their system won't become more sophisticated than that :(
<shevy>
that also means that in /usr/lib/*python* there tends to be a mess (or, they break the FHS and use /usr/local/lib/)
<bean_>
I do not recommend changing that symlink though
Ox6abe has quit [Remote host closed the connection]
<shevy>
heeh
<bean_>
ubuntu will likely throw a fit.
burlyscudd has joined #ruby
<havenwood>
update-alternatives
<shevy>
btw bl4ckdu5t hanmac here uses ruby on ubuntu since many years, if you ever have a ubuntu specific problem, he is your man
obs has joined #ruby
brupeb has joined #ruby
alekst has joined #ruby
Kar- has quit [Ping timeout: 240 seconds]
<bl4ckdu5t>
ok thanks for the eye opening
aagdbl has joined #ruby
mary5030 has joined #ruby
petey has joined #ruby
xk_id has joined #ruby
varfoo has quit [Quit: WeeChat 0.4.0]
<Hanmac>
bl4ckdu5t: there is update-alternatives, with this you can switch the default versions of ruby or python … but as the others said, the current version is 1.9.3* maybe a bit to old, thats why use rvm or compile it yourself
Kricir has joined #ruby
petey has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
graydot has quit [Quit: graydot]
hamush has quit [Quit: Leaving]
<shevy>
you evil evil hanmac you... you dont use a debian ruby?
agjacome has joined #ruby
* lupine
deploys to debian ruby
<lupine>
in squeeze, no less
mrsolo has quit [Quit: This computer has gone to sleep]
<lupine>
it's quite exciting sometimes
<Hanmac>
shevy, no each weekend when i am at home, i recompile my ruby from trunk ;P
nfk has quit [Ping timeout: 245 seconds]
<Hanmac>
shevy i wonder for what luckyruby needs NaN … i hope he does not try to use it in case … when ;P
<shevy>
he wants to outperform chuck norris
<shevy>
and count to infinity thrice
butblack has quit [Quit: butblack]
<shevy>
(in a ruby script)
Rollabunna has quit [Remote host closed the connection]
* bl4ckdu5t
has gotten a new impression about OSX with shevy's advice
pyrac has quit [Quit: pyrac]
rickmasta has joined #ruby
<bl4ckdu5t>
I used to think osX sucked and most Linux distros had all it had + more
<lupine>
no, OSX sucks
xk_id has quit [Quit:
<gregj>
you suck
pyrac has joined #ruby
baordog_ has joined #ruby
<gregj>
linux sucks for some, frebsd for others, osx for some others
<gregj>
try it, don't listen to others
<shevy>
bl4ckdu5t to be honest, all the OS suck, they just have varying areas and degrees of suckage
<shevy>
in general the best you can do is to avoid what sucks and use what is useful
ganeshran has quit [Ping timeout: 250 seconds]
<Hanmac>
shevy look;
<Hanmac>
>> i = 0.0; [ -i == i, (-i).object_id == (i).object_id]
ciziar has quit [Quit: Computer has gone to sleep.]
obs has quit [Quit: Saliendo]
nanoxd has joined #ruby
tagrudev has quit [Remote host closed the connection]
jamesaanderson has quit [Client Quit]
mklappstuhl has joined #ruby
aganov has quit [Remote host closed the connection]
boxmein is now known as [boxmein]
jamesaanderson has joined #ruby
MrThePlague has joined #ruby
MrThePlague has joined #ruby
<luckyruby>
hanmac: I have a report where some of the calculations result in NaN. I wanted to validate that NaN wasn't messing up with my calculation for weighted averages.
<Hanmac>
luckyruby: use value.nan? checking with value == Float::NAN does not work ...
awarner has quit [Read error: Connection reset by peer]
<Hanmac>
even value == value does not work with nan ;P
awarner has joined #ruby
virtualize has quit []
wallerdev has joined #ruby
mephux has quit [Ping timeout: 256 seconds]
aagdbl has quit [Quit: Leaving.]
nemesit|znc has quit [Ping timeout: 252 seconds]
mrsolo has joined #ruby
lkba has quit [Ping timeout: 245 seconds]
jwicked has joined #ruby
virtualize has joined #ruby
mephux has joined #ruby
Fire-Dragon-DoL has joined #ruby
stkowski has quit [Quit: stkowski]
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
snovak_ has quit [Read error: Connection reset by peer]
snovak has joined #ruby
<wuest>
bean_: yup, because you're not guaranteed that any two paths to NAN produce NAN in the same way, so equivalence should be assumed to be false, always.
mrsolo has quit [Quit: This computer has gone to sleep]
<bean_>
valid
wallerdev has quit [Quit: wallerdev]
<Hanmac>
nan == something ALWAYS return false … its the first check in the == method to check if the left side is nan
obs has quit [Client Quit]
Cyrus has quit [Quit: Cyrus.close()]
cody-- has joined #ruby
leehambley has quit [Ping timeout: 264 seconds]
jwicked has quit [Ping timeout: 245 seconds]
ce_afk is now known as cescalante
leehambley has joined #ruby
RORgasm has joined #ruby
scottstamp is now known as zz_scottstamp
almostatheist has joined #ruby
obs has joined #ruby
almostatheist has left #ruby [#ruby]
rickmasta has joined #ruby
wallerdev has joined #ruby
larissa has quit [Ping timeout: 264 seconds]
RORgasm_ has joined #ruby
petey_ has joined #ruby
xcv has quit [Remote host closed the connection]
xcv has joined #ruby
petey has quit [Read error: Connection reset by peer]
quoin has joined #ruby
Roa_ has quit [Quit: leaving]
RORgasm has quit [Ping timeout: 240 seconds]
Roa has joined #ruby
endash has joined #ruby
t_p has joined #ruby
nemesit|znc has joined #ruby
cpruitt has quit [Ping timeout: 245 seconds]
quoin has quit [Ping timeout: 240 seconds]
jprovazn has quit [Quit: Leaving]
dash_ has quit [Quit: dash_]
zz_scottstamp is now known as scottstamp
aryaching has quit [Ping timeout: 248 seconds]
Kar- has joined #ruby
taptapdan has joined #ruby
arturaz has quit [Ping timeout: 245 seconds]
fgo has joined #ruby
dzhulk has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
noopq has quit [Ping timeout: 246 seconds]
jibi has joined #ruby
tkuchiki has joined #ruby
rahulkmr1 has joined #ruby
senayar has joined #ruby
ciziar has joined #ruby
angusiguess has quit [Ping timeout: 245 seconds]
rahulkmr has quit [Ping timeout: 245 seconds]
TheFuzzball has left #ruby ["Leaving..."]
andikr has quit [Read error: Connection reset by peer]
GeissT has quit [Quit: MillBroChat AdIRC User]
rhys has quit [Quit: Leaving]
robbyoconnor has joined #ruby
bl4ckdu5t has quit [Read error: Connection timed out]
bl4ckdu5t has joined #ruby
Monie has joined #ruby
blaxter_ is now known as blaxter
schaerli has quit [Remote host closed the connection]
jp- has left #ruby [#ruby]
petey_ has quit [Remote host closed the connection]
sivoais has joined #ruby
rhys has joined #ruby
Kricir has quit [Remote host closed the connection]
petey has joined #ruby
abstrusenick has joined #ruby
alup has quit [Quit: Leaving]
dash_ has joined #ruby
aryaching has joined #ruby
fgo has quit [Remote host closed the connection]
solars has joined #ruby
acrussell has joined #ruby
angusiguess has joined #ruby
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
acrussell has left #ruby [#ruby]
<solars>
hi, for an app that needs a very small db (100 lines of config) I'm looking for a database that is lightweight and can be synced over 2 hosts (even rsync would be enough because there are few writes). we don't want to install another mysql/pg cluster on these hosts for only 100 entries - does anyone know something like that? doesn't need to be a databse, can also be a different thing
<lupine>
for 100 lines, yaml, even .ini-style, would be fine
<bean_>
or like. sqlite
<apeiros>
luckyruby: sqlite or yaml IMO
<lupine>
you're unlikely to need any relational algebra, so sqlite is a bit pointless
<lupine>
(but not an inherently terrible suggestion)
emergion has joined #ruby
<solars>
lupine, well I'd still like to map it to objects automatically in a rails or similar app
<solars>
question is how to synchronize over the 2 hosts
Kricir has joined #ruby
luckyrub_ has joined #ruby
<apeiros>
solars: yaml maps to objects
quoin has joined #ruby
<lupine>
if you're in jruby, there's hs-something-or-another
<solars>
that's right, but it's not really a difference if I store it in a yaml or a sqlite file, sqlite gives some benefits to query it
pel_daniel has joined #ruby
freezey has quit [Remote host closed the connection]
<solars>
no jruby here..
<lupine>
but if it's read-only, it's honestly not worth putting much thought into it
<solars>
it's not read only
<lupine>
then it becomes a bit more difficult :)
<solars>
:)
<solars>
as I wrote, a few writes
<lupine>
how do you intend to resolve conflicts?
<solars>
but enough to use rsync for example
<lupine>
what are your consistency requiremnts?
<lupine>
etc
<solars>
there will only be writes at one time, as only 1 person can maintain it
KobraKao has joined #ruby
<lupine>
as soon as you need writes, I'd suggest sticking it in your existing data store
<solars>
so rsync would be alright, just wanted some opinions
pyrac has quit [Quit: pyrac]
<solars>
there is no existing data store on that host
<lupine>
anyway, less can go wrong if you're rsyncing yaml
<solars>
and mysql cluster looks like an overkill :)
<lupine>
...while writing it, I mean
<lupine>
also, mysql is never the answer ;)
<solars>
ah, yeah
luckyruby has quit [Ping timeout: 245 seconds]
<solars>
haha I knew it, but it's unfortunately not my decision :)
<solars>
I think I will stick to sqlite and rsync, then later I can always substitute it with another relational db
burlyscudd has quit [Quit: Leaving.]
<solars>
and don't need to change the objects
<apeiros>
we use oracle, and I'm honestly not sure whether I'd prefer oracle or mysql, if given the choice (both are full of horror and stupid)
<Hanmac>
lupine, mysql is the question, the answer is no ;P
<solars>
haha
brennanMKE has joined #ruby
<solars>
well for our needs, the dbs are more or less the same - and all the other stuff the admins have to deal with, so I don't really notice a difference :)
[boxmein] is now known as boxmein
finnnnnnnnnnn has joined #ruby
<apeiros>
oh trust me, there are differences you even notice if you have an abstraction on top of it
jblack has joined #ruby
xk_id has joined #ruby
jibi has quit [Quit: .]
larissa has joined #ruby
<apeiros>
like 30 char max identifier length (*all* identifiers - tablenames, sequences, column names, index-names etc.)
<finnnnnnnnnnn>
hey anyone know if I can range double letters? a..ab returns a-z and then aa, ab also.
<solars>
apeiros, haha right, I even remember such a case
schaerli has joined #ruby
<apeiros>
finnnnnnnnnnn: seem you already answered your own question? or I don't understand it
ephemerian has quit [Quit: Leaving.]
<finnnnnnnnnnn>
apeiros: oh, seems I did thanks
jibi has joined #ruby
xcv has quit [Read error: Connection reset by peer]
bl4ckdu5t has left #ruby [#ruby]
robbyoconnor has quit [Max SendQ exceeded]
Macaveli has quit [Quit: Computer has gone to sleep.]
Bira has joined #ruby
robbyoconnor has joined #ruby
petey has quit [Remote host closed the connection]
kil0byte has quit [Remote host closed the connection]
burlyscudd has joined #ruby
quoin has quit [Ping timeout: 240 seconds]
petey has joined #ruby
dAnjou has joined #ruby
Xeago has joined #ruby
sr78ger has joined #ruby
mengu has quit [Remote host closed the connection]
emergion has quit [Quit: Computer has gone to sleep.]
sr78ger has quit [Max SendQ exceeded]
dagobah has quit [Remote host closed the connection]
sr78ger has joined #ruby
<finnnnnnnnnnn>
apeiros: but if I try to do ('b'..'ab').to_a it fails
luckyrub_ has quit [Remote host closed the connection]
RichardBaker has joined #ruby
<finnnnnnnnnnn>
should so it's should fail? I hoped it would give me b to z and then aa and ab
<finnnnnnnnnnn>
similar to cells in a spreadsheet
<dAnjou>
hi, i'm having a huge headache. i'm trying to setup a padrino app. when running the command "padrino g admin" it said "Could not find rake-10.1.0 in any of the sources" although it was in the list of "gem list". then i installed it using "gem install --user-install rake" and suddenly it didn't complain anylonger. instead it complained about the next gem not being there although it was in "gem list" too.
<finnnnnnnnnnn>
so not a bug with Range but expected?
<workmad3>
apeiros: that means that 'a'..'ab' doesn't really make sense tbh :)
<dAnjou>
and of course i did a "bundle install --path ~/.gem" before
<apeiros>
expected. iterating strings with succ is rather, hm, odd
shredding has quit [Quit: shredding]
ssvo has joined #ruby
<dAnjou>
what is going on?
<apeiros>
workmad3: heh, don't tell me. I wouldn't have implemented String#succ in such an odd way.
newUser1234 has quit [Remote host closed the connection]
Clooth has quit [Quit: Leaving...]
<amanda_k>
hi and i know im probably going to get yelled at -- but here goes. im using guard-haml and its compiling everything with single quotes, is there any way to tell it to use double quotes? (if you're going to yell, be polite)
maletor has joined #ruby
kil0byte has joined #ruby
kil0byte has quit [Remote host closed the connection]
kaspergrubbe has quit [Remote host closed the connection]
jdguzman has joined #ruby
Fraeon has quit [Read error: Operation timed out]
Fraeon has joined #ruby
dash_ has joined #ruby
Voodoofish430 has joined #ruby
dodosan has quit [Read error: Connection reset by peer]
clov3r has joined #ruby
brennanMKE has quit [Remote host closed the connection]
w3pm has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
gwb3 has quit [Remote host closed the connection]
newUser1234 has joined #ruby
dodosan has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
<bean_>
amanda_k: as in the output has single quotes instead of double?
lfox has quit [Quit: ZZZzzz…]
Clooth has joined #ruby
gwb3 has joined #ruby
w3pm has quit [Client Quit]
Xeago has quit [Remote host closed the connection]
kil0byte has joined #ruby
yfeldblum has quit [Read error: Connection reset by peer]
<Morrolan>
If this is all you want to do, though, then FileUtils.copy is the way to go.
<pontiki>
^conner: sure, various ways.
<^conner>
pontiki, user metadata would be possible I guess
nari has quit [Ping timeout: 264 seconds]
<^conner>
pontiki, what I'd like to do is fetch thet capybara app_host name from the ENV, setup caybara before the first describe block and then do a let()
ryandeussing has joined #ruby
haxrbyte has quit [Read error: Connection reset by peer]
<^conner>
:q
<pontiki>
you could do this in spec_helper.rb, for instance
<pontiki>
that's generally where i do capy set up stuff
emergion has quit [Client Quit]
<pontiki>
OTOH, if it's only for one test, you can set up a method in the _spec.rb file
havenwood has quit [Ping timeout: 245 seconds]
ryandeussing has quit [Remote host closed the connection]
<^conner>
pontiki, doing just myfoo = 'bar' describe ... let(:host) { myfoo } doesn't work... myfoo isn't in scope
ryandeussing has joined #ruby
<pontiki>
nope
<pontiki>
but you could do @myfoo = 'bar'...
<pontiki>
and it will be in scope
ryandeussing has quit [Remote host closed the connection]
<Hanmac>
apeiros: there is a Unicode char that looks exact like that … but i dont find it yet
<apeiros>
Freeaqingme: you have to check parent classes and included modules too.
<popl>
^
<popl>
Freeaqingme: it might be inherited
<Freeaqingme>
apeiros, havenwood oh, makes sense. Thanks
<apeiros>
common mistake ;-)
|stargirl is now known as stargirl-
stkowski has quit [Ping timeout: 252 seconds]
nwertman_ has joined #ruby
sectionme has joined #ruby
<Hanmac>
he might also need to look when a module is extended or prepended ;P … (but as far as i know that is not used in RubyCore classes)
<apeiros>
hanmac: 1st row, 4th is Deathly Hollows Symbol
allsystemsarego has quit [Quit: Leaving]
nfk has quit [Quit: yawn]
<apeiros>
gah, Hallows
Kricir has joined #ruby
<Hanmac>
ah the last book that doesnt make any sense … (i mean the first books was great, but in the end the books get bigger, but the "plot" is getting smaller …)
<Hanmac>
it feels like that the last book has more plot holes that hogwarts secret passages ;P
<pontiki>
what is 3rd row, 4th symbol?
<Hanmac>
pontiki: thats the keys from a PlayStation
<havenwood>
ferr: does take more than two arguments that way
<ferr>
I see
<havenwood>
ferr: so you could: stuff(2, 2, 2)
<Morrolan>
Definitely not the way to go if you just want to add two numbers together, though. :P
oddalot has quit [Ping timeout: 256 seconds]
<ferr>
I'm just learning about the functions and trying to get my code as short as possible
mark_locklear has quit [Ping timeout: 252 seconds]
<havenwood>
golf
jbpros has joined #ruby
fcahoon has joined #ruby
kevind has quit [Ping timeout: 248 seconds]
kevind_ is now known as kevind
platzhirsch1 has joined #ruby
Hanmac has quit [Quit: Leaving.]
momomomomo has joined #ruby
<platzhirsch1>
apeiros: Cool thing with Oj, had a chat with the author and he will implement streamed writing for it this week, so I can port my code from Yajl to Oj
Xeago has quit [Remote host closed the connection]
mark_locklear has joined #ruby
yekta has joined #ruby
<platzhirsch1>
with a bit luck I won't face memory leaks anymore :P
stargirl- is now known as Thelxinoe
ghr has joined #ruby
brennanMKE has quit [Ping timeout: 246 seconds]
Xeago has joined #ruby
petey_ has quit [Remote host closed the connection]
Thelxinoe is now known as HabitusMentis
nwertman_ has quit [Ping timeout: 240 seconds]
spider-mario has quit [Remote host closed the connection]
Michael__ has quit [Remote host closed the connection]
reisl has joined #ruby
ehaliewicz has joined #ruby
joofsh has quit [Remote host closed the connection]
quoin has joined #ruby
xcv_ has quit [Remote host closed the connection]
Kar- has joined #ruby
HabitusMentis is now known as Thelxinoe
taptapdan has joined #ruby
KobraKao has quit [Quit: Saindo]
larissa has quit [Ping timeout: 245 seconds]
k610 has joined #ruby
Michael has joined #ruby
Michael is now known as Guest89627
alekst has quit [Quit: Computer has gone to sleep.]
<ferr>
how should I search for +=, what is it called?
<apeiros>
+= is a composite
<apeiros>
a += b is really a = a.+(b)
petey has joined #ruby
quoin has quit [Ping timeout: 264 seconds]
Advocation has quit [Quit: Advocation]
rezzack has joined #ruby
schaerli has quit [Remote host closed the connection]
mneorr has quit [Remote host closed the connection]
burlyscudd1 has quit [Quit: Leaving.]
gwb3 has joined #ruby
noopq has quit [Ping timeout: 245 seconds]
Thelxinoe is now known as Thelxinoe-
JZTech101 has quit [Quit: Now what?]
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
luckyruby has quit [Ping timeout: 264 seconds]
joofsh has joined #ruby
Guest85894 has quit [Read error: Operation timed out]
beginn3r has quit [Quit: Leaving]
twoism has quit [Ping timeout: 260 seconds]
dash_ has quit [Quit: dash_]
beginn3r has joined #ruby
agent_white has joined #ruby
Es0teric has joined #ruby
beginn3r has quit [Read error: Connection reset by peer]
beginn3r has joined #ruby
beginn3r has quit [Remote host closed the connection]
Kar- has quit [Ping timeout: 245 seconds]
zarul has joined #ruby
robustus has joined #ruby
alvaro_o has joined #ruby
riceandb1ans has quit [Quit: leaving]
creature has quit [Read error: Connection reset by peer]
<platzhirsch1>
Is there a similar operator to << ?
<platzhirsch1>
err, nvm
gwb3 has quit [Ping timeout: 245 seconds]
schaerli has joined #ruby
krawchyk has quit [Remote host closed the connection]
bret has left #ruby ["Bye!"]
robustus|Off has quit [Ping timeout: 245 seconds]
decoponio has quit [Quit: Leaving...]
joshu has joined #ruby
soheil has quit [Remote host closed the connection]
<platzhirsch1>
I am looking for Ruby operators to overload. For my metric classes I might use << to add another record to the preprocessing, now I look for another one to get a score out of the metric... but I think I am bloating it
creature has joined #ruby
creature has joined #ruby
* popl
overload apeiros
<platzhirsch1>
"nice, more cryptic operators with non-trivial semantic"
<popl>
*overloads
<apeiros>
platzhirsch1: sure
<apeiros>
x <<= y
platzhirsch1 is now known as platzhirsch
chairabanta has quit [Quit: Leaving...]
<apeiros>
also you can't overload in ruby :)
<apeiros>
you can emulate it, though
<platzhirsch>
<< for initialize and >> for compute score would be rad :P
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
<platzhirsch>
true, that was the wrong term
chairabanta has joined #ruby
stkowski has joined #ruby
<platzhirsch>
so what's correct again? Shadowing?
<havenwood>
i'd like >> for prepending to arrays and strings and such
samsden has joined #ruby
luckyruby has joined #ruby
<apeiros>
platzhirsch: redefine, override
jamesaanderson has joined #ruby
burlyscudd has joined #ruby
jamesaanderson has quit [Client Quit]
<platzhirsch>
oh my, I completely forgot that overloading is about different method signatures
freerobby has quit [Read error: Connection reset by peer]
freerobby1 has joined #ruby
<apeiros>
:)
<platzhirsch>
I've been to long away from Java
Monie has joined #ruby
sayan has joined #ruby
JZTech10- is now known as JZTech101
<popl>
that's a new one
srji has quit [Ping timeout: 264 seconds]
stkowski has quit [Ping timeout: 240 seconds]
Coolhand has quit [Ping timeout: 245 seconds]
iliketurtles has joined #ruby
<ferr>
g'night
bluepojo has quit [Read error: Connection reset by peer]
travisjeffery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Coolhand has joined #ruby
<platzhirsch>
I think I am safe with my fancy operators, as long as there is an alias with a human readable name
travisjeffery has joined #ruby
Coolhand has quit [Remote host closed the connection]
bluepojo has joined #ruby
samsden has quit [Ping timeout: 260 seconds]
Emmanuel_Chanel has joined #ruby
Coolhand has joined #ruby
SHyx0rmZ has joined #ruby
juo has quit [Ping timeout: 240 seconds]
ferr has quit []
Kar- has joined #ruby
<platzhirsch>
metric ^ record
g0th has quit [Quit: Lost terminal]
chairabanta has quit [Quit: Leaving...]
elux has joined #ruby
jamesaanderson has joined #ruby
juo has joined #ruby
c0rn has joined #ruby
kiddorails has quit [Quit: Leaving.]
kiddorails1 has joined #ruby
gwb3 has joined #ruby
elaptics is now known as elaptics`away
twoism has joined #ruby
sailias has quit [Quit: Leaving.]
qubit has left #ruby [#ruby]
mengu has joined #ruby
yekta has quit [Quit: yekta]
alekst has joined #ruby
Macaveli has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby
burlyscudd has quit [Quit: Leaving.]
rehat has joined #ruby
ssvo_ has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
joshu has quit [Ping timeout: 246 seconds]
vlad_starkov has quit [Ping timeout: 256 seconds]
jamesaanderson has joined #ruby
RichardBaker has joined #ruby
jibi has joined #ruby
<rehat>
I am a bit confused. I'm new to ruby. What does this resolve method do https://gist.github.com/rehat/6769508? It is used by a gem called pundit for authorizing
ssvo has quit [Ping timeout: 240 seconds]
kiddorails1 has quit [Ping timeout: 260 seconds]
iliketurtles has quit [Quit: zzzzz…..]
<lupine>
returns scope if user.allowed? returns new
<lupine>
true*
<lupine>
if not, it returns nil
joshu has joined #ruby
mlpinit has joined #ruby
<rumours>
equal false
evenix has quit [Remote host closed the connection]
<rehat>
ahh
<rehat>
but how do I find out what that scope symbol is
mercwithamouth has quit [Ping timeout: 248 seconds]
<rehat>
or should I ignore this magic lol
soheil has joined #ruby
Tearan has quit [Read error: Connection reset by peer]
fmcgeough has quit [Quit: fmcgeough]
julweber has joined #ruby
pushpak has joined #ruby
srji has joined #ruby
<apeiros>
class Foo < Struct.new # <-- bad idiom
<lupine>
Struct.new(symbols) returns a class
<apeiros>
Foo = Struct.new do # <-- better idiom
cody-- has quit [Quit: derp]
<lupine>
that class will have an initialize method that takes two arguments, the first of which it will assign to an instance variable @user, the second to @scope
randomnick_ has quit [Read error: Connection reset by peer]
mercwithamouth has joined #ruby
joshu has quit [Ping timeout: 248 seconds]
Xeago has quit [Remote host closed the connection]
Kar- has quit [Ping timeout: 245 seconds]
motto has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
workmad3 has joined #ruby
m8 has quit [Ping timeout: 248 seconds]
joshu has joined #ruby
havenwood has quit [Remote host closed the connection]
burlyscudd has joined #ruby
sniffingcats has quit [Quit: Til rivido Idisti!]
tsykoduk is now known as zz_tsykoduk
agent_white has quit [Quit: leaving]
mark_locklear has quit [Ping timeout: 252 seconds]
agent_white has joined #ruby
jamesaanderson has joined #ruby
soheil has quit [Ping timeout: 245 seconds]
Lewix has quit [Remote host closed the connection]
io_syl has joined #ruby
elplatt has joined #ruby
asteros has joined #ruby
mark_locklear has joined #ruby
Lewix has joined #ruby
quoin has joined #ruby
heidi has joined #ruby
iliketurtles has joined #ruby
k610 has quit [Quit: Leaving]
geekbri has quit [Remote host closed the connection]
quoin has quit [Ping timeout: 260 seconds]
cj3kim has quit [Read error: Connection reset by peer]
cj3kim has joined #ruby
cj3kim has quit [Remote host closed the connection]
cj3kim has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
reisl has quit [Quit: Leaving]
oktapodi_ has quit [Remote host closed the connection]
<shevy>
it will read until the first \n character right?
Mars` has joined #ruby
<shevy>
how can I read in multi-line user input?
quoin has joined #ruby
<bnagy>
new programming tool called a 'loop'
mayorga has joined #ruby
<volty>
dopie: crimes.each_cons(10) { |arr10| p arr10; puts "delimiter" }
<bnagy>
all the rage in turning complete constructions
<platzhirsch>
shevy: Error: Cannot find local context. Did you use `binding.pry`?
<platzhirsch>
err
<shevy>
what
<platzhirsch>
shevy: I think there was a great shortcut for this
<platzhirsch>
nvm, copy paste mistake
<shevy>
hehe
adambeynon has joined #ruby
<workmad3>
volty: surely that should be each_slice(10), not each_cons(10)?
<volty>
workmad3: yap, a typo, thx :0
<volty>
:)
<workmad3>
:)
<MrZYX>
also that won't only "do something" on multiples of 10 but always one (extra) time
<dopie>
hehe
<dopie>
volty, dont understand your answer
<dopie>
:)
cads has quit [Ping timeout: 260 seconds]
mayorga has quit [Max SendQ exceeded]
mayorga has joined #ruby
ehaliewicz has quit [Remote host closed the connection]
ehaliewi` has joined #ruby
quoin has quit [Ping timeout: 240 seconds]
colonolGron has joined #ruby
<volty>
dopie: you have the list of crimes, so crimes.each_slice(10) { |arr| here you receive the chunks of ten crimes - less the rest, the last chunk }
<platzhirsch>
I've been told this one when I was doing a code gold challenge
<shevy>
platzhirsch no idea how to end it via $stdin.readlines btw
<platzhirsch>
shevy: ^D
vlad_starkov has joined #ruby
<shevy>
canton7 yeah that seems to work very fine
<canton7>
:)
<shevy>
and $/ is still "\n" after calling .gets with argument
<shevy>
platzhirsch hmm
<canton7>
aye
ldnunes has joined #ruby
mayorga has quit [Max SendQ exceeded]
<shevy>
do python and perl have something like $/ by the way?
<popl>
perldoc -v '$/'
<bnagy>
$20 says $/ came from perl
<popl>
dunno about python
zeade has joined #ruby
mayorga has joined #ruby
<popl>
but I wouldn't doubt it
luckyruby has quit [Remote host closed the connection]
asteros has quit [Quit: asteros]
<platzhirsch>
shevy: great another SO where I could put my answer on :P
mayorga has quit [Max SendQ exceeded]
mayorga has joined #ruby
vlad_starkov has quit [Ping timeout: 240 seconds]
<shevy>
yes
Jetchisel has quit [Quit: Unfortunately time is always against us -- *Morpheus*]
<shevy>
both platzhirsch and canton7's answers are missing there
<shevy>
that is a problem with SO btw... better answers rarely get added, once anyone answered before...
<shevy>
but those two answers on SO are not ideal
einarj has joined #ruby
baroquebobcat has joined #ruby
<platzhirsch>
I found a lot of Ruby questions where I have started to add my answers. You might blame me for reputation farming, but either we are talking Programmer's Wikipedia or we are not
asteros has joined #ruby
iamjarvo_ has joined #ruby
<popl>
perl: my @lines = do {local $/; readline;}; # "slurps" stdin into @lines
twoism_ has joined #ruby
havenwood has quit [Ping timeout: 240 seconds]
<shevy>
platzhirsch no, that seems perfectly legit way to raise reputation
mayorga has quit [Max SendQ exceeded]
<shevy>
because others like me, could add, but don't because I am lazy, so I have less reputation which seems to be fair
<platzhirsch>
I firmly believe there was a very short alias to $stdin.readlines where the heck is it
mayorga has joined #ruby
<shevy>
popl huh ok... I never saw do {} before in perl...
<shevy>
that's almost valid ruby code!
<popl>
really?
<popl>
it's useful
<shevy>
yeah, never saw it before
<banisterfiend>
popl what does do {} do in perl?
kaldrenon has quit [Remote host closed the connection]
interactionjaxsn has quit [Remote host closed the connection]
<zaltekk>
banisterfiend: {} in what context?
tvw has joined #ruby
iamjarvo has quit [Ping timeout: 252 seconds]
kaldrenon has joined #ruby
<zaltekk>
oh, the do {}?
interactionjaxsn has joined #ruby
mayorga has quit [Max SendQ exceeded]
twoism has quit [Ping timeout: 252 seconds]
<zaltekk>
it's just a block
enebo has quit [Quit: enebo]
mayorga has joined #ruby
iamjarvo_ has quit [Ping timeout: 248 seconds]
<volty>
loop?
<zaltekk>
not a loop by itself
cads has joined #ruby
<volty>
do {} - is a loop?
<zaltekk>
the do {} is so that changes to $/ are localized to the readline
<popl>
banisterfiend: do {...} evaluates ... and returns the value of hte last thing
<zaltekk>
right, and it lets you scope the localization of $/ to the block
<popl>
that's old antiquated though. you might still see it in production but if you're going to slurp a file use File::Slurp or something
<shevy>
so strange
whunt is now known as whorking
<shevy>
I once thought I knew a little perl but now I feel totally out of it
<popl>
*old and antiquated
creature has left #ruby [#ruby]
AFKGeek has joined #ruby
<zaltekk>
yeah, it's a bit hackish
<popl>
Moose is awesome
<volty>
zaltekk: but you said @lines = do { ... readline;) // more lines?
<popl>
Moose is representative of the new perl
<zaltekk>
volty: what do you mean more lines?
rahulkmr1 has quit [Read error: Connection reset by peer]
rahulkmr has joined #ruby
rahulkmr has quit [Max SendQ exceeded]
randomnick_ has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<banisterfiend>
popl sounds like do in coffeescript
aspires has quit [Quit: aspires]
<volty>
i suppose 'lines' stays for more lines and I see just one readline
kaldrenon has quit [Ping timeout: 246 seconds]
rahulkmr has joined #ruby
jerius has quit [Ping timeout: 246 seconds]
Nogbit has left #ruby [#ruby]
rahulkmr has quit [Max SendQ exceeded]
interactionjaxsn has quit [Ping timeout: 240 seconds]
codecop has quit [Remote host closed the connection]
<zaltekk>
$/ is the line termination character, which is emptied out to make readlines read the entire file
Urizen has joined #ruby
<volty>
ah! no delimiter
rahulkmr has joined #ruby
<volty>
can't that be done in ruby?
rahulkmr has quit [Max SendQ exceeded]
adeponte has quit [Remote host closed the connection]
twoism has joined #ruby
<zaltekk>
volty: yes, you can still use $/
mercwithamouth has quit [Ping timeout: 256 seconds]
<volty>
yap, now I got it
<zaltekk>
i think the "english" versions are preferred, though
rahulkmr has joined #ruby
AFKGeek has quit [Client Quit]
<popl>
should have put $data instead of @lines
<popl>
sorry, that was confusing
ehaliewi` has quit [Remote host closed the connection]
johnnyfuchs has quit [Remote host closed the connection]
ehaliewi` has joined #ruby
neonlex has joined #ruby
soheil has quit [Read error: Connection timed out]
mmitchell has quit [Remote host closed the connection]
<volty>
so a complete code, local $/ , without assigning anything to it, has the 'empty' value?
<popl>
my @lines = do {readline;}; # does what you think
twoism_ has quit [Ping timeout: 248 seconds]
Thelxinoe- has quit [Remote host closed the connection]
<popl>
in Perl?
soheil has joined #ruby
<popl>
in Perl it is newline my default
<popl>
*by
breakingthings has quit []
KobraKao has joined #ruby
elplatt has joined #ruby
tgraham|away is now known as tgraham
yekta has joined #ruby
ehaliewi` has quit [Remote host closed the connection]
Thelxinoe- has joined #ruby
ehaliewi` has joined #ruby
jp- has joined #ruby
<zaltekk>
volty: local $/ # $/ will be undefined
bean__ has quit [Quit: Computer has gone to sleep.]
<popl>
oh d'oh
neonlex has quit [Ping timeout: 245 seconds]
Urizen has quit [Quit: leaving]
<zaltekk>
perl -e 'local $/; print "Yep!\n" if !defined $/"
<zaltekk>
that last " should be a '
Michael has joined #ruby
Michael is now known as Guest2242
v_litvak has joined #ruby
<v_litvak>
hello
cads has quit [Ping timeout: 246 seconds]
joofsh has quit [Remote host closed the connection]
<v_litvak>
i have a question, (I am not as good with ruby yet)
elux has quit [Quit: Bye!]
<v_litvak>
but what im trying to do is
<volty>
so readline does not check for line/field delimiter since not defined, ok, nice
<v_litvak>
actually, i might figure it out on my own
zeade has quit [Quit: Leaving.]
<popl>
zaltekk: !defined?
<popl>
:P
T_T has joined #ruby
<volty>
actually, are you going to ask or to actually do it on your own? :)
fcahoon has quit [Quit: Leaving]
<zaltekk>
popl: this box didn't like undefined
<zaltekk>
didn't bother messing with whatever i did wrong
<zaltekk>
guess i could unless defined
<zaltekk>
it's been a long time since i've written perl
<platzhirsch>
If the link checker simply does not want to finish 99.988% I really overdid it with the timoue
<popl>
just test it
<popl>
perl -E '{local $/; say "in here" if $/;} say "out here" if $/;'
<popl>
:)
<zaltekk>
that's more typing
<popl>
what?
<zaltekk>
what i typed here worked
<popl>
ok dude, whatever :)
<zaltekk>
cba to print in both cases :P
katsrc has joined #ruby
adeponte has joined #ruby
julweber_ has joined #ruby
maloik has quit [Read error: Operation timed out]
maloik has joined #ruby
elektronaut has quit [Read error: Operation timed out]
elektronaut has joined #ruby
rondale_sc has quit [Read error: Operation timed out]
rondale_sc has joined #ruby
indigo has quit [Read error: Operation timed out]
kaiks has joined #ruby
Rylee has quit [Read error: Operation timed out]
mary5030 has quit [Ping timeout: 245 seconds]
lancepantz has quit [Read error: Operation timed out]
indigo has joined #ruby
kx has quit [Read error: Connection reset by peer]
michael_mbp has quit [Read error: Operation timed out]
lancepantz_ has joined #ruby
Rylee has joined #ruby
kilophoton has joined #ruby
lancepantz_ is now known as lancepantz
freerobby1 has quit [Quit: Leaving.]
michael_mbp has joined #ruby
baordog_ has quit [Remote host closed the connection]
julweber has quit [Ping timeout: 256 seconds]
kaspergrubbe has joined #ruby
havenwood has joined #ruby
<shevy>
hmm how to slice up a long string into "pairs of 3 characters each"?
ce_afk is now known as cescalante
<havenwood>
each_char.each_slice(3)
rhys has quit [Quit: Leaving]
jibi has quit [Quit: .]
popl has quit [Quit: We must make an idol of our fear, and call it God.]
freezey has quit [Remote host closed the connection]
ehaliewi` has quit [Remote host closed the connection]
T_T has quit [Remote host closed the connection]
ehaliewi` has joined #ruby
prophile has quit [Quit: Changing server]
apeiros has quit [Remote host closed the connection]
mengu has quit [Remote host closed the connection]
evenix has joined #ruby
<bnagy>
Eiam: unless there's some weird binding implication, logically yeah
adeponte has quit [Remote host closed the connection]
havenwood has quit [Quit: Leaving]
<havenn>
shevy: you want like tuples of triple-char arrays?
xk_id has quit [Quit:
fijimunkii has quit [Ping timeout: 240 seconds]
<shevy>
havenn hmm I think the examples work, I needed a method that gives me n length substrings of a given string
alx- has quit [Quit: Leaving...]
T_T has joined #ruby
adeponte has joined #ruby
mayorga has quit [Ping timeout: 256 seconds]
<bnagy>
it depends a bit on what you want when len % substr_len != 0
<volty>
scan(/.{#{n}}/
cescalante is now known as ce_afk
evenix has quit [Ping timeout: 264 seconds]
xk_id has joined #ruby
iliketurtles has quit [Quit: zzzzz…..]
<shevy>
yeah... 0 and 1 aren't useful
kofno has joined #ruby
yfeldblum has quit [Ping timeout: 246 seconds]
vim_shim has quit [Read error: Operation timed out]
iliketurtles has joined #ruby
elplatt has quit [Quit: elplatt]
soheil has quit [Read error: Connection timed out]
elplatt has joined #ruby
soheil has joined #ruby
mayorga has joined #ruby
Matriks has quit [Remote host closed the connection]
dpaulus has joined #ruby
ssvo_ is now known as ssvo
<volty>
i'm writing cons instead of slice all the evening
KobraKao has quit [Quit: Saindo]
coderhs has quit [Ping timeout: 256 seconds]
mayorga has quit [Max SendQ exceeded]
<shevy>
silly question... can I mix stuff like:
twoism has quit [Read error: Connection reset by peer]
mayorga has joined #ruby
<shevy>
x = 'abc123'; case x; when 'abc1',/^abc/
twoism has joined #ruby
<shevy>
mix string and regex checks
<volty>
yes
<shevy>
cool
<volty>
when compares using ===
jp- has left #ruby [#ruby]
julweber_ has quit [Remote host closed the connection]
quoin has joined #ruby
nanoxd has quit [Quit: nanoxd]
sectionme has joined #ruby
MrZYX is now known as MrZYX|off
srji has joined #ruby
v_litvak has quit [Quit: Lost terminal]
petey has quit [Ping timeout: 245 seconds]
colonolGron has quit [Quit: leaving]
VTLob has quit [Quit: VTLob]
Davey has quit [Quit: Computer has gone to sleep.]
leynos has quit [Quit: Off to dreams of Laserdiscs and Neo-Geos]
DaZ has quit [Ping timeout: 256 seconds]
<volty>
arrays are fine (instead of case) for checking against cases // but as I always say - do it, simply, your own way // think on what you have to do, with the actual "how to do's" that you posses at the moment
<shevy>
yeah
<shevy>
I replaced 'cut3','cut4','cut5' with /cut\d+/