pitzips has quit [Remote host closed the connection]
tricon_ has joined #ruby
toekutr has joined #ruby
rads has quit []
s3m73x has joined #ruby
tylersmith has quit [Quit: tylersmith]
tils has quit [Ping timeout: 245 seconds]
xcv has quit [Remote host closed the connection]
xcv has joined #ruby
tils has joined #ruby
gyre007 has joined #ruby
slainer68 has quit [Remote host closed the connection]
jpcamara has quit [Quit: jpcamara]
Xeago has quit [Remote host closed the connection]
io_syl has quit [Quit: Computer has gone to sleep.]
hogeo has joined #ruby
heftig has quit [Quit: Quitting]
hadees has quit [Quit: hadees]
mercwithamouth has joined #ruby
io_syl has joined #ruby
heftig has joined #ruby
zeade has quit [Quit: Leaving.]
tealmage has quit [Remote host closed the connection]
<dopie>
how do i gets.chomp a user to enter the initialize(name_of_area) ?
eliasp has quit [Quit: No Ping reply in 180 seconds.]
emocakes has joined #ruby
eliasp has joined #ruby
bigoldrock has quit [Ping timeout: 264 seconds]
psyprus has quit [Changing host]
psyprus has joined #ruby
love_color_text has quit [Remote host closed the connection]
<sam113101>
Obj.new(gets.chomp) ?
davetherat has quit [Remote host closed the connection]
danman has quit [Quit: danman]
davetherat has joined #ruby
<shevy>
dopie you can always assign gets.chomp to a variable
jetblack has quit [Quit: leaving]
<shevy>
user_input = $stdin.gets.chomp
dmiller2 has joined #ruby
<shevy>
dopie the method initialize() is not directly called, I think .new() first calls allocate() internally, which then calls initialize() or something like that
havenwood has quit [Remote host closed the connection]
<shevy>
dopie I told you before
<shevy>
initialize() is the method that is called first
<shevy>
so when you want to run other methods, put them inside initialize
<shevy>
also, please use consistent indent
<shevy>
" @name = name.upcase"
<dopie>
ahhhh ok
<shevy>
"@employee = []"
<shevy>
you have a \t tab there
nga4 has quit [Ping timeout: 260 seconds]
adkron has joined #ruby
<dopie>
just saw that
<dopie>
thank you
bitcrave has quit [Ping timeout: 272 seconds]
brianpWins has quit [Quit: brianpWins]
<shevy>
dopie, it is not important, but it shows that you can be consistent in the way you write code
<shevy>
it then helps to think clearer and simpler
<shevy>
less distractions
chipotle_ has joined #ruby
<shevy>
in your code, put all things inside initialize for now
<shevy>
print "What is the Company name" <--- all this part
<shevy>
put it into methods
yshh has joined #ruby
adkron has quit [Ping timeout: 245 seconds]
huoxito has quit [Ping timeout: 258 seconds]
xcv_ has quit [Remote host closed the connection]
<jon_nw>
random question: if i want to transfer some money between accounts, what is the term used to refer to the receiving account and the sending account?
slyv has joined #ruby
<jon_nw>
like, financial terms
adkron has joined #ruby
the_jeebster has quit [Quit: Leaving.]
adkron_ has joined #ruby
tjbiddle_ has joined #ruby
bradhe has quit [Remote host closed the connection]
<Paradox>
all this pycon crap is making me happy to be a rubyist
danman has joined #ruby
miso1337 has quit [Quit: miso1337]
<shevy>
what is pycon crap?
<shevy>
dopie please indent properly
<shevy>
I hate to look at sloppy code
<shevy>
class Foo
<shevy>
def some_method
<shevy>
end
<shevy>
end
<dopie>
I still didnt indent properly?!
<Paradox>
shevy, search "adria richards"
<shevy>
right now you do this dopie
<shevy>
class Foo
<shevy>
def initialize
cheese1756 has quit [Changing host]
cheese1756 has joined #ruby
<shevy>
end
<shevy>
end
<shevy>
look at your code dopie!!!
<shevy>
anyway, as for the content
jdunck has quit [Quit: Computer has gone to sleep.]
jcheng has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
<shevy>
move company = Company.new(new_comp) outside
<shevy>
well
<shevy>
not quite that alone
<shevy>
I will write it for you quickly, that is simpler
nopolitica has quit [Quit: Lost terminal]
rabidpraxis has joined #ruby
tjbiddle has quit [Ping timeout: 272 seconds]
tigris_ has left #ruby [#ruby]
tjbiddle_ has quit [Ping timeout: 256 seconds]
<Paradox>
shevy, tldr: SendGrid's developer evangelist overheard 2 guys joking to each other about "dongles", took their picture, posted it on twitter, and got them fired. The jokes werent directed at her
senayar has quit [Remote host closed the connection]
heftig has quit [Quit: Quitting]
roadt has joined #ruby
gyre007 has quit [Quit: Computer has gone to sleep.]
jjbohn has joined #ruby
vandemar has joined #ruby
brianpWins has quit [Quit: brianpWins]
etcetera has quit []
toekutr has joined #ruby
tommyvyo has quit [Quit:]
Goles has joined #ruby
dmiller2 has joined #ruby
heftig has joined #ruby
yashshah_ has quit [Read error: Connection reset by peer]
yashshah_ has joined #ruby
jimeh has quit [Quit: Computer has gone to sleep.]
brianpWins has joined #ruby
dmiller2 has quit [Ping timeout: 260 seconds]
mercwithamouth has quit [Ping timeout: 264 seconds]
mockra has joined #ruby
Opettaja has quit [Ping timeout: 252 seconds]
dopie has quit [Ping timeout: 245 seconds]
matayam has quit [Remote host closed the connection]
Ontolog has quit [Remote host closed the connection]
tomzx_mac has quit [Ping timeout: 246 seconds]
jjbohn has quit [Quit: Leaving...]
<ics_>
who
tcopp has joined #ruby
brianpWins has quit [Quit: brianpWins]
adkron_ has quit [Ping timeout: 258 seconds]
sambao21 has joined #ruby
heftig has quit [Quit: Quitting]
<andrew12>
who
thinkclay has quit [Quit: Leaving.]
kofno has quit [Remote host closed the connection]
<bnagy>
oh, it's owl impressions? Again?
swounding60 has quit [Ping timeout: 252 seconds]
tomzx_mac has joined #ruby
adkron has quit [Ping timeout: 252 seconds]
sambao21 has quit [Quit: Computer has gone to sleep.]
zeade has joined #ruby
adkron has joined #ruby
swounding60 has joined #ruby
heftig has joined #ruby
rabidpraxis has joined #ruby
SDr is now known as NightCreature
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
mercwithamouth has joined #ruby
stkowski has joined #ruby
etcetera has joined #ruby
banjara has quit [Quit: Leaving.]
rabidpraxis has quit [Ping timeout: 256 seconds]
matayam has joined #ruby
tjbiddle has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
statarb3 has quit [Ping timeout: 276 seconds]
ics_ has quit [Quit: leaving]
banjara has joined #ruby
etcetera has quit [Client Quit]
<Quadlex>
I'm confused by this code
tjbiddle has quit [Client Quit]
jekotia has quit [Quit: ChatZilla 0.9.90-rdmsoft [XULRunner 18.0.2/20130201065344]]
<Quadlex>
And after about 10 minutes
<Quadlex>
I realize it's because someone decided that Exception swallowing is good development
hamakn has joined #ruby
justsee has quit [Quit: Leaving...]
dmiller2 has joined #ruby
classix has quit [Ping timeout: 264 seconds]
huoxito has quit [Ping timeout: 258 seconds]
oxez has joined #ruby
tylersmith has joined #ruby
verysoftoiletppr has quit []
<bnagy>
it's called 'handling'
mockra has quit [Remote host closed the connection]
mockra has joined #ruby
rismoney has quit [Read error: Connection reset by peer]
headius has joined #ruby
ryanf has quit [Ping timeout: 256 seconds]
banjara has quit [Quit: Leaving.]
Goles has quit [Quit: Computer has gone to sleep.]
sayan has joined #ruby
bigmac_ has quit [Quit: Leaving]
drumond19 has quit [Remote host closed the connection]
mercwithamouth has quit [Ping timeout: 258 seconds]
danman has quit [Quit: danman]
kofno has joined #ruby
jrajav has joined #ruby
danneu has joined #ruby
mattbl has joined #ruby
sayan has quit [Quit: Leaving]
sayan has joined #ruby
matayam has quit [Remote host closed the connection]
mmitchell has joined #ruby
forced_request has quit [Read error: Connection reset by peer]
vagmi has joined #ruby
tjbiddle has joined #ruby
tish has quit [Quit: Leaving.]
havenwood has joined #ruby
mmitchell has quit [Ping timeout: 256 seconds]
agarie has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
kofno has quit [Ping timeout: 240 seconds]
PanPan has joined #ruby
ttt_ has quit [Read error: Connection reset by peer]
ttt_ has joined #ruby
hadees has joined #ruby
<shevy>
I use silent exceptions sometimes
<shevy>
begin; require 'awfully_buggy_project'; rescue LoadError; end
<shevy>
or other exceptions
nignaztic has quit [Ping timeout: 252 seconds]
<bnagy>
I use some.statement rescue nil all the time, if there's only one thing that could ever go wrong and it happens infrequently
axxT has joined #ruby
LiquidInsect has joined #ruby
havenwood has quit [Remote host closed the connection]
icole has joined #ruby
ner0x has quit [Quit: Leaving]
crackfu has joined #ruby
bradhe has quit [Remote host closed the connection]
andersbr has joined #ruby
generali_ has quit [Read error: Connection reset by peer]
generalissimo has joined #ruby
ckrailo has joined #ruby
<rking>
bnagy: Please don't. =~(
Rollabunna has joined #ruby
<rking>
My life is far worse for the number of 'rescue nil's I see.
<rking>
Actually, let me count them.
mattbl has joined #ruby
<rking>
541. There are 541 instances of rescue nil in this codebase.
rezzack has quit [Ping timeout: 245 seconds]
Rollabunna has quit [Remote host closed the connection]
<rking>
And not one is worth whatever amount of time it would've taken the programmer to write real handling.
twoism has joined #ruby
hbpoison_ has quit [Ping timeout: 255 seconds]
Ontolog has joined #ruby
hbpoison has joined #ruby
bradhe has joined #ruby
<bnagy>
oh ok, I'll change the all to begin; some.statement; rescue; #do nothing because rking knows everything; end
Davey has quit [Quit: Computer has gone to sleep.]
Guedes0 has quit [Ping timeout: 260 seconds]
<rking>
Well, if you have a legitimate case, I'd love to see it.
<rking>
Of a "Only one thing could go ever go wrong"
ahokaomaeha has joined #ruby
mikurubeam has quit [Ping timeout: 260 seconds]
ahokaomaeha is now known as mikurubeam
icole has quit [Remote host closed the connection]
<rking>
BTW using a more verbose idiom isn't the point. Handling it better (or just letting it go to the toplevel if there are no plans to handle it well) is what I'm advocating.
tealmage has quit [Remote host closed the connection]
mattbl has quit [Quit: This computer has gone to sleep]
baroquebobcat has quit [Quit: baroquebobcat]
<bnagy>
doing nothing _is_ handling it well, in many cases
rabidpraxis has joined #ruby
<rking>
I'm listening, but I'll need examples.
krz has joined #ruby
<rking>
BTW another side of this is API design, and I think the PragProg rule is pretty sound: "If your code could not run without exception handlers, then reconsider the error handling."
tgunr has quit [Ping timeout: 256 seconds]
twoism has quit [Remote host closed the connection]
mattbl has joined #ruby
<bnagy>
that is either unrekated or a stupid 'rule'
<rking>
So if I was using some object that really just blew up once in a while and I didn't care, I'd probably push that into a method that behaves in that way, so callers wouldn't spread the apathetic-handler meme.
<bnagy>
like, if it couldn't run at ALL then it's a valid point
<bnagy>
but no "real" code can run with no exception handling
twoism has joined #ruby
<rking>
Huh?
<rking>
The toplevel exception handler does fine for 90% of the exceptions one would encounter.
<rking>
For example, if you just File.read 'foo' and you have no way to deal with the absence of the file 'foo', then the right thing to do is stop and backtrace.
hemanth_away is now known as hemanth
<rking>
But if you want to be robust against that file's nonexistence, do a "File.exists? 'foo'" check first
<bnagy>
and if you do, then you should handle it
mattbl has quit [Client Quit]
<rking>
If I do what?
<bnagy>
but a File.read is a poor example of a situation where only one thing could go wrong
rabidpraxis has quit [Ping timeout: 252 seconds]
Ontolog has quit [Remote host closed the connection]
<rking>
I'm not the one saying there is such a situation
<rking>
I'm just saying that it is an example of the PragProg rule
zeade has quit [Quit: Leaving.]
andersbr has quit [Quit: andersbr]
<bnagy>
yeah no it's not
<hemanth>
meow
<bnagy>
unless you think having your whole program exiting when it doesn't have to is robust
<rking>
Where it's iffy to write: begin File.read 'foo' rescue Errno::ENOENT end
<Quadlex>
Handling is when you do something with an exception
yashshah_ has quit [Ping timeout: 260 seconds]
<Quadlex>
If you just silently absorb it, well, you better be damned sure you know what you're silently absorbing
<rking>
The quote is saying: Try to use normal control mechanisms ('if', etc.) rather than 'begin/rescue/end', or else just let some outer thing handle it.
<rking>
Quadlex: Exactly. And I'm still waiting on examples where we have that kind of sureity.
<Quadlex>
And that's it's clear to those who come after you
robbyoconnor has joined #ruby
vagmi has quit [Ping timeout: 252 seconds]
tylersmith has quit [Quit: tylersmith]
<rking>
Right. And it doesn't encourage others to write 'rescue nil' where it's not sure.
<Quadlex>
rescue => e isn't very intention revealing unless there's very little between the eing and the rescue
vagmi has joined #ruby
crackfu has quit [Remote host closed the connection]
<Quadlex>
s/eing/begin/
edward_ has quit [Ping timeout: 258 seconds]
twoism has quit [Ping timeout: 256 seconds]
<rking>
Right, though if you follow the "keep methods short" goal, there shouldn't ever be. ☺
<rking>
Talking about ideals, here, of course. Code written by people that don't strive for that exists.
<Quadlex>
That's fair enough
<rking>
(And must be maintained)
<Quadlex>
That's another thing this code is doing:P
jrajav has quit [Quit: I tend to be neutral about apples]
robbyoconnor has quit [Remote host closed the connection]
<rking>
bnagy: No examples? =(
<bnagy>
rking: no, because I have better things to do
<rking>
But you did have time to write the snarky line.
<rking>
Heat: 1, Light: 0
xkickflip has joined #ruby
<bnagy>
examples are irrelevant to the debate, insofar as there is one, because I don't quite get what point you're making
macmartine has joined #ruby
<bnagy>
that you think all exceptions should be handled at toplevel?
<bnagy>
That you think programs should just exit as soon as anything raises?
<bnagy>
yes, but it's trivially correct, which is hardly relevant to the argument
<bnagy>
it's just a clean exit
vagmi has quit [Ping timeout: 258 seconds]
mercwithamouth has joined #ruby
<rking>
I'm saying that: a) 'rescue nil' hides a lot. Most things I see it hiding I would've rather seen go up a level. b) If an error condition is expected, then it's not an "exception", and can be better handled via 'if' than 'rescue', if for no other reason than the communication to other programmers.
<bnagy>
sadly, that's the only one in that whole project :/
vagmi has joined #ruby
<rking>
Well, what's the exception that it's rescuing?
<bnagy>
yes but your experience of code you have seen is not actually a sound basis for prescribing an approach that is perfectly sound in the right cases
<bnagy>
rking: can't remember and it doesn't matter because the program is exiting at that point
twoism has joined #ruby
<rking>
True, but if I don't state my theories, I'll not get them invalidated as quickly.
<bnagy>
and whatever it is, nothing can be done to fix it from that side of the DRb pipe
<rking>
It does matter, very much.
<rking>
Because perhaps the user needs to know about a problem.
<rking>
But I'm only speaking in generalities on that one, I admit.
Davey has joined #ruby
twoism_ has joined #ruby
uris has quit [Quit: Leaving]
<vandemar>
suppose I have func1 with dozens of calls similar to func2(data, :param) with varying params. Is there a way have some func3(:param) such that it calls func2(data, :param) with the data from func1's scope?
andersbr has joined #ruby
<bnagy>
uh.. probably a code example would help with that
<bnagy>
the correct but useless answer is yes, you could pass a binding around, but it's 99.9% likely it's totally the wrong approach
<sshack>
What's the generally accepted way to get ruby 1.9 on osx? I've got the macports version installed, but don't know how to make that the default.
<sshack>
so things like ruby gems uses the old 1.8 system version.
__main__ has joined #ruby
<bnagy>
sshack: there isn't one
<bnagy>
personally I recommend chruby or rbenv
eykosioux has quit [Remote host closed the connection]
<sshack>
bnagy: That's the answer I was afraid of.
<bnagy>
system rubies vs user account rubies is a bit fraught as a topic
hagzag has joined #ruby
<bnagy>
imvho there's not much point in a system ruby on osx
<sshack>
I actually only want to use one tool written in ruby peewee, which has a (distant) depdencancy on gssapi. Which requires ruby 1.9
<bnagy>
but web devs would probably disagree
<sshack>
I disagree. If you've ever used solaris or eco, you know what hell it is to love without tools.
<bnagy>
eh?
<bnagy>
I just mean I think it's a lot easier and cleaner to use user rubies
<sshack>
That's what I was talking about.
<sshack>
SCO and solaris shipped so stripped down (and tried to make you pay $200 for pretty much each individual program) that even installing a user app was difficult.
miso1337 has joined #ruby
<sshack>
emacs, tcp/ip, backup, http, perl were all paid additional extras.
Inside has quit [Ping timeout: 264 seconds]
<sshack>
iirc, tcpip was $500.
Liothen has quit [Ping timeout: 245 seconds]
<bnagy>
cool story
<bnagy>
anyway
<bnagy>
I've never had much luck with the ports version, and never had any luck at all with the system version
<sshack>
bnagy: Yeah sorry. PTSD.
<bnagy>
unless you need to run some ruby crap as root, heaven forbid, then using chruby or rbenv is clean and easy
<sshack>
Alright. Well, i'm attempting rvm now. We'll see how that goes.
divout has joined #ruby
<bnagy>
:(
<bnagy>
rvm is awful
kofno has joined #ruby
<sshack>
This does seem like a bit of a cluster. dozen different (incompatible) ways to do things.
<bnagy>
if you have a long unix background rvm is going to make you want to eyebleach
<sshack>
I wish I didn't.
hagzag has quit [Quit: Konversation terminated!]
miso1337 has quit [Quit: afk]
daniel_hinojosa has quit [Ping timeout: 255 seconds]
kofno has quit [Ping timeout: 258 seconds]
xkickflip has quit [Quit: xkickflip]
<_br_>
Someone have an opinion on the matter of client side templating vs server side templating particular in the context of all the Javascript MV* mess?
Jedi_SCT1 has quit [Quit: See ya]
xkickflip has joined #ruby
<bnagy>
you might be better off in one of the rails channels
<bnagy>
I think they're one or more of #rails #ror or #rubyonrails
<_br_>
don't really care of rails in particular, could try though... thanks
Jedi_SCT1 has joined #ruby
huoxito has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
osvico has joined #ruby
yacks has joined #ruby
miso1337 has joined #ruby
jeka-91 has joined #ruby
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
beneggett has joined #ruby
krz has quit [Quit: krz]
xpen has joined #ruby
twoism_ has quit [Read error: Connection reset by peer]
twoism has joined #ruby
MrZYX is now known as MrZYX|off
Es0teric has quit [Read error: Connection reset by peer]
mattbl has joined #ruby
hamakn has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 256 seconds]
bradhe has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
PanPan has quit [Quit: ChatZilla 0.9.90 [Firefox 19.0.2/20130307023931]]
agent_white has quit [Quit: Leaving]
radic has quit [Disconnected by services]
PanPan has joined #ruby
mockra has joined #ruby
radic_ has joined #ruby
mockra_ has joined #ruby
tgunr has joined #ruby
xpen has quit [Read error: Connection reset by peer]
miso1337_ has joined #ruby
tealmage has joined #ruby
mattbl has quit [Quit: This computer has gone to sleep]
hadees has quit [Quit: hadees]
mockra has quit [Ping timeout: 256 seconds]
rabidpraxis has joined #ruby
bradhe has joined #ruby
thufir_ has joined #ruby
mockra_ has quit [Ping timeout: 256 seconds]
rickmasta has joined #ruby
miso1337 has quit [Ping timeout: 264 seconds]
miso1337_ is now known as miso1337
bluOxigen has joined #ruby
tomzx_mac has quit [Ping timeout: 252 seconds]
rippa has joined #ruby
justsee has joined #ruby
justsee has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
tealmage has quit [Ping timeout: 252 seconds]
rabidpraxis has quit [Ping timeout: 245 seconds]
hbpoison has quit [Ping timeout: 252 seconds]
crackfu has quit [Remote host closed the connection]
roadt has quit [Remote host closed the connection]
roadt has joined #ruby
hadees has joined #ruby
girija has joined #ruby
sshack has quit [Quit: sshack]
miso1337 has quit [Quit: afk]
bradhe has quit [Remote host closed the connection]
dmiller2 has quit [Quit: WeeChat 0.4.0]
ARCADIVS has joined #ruby
hamakn has joined #ruby
matayam has joined #ruby
yashshah_ has joined #ruby
yashshah_ has quit [Read error: Connection reset by peer]
yashshah- has joined #ruby
mockra has joined #ruby
a_a_g has joined #ruby
rickmasta has quit [Quit: Leaving...]
wallerdev has quit [Quit: wallerdev]
reset has joined #ruby
ckrailo has quit [Quit: Computer has gone to sleep.]
Jedi_SCT1 has quit [Quit: See ya]
tcstar has joined #ruby
miso1337 has joined #ruby
Jedi_SCT1 has joined #ruby
slash_nick has joined #ruby
chrishough has quit [Quit: chrishough]
kofno has joined #ruby
verysoftoiletppr has joined #ruby
pepper_chico has joined #ruby
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby
pepper_chico has quit [Max SendQ exceeded]
bradhe has joined #ruby
kofno has quit [Ping timeout: 258 seconds]
pepper_chico has joined #ruby
pepper_chico has quit [Max SendQ exceeded]
pepper_chico has joined #ruby
pepper_chico has quit [Max SendQ exceeded]
ckrailo has joined #ruby
pepper_chico has joined #ruby
brianpWins has joined #ruby
ckrailo has quit [Client Quit]
tonini has joined #ruby
ckrailo has joined #ruby
ckrailo has quit [Client Quit]
wargasm has left #ruby [#ruby]
Faris has joined #ruby
mercwithamouth has quit [Ping timeout: 264 seconds]
a_a_g1 has joined #ruby
headius has quit [Quit: headius]
mattbl has joined #ruby
ananthakumaran has joined #ruby
flexd has quit [Ping timeout: 240 seconds]
bradleyprice has quit [Remote host closed the connection]
<shevy>
_br_ I am sad that I cant use ruby rather than javascript :(
ckrailo has joined #ruby
hamakn has quit [Remote host closed the connection]
<shevy>
rking yeah that was what I always wondered... begin/rescue/end seems to be rather similar to if/else/end. aaaand there is catch/throw on top of that, which somehow reminds me of goto
<shevy>
now that we have require_relative
<shevy>
I want a
<shevy>
require_safe
a_a_g has quit [Ping timeout: 264 seconds]
<shevy>
I may well file a feature request (but they will shoot it down :< )
ananthakumaran has quit [Read error: Connection reset by peer]
<shevy>
kids are away, must learn, parents can be LAZY
ananthakumaran1 has joined #ruby
toekutr has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<Hanmac>
the first day i wanted to goto scool ... but then no more .. :/
<hemanth>
does lazy sample make any sense ? [bangy just gave a boolean answer and left...] i'm curious about that
a_a_g1 has quit [Ping timeout: 246 seconds]
rabidpraxis has joined #ruby
hbpoison has joined #ruby
io_syl has quit [Ping timeout: 245 seconds]
andersbr has quit [Quit: andersbr]
<shevy>
Hanmac lol
NightCreature is now known as SDr
jgrevich has joined #ruby
io_syl has joined #ruby
<bnagy>
hemanth: to me it would be a sample of a series where regions can be calculated lazily
toekutr has joined #ruby
<hemanth>
bnagy, bit confusion, random lazy sample ? o_0
ckrailo has quit [Quit: Computer has gone to sleep.]
<bnagy>
well sample is random by nature
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
flexd has joined #ruby
rabidpraxis has quit [Ping timeout: 252 seconds]
<hemanth>
and lazy randomness means?
<bnagy>
it's not lazy randomness, it's a lazy sample
<hemanth>
a lazy take sound meaningful, but a lazy sample does not
<bnagy>
how would you sample from prime numbers between 2 and 2**64?
a_a_g has quit [Ping timeout: 256 seconds]
<hemanth>
bnagy, find the limits and pick a random index within that limit?
<bnagy>
so you'd start by calculating all primes within that range?
<hemanth>
no! that would be ages
<bnagy>
so you'd do it lazily then?
<hemanth>
yes :-)
tish has joined #ruby
<bnagy>
so that would be a lazy sample then?
xcv has quit [Ping timeout: 256 seconds]
<hemanth>
hmm, true.
<bnagy>
glad I could help
<hemanth>
bnagy, heh heh, so defining laziness in one line would be _________
subbyyy has quit [Ping timeout: 264 seconds]
<bnagy>
not doing work unless it's required
xcv has joined #ruby
twoism has quit [Remote host closed the connection]
<hemanth>
do just as much as needed?
luckyruby has quit [Remote host closed the connection]
heliumsocket has quit [Quit: heliumsocket]
<shevy>
delegating the work to a later time
<shevy>
outsourcing it to india
icole has joined #ruby
mahmoudimus has joined #ruby
tcopp has quit [Ping timeout: 260 seconds]
<hemanth>
shevy, :D
Opettaja has joined #ruby
hamakn has quit [Remote host closed the connection]
<Hanmac>
shevy i heard that they outsource "captcha" solving to china :P
timonv has joined #ruby
wargasm has left #ruby [#ruby]
<shevy>
yeah
<shevy>
so the only ones annoyed by captchas
<shevy>
are real people
dhruvasagar has joined #ruby
Faris has quit [Ping timeout: 264 seconds]
bradhe has quit [Remote host closed the connection]
<Hanmac>
shevy i think for my github ruby-gems projects i think i should outsource the documentation-writing too :P
<Hanmac>
... now i need to find someone that can understand my code :D
d2dchat has quit [Remote host closed the connection]
hamakn has joined #ruby
a_a_g has joined #ruby
banisterfiend has quit [Ping timeout: 260 seconds]
<shevy>
:P
mootpointer has quit [Quit: Computer has gone to sleep.]
mattbl has quit [Quit: This computer has gone to sleep]
arietis has joined #ruby
Jalada has quit [Ping timeout: 264 seconds]
Faris has joined #ruby
Mon_Ouie has joined #ruby
cconstantine_ has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
Jalada has joined #ruby
carraroj has joined #ruby
HecAtic has joined #ruby
<Hanmac>
shevy the good thing when i define attributes, it takes one code line but when i document them thery are minimum 5 lines comment :P
<cconstantine_>
hey all, I'm trying to make a gem with a script in ./bin . The script runs all right when I run it directly, but it won't run from an install. Could someone help?
<hemanth>
Hanmac, type these chinesse chars to enter the site. (promise that you are 18+) :D
<Hanmac>
hemanth normaly i dont have time or topics to blog ... something like "added 5 new classes to rwx this week, still no time to document them and still to end in view"
<shevy>
Hanmac hmmm
vagmi has joined #ruby
MrZYX is now known as MrZYX|off
Ontolog has joined #ruby
<hemanth>
Hanmac, yes, that why i suugested one liners, I know rwx is big and just a simple redirection to a file would eat much of your time
<shevy>
prety cool
* hemanth
I want others also to enjoy your witty one liners!
codecop has joined #ruby
<hemanth>
shevy, we can as well write a bot that runs here and parses all Hanmac>> ;) ?
emergion has joined #ruby
<Hanmac>
xD
andikr has joined #ruby
wadexing has quit [Ping timeout: 258 seconds]
<hemanth>
Hanmac, can that be an one liner as well :D
<Hanmac>
hemanth: well as you can see there is a second hanmac there :P
<Hanmac>
so i only need to grep the logs :D
dhruvasagar has quit [Ping timeout: 264 seconds]
<hemanth>
Hanmac, ya for you it's just the logs, Hanmac == bot; AOL (Always online)
workmad3 has joined #ruby
<Hanmac>
hemanth its my Home pc that is logging while i am at work
<hemanth>
Hanmac2, please grep!
<hemanth>
Hanmac, heh heh
dhruvasagar has joined #ruby
Hanmac has quit [Quit: Leaving.]
<hemanth>
Hanmac ssh to Hanmac2 and run festival or espeak :D (Hope you have speakers and they are on)
apeiros_ has joined #ruby
shevy has quit [Ping timeout: 240 seconds]
mafolz has joined #ruby
osvico has quit [Ping timeout: 246 seconds]
matayam has joined #ruby
dr_bob has joined #ruby
danneu has quit [Ping timeout: 252 seconds]
kofno has joined #ruby
danneu has joined #ruby
nomenkun has joined #ruby
mootpointer has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
Nisstyre-laptop has quit [Quit: Leaving]
dawkirst has quit [Ping timeout: 260 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
kofno has quit [Ping timeout: 255 seconds]
<hemanth>
for method_chaining just returing self in the required method is fine, or you guys use a diff method?
blaxter has joined #ruby
zigomir has joined #ruby
tiennou has joined #ruby
ananthakumaran has joined #ruby
mootpointer has quit [Ping timeout: 276 seconds]
shevy has joined #ruby
brianpWins has quit [Quit: brianpWins]
ananthakumaran1 has quit [Ping timeout: 264 seconds]
nomenkun has quit [Remote host closed the connection]
Morkel has joined #ruby
crackfu has joined #ruby
nomenkun has joined #ruby
* hemanth
TIL : Japanese has one of the hardest way of counting. They have different counters for small animals, people, things etc.
josefrichter_ has joined #ruby
mootpointer has joined #ruby
generalissimo has quit [Remote host closed the connection]
<solidus-lake>
its a return statement but its stupid to call self.project twice
Nisstyre-laptop has joined #ruby
<bnagy>
self.project || self.article
<bnagy>
although self seems a bit redundant, unless your code is odd
pduin has joined #ruby
krz has joined #ruby
miso1337 has quit [Read error: Connection reset by peer]
Vainoharhainen has joined #ruby
miso1337_ has joined #ruby
Myk267 has joined #ruby
Hanmac has joined #ruby
Netfeed has joined #ruby
<Netfeed>
hi, so i succeded with segfaulting ruby when loading(by mistake) an m4v file into nokogiri, is this a bug that should be reported or just leave that as my failure?
ryanf has joined #ruby
sayan has quit [Read error: Connection reset by peer]
browndawg has quit [Quit: Leaving.]
mercwithamouth has quit [Ping timeout: 240 seconds]
emergion has joined #ruby
hasimo-t has quit [Remote host closed the connection]
<bnagy>
do you have a pastie of the crash?
Amnesia has quit [Ping timeout: 245 seconds]
hasimo-t has joined #ruby
chussenot has joined #ruby
MrZYX|off is now known as MrZYX
rabidpraxis has joined #ruby
tealmage has joined #ruby
three18ti has quit [Ping timeout: 276 seconds]
<Netfeed>
no, but i could fix that
<Netfeed>
got the logs
bigkevmcd has quit [Read error: Connection reset by peer]
three18ti has joined #ruby
hamakn has quit [Quit: Leaving...]
hamakn has joined #ruby
<bnagy>
it's very likely a bug in _something_ just depends if you popped libxml / libxslt or ruby itself
thebastl has joined #ruby
samuel02 has joined #ruby
riginding has joined #ruby
<bnagy>
if I were betting I would say libxml2
rabidpraxis has quit [Ping timeout: 246 seconds]
crackfu has quit [Remote host closed the connection]
<apeiros_>
a segfault is always a bug
bigkevmcd has joined #ruby
<apeiros_>
code should fail gracefully on invalid input
<pac1>
I keep getting svn: E175002: Unable to connect
yashshah- has joined #ruby
<Hanmac>
svn is so 80' :D
skbierm has joined #ruby
freeayu has joined #ruby
cibs has joined #ruby
hadees has quit [Ping timeout: 260 seconds]
francisfish has quit [Remote host closed the connection]
robustus has quit [Ping timeout: 276 seconds]
_JamieD_ has joined #ruby
vagmi has joined #ruby
<Sicp>
use Git, pac1
foofoobar has quit [Quit: Computer has gone to sleep.]
hasimo-t has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
robustus has joined #ruby
thebastl has quit [Ping timeout: 246 seconds]
Bry8Star_ is now known as Bry8Star
hadees has joined #ruby
wmoxam has joined #ruby
<JonnieCache>
thats not going to help him check out his svn repo though is it
foofoobar has joined #ruby
wodKa has joined #ruby
<JonnieCache>
pac1: checks out fine for me
timmow has quit [Read error: Connection reset by peer]
sandGorgon has joined #ruby
Spooner_ has joined #ruby
timmow has joined #ruby
wargasm1 has quit [Read error: Connection timed out]
wargasm has joined #ruby
lkba has joined #ruby
lkba has quit [Client Quit]
lkba has joined #ruby
freakazoid0223 has quit [Read error: Connection timed out]
nomenkun has joined #ruby
BSaboia has joined #ruby
freakazoid0223 has joined #ruby
Uranio has quit [Ping timeout: 260 seconds]
nomenkun_ has joined #ruby
gyre007 has joined #ruby
Uranio has joined #ruby
kofno has joined #ruby
moted has quit [Ping timeout: 258 seconds]
Zai00 has joined #ruby
dr_bob1 has joined #ruby
nomenkun has quit [Ping timeout: 256 seconds]
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
aishwarya has joined #ruby
linoge has joined #ruby
dr_bob has quit [Ping timeout: 240 seconds]
emergion has joined #ruby
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
<aishwarya>
hi i want to find the first date of the week, given a week number
<aishwarya>
But the problem is the year starts on April
<aishwarya>
and not January
<linoge>
Hey guys, I'm doing some work learning regexp and I got a little doubt. Assuming I have a list of names, separated by comma, how would I test if there is an extra comma at the end. e.g "carlos, michelle" would match, but "carlos,michelle," wouldn't... Is that even possible?
wmoxam has quit [Ping timeout: 252 seconds]
<aishwarya>
Date.commercial is a solution, but the year begins in January
mikurubeam has quit [Ping timeout: 276 seconds]
<linoge>
Oh, and sorry if the grammar/spelling is wrong. Mothertongue.english? == false
sepp2k has joined #ruby
maxmanders has joined #ruby
statarb3 has joined #ruby
statarb3 has joined #ruby
swingha has joined #ruby
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
<Spooner_>
linoge, If it doesn't match: /,\z/
stefioan has joined #ruby
stefioan is now known as bookies
<tobiasvl>
aishwarya: can't you just do some math on the week numbers? if you know what week the (fiscal?) year starts
emergion has quit [Quit: Computer has gone to sleep.]
philipd has quit [Quit: Computer has gone to sleep.]
Domon has quit [Remote host closed the connection]
<linoge>
Spooner_: checking :)
<aishwarya>
tobiasvl: can you give an example?
sonda has joined #ruby
<Spooner_>
linoge, Or, more simply, str[-1] != ","
<Hanmac>
you could use DateTime.strptime("2013 12","%Y %U") or DateTime.strptime("2013 12","%Y %W")
<Spooner_>
linoge, Well, either works. This simple case would be easier with just string comparison, unless you want to ensure that the whole string is "valid" rather than just thetrailing comma.
faen has quit [Remote host closed the connection]
thufir_ has quit [Read error: Connection reset by peer]
bnagy has quit [Ping timeout: 260 seconds]
foofoobar has quit [Quit: Computer has gone to sleep.]
hasimo-t_ has joined #ruby
hasimo-t_ has quit [Remote host closed the connection]
hasimo-t has quit [Read error: Connection reset by peer]
grayson has joined #ruby
<aishwarya>
<tobiasvl> <Hanmac> thanks
BSaboia has quit [Ping timeout: 258 seconds]
BSaboia has joined #ruby
faen has joined #ruby
Hanmac2 has joined #ruby
Hanmac has quit [Ping timeout: 264 seconds]
philipd has joined #ruby
philipd has quit [Max SendQ exceeded]
<linoge>
Spooner_: Yes, I want to verify the whole string is valid. I'm just killing off some time by doing some research on compilers before the university starts and thought that doing something on my own before reading the book would be better. So I'm writing a little program that translates code in a generic language to C and I need to validate whether a function definition "type func_name ( param1, param2 )" is
<linoge>
valid or not :)
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
maxmanders has quit [Quit: Computer has gone to sleep.]
<Spooner_>
There are better ways to parse that than with a regexp, linoge - you'll only get so far if you do it that way rather than generating a proper AST.
bnagy has joined #ruby
<apeiros_>
Hanmac1: with %W you must not use %Y, your year may be off. you need %G
<linoge>
Spooner_: Well, I'm quite sure you're right, as I did read something before starting. But I think it will be funny to realize all by myself that an abstract syntax tree is the way to go :)
jgrau has quit [Remote host closed the connection]
jonathanwallace has quit [Quit: WeeChat 0.3.9.2]
jgrau has joined #ruby
jon_w has joined #ruby
_64k has joined #ruby
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
girija_ has joined #ruby
jonathanwallace has joined #ruby
girija_ has quit [Read error: Connection reset by peer]
girija_ has joined #ruby
girija has quit [Read error: Connection reset by peer]
swex has quit [Quit: No Ping reply in 180 seconds.]
swex has joined #ruby
jpcamara has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
subbyyy has joined #ruby
heftig has joined #ruby
francisfish has joined #ruby
chussenot has quit [Quit: chussenot]
hasimo-t has joined #ruby
pac1 has quit [Ping timeout: 256 seconds]
nari has quit [Ping timeout: 245 seconds]
girija_ has quit [Read error: Connection reset by peer]
girija_ has joined #ruby
girija_ has quit [Read error: Connection reset by peer]
girija_ has joined #ruby
j303 has joined #ruby
hasimo-t_ has joined #ruby
girija_ has quit [Read error: Connection reset by peer]
girija_ has joined #ruby
hasimo-t has quit [Ping timeout: 260 seconds]
jgrau has quit [Remote host closed the connection]
girija_ has quit [Read error: Connection reset by peer]
jgrau has joined #ruby
girija_ has joined #ruby
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
Nisstyre-laptop has quit [Quit: Leaving]
tonini has joined #ruby
rabidpraxis has joined #ruby
presto53 has joined #ruby
bluenemo has quit [Quit: Verlassend]
tealmage has joined #ruby
jgrau has quit [Remote host closed the connection]
yashshah- is now known as yashshah
jgrau has joined #ruby
sailias has quit [Quit: Leaving.]
jgrau has quit [Remote host closed the connection]
nomenkun has joined #ruby
jgrau has joined #ruby
palyboy has joined #ruby
realDAB has joined #ruby
Banistergalaxy has quit [Ping timeout: 252 seconds]
mmitchell has quit [Remote host closed the connection]
mljsimone has joined #ruby
mikurubeam has joined #ruby
BSaboia has quit [Ping timeout: 258 seconds]
nomenkun_ has quit [Ping timeout: 255 seconds]
Banistergalaxy has joined #ruby
emergion has joined #ruby
hasimo-t has joined #ruby
rabidpraxis has quit [Ping timeout: 256 seconds]
emocakes has joined #ruby
hasimo-t_ has quit [Ping timeout: 260 seconds]
bnagy has quit [Ping timeout: 256 seconds]
hasimo-t has quit [Read error: Connection reset by peer]
hasimo-t_ has joined #ruby
tonini_ has joined #ruby
tealmage has quit [Ping timeout: 256 seconds]
mark_locklear has joined #ruby
tonini has quit [Ping timeout: 248 seconds]
emergion has quit [Client Quit]
hasimo-t has joined #ruby
jgrau has quit [Remote host closed the connection]
jgrau has joined #ruby
tealmage has joined #ruby
hasimo-t_ has quit [Ping timeout: 256 seconds]
NiteRain has quit [Ping timeout: 246 seconds]
Faris has joined #ruby
divout has quit [Quit: Leaving.]
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
jeka-91 has quit [Quit: Leaving]
hasimo-t has quit [Read error: Connection reset by peer]
hasimo-t has joined #ruby
jgrau has quit [Remote host closed the connection]
Xeago has quit [Remote host closed the connection]
jgrau has joined #ruby
mabs29 has quit [Quit: just too busy for words]
mikurubeam has joined #ruby
Neomex has quit [Quit: Neomex]
matayam has quit [Remote host closed the connection]
_JamieD_ has quit [Ping timeout: 252 seconds]
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
andikr has quit [Ping timeout: 255 seconds]
AndChat| has joined #ruby
andikr has joined #ruby
mikurubeam has quit [Ping timeout: 256 seconds]
mikurubeam has joined #ruby
swounding60 has quit [Ping timeout: 264 seconds]
sambio has joined #ruby
hasimo-t has quit [Read error: Connection reset by peer]
Banistergalaxy has quit [Ping timeout: 260 seconds]
girija__ has joined #ruby
bnagy has joined #ruby
girija_ has quit [Read error: Connection reset by peer]
mikurubeam has quit [Client Quit]
linoge has quit [Quit: WeeChat 0.4.0]
miso1337 has joined #ruby
ArchBeOS has joined #ruby
ArchBeOS has quit [Changing host]
ArchBeOS has joined #ruby
ArchBeOS has left #ruby [#ruby]
girija__ has quit [Read error: Connection reset by peer]
miso1337 has quit [Client Quit]
girija__ has joined #ruby
hasimo-t has joined #ruby
rmartin_ has quit [Remote host closed the connection]
luizk has joined #ruby
elico has joined #ruby
carloslopes has joined #ruby
swounding60 has joined #ruby
marr has joined #ruby
thisirs has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
elico has quit [Remote host closed the connection]
francisfish has quit [Remote host closed the connection]
francisfish has joined #ruby
nari has joined #ruby
vagmi has quit [Ping timeout: 256 seconds]
matayam has joined #ruby
skattyadz has quit [Quit: skattyadz]
osvico has joined #ruby
girija__ has quit [Read error: Connection reset by peer]
girija__ has joined #ruby
vagmi has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
subbyyy has quit [Ping timeout: 256 seconds]
francisfish has quit [Ping timeout: 256 seconds]
tish has quit [Quit: Leaving.]
_JamieD_ has joined #ruby
Hanmac2 has quit [Read error: Connection reset by peer]
matayam has quit [Remote host closed the connection]
MrZYX|off is now known as MrZYX
Kirotan has joined #ruby
rabidpraxis has quit [Ping timeout: 252 seconds]
MrZYX is now known as MrZYX|off
bluOxigen has joined #ruby
emocakes has quit [Quit: emocakes]
r0f0 has joined #ruby
sailias has joined #ruby
chussenot has joined #ruby
headius has joined #ruby
tcstar has quit [Remote host closed the connection]
andersbr has quit [Quit: andersbr]
m8 has joined #ruby
wmoxam has joined #ruby
francisfish has quit [Remote host closed the connection]
tmiller has joined #ruby
tealmage has quit [Remote host closed the connection]
francisfish has joined #ruby
hemanth has quit [Quit: This computer has gone to sleep]
flayer has joined #ruby
<flayer>
#/join c
andersbr has joined #ruby
<flayer>
oops, disregard that
kofno has joined #ruby
jerius has joined #ruby
jgarvey has joined #ruby
tcopp has joined #ruby
francisfish has quit [Ping timeout: 264 seconds]
bradleyprice has joined #ruby
jpcamara has joined #ruby
akashj87 has joined #ruby
andersbr has quit [Client Quit]
<Hanmac>
ahh a C user! NULL ptr him! :P
shtirlic has joined #ruby
SCommette has quit [Quit: SCommette]
stevechiagozie has joined #ruby
andersbr has joined #ruby
girija__ has quit [Read error: Connection reset by peer]
girija__ has joined #ruby
mmitchell has joined #ruby
<apeiros_>
Hanmac: I once implemented NilPointerException in ruby for a friend of mine who always said "Null pointer exception" for NoMethodErrors on nil
jtharris has joined #ruby
<apeiros_>
i.e. nil.foo # !> NilPointerException :D
apod has quit []
cmarques has joined #ruby
darmou has joined #ruby
gcds has joined #ruby
<gcds>
Hello
danman has joined #ruby
<gcds>
its only for me rvm.io not working?
ndboost has quit [Remote host closed the connection]
<darmou>
Hi all I'm trying to start rails c from the terminal and getting Rails::Console::IRB::ExtendCommandBundle and getting console.rb:46:in `start': uninitialized constant Rails::Console::IRB::ExtendCommandBundle (NameError)
ndboost has joined #ruby
<darmou>
do I need to require something somewhere?
codenapper has joined #ruby
<apeiros_>
gcds: there are entire brigades of websites dedicated to that question…
ndboost has quit [Read error: Connection reset by peer]
<apeiros_>
oh, Hanmac beat me to it :(
<Hanmac>
gcds ... your shiftkey is hangging :P
Frederick has quit [Ping timeout: 245 seconds]
<darmou>
googling the error did not help sigh
hemanth has joined #ruby
<darmou>
perhaps I'm missing a gem file?
<Hanmac>
apeiros_ hm i may need something similar to the NilPointerException when the C++ side deleted the object and then the ruby side wants to call a function from it
<Hanmac>
darmou try again in #rubyonrails
<Hanmac>
darmou: try again in #rubyonrails
<darmou>
thanks Hanmac, much appreciated
adkron_ has joined #ruby
m8 has quit [Quit: Sto andando via]
krawchyk has joined #ruby
wf2f has quit []
sambao21 has joined #ruby
girija__ has quit [Ping timeout: 258 seconds]
tmiller has quit [Remote host closed the connection]
<rdark>
So.. I'm breaking a script down into a more modular format. I have a parent module, say 'storage', and then a pair of classes (Yaml/Json). Each class exposes a read/write method, but I want to wrap these in the parent module, exposed via methods of the same name. can anyone point me to some example code of a good/clean way to do this?
hemanth has quit [Remote host closed the connection]
solidoodlesuppor has quit [Read error: Connection reset by peer]
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
sheerun has joined #ruby
sheerun has quit [Max SendQ exceeded]
osvico has quit [Ping timeout: 264 seconds]
zigomir has quit [Quit: zigomir]
sheerun has joined #ruby
sheerun has quit [Max SendQ exceeded]
ffranz has joined #ruby
sheerun has joined #ruby
newUser1234 has joined #ruby
sheerun has quit [Max SendQ exceeded]
sambao21 has quit [Quit: Computer has gone to sleep.]
thufir_ has joined #ruby
sheerun has joined #ruby
sheerun has quit [Max SendQ exceeded]
<Hanmac>
lessless as you can see, when you include a module into an ancestor chain, it does build an iClass object (not copyrighted by Apple) and then it connects fits itself between the Class/Module and its parent
sheerun has joined #ruby
sheerun has quit [Max SendQ exceeded]
zigomir has joined #ruby
sheerun has joined #ruby
sheerun has quit [Max SendQ exceeded]
__main__ has quit [Remote host closed the connection]
danman has quit [Quit: danman]
pitzips has joined #ruby
sheerun has joined #ruby
<lessless>
this blog is uber useful :D
sheerun has quit [Max SendQ exceeded]
<Xeago>
Hanmac: mind telling me what that was a reply to?
jonahR has quit [Remote host closed the connection]
xpen has quit [Ping timeout: 256 seconds]
jonahR has joined #ruby
<BryanWB>
Spooner_, tks a ton
nobitanobi has joined #ruby
wolcanus has joined #ruby
icole has joined #ruby
lolzie has joined #ruby
Zai00 has joined #ruby
<Spooner_>
cr3, You could have "if defined? Rspec; describe...end; end" at the end of the file. Still, makes less sense than just writing the spec separately.
<Spooner_>
cr3, Then when you run the script via "rspec myscript.rb" rather than "ruby myscript.rb" you'll get the test to run.
jonahR has quit [Remote host closed the connection]
<lolzie>
In my class I have created a var=() method. It should have a side-effect, which to function needs another value passed to it. Is creating setVar("value", otherObj) the right solution?
<lolzie>
It feels too... Java-y.
megha has joined #ruby
zigomir has quit [Quit: zigomir]
<Spooner_>
lolzie, If it requires two values, then you aren't setting a single value, so #= isn't appropriate.
<JonnieCache>
yep. you need to go back to the drawing board
<lolzie>
Spooner_: profound observation
<lolzie>
(Seriously. hehe)
angusiguess has joined #ruby
<Spooner_>
The right name for the method rather depends on the context.
phantasm66 has joined #ruby
phantasm66 has quit [Changing host]
phantasm66 has joined #ruby
nomenkun_ has quit [Remote host closed the connection]
<JonnieCache>
maybe it should be do_action(thing, other_thing)
<Hanmac>
you can do self.var = [value,otherObj] .... but self[:var,"value"] = otherObj would be more cool
<lolzie>
let's say it was for an IRC channel, and you wanted to set its topic - and it needs the topic content and the user who set it
<JonnieCache>
or thing=(thing) other_thing=(other_thing) and do_action()
jonahR has joined #ruby
love_color_text has joined #ruby
ttt_ has quit [Remote host closed the connection]
<JonnieCache>
where do_action() raises an exception if thing and other_thing havent been set yet
<lolzie>
They're very much part of the same operation of course
<Spooner_>
set_topic(topic, user) sounds fine to me.
<lolzie>
Thanks :)
jonahR has quit [Remote host closed the connection]
<lolzie>
Maybe it was the camelCase that made me feel dirty
<Spooner_>
Camels bad, snakes good!
cmarques_ has quit [Remote host closed the connection]
<failshell>
hello. is there a way with ruby to find if a file system is formatted?
<JonnieCache>
nah dude it would have to be `new userChannelTopicSetterFactory()` before you feel bad
cmarques has joined #ruby
guiguidoc has joined #ruby
cupakromer has left #ruby [#ruby]
<lolzie>
JonnieCache: +1 that made me chuckle hehe
uris has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
v0n has joined #ruby
angusiguess has quit [Ping timeout: 264 seconds]
nomenkun_ has joined #ruby
carloslopes has joined #ruby
<Hanmac>
failshell i dont think so
tish has joined #ruby
sambao21 has joined #ruby
nobuoka has quit [Ping timeout: 272 seconds]
[eDu] has joined #ruby
josefrichter_ has joined #ruby
hasimo-t has quit [Read error: Connection reset by peer]
hasimo-t has joined #ruby
hasimo-t has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
<shevy>
Hanmac problem is (a) they talk about that company (b) they bought a product
<shevy>
it's like advertisement still
angusiguess has joined #ruby
<Hanmac>
shevy for bananaphones? :P
jcheng has joined #ruby
NotMyself has joined #ruby
pskosinski has joined #ruby
<bean>
why would you do that to your phone iphone5
<bean>
(
j^2 has joined #ruby
<bean>
poor phone
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
Mon_Ouie has joined #ruby
<bean>
poor iphone5*
<bean>
ireally can't type today
<bean>
wowow
Giorgio has quit [Ping timeout: 252 seconds]
<shevy>
Hanmac in 2 months you will have forgotten about the negative part
alx- has quit [Quit: alx-]
<Hanmac>
bean: it melted because it doesnt withstand 35°C ... if you ask thats ~ body temperature
BSaboia has quit [Read error: Connection reset by peer]
Ohga has joined #ruby
<bean>
i've never had my iphone 5 melt
<bean>
or warp
BSaboia has joined #ruby
braoru has quit [Remote host closed the connection]
pavilionXP has joined #ruby
headius has quit [Quit: headius]
Pip has joined #ruby
<Pip>
How is Ruby 2.0?
<shevy>
Pip awful
emptymag00 has joined #ruby
<Pip>
Kidding?
<JonnieCache>
Pip: ignore him
<Pip>
lol
<shevy>
half kidding only
<JonnieCache>
it does have bugs obviously
<Ohga>
the beginner asks; what do you guys use for development? I get that ruby is a dynamic language, but is there something that can help with autocompletion or do you just go hardcore with notepad++ et.al?
<JonnieCache>
but nobody is reaching for words like "clusterfuck" or anything
<shevy>
Ohga I use a simple GTK based editor
<Ohga>
shevy: named..?
<shevy>
Ohga bluefish 1.0.7 most of the time
<JonnieCache>
Ohga: most people "go hardcore" with a traditional editor, yes
<JonnieCache>
its not actually hard
<csmrfx>
aha! \$foobar helps there!
<sam113101>
I use vim or sublime
chussenot has quit [Read error: Operation timed out]
* Ohga
is probably spoiled from visual studio and eclipse
_maes_ has joined #ruby
<JonnieCache>
Ohga: ruby APIs tend to be designed with this in mind, whereas lanuages with strong IDE support can get away with cryptic apis
soc42 has joined #ruby
chussenot has joined #ruby
<Hanmac>
Ohga i used eclipse for my C++ stuff i wrote for ruby, and sometimes for some ruby projects too ... but i know that autocompletion does not work well with ruby because of the extreme dynamicness
<shevy>
Ohga you need to use as little as possible and still get away with that in ruby
pyrac has quit [Ping timeout: 256 seconds]
NiteRain has joined #ruby
<Ohga>
JonnieCache: well, if you've worked with ruby a while, fine. but being new to it just make me stare at api docs all the time. I'd hope for at least a little help at the tip of the text cursor
<shevy>
this is the mistake
<shevy>
you want to use a fat API
<Ohga>
shevy: elaborate..
<shevy>
after 10 years of ruby I could not tell you all methods on String, Array, Hash
kpshek has joined #ruby
nari has quit [Ping timeout: 256 seconds]
<shevy>
Ohga all you need to do is just "think" in ruby
<JonnieCache>
Ohga: yeah its a different approach
<shevy>
it's the think your brain will do for you when you wrote a few .rb scripts from scratch
<shevy>
*thing
<shevy>
when you are there, then using eclipse or whatever is ok
<shevy>
like if you want to look up OptionParser quickly
<JonnieCache>
i still look up stuff in the docs in my browser a lot. it might be nice to have that integrated into my editor, but its really nowhere near as much of an issue as you might think
<shevy>
or the format strings %-04s or whatever it was, I forget that all the time
generalissimo has joined #ruby
<shevy>
I don't know how Hanmac manages to remember this all
<shevy>
he is using eclipse right? :)))
<Ohga>
I'm not saying I'm not reading documentation, I do. but these things complement each other..
alx- has joined #ruby
<Hanmac>
shevy for the formatstrings i so Ctrl-Shift-T to create an new Console and then look at "ri sprintf"
<shevy>
eclipse user!!!
<shevy>
ah ok, so you use ri
<shevy>
Ohga, there you are, copy Hanmac :)
<Ohga>
ok, well.. my other problem, related to this in a way, is that I just tried eclipse with a little ruby project and the std lib works perfectly.. trying to get autocompletion for Nokogiri on the other hand.. nothing
tonini has quit [Remote host closed the connection]
<Ohga>
so, and I would understand if no one here knows, how do I tell eclipse where my gems are?
<shevy>
yeah Hanmac how do you get autocompletion working for Nokogir!
<shevy>
*Nokogir
<shevy>
grrrr
<shevy>
I really tried to append an 'i' but it won't happen :(
wolcanus has quit [Remote host closed the connection]
* Ohga
comforts shevy
<Hanmac>
shevy no we are in the 22' ... we are not copy each other, we do it like in the dark age, we fork each other :D
dustint has quit [Ping timeout: 245 seconds]
<shevy>
ok fork each other then
<shevy>
(you little perverts ...)
wolcanus has joined #ruby
emanon_ has quit [Ping timeout: 252 seconds]
<shevy>
Ohga, I try to collect what seems useful and helpful to me in a local knowledge base
<Ohga>
shevy: que?
emanon_ has joined #ruby
jjbohn has joined #ruby
sayan has quit [Read error: Connection reset by peer]
<shevy>
Ohga well like a FAQ of some sorts, with lots of examples
sepp2k has quit [Quit: Leaving.]
<shevy>
"How do I fetch user input in ruby?
<shevy>
user_input = $stdin.gets.chomp
<Hanmac>
⋔
<Ohga>
shevy: is this from conversation prior to my joining? I'm not following..
headius has joined #ruby
Virunga has joined #ruby
<shevy>
Ohga when you said you don't know where to look at or what to use
<shevy>
example in nokogiri
<shevy>
what I would do is I start a subsection about nokogiri in my local knowledge base
carloslopes has quit [Remote host closed the connection]
danman has joined #ruby
wolcanus has quit [Ping timeout: 260 seconds]
<Ohga>
shevy: nokogiri were just an example that happen to apply to me.. What I'm after is having eclipse discover gems in addition to the ruby standard lib..
dhruvasagar has joined #ruby
<Ohga>
the question about IDEs were a pre-question to find out if some other IDE already handles this better..
bencc has joined #ruby
<bencc>
how can I wrap each element in array with some string?
<Spooner_>
bencc, You can't wrap something with a single string. Presume you mean two strings.
anonymuse has quit [Remote host closed the connection]
<Spooner_>
Mapping would make sense if you wanted to make a new Array, ratehr than output a string like that.
_hemanth has quit [Read error: Connection reset by peer]
<Spooner_>
Oops, did that wrong, bencc: %{[<<"#{fqdn.split(".").reverse.join('">>, <<"')}">>]} (bad use of quotes)
_hemanth has joined #ruby
<bencc>
what is #{?
<Hanmac>
bencc string interpolaratio
<Hanmac>
n
<Spooner_>
It is string interpolation in Ruby. e.g. x = 5; "frog#{x}fish" #=> "frog5fish"
Bira has quit [Ping timeout: 258 seconds]
<bencc>
thanks. will try it and be back in 20 minutes
<bencc>
thanks!
<Spooner_>
And %{ } is just an alternative syntax for " ", since it saves you escaping any " inside the string.
mafolz has joined #ruby
Mon_Ouie has quit [Ping timeout: 256 seconds]
kirun has joined #ruby
tiennou has quit [Ping timeout: 256 seconds]
sambao21 has joined #ruby
jcheng has quit [Quit: Computer has gone to sleep.]
eightbitraptor has joined #ruby
infecto is now known as infect0
infect0 is now known as infecto
mockra has joined #ruby
arturaz has quit [Quit: Leaving]
ssvo has quit [Remote host closed the connection]
bigoldrock has joined #ruby
maletor has joined #ruby
mlr has joined #ruby
sayan has joined #ruby
mlr has left #ruby [#ruby]
sleetdrop has joined #ruby
mmitchell has quit [Remote host closed the connection]
freeayu has joined #ruby
mmitchell has joined #ruby
ArchBeOS has joined #ruby
Voodoofish430 has joined #ruby
ArchBeOS has left #ruby [#ruby]
icole has joined #ruby
ShellFu has quit [Ping timeout: 260 seconds]
threesome has quit [Ping timeout: 256 seconds]
jdunck has joined #ruby
jgrau has quit [Remote host closed the connection]
maletor has quit [Ping timeout: 264 seconds]
miyako has joined #ruby
skattyadz has quit [Read error: Operation timed out]
ssvo has joined #ruby
ShellFu has joined #ruby
mmitchell has quit [Ping timeout: 260 seconds]
wolcanus has joined #ruby
mmitchell has joined #ruby
jgrau has joined #ruby
jgrau has quit [Remote host closed the connection]
skattyadz has joined #ruby
jgrevich has joined #ruby
ShellFu has quit [Read error: Connection reset by peer]
apod has quit []
<ARCADIVS>
I have some test cases that are puzzling me. The test case says: Expected: #<NoPoints:0x00000002349840>
<ARCADIVS>
Actual: NoPoints
pduin has quit [Remote host closed the connection]
maletor has joined #ruby
gyre007 has joined #ruby
<ARCADIVS>
I keep seeing this where I expect things to be the same.
cmarques has quit [Quit: Lost terminal]
atno has quit [Read error: No route to host]
gcds has quit [Quit: gcds]
<Muz>
ARCADIVS: what are you actually asserting against?
<ARCADIVS>
I am not very familiar with Ruby so I can't tell what's making some values print with the # and the number. NoPoints is a class without variables, only methods.
<Muz>
As in, how are you doing your comparison
<Spooner_>
ARCADIVS, I'd guess you are comparing the class to an instance.
atno has joined #ruby
ndboost has quit [Ping timeout: 252 seconds]
<Spooner_>
ARCADIVS, That is, it expected a specific instance, but it is receiving the class instead.
rabidpra_ has joined #ruby
etcetera has joined #ruby
pygmael has joined #ruby
sleetdrop has quit []
jonathanwallace has joined #ruby
ttt has joined #ruby
macmartine has joined #ruby
sleetdrop has joined #ruby
ARCADIVS has quit [Ping timeout: 264 seconds]
jbueza has joined #ruby
headius has joined #ruby
gyre007 has quit [Read error: Operation timed out]
ARCADIVS has joined #ruby
realDAB has quit [Quit: realDAB]
rabidpra_ has quit [Ping timeout: 264 seconds]
c0rn has joined #ruby
ndboost has joined #ruby
ttt has quit [Ping timeout: 256 seconds]
chrishough has quit [Quit: chrishough]
freerobby has quit [Quit: Leaving.]
Gowie has joined #ruby
<ARCADIVS>
:/ Now I don't know which message last reached the channel.
xbob has joined #ruby
froy has quit [Ping timeout: 264 seconds]
sjoeboo has joined #ruby
gyre007 has joined #ruby
louism2_ has joined #ruby
tjbiddle has quit [Quit: tjbiddle]
oktapodi has joined #ruby
c0rn has quit [Ping timeout: 252 seconds]
<sjoeboo>
really silly question: I've got some classes defined. I've also got some (forgive the almost certainly wrong terms) top-scope methods (functions?), and i want to access those classes from inside the "function"...but can't?
<sjoeboo>
and by access, its things like initialize and access public methods etc
<louism2_>
Hey everyone. Control flow like this --> x == 1..3 . It works but I get a warning. Should I do that or not? Why?
froy has joined #ruby
<Spooner_>
louism2_, What warning do you get? Looks fine to me.
<Gowie>
Anybody know why starting websocket client like so: https://gist.github.com/Gowiem/5214440 is causing my program to stop? The websocket client is locking the current process and I want it to continue and just run in the background. I am not used to threads in Ruby, but is that the answer here?
<louism2_>
Spooner: warning: integer literal in conditional range
<sjoeboo>
or i could jsut have a typo...sigh
Pip has quit [Ping timeout: 245 seconds]
<Hanmac>
sjoeboo: x == (1..3)
<Spooner_>
louism2_, Can you give a bit more context to the code?
fjfish has quit [Remote host closed the connection]
jnoob22 has joined #ruby
etcetera has quit []
<Spooner_>
Ah.
cgore has joined #ruby
headius has quit [Quit: headius]
<jnoob22>
trying to test if both values are in an arrary: I have this: if request.query.include? 'name' and request.query.include? 'age' ... is there a better way to do this possibly?
<Hanmac>
ups wrong user
<Spooner_>
louism2_, I get "ArgumentError: bad value for range" when I run your code. Anyway, Hanmac has the solution.
<Hanmac>
louism2_: x==(1..3)
<louism2_>
Spooner: I am grabbing database entries based on the number of the month
emanon_ has quit [Ping timeout: 264 seconds]
yacks has quit [Quit: Leaving]
hasimo-t has joined #ruby
maletor has quit [Read error: Connection reset by peer]
cmarques has joined #ruby
_maes_ has quit [Ping timeout: 276 seconds]
andikr has quit [Remote host closed the connection]
buscon has quit [Quit: Leaving]
etcetera has joined #ruby
robbyoconnor has joined #ruby
<louism2_>
Hanmac: Your code works until I put it into control flow like 'if x==(1..3)'. Then it just returns nil
<bencc>
Spooner_: works great
bookies has quit [Read error: No route to host]
solidus-lake has joined #ruby
elico has quit [Quit: elico]
aspiers has quit [Quit: WeeChat 0.4.0-rc3]
<bencc>
Spooner_: the <<" join('">>, <<"') ">> trick is cool
elico has joined #ruby
BadDesign has joined #ruby
etcetera has quit [Client Quit]
brianpWins has joined #ruby
<Hanmac>
louism2_ show more off your code
elico has quit [Client Quit]
andersbr has quit [Quit: andersbr]
hasimo-t has quit [Ping timeout: 264 seconds]
<Spooner_>
louism2_, I suspect you actually want to use if (1..3).include? x
dmerrick has quit [Quit: dmerrick]
<Spooner_>
Or case x; when 1..3; ...; when 4..5; ...; end
<louism2_>
Hanmac: Interesting, it behaves differently depending on if I am in the console or an irb shell
<louism2_>
it is now working in the console
<louism2_>
Spooner, Hanmac: Thanks for your help
<ARCADIVS>
I found out I was missing new here and there. :(
gcds has joined #ruby
zastern has joined #ruby
tjbiddle has joined #ruby
emanon_ has joined #ruby
banjara has joined #ruby
pygmael has quit [Quit: pygmael]
sepp2k has joined #ruby
gcds has quit [Read error: Connection reset by peer]
chrishough has joined #ruby
<Ohga>
finaly found the way to let eclipse know of the ruby gems.. just a matter of adding the path to the root of the installed gems to the settings for the ruby interpreter
gcds has joined #ruby
fcoury has joined #ruby
freerobby has joined #ruby
lukeholder has quit [Quit: Computer has gone to sleep.]
sleetdrop has quit [Quit: Computer has gone to sleep.]
<Eiam>
I notice a trend here, "replacing shitty slow ruby libraries" =0, tar, http, ssh
vlad_starkov has joined #ruby
breakingthings has quit []
realDAB has joined #ruby
anvl has quit [Remote host closed the connection]
solidus-lake has quit [Quit: Leaving.]
jjbohn|afk is now known as jjbohn
swex_ has joined #ruby
tmiller has joined #ruby
<Hanmac>
Eiam: imo its the kill for the project if it does not support Rubygems anymore :P
<Paradox>
rubygems are arguably one of the best things about ruby
adkron_ has joined #ruby
vlad_starkov has quit [Ping timeout: 256 seconds]
<Eiam>
*shrug* we are just getting into vagrant
<Paradox>
i love being able to just type "gem install herpderp" and be ready to go
br4ndon has joined #ruby
<Paradox>
basically what this reads as is "vagrant is popular enough now we want to implement our own package management system"
lkba has quit [Ping timeout: 256 seconds]
arturaz has joined #ruby
swex has quit [Ping timeout: 258 seconds]
<Ohga>
um, e mention dependency version mismatches.. but.. don't you specify what version to depend on in your script and ruby gems handles it for you?
<Eiam>
hmm it sounded to me like "vagrant is now popular enough outside the ruby community that people don't like mucking with ruby to get it"
_64k has joined #ruby
Ontolog has joined #ruby
Ontolog has quit [Remote host closed the connection]
ndboost has quit [Remote host closed the connection]
Ontolog has joined #ruby
vagmi has quit [Quit: vagmi]
<Ohga>
hm.. the title could almost be "Abandoning Ruby", given the content in the last section.. "this is much better in c, so we used c"
<Ohga>
and it tricked me me to give "kodos" just by hovering. Damn u!
kirun has quit [Ping timeout: 260 seconds]
wallclockbuilder has joined #ruby
marcdel has joined #ruby
<Hanmac>
hm ok they use libarchive, i do it too so i write my own libarchive gem ... the problem was that the current ones was not very ruby like
dagobah has quit [Remote host closed the connection]
gnrlbzik has joined #ruby
wallclockbuilder has quit [Remote host closed the connection]
interact_ has quit [Remote host closed the connection]
Ontolog has quit [Ping timeout: 256 seconds]
<lessless>
can I define some inline object, like time ||= {..some complex multi-line logic... }
tmiller has quit [Ping timeout: 264 seconds]
interactionjaxsn has joined #ruby
<lessless>
?
<aedorn>
hmm, what is this "more stable, well maintained SSH library written in C"?
obs has joined #ruby
dmerrick has joined #ruby
<lessless>
sorry, not object, but block
<banisterfiend>
lessless: yes: time ||= proc { ... }
Ontolog has joined #ruby
Ohga has left #ruby [#ruby]
<Hanmac>
aedorn i dont know ... maybe they dont understand that ruby has with openssl an ssl lib too?
love_color_text has joined #ruby
mikurubeam has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
interactionjaxsn has quit [Ping timeout: 272 seconds]
<Hanmac>
"Overall, Vagrant got a lot better because I was able to make changes I couldn't safely make by distributing via RubyGems." ... hm he does not know that each of his problems chould have been solved with an Ruby-C-Ext-Gem ...
karthikselva has left #ruby [#ruby]
<Eiam>
maybe
jtharris has quit [Quit: WeeChat 0.4.0]
eightbitraptor has quit [Remote host closed the connection]
<Eiam>
argh why do people use HAML
<aedorn>
Unfortunately, a stand alone installer is definitely going against the grain for Linux users.
<Eiam>
sometimes I dislike my boss ;p
Ontolog_ has joined #ruby
kirun has joined #ruby
<aedorn>
Eiam: I use HAML! =p
<Hanmac>
Eiam is he sure? maybe he wants YAML and does a typo?
jrajav has quit [Quit: phunq, sandwich store loop, WHAT NO UNIVERSE]
<Eiam>
Hanmac: yeah, its definitely haml crapping itself inside this index.haml =)
* Hanmac
feels sorry for you :P
<Eiam>
aedorn: yeah, and unfortunately one weekend my boss decided he wanted to use it too, now I've got sass & haml to go learn to read his code
<Eiam>
and figure out WTH hes doing so I can fix it
lkba has joined #ruby
GIANTrock has joined #ruby
<GIANTrock>
Hello
<Eiam>
I'll add it to my list of learning vagrant & chef too
<Eiam>
since apparently we are using those now too =)
<aedorn>
Eiam: That's sounding more like "other people are doing it so we should do it"
<GIANTrock>
Looking to implement a reverse proxy/load balancer in ruby that will divy up web requests to http servers in a cluster
<aedorn>
I only use HAML because I got tired of typing <%=%>
<GIANTrock>
The http servers will be forked, so best way to communicate is with io pipes?
<mouse-_>
haml's pretty nice
<Eiam>
aedorn: eh. we've spoken a bit about the move to vagrant. fundamentally I'm behind the idea of deploying our services on a VM
tish has joined #ruby
<Eiam>
I'm not a sysadmin, and unfortunately in the business of web dev people like to treat me like one
<Eiam>
i hate setting up servers, I hate maintaining them
<Eiam>
i hate deploying things to them
thatRD has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
Ontolog has quit [Ping timeout: 272 seconds]
codenapper has quit [Quit: Leaving...]
<Eiam>
vagrant is just one small step towards getting us out of the SA business
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
thatRD has quit [Client Quit]
<Eiam>
mouse-_: I'm not particularly upset with HAML, I just don't know it. the web stack has this tendency towards *more* complexity and *more* layers as people try to pave over the drivel that is javascript, html & css
<Eiam>
mustache this, haml that, sass this, less that
<Eiam>
compass blah blah, it goes on & on
thatRD has joined #ruby
yacks has quit [Quit: Leaving]
<Eiam>
coffeescript wee, _.js and so on
mafolz has quit [Ping timeout: 256 seconds]
<Eiam>
when I go write obj-c, all I need in my toolkit is xcode + objc
mercwithamouth has joined #ruby
<Eiam>
clearly, I'd rather people just use js, html & css because thast what I ultimatey have to debug
solidus-lake has joined #ruby
duosrx has joined #ruby
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
buibex has quit [Read error: Connection reset by peer]
dr_bob has left #ruby [#ruby]
Hanmac has quit [Ping timeout: 260 seconds]
tjbiddle has joined #ruby
<mouse-_>
eiam: that's true :/
keymone has quit [Read error: Operation timed out]
Bira has joined #ruby
<mouse-_>
also, notice the amount of languages necessary to achieve the goal is inversely proportional to the salary
<Eiam>
ha
<Eiam>
my salary is paid by my usage of the human language
Vert has joined #ruby
<Eiam>
but my bonuses are paid by the web stack =)
nobuoka has joined #ruby
<mouse-_>
i bailed out of the tech field, i've lucked out in a job in academia.. no shortage of monies at private schools, lol
<realDAB>
mouse-_: where do you teach?
<realDAB>
mouse-_: (or whatever you do)
* realDAB
is a former academic
<mouse-_>
ill be movin to jersey city, st peters prep
<mouse-_>
(9-12 hs) .. doing IT and teaching programming classes lol
<realDAB>
cool
dhruvasagar has joined #ruby
<mouse-_>
havent decided what yet, have to sit down and figure that out with the staff..
<mouse-_>
i remember learning apple logo in 6th grade and loving it, and learning pascal in hs and hating it.. probably go with ruby or python today, hhe
jrajav has joined #ruby
akashj87 has quit [Ping timeout: 260 seconds]
<Eiam>
I generally recommend python to most beginners myself..
<mouse-_>
yeah, seems it might be more futureproof
tjbiddle_ has joined #ruby
<Eiam>
well, my motive there is less about futureproof, I don't think ruby is going away
<mouse-_>
though its nit picky syntax might be a pain (i love ruby's free flow and the ability to perform 5-6 actions per line of code)
<Eiam>
I just think ruby has sufficent amounts of magic that you are exposed to even at the entry level, that pythons… explicitness tends to be better for new people
<mouse-_>
yeah
<mouse-_>
agreed
<Eiam>
I have a love/hate relationship with Ruby magic =)
<Eiam>
I appreciate it when it saves me time, I dislike it when it bites me in the ass, or I'm reading someones code that uses too much magic. magic being anything I don't easily understand, or belongs it perhaps the more obscure corpus of ruby abilities
tmiller has joined #ruby
wodKa has quit [Read error: Connection reset by peer]
banjara has left #ruby [#ruby]
icole has quit [Remote host closed the connection]
<banisterfiend>
mouse-_: you refer to teaching at a highschool to a "job in academia" ? :P
<infecto>
+1 to python first
Hanmac has joined #ruby
<banisterfiend>
in new zealand it strictly refers to a college position, afaik
<mouse-_>
banisterfiend: it's a jesuit school
rdark has quit [Quit: leaving]
imsplitbit has joined #ruby
<banisterfiend>
no real idea what that is :) like a religious highschool?
<mouse-_>
and by academia i mean "the great monstrosity machine/institution that is academic in nature"
<infecto>
it really is not a big deal which language you learn first though. learn the first and the second can be picked up rather quickly
tjbiddle has quit [Ping timeout: 260 seconds]
tjbiddle_ is now known as tjbiddle
Giorgio has joined #ruby
<mouse-_>
heh
bean has quit [Quit: Computer has gone to sleep.]
cha1tanya has quit [Ping timeout: 246 seconds]
browndawg has quit [Quit: Leaving.]
LiquidInsect has quit [Quit: vacation time]
alvaro_o has joined #ruby
gnrlbzik has quit []
obs has quit [Quit: Konversation terminated!]
interactionjaxsn has joined #ruby
<banisterfiend>
infecto: well i think it's much, much easier to go from C -> Ruby than from Ruby -> C :) (i'm glad i went C -> Ruby)
mljsimone has quit [Ping timeout: 264 seconds]
lodeston_ has joined #ruby
duosrx has quit [Remote host closed the connection]
<infecto>
while there can be more efficient paths for each individual, the key is to just master the first language
v1n has joined #ruby
tmiller has quit [Read error: Connection reset by peer]
<Hanmac>
banisterfiend imo an good way is to go "C -> C++ -> Ruby" :P
tmiller has quit [Read error: Connection reset by peer]
tmiller has joined #ruby
<Eiam>
Hanmac: !
<Eiam>
if there is one thing I regret about programming
<Eiam>
its doing four years of C++ (As my first language)
<Eiam>
I wish it had been C
<wuest>
<obligatory mention of lisp>
<Eiam>
or scheme/lisp =)
v0n has quit [Ping timeout: 264 seconds]
<Eiam>
mouse-_: to be fair I'll amend python.. if people want to be serious about programming they should probably start with C. if they just want ot learn some basic programming, python
marcdel has quit []
mikurubeam has joined #ruby
ryanf has joined #ruby
<Eiam>
C has too many roots in too many things and if you do programming long enough you eventually are going to end up at C anyway
<Eiam>
=p
<wuest>
You mean, "too many things have roots in C," rather?
<Eiam>
^
<Eiam>
yes, ofc
moofy has joined #ruby
<Hanmac>
Eiam C->(yeah, no stuct in stucts anymore, you can use real inheritance )->C++->(yeah you can define methods everywhere, on (mostly) each Object you want)->Ruby
rezzack has joined #ruby
jekotia has joined #ruby
<Eiam>
still disagree with C++ providing any value in that chain =)
elaptics is now known as elaptics`away
<Hanmac>
Eiam: for sample libarchive is written in C, and Ruby has a C-API, but i use C++ for my gem because its more clean
jekotia has quit [Client Quit]
jtharris has joined #ruby
\dev\nullX has quit [Ping timeout: 252 seconds]
jekotia has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
\dev\nullX has joined #ruby
zavier has quit [Quit: WeeChat 0.3.8]
Beoran has joined #ruby
rezzack has quit [Client Quit]
\dev\nullX has quit [Remote host closed the connection]
icole has joined #ruby
mikurubeam has quit [Ping timeout: 256 seconds]
marcdel has joined #ruby
rezzack has joined #ruby
andersbr has joined #ruby
_64k has quit [Ping timeout: 256 seconds]
toekutr has quit [Read error: Connection reset by peer]
atno has quit [Ping timeout: 245 seconds]
toekutr has joined #ruby
GIANTrock has quit [Quit: Page closed]
wolcanus has joined #ruby
jurassic_ has joined #ruby
xardas has joined #ruby
statarb3 has quit [Ping timeout: 252 seconds]
spider-mario has joined #ruby
chichou has quit [Ping timeout: 276 seconds]
<tewlz>
as someone who doesn't use C or C++ I always feel like linus has backdoors in the linux kernel just so he can judge me if I use c++
apeiros_ has quit [Remote host closed the connection]
<jurassic_>
Is there anything like ipython for ruby that provides tab completion in the interpreter?
louism2_ has quit [Quit: This computer has gone to sleep]
AWOMS has joined #ruby
nazty has quit [Ping timeout: 256 seconds]
cantonic has quit [Client Quit]
luckyruby has joined #ruby
dfried has quit [Quit: dfried]
<miyako>
I ran into an unexpected situation with passing a lambda as a parameter to a function; I was wondering if anyone could explain why the last example fails: https://gist.github.com/timskinner/5214338
mando has quit [Remote host closed the connection]
tymat has joined #ruby
Morkel has quit [Quit: Morkel]
tymat has quit [Client Quit]
<bricker>
Hanmac: actually, xml: :text is perfect, thanks!
cgore has quit [Remote host closed the connection]
<Hanmac>
bricker hm but :xml=>:text does not escape the quots ...
chrishough has joined #ruby
dfried has joined #ruby
headius has quit [Quit: headius]
<shevy>
ENCODING
<shevy>
GIVE ME MORE BABY
zeade has joined #ruby
wyan has joined #ruby
shock_one has quit [Ping timeout: 264 seconds]
agarie has quit [Remote host closed the connection]
chussenot has quit [Quit: chussenot]
xcv has quit [Remote host closed the connection]
devdazed has quit [Read error: Connection reset by peer]
xcv has joined #ruby
devdazed has joined #ruby
binaryplease has joined #ruby
<jblack>
is the simplist way to get a backtrace for self to throw an exception?
atno has joined #ruby
apeiros_ has joined #ruby
cantonic has joined #ruby
frem has quit [Quit: Computer has gone to sleep.]
<banisterfiend>
jblack: no, use 'caller'
<jblack>
e.g. puts self.caller ?
sambao21 has quit [Quit: Computer has gone to sleep.]
<jblack>
no, just caller.
<jblack>
Thanks much!
wolcanus_ has joined #ruby
freezey has joined #ruby
bluOxigen has quit [Read error: Connection reset by peer]
sonda has quit [Remote host closed the connection]
jjbohn|afk is now known as jjbohn
duosrx has joined #ruby
thinkclay has quit [Quit: Leaving.]
axl_ has quit [Quit: axl_]
tricon_ has joined #ruby
<tgunr>
could anyone help me decyper this error? https://gist.github.com/anonymous/5215904 at the error it obviously is trying to setup where the config file is located but what is casuing the error? syntax? total ruby noob here
duosrx has quit [Ping timeout: 264 seconds]
daniel_- has joined #ruby
<tgunr>
How do constants work? Does WikiExternalFilterHelper have to declared first or something?
catphish has joined #ruby
moofy has left #ruby [#ruby]
demas has quit [Quit: demas]
<catphish>
using OpenSSL::PKey::DSA, is there a way to obtain the raw key?
BigFatFatty has joined #ruby
Adys has quit [Remote host closed the connection]
jbpros has quit [Read error: Operation timed out]
sjoeboo has quit [Read error: Connection reset by peer]
<catphish>
i guess DER format is ok for most purposes
ckrailo has quit [Ping timeout: 276 seconds]
rezzack has quit [Quit: Leaving.]
axl_ has joined #ruby
Adys has joined #ruby
jbpros has joined #ruby
ckrailo has joined #ruby
bean has joined #ruby
tricon_ is now known as Tricon
mikurubeam has joined #ruby
ferdev has quit [Quit: ferdev]
Amnesthesia has quit [Read error: Operation timed out]
Giorgio has quit [Ping timeout: 260 seconds]
Xeago has quit [Remote host closed the connection]
presto53 has joined #ruby
Giorgio has joined #ruby
mando has joined #ruby
banjara has quit [Quit: Leaving.]
lushious has joined #ruby
banjara has joined #ruby
hmarr has quit [Ping timeout: 252 seconds]
ebobby has joined #ruby
thisirs has quit [Read error: Operation timed out]
thisirs has joined #ruby
zeade has quit [Quit: Leaving.]
dfried has quit [Ping timeout: 264 seconds]
dfried has joined #ruby
Amnesthesia has joined #ruby
<banisterfiend>
can someone name a stdlib library that uses C?
akashj87 has joined #ruby
mando has quit [Remote host closed the connection]
Guedes has quit [Remote host closed the connection]
thinkclay has joined #ruby
tylersmith has quit [Quit: tylersmith]
cyberarm has joined #ruby
marcdel has joined #ruby
thinkclay1 has joined #ruby
razibog has quit [Quit: Leaving.]
razibog has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
Es0teric has joined #ruby
spyderman4g63 has quit [Remote host closed the connection]
Astralum has quit [Ping timeout: 240 seconds]
<nmeum>
Is there a builtin method to overwrite the content of a file or do I have to do this manually?
<Hanmac>
nmeum: File.write
thinkclay has quit [Read error: Operation timed out]
brhelwig has joined #ruby
kofno has quit [Remote host closed the connection]
mikewintermute has joined #ruby
jgrevich_ has joined #ruby
jgrevich has quit [Ping timeout: 260 seconds]
jgrevich_ is now known as jgrevich
<nmeum>
Hanmac: oh
ferdev has joined #ruby
<Hanmac>
nmenum File has a class method named write
skattyadz has quit [Quit: skattyadz]
<nmeum>
I know
huoxito has quit [Quit: Leaving]
BlankVerse1 has joined #ruby
AWOMS has quit []
jlast has quit [Ping timeout: 264 seconds]
rippa has quit [Ping timeout: 240 seconds]
zommi has joined #ruby
spider-mario has quit [Remote host closed the connection]
mikewintermute has quit [Quit: mikewintermute]
<aedorn>
systemd/udev 197 is making me hate life.
sambio has joined #ruby
<bricker>
Is something like this uncommon? https://gist.github.com/bricker/5216251 Sort of a contrived example, but basically I only want to set an attribute ("name" in this example) if it wasn't already set in the block
workmad3 has joined #ruby
mikewintermute has joined #ruby
sambao21 has joined #ruby
sambao21 has quit [Client Quit]
c0rn has joined #ruby
mattbl has joined #ruby
mattbl has quit [Client Quit]
mercwithamouth has joined #ruby
realDAB has joined #ruby
mattbl has joined #ruby
krawchyk has quit [Remote host closed the connection]
nobitanobi has joined #ruby
nomenkun has joined #ruby
xcv_ has joined #ruby
<bean>
the ||= pattern is common
<bean>
imo
<pskosinski>
For noob using so far only erb for templates in web apps… Markaby or haml? Or something else? I like how Markaby looks but it has poor documentation and seems to be not developed anymore…
banjara has quit [Quit: Leaving.]
banjara has joined #ruby
jgarvey has quit [Quit: Leaving]
<dallasm_>
bricker: nothing wrong with ||= but passing a block like that and then using eval for assignment is kinda weird
<pskosinski>
"Try all", problem that there are a lot of template engines, as I see :p
bitcycle has joined #ruby
zommi has quit [Remote host closed the connection]
<bricker>
dallasm_: right, but I expect some attributes might be set from inside of the eval'd block
xcv has quit [Ping timeout: 246 seconds]
rickmasta has joined #ruby
rismoney has joined #ruby
haxrbyte has quit [Ping timeout: 256 seconds]
haxrbyte has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
peteyg has joined #ruby
<peteyg>
I got a question on array/hash munging. Here's a detailed gist on what I want to do and what's not working with my current implementation: https://gist.github.com/peteygao/5216382
sambao21 has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
92AAB9ME3 has joined #ruby
<bean>
peteyg: throw a .flatten on the end
<bean>
:)
strangelyNormal has left #ruby [#ruby]
tomzx_mac has joined #ruby
<peteyg>
bean: wooooh!
daniel_- has quit [Ping timeout: 240 seconds]
mercwithamouth has quit [Ping timeout: 276 seconds]
<apeiros_>
using flatten feels like doing the start wrong
mattbl has quit [Quit: This computer has gone to sleep]
<peteyg>
apeiros_: Hmm, do you have a better way to do this without using nested maps?
<peteyg>
<- Ruby novice, so any advice is much appreciated :)
<apeiros_>
you always only want the "object" key? then no need for map at all in the inner side.
<mikewintermute>
Trying to understand this code: on :message, /hello/ do |m|
nobitanobi has quit [Ping timeout: 245 seconds]
<mikewintermute>
what does the 'on' bit mean?
<arturaz>
a method call
<shevy>
mikewintermute it is simply a method call on
<shevy>
def on
<shevy>
on on :message, /hello/ do |m|
<shevy>
oops
<shevy>
on :message, /hello/ do |m|
<shevy>
is
<shevy>
on(:message, /hello/) do |m|
<shevy>
is
<shevy>
on(:message, /hello/) { |m|
Corey has joined #ruby
<mikewintermute>
Any docs?
<shevy>
but if you omit the (), you can not use {
<shevy>
there are many docs :)
<shevy>
it's basic ruby syntax though
<mikewintermute>
;-) problem is 'on' is a very common word - struggled to find a page
Asher has quit [Quit: Leaving.]
Faris has joined #ruby
<shevy>
it is a name of a method
<shevy>
def foo
<shevy>
def bla
<shevy>
def on
<shevy>
you must look at the specific project to look what it does internally, you should be able to grep for "def on" (or define_method, but most will just have used "def on")
<Hanmac>
def def works too :P
astomp has quit [Quit: Computer has gone to sleep.]
<shevy>
ewwww
<mikewintermute>
so, is 'on' a ruby method or defined in a project?
<shevy>
Hanmac does not seem to work in irb
<shevy>
def def(i); puts i; end; def("test")
<sepp2k>
mikewintermute: It's not defined in core ruby or, as far as I know, anywhere in the standard library.
<shevy>
mikewintermute it is a ruby method defined in this project
rezzack has joined #ruby
<mikewintermute>
shevy: thanks - that's making more sense now
<shevy>
I do not know from where you get your line of code mikewintermute :-)
<Hanmac>
shevy you need to use it with self.
<shevy>
sinatra has stuff like this:
<shevy>
get '/' do
<shevy>
'Hello world!'
<shevy>
end
brianpWins has joined #ruby
<shevy>
Hanmac ewwww that is ugly :(
<Hanmac>
or send
<shevy>
def def(i); puts i; end; self.def('test') # test
<shevy>
awful!
<shevy>
send :def, 'test' # test
<shevy>
that is even worse hahaha
AndChat| has joined #ruby
<shevy>
can I reassign to self?
<shevy>
rather than self.def('test')
<shevy>
main_object = self
<shevy>
def('test') # would then work
<shevy>
?
xcv_ has quit [Remote host closed the connection]
jlast has joined #ruby
slainer68 has joined #ruby
catphish has left #ruby ["Leaving"]
<mikewintermute>
so there should be a 'def on' somewhere in the project?
<realDAB>
shevy: what do you mean by main_object?
<mikewintermute>
aha - yes
<realDAB>
shevy: in any case i think the parser would still have a problem with def('test')
toekutr has quit [Read error: Connection reset by peer]
newellista has joined #ruby
<Hanmac>
miewintermute: yeah, or it works with method_missing
Banistergalaxy has quit [Ping timeout: 245 seconds]
newellista has quit [Client Quit]
newellista has joined #ruby
ukd1 has joined #ruby
<shevy>
realDAB yeah could be
<mikewintermute>
is there a way of finding out where a method is defined? (apart from searching through an entire file system for 'def on')
<shevy>
mikewintermute you could try method.source_location
<Hanmac>
source_location does not work for C methods
tommyvyo has quit [Quit:]
<shevy>
class Foo; def bar; 'hi'; end; end; p Foo.new.method(:bar).source_location
<shevy>
["(irb)", 11] # => ["(irb)", 11]
<shevy>
sepp2k I thought it would tell me where strip is defined :(
newellista has joined #ruby
<shevy>
that kinda sucks
newellista has left #ruby [#ruby]
Banistergalaxy has joined #ruby
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
jon_w has quit [Quit: The 7 Deadly Sins: anything else would be uncivilized [www.t7ds.com.br]]
Ryan__ has joined #ruby
<Ryan__>
Here's a simple question about File requiring I'm still trying to figure out:
BryanWB has quit [Quit: Ex-Chat]
cjs226 has joined #ruby
realDAB has quit [Quit: realDAB]
_64k has joined #ruby
Davey has quit [Quit: Computer has gone to sleep.]
agarie has joined #ruby
arturaz has quit [Remote host closed the connection]
<Ryan__>
I'm using Rake::TestTask to run some of my testing for me. What I'm finding it shat all of my test files still need 'require test/unit', 'require 'my code'', at the top of each test files, despite my best effort to load them through Rake. Am I missing a core feature? Or something obvious?
colonolGron has joined #ruby
felixjet has joined #ruby
tvw has quit []
wrapids has joined #ruby
Catbuntu has quit [Quit: Leaving]
<wrapids>
How would I go about communicating RCP over RTMP with ruby? I can't find enough documentation to even begin establishing a connection.
Davey has joined #ruby
sailias has quit [Read error: Operation timed out]
avelldiroll has quit [Ping timeout: 248 seconds]
c0rn has quit [Ping timeout: 260 seconds]
bitcycle has quit [Remote host closed the connection]
Myk267 has quit [Quit: Ack! Hans, run! It's the lhurgoyf!]
v1n has quit [Ping timeout: 264 seconds]
c0rn has joined #ruby
tenmilestereo has joined #ruby
marcdel has quit [Ping timeout: 252 seconds]
banseljaj is now known as imami|afk
ehellman has quit []
jrajav has quit [Quit: I tend to be neutral about apples]
Xeago has joined #ruby
jnoob22 has quit [Quit: Leaving]
* Xeago
returns from 4 hours of cooking and 1 hour of cleaning dishes
<Xeago>
apeiros_: the dish-water was very hots, wanna play?
<shevy>
Xeago where is your wife man
mark_locklear has quit [Read error: Operation timed out]
<Xeago>
shevy: not yet married, sitting next to me
<shevy>
damn, don't let her watch what is written here!
Mattx has quit [Read error: Connection reset by peer]
<apeiros_>
Xeago: tomorrow, if I can fit the components together
<apeiros_>
but then with 90fps on all ultra
angusiguess has quit [Ping timeout: 256 seconds]
iondream has joined #ruby
slainer68 has quit [Remote host closed the connection]
rabidpra_ has joined #ruby
Ryan__ has quit [Quit: Page closed]
apucacao has joined #ruby
v1n has joined #ruby
xcv has joined #ruby
hbpoison has quit [Ping timeout: 256 seconds]
benlieb has joined #ruby
marcdel has joined #ruby
rabidpra_ has quit [Ping timeout: 256 seconds]
carloslopes has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
<wrapids>
Is anyone aware of a library similar to FlourineFX for ruby?
rabidpraxis has joined #ruby
Tricon has quit [Quit: Leaving...]
j^2 has quit [Quit: for i in `/names` ; do adios $i; done]
jpcamara_ has quit [Ping timeout: 264 seconds]
jpcamara has joined #ruby
<apucacao>
I would like to define a bunch of modules inside of a directory which each define a function that will generate a dataset. Each of these files will be loaded by a script which will run each function to build a big collection of datasets. Without knowing how many files there may be, how can I load each module, run the contained function and continue?
wolcanus_ has quit [Remote host closed the connection]
<apucacao>
if i were writing this in node, each module would export the function itself, but I am not sure how to do that in Ruby.
nomenkun has quit [Remote host closed the connection]
iondream has left #ruby [#ruby]
avelldiroll has joined #ruby
Vainoharhainen has quit [Quit: Leaving...]
Xeago has quit [Remote host closed the connection]
anonymuse has joined #ruby
jonathanwallace has quit [Ping timeout: 256 seconds]
thinkclay1 has quit [Quit: Leaving.]
chussenot has joined #ruby
Tricon has joined #ruby
Goles has joined #ruby
jjbohn|afk is now known as jjbohn
failshel_ has joined #ruby
Goles has quit [Remote host closed the connection]
k3rn3lito has joined #ruby
Roa has joined #ruby
Roa has quit [Changing host]
Roa has joined #ruby
techlife has quit [Ping timeout: 276 seconds]
failshell has quit [Ping timeout: 258 seconds]
johndju has joined #ruby
<apucacao>
all I can think of is have a module (eg. Dataset) and each file defines a module inside of the Dataset module, and then use introspection
<johndju>
Hi everyone. Having trouble understanding puts nil. puts nil -> "nil", but puts nil.to_s -> "", puts nil.to_str -> undefined method. What is puts calling to turn nil into "nil", because I can't see to replicate it?
Bira has quit [Quit: Leaving]
freezey has quit [Remote host closed the connection]
<apucacao>
bean: i used because because the "classes" will never have instances, just a single static method
<johndju>
I'm trying this in IRB, and it prints nil there, as well as displaying the result of puts nil, which is also nil
HecAtic has quit [Quit: HecAtic]
<bean>
apucacao: ah, so maybe you do want modules... you would likely iterate over all of the files, etc
thomasfedb has quit [Ping timeout: 252 seconds]
waxjar has quit [Ping timeout: 258 seconds]
slainer68 has joined #ruby
<johndju>
tyanf: and when I try puts nil in this http://tryruby.org i also get "nil" printed
tvw has joined #ruby
noxgirl has quit [Ping timeout: 264 seconds]
<apucacao>
bean: that's how far I am. but then how do I run each method so that I can collect the result of each call?
rabidpraxis has quit [Ping timeout: 260 seconds]
<ryanf>
johndju: I don't know what's up with tryruby.org, but puts nil in irb does not print nil for me
<johndju>
ryanf: it prints nil in 1.x, empty line in 2.x
<ryanf>
ah
tmiller has quit [Remote host closed the connection]
<bean>
apucacao: would likely need to know some code / actual structure to help
<ryanf>
it's actually a difference between ruby 1.8 and 1.9
jpcamara has quit [Quit: jpcamara]
<MrZYX>
apucacao: do you want to run that stuff right away or has loading and running to be separate things?
<johndju>
ryanf: so where does ruby 1.8 get nil from? any idea?
sambao21 has quit [Quit: Computer has gone to sleep.]
<ryanf>
I have no idea
<ryanf>
I tried defining to_s and inspect on a random object and putsing it and it calls to_s, not inspect
thomasfedb has joined #ruby
<apucacao>
MrZYX: either way is fine I think, assuming I can collect the result of each call, since I will be assembling all the results into a big structure to serialize to json
waxjar has joined #ruby
sambao21 has joined #ruby
autumn has joined #ruby
<ryanf>
and actually it would make no sense for it to call inspect on everything
<johndju>
ryanf: ok i can see it special casing it in the source code
<ryanf>
I'm glad they got rid of it, that's dumb
<ryanf>
haha yeah
<johndju>
ryanf: it might be helpful if they put this kind of thing somewhere in the documentation apart from the C code...
alx- has quit [Quit: alx-]
<wrapids>
fun times, get to learn c#!
dhruvasagar has quit [Ping timeout: 245 seconds]
angusiguess has joined #ruby
chussenot has joined #ruby
<johndju>
ryanf: thanks
johndju has quit [Quit: Page closed]
<MrZYX>
apucacao: you could just define them in a common module and iterate through ThatModule.constants. Another possibility to define the "function" directly at the root level of the file inside nothing (not even a function definition) and do data = eval(File.read(file))
rabidpraxis has joined #ruby
wmoxam has quit [Quit: leaving]
adkron_ has quit [Ping timeout: 276 seconds]
dustint has quit [Ping timeout: 264 seconds]
willbradley has joined #ruby
<willbradley>
ruby wizards: i need your help, i'm on hour 12
<MrZYX>
or you define a function @data = []; def add_data; @data << yield; end; and use the files with load which loads them in the current context, and the files contain something like add_data do [1, 2, 3] end
<willbradley>
trying to create a tree hash out of a dotted string
<willbradley>
i'm trying to do something where if(segment === segmented_string.last) then h[segment] = "last segment" however i get a "string not matched" error
<wrapids>
willbradley: you're turrently getting the output listed initially?
chussenot has quit [Ping timeout: 252 seconds]
<willbradley>
the first two lines: yep
<Hanmac>
willbrandley are you shure you wants === ?
<willbradley>
i made several attempts at modifying it to add something to the child-est node, but i'm missing something
<willbradley>
*shrug* it works
jbueza has quit [Read error: Connection reset by peer]
rabidp___ has joined #ruby
<willbradley>
what doesn't work is whenever i touch the ||={} line
<Hanmac>
yeah ... download 4 Toolkits with each more than 500MB (guessing) to run one 200kb app :P
interactionjaxsn has quit [Ping timeout: 245 seconds]
mrsolo has quit [Quit: Leaving]
bean has quit [Quit: Computer has gone to sleep.]
<gaspar|work>
Hey guys, I'm trying to modify array elements but the following code shows "nil" in the console for each element of the array http://pastie.org/6994978
jjbohn is now known as jjbohn|afk
<gaspar|work>
I'm getting all the codes, checking the IP address if it exists, and adding GeoIP information
nobitanobi has quit [Read error: Connection reset by peer]
<gaspar|work>
if I do puts geoip.city(IPAddr.new(code.ip, Socket::AF_INET).to_s).inspect I get all the data I need
luckyruby has joined #ruby
<gaspar|work>
So it's not saving the information in the code variable
s1n4 has joined #ruby
<wrapids>
gaspar|work: you need `code = []` before that loop, you're creating a local variable which is destroyed when the loop terminates.
newUser1234 has quit [Remote host closed the connection]
<gaspar|work>
wrapids: That doesn't change a thing
<Paradox>
im surprised
<Paradox>
normally on freenode talk about ruby outside ruby channels and get the shit flamed out of you
<Paradox>
pytards hate ruby
<gaspar|work>
Besides I'm accessing the variable inside the loop
<wrapids>
#web seems to be a healthy mixture of everything not related to .net
<Paradox>
thats good
<Paradox>
i dont always tell people to use php
<Paradox>
but if they're using .net i do
<sam113101>
why?
<Paradox>
lol php
<wrapids>
Meh, nothing wrong with php.
axl_ has joined #ruby
<Paradox>
sam113101, because php in all its shittiness is far better than .net
tylersmith has joined #ruby
<bricker>
Hanmac: No problem, just curious. Why Hash.new("Go Fish") will use that as the "default" value... I mean it's not weird I guess, I just can't figure out what the use case is
<Paradox>
bricker, be careful though
<wrapids>
When you guys come up with better enterprise solutions to all of the php enterprise solutions out there, you can boast all you'd like.
<Paradox>
every new entry in the hash will reference the same object
<Hanmac>
bricker: learn the difference between default_value and default_proc and what it does and what you gain, and what you lose
rboyd has quit [Quit: rboyd]
<Paradox>
oh
<Paradox>
i see that was already the discussion
<Paradox>
lel
<Paradox>
i always do Hash.new(->("lel"))
<froy>
php enterprise? wow, never thought I'd hear that.
rabidpra_ has quit [Remote host closed the connection]
rabidpra_ has joined #ruby
freezey has joined #ruby
zastern has quit [Remote host closed the connection]
<Eiam>
oh christ
<Eiam>
another one? see?
<Eiam>
mouse-_: see?
otters has quit [Quit: bye]
DarthGandalf has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
<shevy>
that looks actually neat
otters has joined #ruby
<shevy>
I suppose without indent it would not work at all
<shevy>
and it looks better than erb too
roadt has quit [Ping timeout: 258 seconds]
<shevy>
except for
<shevy>
- for item in items do
<shevy>
i hate for loops in ruby
<shevy>
I dunno why, they just dont seem to fit :(
<MrZYX>
hm in HAML that just evals basically, so you could do items.each do |item|
<MrZYX>
the - "operator" that is
generalissimo has joined #ruby
rabidpra_ has quit [Ping timeout: 255 seconds]
<shevy>
MrZYX it still freaks me out that you are not MrXYZ
<MrZYX>
:P
<MrZYX>
that's on purpose
mockra has joined #ruby
BSaboia has joined #ruby
<Eiam>
this looks a lot like haml
<Eiam>
just without some %
alx- has joined #ruby
<TMM>
Not sure if anyone read my questions, but if anyone has, I switched from treetop to citrus and I got it to work with a minimum of fiddling. Citrus rocks, Treetop doesn't, or I'm too stupid to use it, either one of those :)
gaspar|work has quit [Quit: gaspar|work]
mootpointer has joined #ruby
jlast has quit [Remote host closed the connection]
bencc has left #ruby [#ruby]
etcetera has quit []
dEPy_ has joined #ruby
Davey has joined #ruby
cupakromer has joined #ruby
<shevy>
TMM no idea, never heard of either
chessguy has joined #ruby
jonahR has quit [Quit: jonahR]
<TMM>
shevy, parser generators for ruby
dEPY has quit [Ping timeout: 256 seconds]
mikurubeam has joined #ruby
dEPy_ is now known as dEPy
Morkel has quit [Quit: Morkel]
danman has quit [Quit: danman]
Hanmac has joined #ruby
johndju has joined #ruby
chussenot has joined #ruby
ArchBeOS has joined #ruby
ArchBeOS has quit [Changing host]
ArchBeOS has joined #ruby
otters has quit [Changing host]
otters has joined #ruby
<johndju>
Hi - does anyone want to talk about argument restructuring? [[1, 2]].each { |x, y| ... } - why does this work? there is no splat in the block's arguments, so how does Ruby know to destructure here? It doesn't work in a method (def foo(x, y); puts x, y; end; foo([1, 2])), so what is special about the block here?
<johndju>
*destructuring, not restructuring
thibauts_ has quit [Ping timeout: 264 seconds]
akashj87 has quit []
Faris has quit [Ping timeout: 260 seconds]
ArchBeOS has left #ruby [#ruby]
celestius has joined #ruby
realDAB has joined #ruby
<havenwood>
johndju: x, y = [1, 2] type assignment works, but not [x, y] = 1, 2
philipd has quit [Quit: Computer has gone to sleep.]
<johndju>
havenwood: sorry, I don't understand what you're saying, can you elaborate?
realDAB has quit [Client Quit]
<vandemar>
johndju: apparently if you use multiple block arguments, ruby will decompose what would be the single argument if that argument is an enumerable-ish class
tish has quit [Quit: Leaving.]
rabidpraxis has joined #ruby
<johndju>
vandemar: and that is a special case just for blocks, not methods?
sepp2k has quit [Remote host closed the connection]
mpfundstein has quit [Remote host closed the connection]
jpcamara has joined #ruby
thone_ has joined #ruby
nari has joined #ruby
chussenot has quit [Quit: chussenot]
slainer68 has quit [Remote host closed the connection]
pavilionXP has quit [Read error: Connection reset by peer]
alx- has quit [Quit: alx-]
ephemerian has quit [Quit: Leaving.]
<shevy>
johndju I think it auto-applies splat on it
<shevy>
look at this:
thone has quit [Ping timeout: 264 seconds]
Xeago_ has joined #ruby
Xeago is now known as Guest77027
Guest77027 has quit [Killed (verne.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
wallerdev has quit [Quit: wallerdev]
<shevy>
[ [1, 2, 3] ].each { |x, y| print y } # 2
ckrailo has quit [Quit: Computer has gone to sleep.]
<shevy>
as you did not assign a third variable, 3 is inaccessible here
Xeago_ has joined #ruby
Xeago is now known as Guest48828
Guest48828 has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
etcetera has joined #ruby
<shevy>
methods have specific arguments and never more
<shevy>
for blocks apparently the arguments aren't as important
<havenwood>
head, *tail = [1, 2, 3]
Xeago_ has joined #ruby
Xeago has quit [Killed (adams.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
hbpoison_ has joined #ruby
BigFatFatty has left #ruby [#ruby]
Xeago is now known as Guest88395
Xeago_ has joined #ruby
Guest88395 has quit [Killed (wolfe.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
Xeago_ has joined #ruby
Xeago has quit [Killed (sendak.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
thinkclay has joined #ruby
wallerdev has joined #ruby
Xeago_ has joined #ruby
Xeago has quit [Killed (adams.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
<oz>
shevy: of course you can also [ [1, 2, 3] ].each { |x, y| print y }
<oz>
err I meant: [ [1, 2, 3] ].each { |x, *y| print y } # [2, 3]
Xeago_ has joined #ruby
Xeago is now known as Guest9601
Xeago_ is now known as Xeago
Guest9601 has quit [Killed (gibson.freenode.net (Nickname regained by services))]
hbpoison has quit [Ping timeout: 260 seconds]
cjs226 has joined #ruby
cyberarm has quit [Quit: Bye]
Xeago_ has joined #ruby
Xeago has quit [Killed (cameron.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
BSaboia has quit [Ping timeout: 245 seconds]
<shevy>
yeah but you used *
slainer68 has joined #ruby
<shevy>
johndju did not
Xeago_ has joined #ruby
Xeago is now known as Guest38316
Guest38316 has quit [Killed (hubbard.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
Davey has quit [Quit: Computer has gone to sleep.]
Kirotan has quit [Ping timeout: 256 seconds]
<shevy>
johndju btw what is your method supposed to do?
Xeago_ has joined #ruby
Xeago_ is now known as Xeago
Xeago is now known as Guest94874
SCommette has quit [Quit: SCommette]
<shevy>
foo([1, 2]))
otherj has joined #ruby
<shevy>
or did you mean
<shevy>
foo([1, 2])
Xeago_ has joined #ruby
Xeago_ is now known as Xeago
<shevy>
johndju is so silent :(
Xeago is now known as Guest39040
Xeago has joined #ruby
Guest39040 has quit [Killed (zelazny.freenode.net (Nickname regained by services))]
<johndju>
shevy: this stuff is all crazy... i mean is this written down somewhere? i'm reading the c code
Xeago_ has joined #ruby
Xeago is now known as Guest18782
Guest18782 has quit [Killed (barjavel.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
<shevy>
not sure
<johndju>
shevy: i'm not trying to achieve anything in particular - my interest is didactic