apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
EzeQL has quit [Remote host closed the connection]
EzeQL has joined #ruby
ilyam has joined #ruby
fayimora_ has joined #ruby
sohocoke has quit [Ping timeout: 245 seconds]
tvw has quit [Ping timeout: 246 seconds]
flip_digits has joined #ruby
rmascarenhas has joined #ruby
Tasser has quit [Ping timeout: 265 seconds]
ikaros has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
fbernier has quit [Ping timeout: 246 seconds]
bambanx_ has joined #ruby
andrewhl has joined #ruby
Tasser has joined #ruby
fbernier has joined #ruby
fayimora has quit [Ping timeout: 246 seconds]
cjs226 has joined #ruby
DRCALKIN has quit [Quit: Leaving]
ciopte7_ has quit [Quit: ciopte7_]
mikalv has quit [Ping timeout: 260 seconds]
mikalv has joined #ruby
ken_barber has quit [Remote host closed the connection]
cjs226 has quit [Client Quit]
mikepack has joined #ruby
kylemcgill has joined #ruby
EzeQL has quit [Remote host closed the connection]
EzeQL has joined #ruby
nari_ has quit [Ping timeout: 245 seconds]
Urthwhyte is now known as Urth|Away
perryh_away is now known as perryh
austinbv has joined #ruby
looopy has quit [Remote host closed the connection]
adamkittelson has quit [Ping timeout: 276 seconds]
kenichi has joined #ruby
<krz>
given [1,2,3,4,5,6,7,8,9,10] whats a good way to grab 4 of the middle values
<krz>
i.e.3,4,5,6 or 4,5,6,7,8
EzeQL has quit [Read error: Connection reset by peer]
<cout>
array[start..end]
ghanima has quit [Quit: Leaving.]
<krz>
what?
EzeQL has joined #ruby
wagle has quit [Remote host closed the connection]
weasels has joined #ruby
looopy has joined #ruby
otters has quit [Read error: Connection reset by peer]
ZachBeta has quit [Quit: Computer has gone to sleep.]
savage- has joined #ruby
Urth|Away is now known as Urthwhyte
mattonrails has quit [Remote host closed the connection]
eywu has quit [Quit: Leaving.]
freeayu3 has quit [Ping timeout: 260 seconds]
baroquebobcat has joined #ruby
ciopte7_ has quit [Quit: ciopte7_]
mpereira has quit [Ping timeout: 260 seconds]
jcromartie has joined #ruby
freeayu3 has joined #ruby
jcromartie has quit [Client Quit]
jlwestsr has quit [Quit: Leaving]
test34 has quit [Ping timeout: 260 seconds]
krusty_ar has quit [Remote host closed the connection]
Tref has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
austinbv has joined #ruby
harukomoto has joined #ruby
kah_ has quit [Quit: Leaving]
moosya has joined #ruby
mrwalker has joined #ruby
robdodson has joined #ruby
cableray has joined #ruby
albemuth has joined #ruby
godzirra has quit [Read error: Connection reset by peer]
looopy has quit [Remote host closed the connection]
c0rn has joined #ruby
Cakey has joined #ruby
godzirra has joined #ruby
azm has joined #ruby
yoklov has quit [Remote host closed the connection]
yoklov has joined #ruby
yoklov has quit [Remote host closed the connection]
mattonrails has joined #ruby
jimmy has joined #ruby
mattonrails has quit [Remote host closed the connection]
cdepue has quit [Read error: Connection reset by peer]
foo42 has joined #ruby
looopy has joined #ruby
cdepue has joined #ruby
c0rn has quit [Client Quit]
spaceships has quit [Quit: leaving]
weasels has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
austinbv has quit [Quit: austinbv]
foo42 has quit [Quit: haskell]
weasels has quit [Client Quit]
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
weasels has joined #ruby
weasels has quit [Client Quit]
ZachBeta has joined #ruby
weasels has joined #ruby
ZachBeta has quit [Client Quit]
joshman_ has joined #ruby
ZachBeta has joined #ruby
vitoravelino is now known as vitoravelino`afk
ZachBeta has quit [Client Quit]
TrevorBramble has joined #ruby
tvw has quit [Remote host closed the connection]
bambanx_ has joined #ruby
bambanx_ has quit [Client Quit]
ciopte7 has joined #ruby
radic has quit [Read error: Operation timed out]
<bambanx>
hi
<bambanx>
guys can i do in ruby a method for example with 3 arguments mymethod(arg1, arg2, arg3) and in some cases dont use all , for example call this method mymethod(arg1,arg2) without use arg3 ?
<bambanx>
offby1, i dont wanna default values, i wanna arg1 variables but in somes case dont use all args
<offby1>
also def method (arg1, arg2, *rest)
becom33 has quit [Ping timeout: 265 seconds]
becom33 has joined #ruby
weasels has quit [Quit: WeeChat 0.3.7]
weasels has joined #ruby
Targen has quit [Ping timeout: 245 seconds]
defendguin has joined #ruby
cableray has quit [Quit: cableray]
<bambanx>
offby1, if i declare a method like this mymethod(arg1,arg2,arg3) when i can it only with two method like this mymethod(1,12) it give me a error
<bambanx>
offby1, say me wrong number of arguments
igotnolegs has joined #ruby
savage- has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
austinbv has joined #ruby
dhaskew_ has joined #ruby
ryanf has quit [Ping timeout: 248 seconds]
imami|afk is now known as banseljaj
heftig has quit [Ping timeout: 272 seconds]
weasels has quit [Quit: WeeChat 0.3.7]
<horseman>
bambanx: so, if you dont use all the args, then what do u expect the value of arg3 to be inside the method?
JohnBat26 has joined #ruby
weasels has joined #ruby
<bambanx>
horseman, no this is why i am asking
otters has quit [Quit: Leaving]
c0rn has joined #ruby
<horseman>
bambanx: well, that's why you need to provide a default value, as offby1 demonstrated, so that if you dont provide arg3 it still has a value. ok?:)
<bambanx>
ok horseman , thanks
gtuckerkellogg has joined #ruby
<bambanx>
thanks offby1 too
<bambanx>
sorry if i dont understand to the first my english suck and i am learning :) ruby
dhaskew_ has quit [Ping timeout: 246 seconds]
Cakey has quit [Ping timeout: 245 seconds]
xclite has quit [Quit: Leaving]
Chryson has quit [Quit: Leaving]
hadees has quit [Ping timeout: 265 seconds]
weasels has quit [Quit: WeeChat 0.3.7]
otters has joined #ruby
_theriffer_ has quit [Quit: Leaving.]
<bambanx>
is posible write a method within a method?
<offby1>
no, unfortunately
<horseman>
bambanx: depends, how do u want the inner method to behave?
<offby1>
oh!
* offby1
's ears perk up
techhelp has joined #ruby
<bambanx>
only for work into my main mehtod
Cakey has joined #ruby
techhelp has quit [Read error: Connection reset by peer]
<horseman>
offby1: the thing about methods is they're always bound to the receiver, so if you define a method inside a method then it is bound to the receiver too -- in other words its scope is not limited to just the enclosing methods, it becomes a fully fledged instance method on the receiver
<bambanx>
in my method with variable quantity of args i am rewriting to much code i am trying to find a way for fix it
<horseman>
offby1: so this works:
<horseman>
offby1: class A; def alpha; def beta; end; end; end
<bnagy>
which in other words, means "don't do that"
<horseman>
offby1: a = A.new; a.alpha; a.beta
<horseman>
offby1: should be an extra 'end' in that example above :)
jimmy has quit [Remote host closed the connection]
jimmy has joined #ruby
<horseman>
bnagy: it's useful in one or two situations
<bambanx>
horseman, what mean bound is like a limit?
jimmy has quit [Remote host closed the connection]
Cicloid has quit [Remote host closed the connection]
<bnagy>
horseman: suure it is. Name two with a straight face.
<horseman>
bambanx: no... :) dont worry :)
emmanuelux has quit [Ping timeout: 264 seconds]
jimmybaker has joined #ruby
<bnagy>
you'd be better off using a normal private method
<horseman>
bnagy: when doing metaprogramming stuff, i used it when i wrote an 'attr_accessor_with_defaults'
<bnagy>
at least then you're expressing some kind of intention that the 'inner' method is special
<bambanx>
horseman, i worry i am trying to learn :)
ryanf has joined #ruby
<horseman>
bnagy: other examples are when using method_missing, and defining the missing method on the first time someone tries to access it
<offby1>
what I really miss (Python doesn't have this either) is an easy inline way to create a new scope, like scheme's "let"
<bnagy>
horseman: why does that need a nested method? Surely it's just defining the accessor in class scope?
<bnagy>
or do I misunderstand?
<horseman>
offby1: it's extremely easy to define a let
<horseman>
offby1: let me show u my blog post on it
<bnagy>
horseman: again, that's just dynamic method definition, not nested method definition, no?
<horseman>
bnagy: but that's the point, ruby doesn't have 'nested' method definitions, but i was giving examples wehre it's still useful to put a 'def blah' inside another method
vipaca has joined #ruby
vipaca has quit [Changing host]
vipaca has joined #ruby
<horseman>
bnagy: i.e the: def hello; def goodbye; end; end example
<horseman>
bnagy: or were you specifically arguing against actual nested methods (which ruby doesn't have) ?
<bnagy>
ok, but that kind of wasn't the question. I was foolishly thinking you were answering it ;)
<offby1>
horseman: your cunning disguised fooled me
<offby1>
although I should have known from the "u"s
<horseman>
hehe
<ryanf>
hi horseman
<horseman>
ryanf: hey
<horseman>
offby1: anyway, i think it's a pretty neat way to abuse default arguments to mimic a let*
<ryanf>
how are the horses
<offby1>
horseman: that's about the most elegant definition I've seen in any language :)
<horseman>
ryanf: flashing into the dark
<bnagy>
horseman: more specifically, I thought we were debating about me saying 'don't do that' re trying to make nested methods
fbernier has quit [Ping timeout: 246 seconds]
<horseman>
bnagy: oh ok
<horseman>
bnagy: cool, i think the strongest argument against nested methods is that methods should be so small that you shouldn't need to actually break it up into other inner methods anyway
razer123 has joined #ruby
<horseman>
or more like
<horseman>
you can just define private methods on the class that do that stuff, u dont need to be hide that stuff just inside the method
<horseman>
but maybe offby1 can give a good reason for using them
<offby1>
heh
fbernier has joined #ruby
<offby1>
I just wanted a narrow scope, I think
hadees has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<offby1>
also it's just natural to me to define functions within functions, being an old lisp-head.
<ryanf>
i think it's nice to be able to literally scope helpers inside methods so that it's not part of the broader interface
<horseman>
i went on a campaign trying to get people to implement it in ruby core but didnt get very far
azm has quit [Ping timeout: 276 seconds]
<horseman>
i think it was more or less ignored :P
<horseman>
which is a shame cos it's such a cute implementation
<ryanf>
yeah i hadnt seen it but read it just now
<ryanf>
and enjoyed it
L-----D has quit [Quit: Leaving]
<horseman>
ryanf: i really like exploiting default args
<horseman>
ryanf: another cool feature of that 'let' is that you can use block control keywords in there to do other stuff, like 'redo'
<bnagy>
horseman: yeah, private method is what I said ^^^ up there somewhere
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<horseman>
so: let { x = rand(10); case x; when 3; redo; else "puts hi"; end }
simao has joined #ruby
<horseman>
ryanf: it also gives u the ability to early-exit out of structures that dont normally allow early-exit, by putting a 'next' in code contained in the let
savage- has joined #ruby
tchebb_ has quit [Quit: Leaving.]
tchebb has joined #ruby
Urthwhyte is now known as Urth|Away
<horseman>
against using 'let' though, i've never had a use for it in my life ;)
keanehsiao has joined #ruby
simao_ has quit [Ping timeout: 240 seconds]
rmascarenhas has quit [Quit: leaving]
zommi has joined #ruby
<any-key>
I just looked it up
<any-key>
never seen it before
<any-key>
...outside of haskell :P
dhaskew has quit [Quit: dhaskew]
mrwalker has quit [Remote host closed the connection]
ilyam_ has joined #ruby
ilyam_ has quit [Client Quit]
ryanf_ has joined #ruby
fulmato has quit [Read error: Operation timed out]
c0rn has quit []
ilyam has quit [Ping timeout: 260 seconds]
brianpWins has quit [Quit: brianpWins]
fbernier has quit [Ping timeout: 246 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
fbernier has joined #ruby
mahmoudimus has joined #ruby
baroquebobcat has joined #ruby
horseman has quit [Read error: Connection reset by peer]
L-----D has joined #ruby
horseman has joined #ruby
yankov has joined #ruby
ryanf__ has joined #ruby
icy` has quit [Quit: Leaving]
DRCALKIN has joined #ruby
davidcelis has joined #ruby
kylemcgill has quit [Remote host closed the connection]
davidcelis has quit [Client Quit]
ryanf__ has quit [Client Quit]
davidcelis has joined #ruby
horseman has quit [Read error: Connection reset by peer]
danielvdotcom has joined #ruby
danielvdotcom has left #ruby [#ruby]
rippa has joined #ruby
joshman_ has quit [Quit: Computer has gone to sleep.]
Cakey has quit [Quit: Lost terminal]
davidcelis has quit [Client Quit]
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
horseman has joined #ruby
moshee has quit [Remote host closed the connection]
pdtpatr1ck has quit [Quit: pdtpatr1ck]
moshee has joined #ruby
moshee has joined #ruby
moshee has quit [Changing host]
pdtpatr1ck has joined #ruby
bambanx has quit [Read error: Connection reset by peer]
albemuth has quit [Quit: Computer has gone to sleep.]
ananthakumaran1 has joined #ruby
Jaded is now known as Jade
philcrissman_ has quit [Remote host closed the connection]
khakimov has joined #ruby
sebastorama has quit [Ping timeout: 244 seconds]
Progster has quit [Ping timeout: 245 seconds]
ananthakumaran has quit [Ping timeout: 244 seconds]
Targen has joined #ruby
robdodson has quit [Quit: robdodson]
mikeycgto has quit [Remote host closed the connection]
chimkan_ has quit [Quit: chimkan_]
lkba has quit [Ping timeout: 246 seconds]
td123 has quit [Ping timeout: 246 seconds]
CheeToS has joined #ruby
ananthakumaran has joined #ruby
amolpujari has joined #ruby
austinbv has quit [Quit: austinbv]
tonini has joined #ruby
ananthakumaran1 has quit [Ping timeout: 250 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
fbernier has quit [Ping timeout: 246 seconds]
horseman has quit [Read error: Connection reset by peer]
techhelp has joined #ruby
Zolrath has quit [Quit: Computer has gone to sleep.]
_theriffer_ has joined #ruby
_theriffer_1 has joined #ruby
horseman has joined #ruby
nirakara has joined #ruby
noodletraveler has joined #ruby
kil0byte has quit []
visof has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
mahmoudimus has quit [Read error: Connection reset by peer]
_theriffer_ has quit [Ping timeout: 265 seconds]
zommi has quit [Remote host closed the connection]
jackiechan0 has joined #ruby
jackiechan0 has quit [Remote host closed the connection]
philcrissman has quit [Remote host closed the connection]
techhelp has quit [Quit: Leaving]
mahmoudimus has joined #ruby
Axsuul has quit [Ping timeout: 256 seconds]
tris has quit [Ping timeout: 256 seconds]
mahmoudimus has quit [Client Quit]
Axsuul has joined #ruby
Vert has quit [Read error: Connection reset by peer]
gtuckerkellogg has joined #ruby
chimkan has joined #ruby
mikepack has quit [Remote host closed the connection]
<shevy>
god I hate bundler
techhelp has joined #ruby
<shevy>
apparently you must have openssl installed and working to use bundler + rails
cephalopod has quit [Remote host closed the connection]
hamfz_ has quit [Ping timeout: 245 seconds]
tris has joined #ruby
visof has quit [Ping timeout: 246 seconds]
noganex has quit [Ping timeout: 240 seconds]
adeponte has joined #ruby
noodletraveler has quit [Ping timeout: 246 seconds]
jjp has quit [Ping timeout: 240 seconds]
noganex has joined #ruby
<bnagy>
why would you not want to have openssl installed and working?
<bnagy>
I mean, I'm not so keen about the bundler and Rails part, but...
friskd has joined #ruby
mahmoudimus has joined #ruby
brianpWins has joined #ruby
KL-7 has joined #ruby
nirakara has quit [Quit: This computer has gone to sleep]
Solnse has joined #ruby
KL-7 has quit [Client Quit]
danielvdotcom has joined #ruby
ananthakumaran has quit [Ping timeout: 260 seconds]
kenneth has joined #ruby
mfridh_ has joined #ruby
<kenneth>
hey, i'm curious, how is something like attr_accessor implemented
mfridh has quit [Read error: Operation timed out]
<kenneth>
is it just def attar_accessor on Object
nirakara has joined #ruby
<horseman>
kenneth: no
musl has quit [Read error: Connection reset by peer]
<kenneth>
hmm. the reason i'm asking is because i'd like to replicate something like that
techhelp has quit [Quit: This computer has gone to sleep]
musl has joined #ruby
<horseman>
kenneth: like this: class Module; def attr_accessor(*args); args.each { |v| define_method(v) { instance_variable_get("@{v}") }; define_method("#{v}=) { |c| instance_variable_set("@#{v|", c) }; end
<horseman>
something like tha t^
<horseman>
a few typos there but u get the idea
<kenneth>
hmm, interesting. why is it defined on the Module class?
<horseman>
kenneth: because it defines instance methods, and only modules (and classes, which are a type of module) can have instance methods
<kenneth>
and would it be possible to make something like that only works on subclasses of class X?
<horseman>
kenneth: Yes
scb has quit [Remote host closed the connection]
<horseman>
kenneth: you'd define it like this: class X; def self.attr_accessor...; end
<kenneth>
ah, i see
<horseman>
then all subclasses could use it
<kenneth>
that's awesome. gotta love ruby
<horseman>
yeah, ruby is the shit
<horseman>
there's usually a way to do something, and the way is typically elegant
<horseman>
no matter how ambitious the idea
<kenneth>
the only thing i haven't been able to do
maahes has quit [Ping timeout: 252 seconds]
yxhuvud has joined #ruby
harukomoto has quit [Ping timeout: 246 seconds]
jesly_ has quit [Ping timeout: 246 seconds]
<kenneth>
being able to create a enqueue do; whatever; end
jesly has quit [Ping timeout: 244 seconds]
<horseman>
why cant u do that
<kenneth>
which would serialize the block, send it to a queue, and execute it later
<kenneth>
because you can't serialize code and capture scope at the same time
scb has joined #ruby
scb has quit [Read error: Connection reset by peer]
<horseman>
brb
horseman has quit [Remote host closed the connection]
altiouz has joined #ruby
xjiujiu has joined #ruby
whuffor has quit [Read error: Operation timed out]
lambdan has quit [Read error: Operation timed out]
<bnagy>
heisenscope
<bnagy>
of course you can
c0rn has joined #ruby
<bnagy>
they just haven't done it neatly yet :D I think jruby is probably closest, but I dunno if they want to have features > MRI
yugui_zzz is now known as yugui
<kenneth>
i mean if you could, that'd be beyond awesome
<kenneth>
that's something that only lisps can do at the moment
<kenneth>
essentially, continuations
minijupe has quit [Quit: minijupe]
altiouz has quit [Ping timeout: 256 seconds]
DRCALKIN has quit [Quit: Leaving]
lambdan has joined #ruby
<bnagy>
google for marshallable proc
<bnagy>
I would quite like it to be a mainstream feature, as well :)
ananthakumaran has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
<bnagy>
although if you think through the use cases, in a lot of them you actually want to strip out the old binding
<bnagy>
which pretty much leaves you at eval, but it's just that we all love to hate on eval
<bnagy>
me included
<kenneth>
yeah i mean that was something i really wanted a long time ago
<kenneth>
now i've moved on to other things
wvdschel has joined #ruby
<bnagy>
there are tons of concurrent programming options for ruby though
mattp_ has quit [Read error: Operation timed out]
AlbireoX has joined #ruby
<bnagy>
so despite wanting a marshallable proc, I don't _need_ it
mattp_ has joined #ruby
<kenneth>
right
<kenneth>
at this point i'm sold on using zeromq
sspiff has quit [Ping timeout: 246 seconds]
<kenneth>
and a language-agnostic distributed architecture
<kenneth>
most of our product is in php anyway, sadly
cdepue has quit [Remote host closed the connection]
<bnagy>
yeah that's pretty much how I approach it
<bnagy>
except I'm not sold on pure 0mq for work-queue patterns
<bnagy>
so we use beanstalkd for that bit
<kenneth>
i'm working on writing my own ruby mvc micro framework as a side project though
<fowl>
jackiechan0, you can't do gets from codepad, because nobody is sitting at the terminal to input
schovi has joined #ruby
<fowl>
kenneth, whats confusing about that?
keanehsiao has quit [Quit: keanehsiao]
<jackiechan0>
fowl: i don't understand why when i gets.chomp the break string it doesn't break
<jackiechan0>
fowl: thanks for helping
<fowl>
jackiechan0, because while imput == imput.downcase will go on forever
<fowl>
if its true
<jackiechan0>
fowl: yeah but i i'mut the 'CIAO NONNA' uppercase that should break the loop
tchebb has joined #ruby
<jackiechan0>
fowl: and what i get is the break string puts 'CIAO NIPOTE TORNA PRESTO!!' and the first string puts 'Ciao nipote da quanto tempo? come stai?' string again
<kenneth>
jackiechan0: also, it's spelt input ;)
<jackiechan0>
fowl: seems that break let me out the loop but since start = '' and while start =='' is still true, it let me get into the loop again
<bnagy>
jackiechan0: wtf is while start=='' ??
<bnagy>
jackiechan0: just use loop dp
<bnagy>
*do
khakimov has quit [Quit: Computer has gone to sleep.]
<kenneth>
okay never mind, i'm starting to get it
<kenneth>
not the most readable piece of code :p
ABK has joined #ruby
<fowl>
jackiechan0, the inner break will only break you out of that loop, but like i said, that condition "while input == input.downcase" is a trap
<bnagy>
jackiechan0: and those inner while loops are bad control flow. You actually want to be testing if the input is uppercase
<bnagy>
which means one input=gets.chomp and then some kind of if or case statement
danblick has left #ruby [#ruby]
<jackiechan0>
bnagy: ok fowl tnx
<bnagy>
jackiechan0: basically, the skeleton is loop do; #get input; if input is IN CAPS do this, elsif it's the break command break else be deaf end end
<jackiechan0>
mhh
<bnagy>
although I would favour a case statement over if elsif imho
maesbn_ has joined #ruby
<jackiechan0>
bnagy: i have just a question , what I did at the begin of the skeleton was start=''
<jackiechan0>
while start == ''
<jackiechan0>
bnagy: i'ts the same to write while true instead ?
<bnagy>
yes, that's just an obfuscated way to write 'loop do'
yankov has quit [Read error: Connection reset by peer]
<bnagy>
while true is also stupid, just less stupid
noodletraveler has joined #ruby
maesbn_ has quit [Read error: Connection reset by peer]
yankov has joined #ruby
maesbn has joined #ruby
<jackiechan0>
bnagy: sorry but i'm using the infos that the book gave to me until now, if i use more advanced options i'll get confused
<bnagy>
while (0^3&&3^0)||0%1==0... I mean it's just silly
<bnagy>
jackiechan0: I wish you'd stop saying that
<bnagy>
if you want to use only what the book gives you, don't ask questions here
<bnagy>
if you ask questions here, then listen to the answers
quesada_ is now known as urlwolf
<jackiechan0>
bnagy: ok ok i don't want to say that tnx for your time so do loop
<jackiechan0>
bnagy: why don't try
Gavilan has left #ruby [#ruby]
<bnagy>
jackiechan0: also, remember that while it's an OK book, learn to program was written just after the american civil war
<jackiechan0>
bnagy: lol ! do u suggest me to change book ?
akem has joined #ruby
<bnagy>
I have no strong opinion on the matter. The exercises seem OK, but some of the "solutions" you present as being from the book are terrible
xiaotian has quit [Quit: Computer has gone to sleep.]
looopy has quit [Remote host closed the connection]
francisfish has quit [Remote host closed the connection]
<jackiechan0>
bnagy: the author gives various solutions to the exercises 1) Deaf Grandma -How you could do it: & How I would do it:
andrewhl has quit [Quit: andrewhl]
<bnagy>
imho I would rather people break bad habits right at the start, but I'm not didactic
Guest48615 has quit [Ping timeout: 252 seconds]
<jackiechan0>
bnagy: i think the same as you, you you get a bad habit maybe you could have difficulty to remove in the future
<jackiechan0>
bnagy: anyway.... where did you start learning ruby if i can ask ?
ph^ has joined #ruby
<bnagy>
I wrote code, but I already knew how to program and knew several other languages
<bnagy>
learning your fourth language is a very different process to learning to program
<bnagy>
\o/ length match!
<jackiechan0>
bnagy: that's true skeleton of some language is similar so you learnt it very fat
<jackiechan0>
*languages
kaneda has joined #ruby
kaneda is now known as Guest50932
<bnagy>
the skeletons of every language are similar, if you go deep enough
djdb has joined #ruby
MrGando has joined #ruby
<jackiechan0>
bnagy: that's good, if you are able to learn very well a language it will be really easier to learn other
adeponte has quit [Remote host closed the connection]
kaneda_ has joined #ruby
<bnagy>
learning to program is something else. Once you can program then languages are just a way to help (or hinder) you with their own flavour of magic incantations and style
<bnagy>
here, you're learning about loops and flow control
<bnagy>
just happens to be in ruby (allegedly)
abionic has joined #ruby
Guest50932 has quit [Ping timeout: 245 seconds]
<bnagy>
anyway, enough philosophy, go make deaf nonna
<jackiechan0>
:
<jackiechan0>
)
<kenneth>
(segments = path.split('/')).shift
Shrink has quit [Ping timeout: 244 seconds]
<kenneth>
is there a more idiomatic way of doing that?
noodletraveler has quit [Ping timeout: 245 seconds]
<jackiechan0>
bnagy: loops and flow control just happen in ruby?!
<bnagy>
there's a constant for the separator, for a start
<bnagy>
and some File methods you might want to look at
Morkel has joined #ruby
ABK has quit [Ping timeout: 256 seconds]
<rking>
kenneth: Hrm, yep. So you're throwing away the first part completely?
gokul has joined #ruby
<kenneth>
yes
<kenneth>
it's for a request_uri that starts with a leading /
kevinbond has quit [Quit: kevinbond]
<rking>
So far I have: throwaway, *segments = "a/as/sd/f/".split '/' …but I'm sure there's something better re the "throwaway" part.
kenichi has quit [Remote host closed the connection]
<bnagy>
kenneth: nb if you're just going to modify these routes at instance time then I don't see why you can't just have ivars, you would only do all this stuff if you have some meta happening, I think
<kenneth>
so something like def self.add_route(r); @routes << r; end
<bnagy>
should be, yeah
<bnagy>
then you just need to jump through small hoops to access that @routes as an instance
kaneda_ has quit [Ping timeout: 244 seconds]
Hanmac1 is now known as Hanmac
<bnagy>
like a class accessor self.routes @routes then instance time you can self.class.routes
<bnagy>
or possibly something more elegant, I try and avoid meta these days :/
wargasm has joined #ruby
kaneda_ has joined #ruby
pdtpatr1ck has quit [Quit: pdtpatr1ck]
pdtpatr1ck has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jimeh2 has quit [Ping timeout: 265 seconds]
noodletraveler has quit [Ping timeout: 245 seconds]
noodletraveler has joined #ruby
Kabaka_ is now known as Kabaka
ryanf has quit [Quit: leaving]
noodletraveler has quit [Ping timeout: 252 seconds]
Neil___ has joined #ruby
noodletraveler has joined #ruby
piotr_ has joined #ruby
eka has joined #ruby
hemanth has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
neil__ has quit [Ping timeout: 265 seconds]
blacktulip has joined #ruby
bosphorus has joined #ruby
horseman has quit [Read error: Connection reset by peer]
ananthakumaran has joined #ruby
arturaz has joined #ruby
banseljaj is now known as imami|afk
neersighted is now known as neersighted[d]
seoaqua has joined #ruby
horseman has joined #ruby
Helius has joined #ruby
<seoaqua>
will File.open set a file to nothing if it's aborted by user or by exception?
<hemanth>
seoaqua, depends on the mode?
<rking>
seoaqua: Well, it will close the IO in an "ensure".
<bnagy>
(if you use the block form)
<seoaqua>
rking: what if i did not use 'ensure'? will the file be set to zero byte?
noodletraveler has quit [Ping timeout: 244 seconds]
Urth|Away is now known as Urthwhyte
<rking>
seoaqua: You implicity do "ensure" by using the block-form of File.open.
rajkane has joined #ruby
<rking>
From `echo '$ File.open' | pry` (with the pry-doc gem installed): if (rb_block_given_p()) return rb_ensure(rb_yield, io, io_close, io);
Vendethiel has joined #ruby
noodletraveler has joined #ruby
pdtpatr1ck has quit [Quit: pdtpatr1ck]
<seoaqua>
rking: i cant quite follow u. pls tell me directly will the file be zero with block-formed File.open :)
heftig has quit [Quit: leaving]
<seoaqua>
rking: i even dont know there is another way of File.open
Eldariof-ru has joined #ruby
<rking>
seoaqua: So your scenario is: File.open { |f| f.write buncha_stuff; … fail }, now you're wondering if some/all of buncha_stuff made it to disk?
<rking>
seoaqua: Sure, there's the non-block form (which I don't think you generally want): f = File.open
<rking>
seoaqua: BTW for things like this the best way is Try It And See. #ruby may give you good info, or it may give some random dude like me a chance to spout half-baked knowledge.
<kenneth>
is it not possible to do def self.route(*methods, path, &block)
<seoaqua>
rking: my file is randomly set to nothing, and i cant locate the error yet. i assume File.open to be the most suspicious one
hoelzro|away is now known as hoelzro
noodletraveler has quit [Ping timeout: 245 seconds]
<Beoran__>
seoaqua, sounds more like the writing fails
sparrovv has joined #ruby
<seoaqua>
Beoran__: but the disk could never be full, and there should be no hardware problems
<rking>
kenneth: You can do that… why do you ask?
rajkane has quit [Remote host closed the connection]
<kenneth>
i'm having trouble with it, it's spitting out an error because somehow path becomes the Proc
nikhil_ has quit [Quit: This computer has gone to sleep]
<rking>
kenneth: Gist me more code.
<kenneth>
i'm probably doing something wrong here then: def self.get(path, &block); self.route(:get, path, &block); end
<kenneth>
er, scratch that, no & on line 2
noodletraveler has joined #ruby
<seoaqua>
Beoran__: if i'm writing a huge text string to file /tmp/abc and then Ctrl+C. will the /tmp/abc be noting? or the original text?
<rking>
kenneth: Well, your 'block' is misnamed.
<rking>
kenneth: A block is a callable thing that cannot possibly have a name.
<rking>
kenneth: So I'm wondering if it's a Proc.new {…}, proc {…}, or lambda {…}
<rking>
seoaqua: I'd think the implicit .close would flush the buffer
<kenneth>
it's used as get '…' do …
tvw has joined #ruby
Vendethiel has quit [Ping timeout: 244 seconds]
maxgas has joined #ruby
<rking>
kenneth: Hook it up with more code on a gist. I can't see what's what.
<kenneth>
that's a block, no? and then i can grab it as a variable on the get method that gets executed
<kenneth>
okay, hold on
<seoaqua>
rking: still cant follow u :S
<maxgas>
Hello people. I'm a Java guy and i'm having problems understanding some Ruby snippets. Maybe you guys can quickly help with some details?
<maxgas>
In this code..
<maxgas>
while i < code.size chunk = code[i..-1]
<maxgas>
What does i..-1 mean?
<maxgas>
The double dots are confusing me.
<maxgas>
It's the i minus -1 inside the code string?
<rking>
maxgas: '..' creates a range. In this case, it's sort of a special case, since -1 means the last element.
<maxgas>
Acessing as an array?
<seoaqua>
rking: what's the procedure of File.open? to wirte a tmp file and then mv to the target file? or clean the target file then write to it?
<maxgas>
Oh, a range.
<maxgas>
I see.
<maxgas>
So, a range between the current loop index and -1?
<rippa>
maxgas: if code is an array, that gives you elements from i to last
replore has quit [Remote host closed the connection]
noodletraveler has quit [Ping timeout: 252 seconds]
<maxgas>
Oh, i see.
<maxgas>
Thanks. :)
BiHi has joined #ruby
noodletraveler has joined #ruby
<rking>
seoaqua: It's going to boil down to the syscall open(), which returns a file descriptor. That FD will then get write()s, but the whole thing is buffered (because it's inefficient to write each byte as it comes in). Under normal circumstances, you may or may not see your data due to that buffering, but my understanding is that a close() will flush first.
<maxgas>
Ruby's syntax is still a challenge for me.
<maxgas>
I'm blinded by c-like languages.
jjp has joined #ruby
* rking
wonders how one finds the implementations of things like close() in /usr/src/linux/**/*
<rking>
maxgas: Yeah, it's plenty cryptic at times. And it's very difficult to google for stuff like that.
<rking>
maxgas: Your 4 options (AFAIK) are: 1) Try it and see. (Or should I say, Pry it and see (?)), 2) grep existing ruby code to see if you can get some context, 3) read a Ruby book straight through, 4) ask somebody.
<seoaqua>
rking: so u mean its my second guess? btw,i never used .close , will {} do it?
ronniy has joined #ruby
Shrink has joined #ruby
<maxgas>
rking, yeah, i went through google a few times and could not find nothing about the double dots. Ended up here.
<maxgas>
IRC is usually my last resort.
<rking>
seoaqua: Yes. File.open(…) { … } has an "ensure" inside it, which does an IO#close, and that fluses the stream
<seoaqua>
rking: there was a normal text file,then i start the program, so
<seoaqua>
bnagy: hug u
<bnagy>
and I always recommend adding 'b' if you ever want your code to run on windows
Jade has quit [Ping timeout: 248 seconds]
<seoaqua>
bnagy: not a gay way
tvw has quit [Remote host closed the connection]
<rking>
bnagy: But then that fubars the encodings, no?
<bnagy>
not that there's anything wrong with that
<bnagy>
rking: no it just stops ruby messing with your \r\n stuff
urlwolf has quit [Quit: Konversation terminated!]
roolo has joined #ruby
<rking>
bnagy: Nope.
<rking>
echo ö > x; ruby -e 'File.open "x", "rb" do |f| p f.read end' ⇒ "\xC3\xB6\n"
foofoobar has joined #ruby
<rking>
ruby -e 'File.open "x", "r" do |f| p f.read end' ⇒ "ö\n"
ABK_ has joined #ruby
<bnagy>
?
<rking>
bnagy: Encoding gets fubard by the 'b' flag.
<rking>
As in, it treats the bytes as chars.
<bnagy>
:) No it doesn't, it just read it as binary
<bnagy>
the contents of the file are the same
<bnagy>
just force_encoding on the string or whatever if you love umlauts
<rking>
Well, I'm not sure about all the behaviors, but clearly .inspect gets it wrong after "rb" mode.
<rking>
Yeah, no.
<rking>
force_encoding is more of a problem than \r.
<bnagy>
depends what kind of data you're writing
beneggett has joined #ruby
<rking>
kenneth: Do you have any unit tests?
abionic has quit [Ping timeout: 245 seconds]
skogis has joined #ruby
<kenneth>
actually, reload, but here's the code that's giving me trouble. i haven't gotten to testing the `call` method, i'm still blocked on the route for now :) https://gist.github.com/7da1fd318c0a3ebf0139
darthdeus has joined #ruby
francisfish has joined #ruby
<kenneth>
and no, i don't really do TDD. i know it's all the rage, but i usually build unit tests after i build the feature to prevent regressions, instead of before
<rking>
kenneth: Gritty bits like this are perfect for TFD.
yeggeps has quit [Quit: yeggeps]
kylemcgill has joined #ruby
yugui is now known as yugui_zzz
codespectator has quit [Quit: Computer has gone to sleep.]
ukwiz has joined #ruby
<rking>
kenneth: I'm really not sure why what you expect to see in 'block' is ending up in 'path'. Is 'block' nil at that point?
<kenneth>
rking: NoMethodError: undefined method `split' for #<Proc:0x007fbecc02efd0@(pry):3> \ from /Users/kenneth/Dropbox/dev/azure/kenji/lib/kenji/controller.rb:52:in `block in route'
<kenneth>
i expect block to simply be passed along, but it seems to end up in the path variable, and i guess path is eaten up by the splat
<rking>
kenneth: Yes, but what is in 'block'?
<kenneth>
hmm, lemme see. nil i presume, but lemme check
<kenneth>
yeah, def nil
<kenneth>
I'm assuming my problem is that block is not ending up in &block, because &block only takes anonymous closures, not variables containing closures
Asher1 has joined #ruby
Choobie has quit [Ping timeout: 245 seconds]
codespectator has joined #ruby
medik has quit [Read error: Connection reset by peer]
<Hanmac>
kenneth not 100% true ... &block can take any object with has a to_proc method
Asher has quit [Ping timeout: 240 seconds]
<kenneth>
oh, looks like doing self.route(…, &block) instead of just `block` does the magic
medik has joined #ruby
<rking>
kenneth: Aha! Good work.
petercs has joined #ruby
fixl has joined #ruby
<kenneth>
i ruby syntax always trips me up. that's a sign that i need to spend more time with it
MrGando has quit [Ping timeout: 240 seconds]
brianpWins has quit [Read error: Connection reset by peer]
yankov has quit [Quit: yankov]
indeterminate has joined #ruby
brianpWins has joined #ruby
MrGando has joined #ruby
brianpWins has quit [Remote host closed the connection]
brianpWins has joined #ruby
<kenneth>
:p i'm more of a objc / c / php / lisp developer
Asher has joined #ruby
Asher1 has quit [Ping timeout: 244 seconds]
maxgas has quit [Quit: Page closed]
yankov has joined #ruby
piotr__ has joined #ruby
piotr_ has quit [Ping timeout: 276 seconds]
yankov has quit [Client Quit]
<rking>
hemanth: Cool. How come you didn't use open() in the XKCD.comic method?
<hemanth>
rking, yes with require 'open-uri'
<rking>
hemanth: But XKCD.img uses it, but XKCD.comic uses Net::HTTP::Get.new and such.
<rking>
Also, as part of the tangent from reading the 'xkcd' gem source, I found this fun oneo 'URI::DEFAULT_PARSER.instance_eval { @regexp }' | pry -rnet/http
seoaqua has quit [Ping timeout: 245 seconds]
<hemanth>
strange! I'm using open() it self
brianpWins has quit [Quit: brianpWins]
<rking>
hemanth: Oh, shoot. I was looking at the xkcd.rb from "gem install xkcd". It doesn't look like this. =)
<hemanth>
rking, :) you must get this with the latest version of the gem
<rking>
hemanth: Do you know why my 'gem install' didn't get the latest version?
<hemanth>
rking, you have two versions?
<hemanth>
gem uninstall xkcd && gem install xkcd
<rking>
hemanth: This is the code that came in: # These settings were set by the catalyst build script that automatically
<rking>
# built this stage.
rushed has joined #ruby
<rking>
# Please consult /usr/share/portage/config/make.conf.example for a more
<hemanth>
vectorshelve, gita; it's not who you think!
Vainoharhainen has joined #ruby
<vectorshelve>
hemanth: Bhagavad gita right
<hemanth>
vectorshelve, yes not; gita the girl
c0rn has quit []
mohit_ has joined #ruby
mohit__ has joined #ruby
<vectorshelve>
hemanth: arey yaar... bura joke.. aur waise b aaj ke zamaane ladkiya itne achche naam thodi rakhte hain.. it will be like sandra.. maria and all that :D
mohit__ has quit [Client Quit]
mohit_ has quit [Client Quit]
<hemanth>
vectorshelve, :P
<horseman>
vectorshelve: i want you to be banned forever
mohit_ has joined #ruby
mohit_ has quit [Remote host closed the connection]
<vectorshelve>
horseman: why ?
mohit_ has joined #ruby
ananthakumaran has quit [Ping timeout: 252 seconds]
mohit_ has quit [Read error: Connection reset by peer]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<horseman>
vectorshelve: because you're an irritant
ananthakumaran has joined #ruby
<vectorshelve>
horseman: can u explain as to how did I irritate u...
ananthakumaran has quit [Read error: Connection reset by peer]
<Hanmac>
vectorshelve ignore him, he spamming 99.99% the time
sepp2k has quit [Remote host closed the connection]
<DefV>
mai/23
tonini has quit [Remote host closed the connection]
ciopte7 has quit [Quit: ciopte7]
ananthakumaran has joined #ruby
<vectorshelve>
Hanmac: ok..
<horseman>
vectorshelve: ignore Hanmac, not only is he german but he's also has Aspergers. a lethal combination that possibly makes him the most boring man on the planet
<workmad3>
heh
<vectorshelve>
Hanmac: becom33 workmad3 shevy all of you ROCK \m/ and horseman STFU ok
<horseman>
vectorshelve: i will wear a suit made from your skin b4 the end of the night
<vectorshelve>
horseman: hahahaha
<workmad3>
vectorshelve: quick bit of advice btw... IRC is pretty brutal, you may want to grow a bit of thicker skin (no offence meant)... also useful because it'll keep horseman warmer in his vectorshelve suit
<vectorshelve>
Hanmac: is he justin bieber's dad ? :D
FlyingFoX has joined #ruby
<workmad3>
shove a group of highly opinionated, arrogant loudmouths together and then remove all form of visual feedback and sparks are gonna fly :)
Mohan has quit [Ping timeout: 240 seconds]
schovi has quit [Remote host closed the connection]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
Mohan has joined #ruby
pietr0 has quit [Remote host closed the connection]
pietr0 has joined #ruby
<workmad3>
wow, I killed the conversation
<bnagy>
THANKYOU
<workmad3>
:)
<vectorshelve>
workmad3: yeah thanks to ur boring incongruous obscure philisophical excerpts :D
ecolitan has quit [Remote host closed the connection]
yonggu has quit [Read error: Connection reset by peer]
yonggu has joined #ruby
A124 has joined #ruby
A124 has left #ruby [#ruby]
jackiechan0 has quit [Ping timeout: 245 seconds]
narkoz has joined #ruby
jackiechan0 has joined #ruby
<narkoz>
how can I refactor it: message = users > 0 ? 'ok' : nil
<Hanmac>
its like: if users > 0 then message = 'ok' else message = nil end
<baniseterfiend`>
or just: message = 'ok' if users > 0
<hemanth>
gem list > my_list
<hemanth>
gem install my_list?
workmad3 has quit [Read error: Operation timed out]
thecreators has quit [Quit: thecreators]
<bnagy>
narkoz: yeah, don't crosspost like that, please
MrGando has quit [Read error: Connection reset by peer]
SegFaultAX|work2 has quit [Read error: Connection reset by peer]
SegFaultAX|work2 has joined #ruby
jadon has left #ruby [#ruby]
thecreators_ has joined #ruby
Vendethiel has joined #ruby
mohits has quit [Remote host closed the connection]
zz_chrismcg is now known as chrismcg
gazler_ has quit [Remote host closed the connection]
<shevy>
ack
<shevy>
narkoz!!!
wargasm has quit [Read error: Connection reset by peer]
<shevy>
good that apeiros is not here, he'd ban you outright
adambeynon has joined #ruby
wargasm has joined #ruby
hakanensari has quit [Ping timeout: 265 seconds]
dwaynecrooks has quit [Read error: Operation timed out]
narkoz has left #ruby [#ruby]
jackiechan0 has quit [Quit: Sto andando via]
savr has joined #ruby
<savr>
hi
<savr>
how do I get bundle install to stop asking for my password?
<savr>
it seems like every gem I add requires it now
BiHi has quit [Quit: Computer has gone to sleep]
<shevy>
the bundler gurus are on #bundler
<shevy>
for my part I try to just avoid anything that uses bundle
chimkan has quit [Quit: chimkan]
urorbit has joined #ruby
Guedes_out is now known as Guedes
urorbit has quit [Quit: Leaving]
<savr>
shevy, why?
<shevy>
savr it never worked for me. Even when I do something simple, like this, require 'bundler', it explodes into errors NoMethodError: undefined method `root' for Bundler:Module
<shevy>
lately it exploded in another error because I did not have openssl installed
<savr>
it is working for whatever I'm using it for
<savr>
:)
<shevy>
I thought you have a problem with passwords ... :P
nirakara has quit [Quit: This computer has gone to sleep]
Eldariof-ru has quit []
jesly_ has joined #ruby
dwaynecrooks has joined #ruby
luxpir has left #ruby ["_part"]
jesly has joined #ruby
berserkr has quit [Quit: Leaving.]
fjfish has joined #ruby
sohocoke has joined #ruby
Eldariof-ru has joined #ruby
<savr>
shevy, it takes bundle about 30 seconds to promt for the password
<shevy>
hehe
<savr>
so I have to run the command and come back to let it run for about 3 min
<shevy>
shows its solid design and planning!
<savr>
it is horribly slow
n1x has joined #ruby
<shevy>
could be a feature :)))
kylemcgill has quit [Remote host closed the connection]
greyEAX has quit [Remote host closed the connection]
<savr>
shevy, linux
<baniseterfiend`>
shevy: sup shevs
liluo has quit [Remote host closed the connection]
<mfridh_>
Could anyone shed some light on this failure on nokogiri native extension? Fedora 16: https://gist.github.com/70eadd7c0a1159dccf81 . gem install nokogiri -v 1.5.2 gives same results.
Soda has quit [Read error: Connection reset by peer]
davidcelis has quit [Read error: Connection reset by peer]
davidcelis has joined #ruby
<Hanmac>
mfridh_ you need ruby dev package and libxml2 dev package
gokul has quit [Quit: Leaving]
<Hanmac>
(but it seems that user make programm is missing)
greyEAX has joined #ruby
mtfk has joined #ruby
fjfish has quit [Read error: Connection reset by peer]
<mtfk>
hi anyone know some good solution for override class ?
mneorr has quit [Remote host closed the connection]
francisfish has joined #ruby
<Hanmac>
mtfk what are you planing todo??
greyEAX has quit [Remote host closed the connection]
<mfridh_>
hah omg
<mfridh_>
Hanmac: yeah, make is missing
<mfridh_>
too obvious!
<mtfk>
I have class let say: class Foo < A
<mtfk>
and I make a plugin which should override this class to use class Foo < B
<Hanmac>
mtfk this is not possible without breaking other code
radic has quit [Ping timeout: 240 seconds]
<mtfk>
so I need remove old one class and then write new one
<Hanmac>
but you could define B as module and include it an Foo
<Hanmac>
yeah you could remove the old class but its not good style
greyEAX has joined #ruby
<mtfk>
if I will include B as module then I still have A
<Hanmac>
yeah
<mtfk>
which I do not want to have and I will need to override all methods from it to make sure that all which will work will be from B
<Hanmac>
i think you should make clear what excatly you want todo
<Hanmac>
its still ugly code
<mtfk>
I have application where I have model which inherits fromo ActiveRecord and I want to replace it by model which will inherits from ActiveLdap
noodletraveler has quit [Quit: leaving]
<mtfk>
replace I mean create plugin which will override functionality of this application
dnyy has quit [Remote host closed the connection]
kil0byte has joined #ruby
<mtfk>
beacause I want to have possibility to uninstall plugin and back to orignal functionality
[edu] has left #ruby [#ruby]
<mtfk>
and only one thing which works right now is to remove old one model which is not best solution
fearoffish has joined #ruby
savr has left #ruby ["Ex-Chat"]
fermion has joined #ruby
<Hanmac>
make a class with does not inherit from any of them, but let the Foo class take an object, you can change the object
<vectorshelve>
shevy: what is that "e" from line 121 to 134 -> begining of each line
<shevy>
vectorshelve I usually keep an alias e to puts, or another method, so that I can lateron change the output method
ananthakumaran has quit [Read error: Connection reset by peer]
<shevy>
e is shorter to type, but I usually hook it up into some method that uses ansi colours, for commandline output
<Hanmac>
shevy: set_*() methods are bad style
<shevy>
and that way I can toggle it
ananthakumaran has joined #ruby
<vectorshelve>
shevy: so where is that u define the alias.. in the same file ?
<shevy>
vectorshelve usually yes, or on a per-project basis
<shevy>
Hanmac well I could get rid of the set_ part, but I dont wanna use = instead either :(
<Hanmac>
but "method=" is the ruby way of life :P
<vectorshelve>
shevy: ok... nice... but define sensible aliases.. intepretable by laymen.. I mean e for print doesnt make much sense :) just a suggestion
<shevy>
vectorshelve what else would you use
<shevy>
vectorshelve I mean, the sensible thing would be to use puts :)
<vectorshelve>
shevy: write_out :)
<bnagy>
shevy: wow that's horrible
<shevy>
yeah but puts would tend to be short
xkx has joined #ruby
<shevy>
bnagy hah, it's only one file of a larger project, I dont dare show the other files :)))
<shevy>
but one fun thing from another file...
Eldariof-ru has quit []
<vectorshelve>
shevy: then dont waste lines of ruby code to define aliases for something primitive :)
<wlievens>
I'm trying to install Ruby on CentOS 5. Is that possible without building from source?
<wlievens>
Not just ruby, RoR and a specific application
tomzx has quit [Ping timeout: 276 seconds]
mengu has joined #ruby
ivar has joined #ruby
mrwalker has joined #ruby
becom33 has quit [Ping timeout: 248 seconds]
mvangala has joined #ruby
neil__ has joined #ruby
<JonnieCache>
wlievens: you could find rpms for ruby
<JonnieCache>
there is no official ones though afaik
dhaskew has quit [Quit: dhaskew]
<seanstickle>
rvm is going to be a better option, I suspect
<seanstickle>
Unless you really really can't compile
<JonnieCache>
after youve installed ruby, rails, its dependencies and everything else are managed by the gem system
madtyp97 has joined #ruby
madtyp97 has left #ruby [#ruby]
<JonnieCache>
rvm on a server can be a nightmare. just do everything by hand, after trying lots of solutions thats what i do now
<seanstickle>
But some of the gems may require local compilation
fbernier has joined #ruby
<seanstickle>
rvm on a server *can* be a nightmare, but also can be fine.
<JonnieCache>
oh yeah there is that. impossible to avoid without massive effort.
<seanstickle>
Anything on CentOS 5 is going to be a nightmare. :P
snearch has quit [Quit: Verlassend]
<seanstickle>
You might be able to use JRuby on your local machine and then compile the whole app to JVM byte code and deploy to CentOS 5
<seanstickle>
That could work, but I make no promises
<JonnieCache>
rvm on the server just leads to problems when deploying. the shell environment it sets up is so convoluted its trickly to get it to work via ssh automation
<JonnieCache>
tbh thats probably my lack of linux-foo
<seanstickle>
JonnieCache: there is server-wide installs of rvm these days
<seanstickle>
JonnieCache: it works ok
<wlievens>
what is rvm?
<JonnieCache>
yeah ive tried that. you still have to load the script and set the shell variables and oh god i dont want to even think about it
<wlievens>
JonnieCache: actually building right now so I think I will sit it out
<wlievens>
seanstickle: I'm not in a position to do that with this server I guess
<seanstickle>
Dang shame
<JonnieCache>
dont knock centos
<wlievens>
I probably could if I really wanted to, but then I'd be the guy in charge of that server
<JonnieCache>
for work purposes the reliability is nice
* seanstickle
knocks CentOS
kaspernj has joined #ruby
<matled>
JonnieCache: the only problem I have with compiling from source is that it also moves the responsibility of checking if I have the latest version (mainly for security related fixes)
<seanstickle>
The reliability of a C-64 is pretty good too.
<seanstickle>
:P
<JonnieCache>
if youre just running redmine you dont need all the latest shit. you need a server that wont make extra work for you
<wlievens>
yes, you get me
<baniseterfiend`>
seanstickle: sup stick
<wlievens>
you've used redmine?
<seanstickle>
Hey baniseterfiendishly
vectorshelve has quit [Quit: Page closed]
<JonnieCache>
wlievens: nope
<seanstickle>
I am departing for the verdant shores of Python, I'm afraid
becom33 has joined #ruby
tar_ has joined #ruby
<seanstickle>
I will miss the honeyed music of Ruby
<seanstickle>
Redmine is … something.
<wlievens>
hmm?
<seanstickle>
A bad wiki and a mediocre ticket tracker, come together to form a … something.
<seanstickle>
;)
<wlievens>
I can't see that character to be honest
<wlievens>
it's a black block
<seanstickle>
Ellipses.
<seanstickle>
. . .
<JonnieCache>
black block? oh right sorry
withnale_ has joined #ruby
<wlievens>
I was just looking for a relatively light weight project management tool
<JonnieCache>
thought you were talking about anarchists
<seanstickle>
JonnieCache: haha
<baniseterfiend`>
seanstickle: Stick.
<JonnieCache>
wlievens: best project management tool is a whiteboard and postit notes
<JonnieCache>
if you need to check it remotely point a webcam at it
<seanstickle>
A3 paper is my project management too of choice
<seanstickle>
*too -> tool
<JonnieCache>
ooooh new nmap
<JonnieCache>
SCAN ALL THE THINGS
test34- has joined #ruby
test34- has quit [Changing host]
test34- has joined #ruby
withnale_ has quit [Client Quit]
withnale_ has joined #ruby
<JonnieCache>
ok first the printer...
<baniseterfiend`>
seanstickle: stick, do you have a background in python?
<seanstickle>
baniseterfiend`: no, but I have a background in systems administration and devops
<seanstickle>
I'm sure to keep using Ruby in my sideline work though.
mrlemon has joined #ruby
<seanstickle>
Cause it's so purty
baroquebobcat has quit [Quit: baroquebobcat]
gauloises has joined #ruby
<baniseterfiend`>
seanstickle: i thought a lot of devops stuff is ruby these days with chef/puppet and frens
<seanstickle>
There is puppet involved, it is true.
christianrojas has joined #ruby
<baniseterfiend`>
seanstickle: maybe you could secretly replace the python with ruby
<seanstickle>
Ha
<baniseterfiend`>
start by writing you code like this
<baniseterfiend`>
def hello
<baniseterfiend`>
puts "hi"
<baniseterfiend`>
end
nilg has quit [Remote host closed the connection]
philcrissman has joined #ruby
<balboah>
My ruby 1.8.7 refuses to find an installed gem, json_pure in particular. Shouldn't "ruby" be getting same paths as "ruby" and "irb"? However gem list says its there
<wlievens>
how long should the "linking ruby" part of the build take?
robbyoconnor has joined #ruby
<balboah>
aaah require 'rubygems' fixed it
zz_chrismcg is now known as chrismcg
mrwalker has quit [Remote host closed the connection]
narkoz has joined #ruby
ken_barber has quit [Remote host closed the connection]
<mejzz>
Is there a way to set a specific platform for bundler?
<mejzz>
I would like to "bundle install" for another platform
linoj has joined #ruby
hynkle has joined #ruby
KL-7 has joined #ruby
rbanffy has joined #ruby
jrist-afk is now known as jrist
malcolmva has quit [Ping timeout: 272 seconds]
tomb_ has quit [Quit: Computer has gone to sleep.]
tar_ has quit [Quit: farewell]
narkoz has left #ruby [#ruby]
tk___ has joined #ruby
LOLZIE has joined #ruby
bglusman has joined #ruby
kpshek has joined #ruby
enroxorz has joined #ruby
<enroxorz>
join #r.trees
<enroxorz>
sorry
<enroxorz>
forgot /
KL-7 has quit [Quit: This computer has gone to sleep]
<wlievens>
if I "make install" ruby, does it automatically make /usr/bin/ruby point to the version I built?
<wlievens>
(there already was a version of ruby installed)
ivar has quit [Remote host closed the connection]
lorandi has joined #ruby
<heftig>
wlievens: should be /usr/local/bin/ruby
<heftig>
that should be before /usr/bin in the PATH
<wlievens>
hmm /usr/local/bin/ruby: No such file or directory
<seanstickle>
"/usr/bin/env ruby" is what you'll want to use in a script
axl_ has quit [Read error: Connection reset by peer]
<seanstickle>
Do "which ruby"
<wlievens>
which ruby
<wlievens>
returns /usr/bin/ruby
axl_ has joined #ruby
<wlievens>
(but I installed ruby earlier with yum)
<hoelzro>
wlievens: why are you clobbering your system Ruby with another Ruby?
<hoelzro>
that sounds like a bad idea.
KL-7 has joined #ruby
<wlievens>
hoelzro: the Redmine installation tutorial tells me to install ruby from source. Should I uninstall the existing ruby installation first?
v0n has joined #ruby
<hoelzro>
I don't see why you couldn't just use your system Ruby...
<hoelzro>
but I'm no expert
<wlievens>
I think it's because I need the headers for other dependencies
<wlievens>
can't find header files for ruby.
<wlievens>
(says gem install passenger)
<hoelzro>
wlievens: have you tried installing him?
<hoelzro>
s/him/them/
<wlievens>
installing what?
<hoelzro>
the ruby headers?
<wlievens>
how?
MrGando has joined #ruby
<hoelzro>
yum?
<wlievens>
yum install .... <--- fill me in here
<hoelzro>
I have no idea
<hoelzro>
I don't use CentOS
<hoelzro>
hang on
asobrasil has joined #ruby
<hoelzro>
wlievens: try ruby-devel
<wlievens>
that fetches headers for 1.8.5-24.el5
<wlievens>
I seem to need 1.8.6 or higher
ananthakumaran has quit [Quit: Leaving.]
chson has quit [Remote host closed the connection]
<wlievens>
so I tried it with a yum repo config file for a repo that has 1.8.6
<hoelzro>
what version of CentOS are you on?
<wlievens>
5.4
<hoelzro>
ah
<wlievens>
CentOS release 5.4 (Final)
<wlievens>
then I get errors like
<wlievens>
file /usr/lib/ruby/1.8/xmlrpc/datetime.rb from install of ruby-libs-1.8.5-24.el5.i386 conflicts with file from package ruby-libs-1.8.6.383-6.el5.kb.x86_64
<wlievens>
should I uninstall the "old" ruby-devel somehow first?
<hoelzro>
yes
<wlievens>
(it also seems to be for 32 bit which makes even less sense)
<hoelzro>
hopefully that doesn't break anything...
<wlievens>
is that yum remove ruby-devel?
* hoelzro
shrugs
<wlievens>
hehe
<hoelzro>
more likely ruby-libs
<hoelzro>
as far as 'yum remove' goes, I don't know
<wlievens>
that seems to do something
dv310p3r has joined #ruby
<wlievens>
hmm seems to have some things depending on it
<wlievens>
oh well I'll be bold
dv310p3r has quit [Read error: Connection reset by peer]
n1x has quit [Quit: Ex-Chat]
KL-7 has quit [Quit: This computer has gone to sleep]
<wlievens>
okay looks nice
flype has joined #ruby
cha1tanya has joined #ruby
becom33 has quit [Ping timeout: 252 seconds]
becom33 has joined #ruby
ivar has joined #ruby
csavola has joined #ruby
trivol has joined #ruby
csavola has quit [Client Quit]
davidw has quit [Ping timeout: 246 seconds]
ElitestFX has joined #ruby
saschagehlich has joined #ruby
rippa has quit [Quit: derp herp]
rbanffy has quit [Quit: Ex-Chat]
rbanffy has joined #ruby
mpereira has joined #ruby
theRoUS has joined #ruby
chrismcg is now known as zz_chrismcg
rmascarenhas has joined #ruby
nilg has joined #ruby
Guest65890 has quit [Remote host closed the connection]
nari has quit [Ping timeout: 260 seconds]
<baniseterfiend`>
seanstickle: hi
<seanstickle>
Hallo again
<baniseterfiend`>
seanstickle: im bored, any interesting discoveries or something you've learned recently?
<wlievens>
gem install bundler
<wlievens>
ERROR: Error installing bundler:
<wlievens>
bundler requires Ruby version >= 1.8.7.
<wlievens>
help
gtuckerkellogg has joined #ruby
<seanstickle>
I learned some stuff about angels. That's interesting to me. Less so to most other people.
<seanstickle>
Also, I've been reading about throughput accounting.
bojicas has joined #ruby
<baniseterfiend`>
seanstickle: i've been watching a lot of documentaries about geology
<seanstickle>
Also about endogenous retroviruses.
<Tasser>
wlievens, install new ruby
<seanstickle>
I hear that life is a significant geologic force on earth
<baniseterfiend`>
seanstickle: do you know much about the mass extinctions?
<seanstickle>
Is that borne out in the documentaries
<seanstickle>
I know a fair bit about extinction level events, yeah
<baniseterfiend`>
seanstickle: sure, it is
<wlievens>
Tasser: are there any newer versions available for centos 5.4?
<Hanmac>
wlienvens it seems that you need an newer OS :P
<wlievens>
no control over that sorry
<baniseterfiend`>
seanstickle: here i'll link you the series, it's not one of those awful gooey-eyed american sensationalist docos
<wlievens>
so I build from source?
<baniseterfiend`>
seanstickle: it's calm sober stuff by a cynical old brit
yonggu_ has quit [Remote host closed the connection]
<JonnieCache>
baniseterfiend`: enjoy, the greatest documentary program ever made: http://www.youtube.com/watch?v=-QetE6WvBFY indeed it is the blueprint for all documentaries since in some ways
yonggu has joined #ruby
davidw has joined #ruby
<baniseterfiend`>
JonnieCache: bronowski?
<seanstickle>
baniseterfiend`: that guy looks *exactly* like I would expect a geologist to look like
<baniseterfiend`>
JonnieCache: yeah that's very good
davidw is now known as Guest54524
<baniseterfiend`>
seanstickle: hehe, i agree (though technically he's a biologist with an interesting in geology, unless you're not talking about the host himself)
dv310p3r has joined #ruby
<baniseterfiend`>
interest in*
<seanstickle>
I'm talking about the guy with the beard and the crazy hair
<baniseterfiend`>
ah yeah
bojicas has quit [Client Quit]
<baniseterfiend`>
seanstickle: geology-beards existed long before unix-beards :P and just as ubiquitous
<seanstickle>
Ah, the host is a different guy, I see
<JonnieCache>
if only for his awesome transparancies he uses
bojicas has left #ruby [#ruby]
<baniseterfiend`>
JonnieCache: cool! though i find penrose kind of incoherent, not his own fault, but he always pitches his general-audience lectures way too high :P
<baniseterfiend`>
JonnieCache: you should see his 'general audience' lecture on "twistor theory"
<baniseterfiend`>
it's ridiculous, there's old grandmas in the audience and he's talking about quaternions
<JonnieCache>
hah yeah i tried to watch that. got about 10 minutes in
<baniseterfiend`>
and vector spaces
<seanstickle>
baniseterfiend`: this is a *great* series
<seanstickle>
Twistors is awesome
<baniseterfiend`>
seanstickle: yeah, the one on 'snowball earth' is the most fascinating
<JonnieCache>
that one i linked is kind of toned down though compared to another version of the same lecture. its a christmas lecture open to the public
companion has quit [Ping timeout: 252 seconds]
<baniseterfiend`>
seanstickle: apparently 600 millions years ago the earth was completely encased in ice 1km thick
<seanstickle>
I recently learned that flowers only appeared 300 MM years go
<seanstickle>
*ago
<JonnieCache>
i saw an amazing docu about the earths core, you should watch that if you can find it. it was a recent bbc one
<JonnieCache>
theres all kinds of mad stuff down there, as you might imagine
<wlievens>
ahhhhhhhh
<seanstickle>
And the Devonian age of no terrestrial life, and short dwarf plants across the land
<wlievens>
sudo make install gives me errors
<seanstickle>
Baffles my imagination
dv310p3r has quit [Client Quit]
<baniseterfiend`>
seanstickle: and it was only due to the most ridiculous outpouring of magma and gas from volcanoes that was able to melt the ice, due to filling the atmosphere with methane and co2 (greenhouse gases)
<seanstickle>
Ha
<baniseterfiend`>
JonnieCache: ah i think i saw that, they go to a laboratory in japan right?
<baniseterfiend`>
where the have a machine to apply the same temperatures and pressures found in the core
<wlievens>
what does that mean?
<JonnieCache>
hmm cant quite remember. there was a lot of stuff about stalagmites of molten iron or something
<baniseterfiend`>
seanstickle: cool
carloslopes has joined #ruby
<JonnieCache>
actually i do vaguely remember a japanese man looking very pleased with his dangerous looking machine
flype has quit [Quit: Computer has gone to sleep.]
eka has joined #ruby
<baniseterfiend`>
yeah hehe
<baniseterfiend`>
he was proud of himself
<seanstickle>
Also learned recently that our mitochondria, the resident bacteria in our cells, are refugees from the oxygen holocaust caused by the overproduction of oxygen by cyanobacteria a few billion years ago
<seanstickle>
They hid in other cells to survive the devastation of oxygen in the atmosphere, and now we carry them around
elliot98 has joined #ruby
<seanstickle>
Crazy notions.
ananthakumaran has joined #ruby
<baniseterfiend`>
seanstickle: was that in a doco or you read that somewhere?
emmanuelux has quit [Remote host closed the connection]
<seanstickle>
baniseterfiend`: I was reading a book on symbiotic bacteria and such things
dv310p3r has joined #ruby
<wlievens>
any idea why ruby's "make install" step fails?
<baniseterfiend`>
cool
<seanstickle>
Also read, in a related book, that live birth in mammals was made possible by a horrible immunossuppressive retrovirus disease
<baniseterfiend`>
seanstickle: haha
<seanstickle>
That, after some mutation, allowed animals to have non-eggshell-contained organisms inside them without rejection by the immune system
<baniseterfiend`>
now that is cool
<Hanmac>
seanstickle why dont we also carry cloroplasts around ?
<seanstickle>
Hanmac: I don't believe so
<seanstickle>
Hanmac: but at this point, it wouldn't surprise me
<seanstickle>
Oh, "why"
<seanstickle>
I dunno.
kil0byte_ has joined #ruby
<Hanmac>
it would be cool if we could feed ourself with sunlight :P
<seanstickle>
baniseterfiend`: yeah, so the next time you have a friend who is pregnant you can say, "thank goodness for the horrible devastation of ancient AIDS that allowed you to give live birth."
emmanuelux has joined #ruby
<baniseterfiend`>
seanstickle: i'll put that on the 'congratulations' card ;)
<seanstickle>
But don't be surprised if it doesn't go over well. :)
nu7hatch has joined #ruby
<seanstickle>
I brought that up at dinner once with some friends who were going to have children.
<seanstickle>
It was not as interesting to them, I don't think
<seanstickle>
I am an idiot
<wlievens>
there there
exchgr has joined #ruby
KL-7 has joined #ruby
<seanstickle>
:)
<wlievens>
JonnieCache: mayhaps you have a hint for me?
<wlievens>
I'm clueless
<wlievens>
I get /root/Downloads/ruby-1.9.3-rc1/lib/fileutils.rb:1371:in `initialize': Permission denied - /usr/local/bin/ruby (Errno::EACCES)
<wlievens>
during make install
kil0byte has quit [Ping timeout: 245 seconds]
<baniseterfiend`>
seanstickle: what do u think of the aquatic ape theory
elhu has joined #ruby
<JonnieCache>
well firstly dont install rc1 of 1.9.3
<Tasser>
wlievens, rbenv/rvm
<JonnieCache>
install the latest 1.9.3
<seanstickle>
baniseterfiend`: I read that years ago, but it seemed to be persuasive, in my limited knowledge.
<wlievens>
okay that's a good start
<Tasser>
wlievens, ruby guys never liked package managers ;-)
<seanstickle>
I've also heard rebuttals that make an equally strong case for the same results in a savannah environment
<seanstickle>
Sometimes I think evolutionary theory is a bit of a "Just So" story
<Tasser>
wlievens, and wtf @ compiling stuff as root
<seanstickle>
Until we have fossils and things
<wlievens>
Tasser: what part of "clueless" did you miss?
<wlievens>
I'm not supposed to do that?
<seanstickle>
Certainly evo-psych is mostly bullshit
<baniseterfiend`>
seanstickle: yeah, i liked the explanation of human tears/crying; that we were (like other aquatic animals) covering our eyes with a layer of protective mucas for when we ran into the sea to escape a predator
<baniseterfiend`>
mucus
<Tasser>
wlievens, grab a basic linux guide
<seanstickle>
And our unusual ability to hold our breath for a long time.
<wlievens>
Tasser: I know the basic commands mind you
<seanstickle>
And forward-facing genitals
<baniseterfiend`>
seanstickle: so whenever you see someone cry, you know they're really (evolutionarily speaking anyway :P) getting ready to run into the sea
<Tasser>
wlievens, I'd say you shouldn't be let on a server, but I suppose everyone has his time constraints ;-)
joshman_ has joined #ruby
<seanstickle>
I dunno, it all makes a good sense.
<seanstickle>
But people say that about all sorts of crazy stuff, I guess
<wlievens>
Tasser: nobody else in my company is going to. We don't have sysadmins
<wlievens>
small company
kil0byte has joined #ruby
<Tasser>
wlievens, now that's a hazard I'd say
<wlievens>
JonnieCache: what is the latest stable version I should install?
<wlievens>
the one with the -p suffix then?
<wlievens>
Tasser: small company...
<Tasser>
wlievens, then install a linux on yer own and become the sysadmin ;-)
odinswand has joined #ruby
<wlievens>
Tasser: not in a million years
mengu_ has joined #ruby
mengu has quit [Ping timeout: 244 seconds]
<wlievens>
it's not like this stuff is enjoyable
<Tasser>
wlievens, so why are you doing sysadmin work?
<wlievens>
because I'm not an autistic idiot? :)
<Tasser>
did you draw the smallest straw? ^^
<wlievens>
not really, I'm the closest to a sysadmin in this context - unfortunately :)
<wlievens>
how is that even possible if I'm logged in as root :-/
<wlievens>
ooooh
<Tasser>
selinux? -w ?
<Tasser>
mount -o ro ?
<wlievens>
it seems /usr/local is mapped to a mounted drive
<wlievens>
I have no idea what to make of that
<wlievens>
ll /usr/local returns: /usr/local -> /[some path physically on another machine]
<wlievens>
ll is ls -l ofc
catphish has left #ruby ["Leaving"]
<Tasser>
who did setup that?
<wlievens>
a colleague - who happens to be absent
kil0byte has quit [Ping timeout: 260 seconds]
<baniseterfiend`>
i
<wlievens>
Today, at least. But I'm not going to go and change that right now :)
baniseterfiend` is now known as banisterfiend
C0deMaver1ck has joined #ruby
cmarques has joined #ruby
<wlievens>
so erm, /usr/local is where software is typically installed?
<wlievens>
I'm guessing this mount was set up such that software installed on our other server can be used on this one
PaciFisT has joined #ruby
<Tasser>
wlievens, prepare for fuckup...
<wlievens>
hah
<wlievens>
I'll just go and install ruby on that other server, then
<wlievens>
could not possibly go wrong!
sspiff has joined #ruby
sspiff has joined #ruby
<Tasser>
probably you can abuse a vagrant instance for production...
<Tasser>
vms are a good way to experiment anyway :-)
kaspernj has quit [Quit: Leaving]
bjhaid has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
andrewhl has joined #ruby
uris has quit [Ping timeout: 244 seconds]
<LOLZIE>
In a block such as 1000.times { }, is it possible to programmatically find the 1000 from within the block?
ivar has quit [Remote host closed the connection]
<LOLZIE>
i.e. is it stored into some sort of variable
eka has quit [Quit: Leaving]
crankycoder has joined #ruby
<heftig>
LOLZIE: just give it a variable, e.g. { |x| }
<heftig>
it will pass 0 to 999
<LOLZIE>
heftig: I'm not looking for the current iteration number, but the total number of times
<heftig>
ah, no.
<heftig>
well, give it a variable :p
<heftig>
a = 1000; a.times { ... }
<LOLZIE>
Saying that actually, I've just modified my code to not need this (it was wrong) - would be interesting if there was a way but not necessary :)
bjhaid has quit [Read error: Connection reset by peer]
heisenmink has quit [Quit: Lämnar]
<wlievens>
Tasser: vagrant is a virtual machine engine?
<wlievens>
is it good? it sounds interesting
ananthakumaran has quit [Quit: Leaving.]
chson has joined #ruby
<wlievens>
but - can I then still a RoR app in it on that server? I probably can but I have no clue how
maesbn has quit [Remote host closed the connection]
JC_SoCal has joined #ruby
ph^ has quit [Remote host closed the connection]
anildigital_work has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
spligak has quit [Remote host closed the connection]
ph^ has joined #ruby
wvms has quit [Quit: wvms]
pvh has joined #ruby
tomb_ has joined #ruby
lkba has joined #ruby
JohnBat26 has quit [Remote host closed the connection]
relix has joined #ruby
kenperkins has joined #ruby
moeSeth has joined #ruby
<hoelzro>
jadon: can you verify that your setter is running?
<hoelzro>
also, why not just use attr_reader if you're going to override the writer?
francisfish has joined #ruby
<jadon>
I've tried a number of things ~ even just manually defining and nada.
<hoelzro>
jadon: works for me
chimkan_ has joined #ruby
<hoelzro>
what version of Ruby are you on?
<jadon>
1.9.2
Targen has joined #ruby
<hoelzro>
hmm, nevermind, it does not work for me.
billiamii has joined #ruby
MasterIdler has joined #ruby
<Hanmac>
INFORMATION: in ruby "abc.xyz = bla" returns "bla" indipent from whats inside "xyz="
Synthead has joined #ruby
<seanstickle>
True fact
<hoelzro>
Hanmac: ah, thank you
<hoelzro>
I did not know that
wvms has joined #ruby
<hoelzro>
jadon: that explains it
<mrbrdo>
what's the pastebin for ruby that executes the code and displays output too?
pygospa has quit [Disconnected by services]
pygospa has joined #ruby
<Hanmac>
so abc.send(:xyz=,bla)
oooPaul has joined #ruby
<hoelzro>
mrbrdo: codepad?
<jadon>
so the override will not work ?
freeayu3 has quit [Quit: 离开]
mnaser has joined #ruby
mnaser has joined #ruby
<Hanmac>
jadon, it works but blah.some_option = will not show it ... you need an blah.some_option after that
demici has joined #ruby
demici has left #ruby [#ruby]
Dr4g has joined #ruby
mikepack has joined #ruby
ziyadb has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
<mrbrdo>
Hanmac any idea what the reason behind this design is though?
sohocoke has quit [Quit: sohocoke]
<Hanmac>
mrbrdo the same reason for this: a = b = c = d = e = 0
notbrent has joined #ruby
macmartine has joined #ruby
saidin_ has joined #ruby
_marvin has joined #ruby
fr0gprince_mac has joined #ruby
wvms has quit [Ping timeout: 244 seconds]
thecreators_ has quit [Quit: thecreators_]
Spaceghostc2c has joined #ruby
lorandi has quit [Quit: Leaving]
ank has joined #ruby
gearaholic has quit [Remote host closed the connection]
mikeycgto has joined #ruby
mikeycgto has quit [Changing host]
mikeycgto has joined #ruby
<makkura>
jadon: check your comments
Eldariof-ru has quit []
<mrbrdo>
Hanmac seems reasonable, a bit weird though :)
seanstickle has quit [Quit: Nihil sub sole novum]
blooberr has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
sohocoke has joined #ruby
albemuth has joined #ruby
td123 has joined #ruby
mohit_ has joined #ruby
mohit_ has quit [Read error: Connection reset by peer]
mohit_ has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
bjhaid has joined #ruby
mohit_ has quit [Client Quit]
lectrick has joined #ruby
randym has joined #ruby
mohits has quit [Client Quit]
tworkin has joined #ruby
mohits has joined #ruby
kish has quit [Ping timeout: 252 seconds]
mohits_ has joined #ruby
imami|afk is now known as banseljaj
mohits has quit [Disconnected by services]
mohits_ is now known as mohits
mohits has quit [Changing host]
mohits has joined #ruby
mohits_ has joined #ruby
ipoval has joined #ruby
amar_key has joined #ruby
mohits has quit [Remote host closed the connection]
mohits_ has quit [Remote host closed the connection]
SeanTAllen has joined #ruby
davidboy has joined #ruby
crankycoder has quit [Remote host closed the connection]
vipaca has joined #ruby
ben225 has joined #ruby
beneggett has quit [Ping timeout: 240 seconds]
ben225 is now known as beneggett
bjhaid has quit [Quit: Leaving.]
kish has joined #ruby
sohocoke has quit [Remote host closed the connection]
techhelp has joined #ruby
kish has quit [Read error: Connection reset by peer]
eywu has joined #ruby
hoelzro is now known as hoelzro|away
crankycoder has joined #ruby
<jadon>
messed with it more… even with the suggestions…. no dice. If I'm using attr_accessor for other variables do you think that would cause issue attr_reader for one?
maesbn has joined #ruby
cesario has joined #ruby
schovi has quit [Remote host closed the connection]
khakimov has joined #ruby
kil0byte_ has joined #ruby
techhelp has quit [Client Quit]
ABK has quit [Ping timeout: 276 seconds]
kish has joined #ruby
mneorr has joined #ruby
kish has quit [Read error: Connection reset by peer]
denysonique has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
kil0byte has quit [Ping timeout: 276 seconds]
mikepack has joined #ruby
mahmoudimus has joined #ruby
mengu_ has joined #ruby
kish has joined #ruby
carloslopes has joined #ruby
cbuxton has joined #ruby
ipoval has quit [Quit: ipoval]
kish has quit [Read error: Connection reset by peer]
Axsuul has quit [Read error: Connection reset by peer]
Vendethiel has quit [Ping timeout: 260 seconds]
tworkin has quit [Quit: Leaving.]
Prz has quit [Remote host closed the connection]
dnsdds has joined #ruby
Guest54524 has quit [Ping timeout: 244 seconds]
kish has joined #ruby
Helius has quit [Remote host closed the connection]
kish has quit [Read error: Connection reset by peer]
Targen_ has joined #ruby
joshman_ has joined #ruby
Targen has quit [Ping timeout: 245 seconds]
patricksroberts has joined #ruby
ivar has joined #ruby
berserkr has joined #ruby
timonv has quit [Remote host closed the connection]
altiouz has joined #ruby
kish has joined #ruby
cmarques has joined #ruby
mrwalker_ has joined #ruby
kish has quit [Read error: Connection reset by peer]
pdtpatr1ck has joined #ruby
mrwalker has quit [Read error: Connection reset by peer]
tworkin has joined #ruby
BiHi has quit [Ping timeout: 245 seconds]
MrGando has quit [Quit: Computer has gone to sleep.]
dnyy has joined #ruby
looopy has quit [Remote host closed the connection]
quest88 has quit [Quit: quest88]
kish has joined #ruby
Vendethiel has joined #ruby
kish has quit [Read error: Connection reset by peer]
<cek>
How do you write onliner that would rescue any Exception class?
apeiros_ has joined #ruby
kish has joined #ruby
philcrissman_ has joined #ruby
ron has joined #ruby
cha1tanya has quit [Read error: Connection reset by peer]
<Mon_Ouie>
begin; …; rescue Exception; …; end
kish has quit [Read error: Connection reset by peer]
<Hanmac>
jadon maye your ruby is broken ...
<cek>
Mon_Ouie, eh, non beauty
* rking
thumbs up the use of Unillipses.
codespectator has quit [Ping timeout: 244 seconds]
<ron>
someone please help :( I know nothing about ruby, just trying to get this app running, and I get this error: http://pastebin.com/CWPJdPhv - no matter how many online solutions I've tried following, I keep failing :-/
<Mon_Ouie>
It's visually ugly because you want to do it in one line
<jadon>
so I'm not crazy ~ this should work no?
<Mon_Ouie>
It's also dangerous, and should usually not be done
<cek>
raise rescue 'rescued'
<cek>
but how about Exception
<Gowie>
Hey all, I am trying to subclass array, but I am losing the to_yaml method which I like for debuggin. Anybody have any idea why? The error I get when I call to_yaml is "Anchor value must not be empty". and here is the code I use to subclass Array: https://gist.github.com/2770062
<Mon_Ouie>
It is not forbidden to hit the enter key while writing Ruby code
<Hanmac>
jadon i test it with 1.8 and 1.9 both works for me and p returns {:name=>"Option 1", :desc=>""}
brasten has joined #ruby
<jadon>
it's not using the override for me. I even hardest @some_option to "blah" and still no return outside of what I pass it.
<Hanmac>
jadon or is 0 your wanted output?
<jadon>
0 is NOT the wanted output
<Mon_Ouie>
Gowie: You forgot to require 'json'?
<jadon>
I am trying to just pull from the constant ~ even simplified and set @some_option = "blah" in the setter and still no dice.
kish has joined #ruby
<Gowie>
Mon_Ouie: Hm, can you explain why that would matter?
<Hanmac>
jadon so the getter still returns 0 ??
<jadon>
if I set it to 0 then yes
banseljaj is now known as imami|afk
<Mon_Ouie>
Because the to_yaml method is defined in the YAML library
<jadon>
it'll return whatever I set it to ~ it will not return whatever is in the setter method though.
<Mon_Ouie>
ron: You probably didn't have OpenSSL installed when compiling ruby, which is why it didn't get compiled then
kish has quit [Read error: Connection reset by peer]
francisfish has quit [Remote host closed the connection]
<Mon_Ouie>
Install it (the OpenSSL C library), and recompile your ruby
<Hanmac>
jadon check if you realy use the currect code
Tomasso has quit [Ping timeout: 245 seconds]
looopy has joined #ruby
<jadon>
this is inside a lib ~ exiting rails console and going back in should reset it no?
<Mon_Ouie>
jadon: I also doubt you're really just running the code that you've shown us
CheeToS has quit [Ping timeout: 244 seconds]
<Gowie>
Mon_Ouie: So I put "require 'json'" at the top of that file and still am getting the same error. What is the connect between the YAML library and json? Maybe that will help me understand you better
<jadon>
I did do a separate file as a test.
<Mon_Ouie>
Woops, I meant require 'yaml', sorry
<Gowie>
Mon_Ouie: Ahhh ok, yepp that makes sense. Thanks
digitalcakestudi has joined #ruby
<ron>
Mon_Ouie: already tried that, still getting the error.
<cek>
How do you get process exit status in popen3 in 1.8.7?
codespectator has joined #ruby
<Gowie>
Mon_Ouie: yeah, that didn't work. Made sense but didn't work
kish has joined #ruby
<Gowie>
I mean I guess I can live without it but i'll probably just cry myself to sleep every night
ViperMaul has quit [Ping timeout: 245 seconds]
kish has quit [Read error: Connection reset by peer]
ViperMaul has joined #ruby
<jadon>
… that is crazy - if I create pass the same lines in the gist to the file itself and call the file it executes it properly, however if I pass the same lines in the rails console it fails.
Rizzle has quit [Ping timeout: 265 seconds]
yankov has quit [Quit: yankov]
bdnelson has quit []
<Hanmac>
so rails is the creap? XD
<shevy>
cek, try something like Process.pid or Process.getpgid(Process.ppid())
<shevy>
pid = Process.fork { exec(cmd) }
<Mon_Ouie>
ron: You did install the development files too (not just the library files)?
<cek>
with 3 pipes connected
wargasm has joined #ruby
<jadon>
bleh! but it makes no sense no? assigning the property multiple ways in different tests… these should not fail in the rails console.
<ron>
Mon_Ouie: I'm not sure. I'm a Java developer.. not used to all those OS packages and dependencies. Specific guidance would be greatly appreciated :)
looopy has quit [Remote host closed the connection]
<Mon_Ouie>
Well, that would depend on what OS you're using first
<jadon>
@hanmac thanks for the help man ~ for some reason it wasn't working properly when the class was pre-loaded. When I stopped preloading it the property used the override
<becom33>
carloslopes, *
jjp has joined #ruby
kish has joined #ruby
<becom33>
its not a clean code . still im working on it
dnyy has quit [Read error: Connection reset by peer]
markborcherding has joined #ruby
abra has quit [Ping timeout: 276 seconds]
cdepue has quit [Ping timeout: 260 seconds]
dnyy has joined #ruby
<carloslopes>
becom33: hmm let me see it
kish has quit [Read error: Connection reset by peer]
<becom33>
okey thanks
abra has joined #ruby
kenichi has joined #ruby
<shevy>
hmm
<benwoody>
becom33: do you use emacs?
<shevy>
come to github becom33 ! :(
<Hanmac>
jadon :P another reason why i not like rails :P
bglusman_ has joined #ruby
<shevy>
it's more convenient to follow people there for me :P
* Hanmac
is on github and on bitbucket too
<becom33>
i will shevy when Im done with this test framework
<shevy>
cool
bglusman has quit [Read error: Connection reset by peer]
<jadon>
lots of tears on the inside now… what a waste of time that was
<shevy>
jadon hehehe
<becom33>
benwoody, no
<shevy>
jadon pain is good when you remember it for the rest of your life!
dwaynecrooks has quit [Quit: Ex-Chat]
<jadon>
thankfully there was no loss of life during this process.
<becom33>
benwoody, i know I need to get rid of the save files
<benwoody>
becom33: :)
theRoUS is now known as coar
netogallo has joined #ruby
<becom33>
Hanmac, would you like contribute ?
syamajala has joined #ruby
kish has joined #ruby
ramblex has joined #ruby
cek has quit [Quit: жопа диридай диридиридай]
Morkel has quit [Quit: Morkel]
tatsuya_o has joined #ruby
<Hanmac>
what?
kish has quit [Read error: Connection reset by peer]
<shevy>
I thinK Hanmac is busy with C-things
<shevy>
wait
<shevy>
C++
<carloslopes>
becom33: interesting project :)
<becom33>
carloslopes, thanks
<carloslopes>
becom33: i will mark here to see it more patiently later
bjhaid has quit [Ping timeout: 252 seconds]
<becom33>
carloslopes, thanks . if can help me to keep a clean code :)
fermion has joined #ruby
Araxia_ has joined #ruby
<becom33>
btw does any one know about open source licenses ? i need some help with it
* Hanmac
is building wx bindings, and maker and an game-engine and an map parser .... all in or for ruby :P
<bnagy>
deep_copy is usually Marshal.load Marshal.dump(obj)
Eldariof59-ru has joined #ruby
hashpuppy has joined #ruby
krusty_ar has quit [Read error: Connection reset by peer]
jesly_ has quit [Ping timeout: 244 seconds]
friskd has quit [Ping timeout: 244 seconds]
kish has joined #ruby
ananthakumaran has joined #ruby
<lectrick>
it looks like clone should copy the tainted? but dup shouldn't
<lectrick>
or is it the frozen?
krusty_ar has joined #ruby
Eldariof-ru has quit [Read error: Operation timed out]
<bnagy>
deep dup in particular makes not much sense
jesly has quit [Ping timeout: 276 seconds]
aszurom has joined #ruby
<bnagy>
clone should copy both
kish has quit [Read error: Connection reset by peer]
friskd has joined #ruby
<bnagy>
deep_copy > clone > dup
zinjacoder_ has joined #ruby
<hashpuppy>
i have module MyModule; module Util; def method1; end; end; then i have module MyModule; module SubModule; def self.blah ... end; end; end; in self.blah, how can I access MyModule::Util::method1? I keep getting unitialized constant
Tomasso has joined #ruby
andrewhl has joined #ruby
cdepue has quit [Remote host closed the connection]
<aszurom>
I'm writing my first ruby code? I'm about to ask a bunch of really simple questions :-)
<bnagy>
hashpuppy: make it a module_function maybe, or include it or something
<aszurom>
I assume that arguments passed to the program will be in some array. Is that Arguments[] by chance?
<vandemar>
ARGV
netogallo has quit [Ping timeout: 245 seconds]
Jay_Levitt has joined #ruby
Eldariof27-ru has joined #ruby
<bnagy>
aszurom: trollop is a nice gem for proper opt parsing, if argv is too annoying
tommyvyo has joined #ruby
<aszurom>
is this correct? filename = File.extend_path(ARGV[0])
elliot98 has joined #ruby
<bnagy>
expand+path
friskd has quit [Client Quit]
<bnagy>
*_
redgetan has joined #ruby
kish has joined #ruby
Gowie has joined #ruby
<aszurom>
ok, but the File object here puts what into filename var?
<aszurom>
it makes filename an instance of the File class?
kish has quit [Read error: Connection reset by peer]
<bnagy>
assuming you call the correct method, the expanded path of whatever was the first argument
<bnagy>
~/thing -> /home/fred/thing
jackiechan0 has quit [Quit: Sto andando via]
<bnagy>
filename will be a string
jackiechan0 has joined #ruby
Eldariof59-ru has quit [Ping timeout: 244 seconds]
<bnagy>
there are docs for this, btw :)
<aszurom>
yeah, so I'd heard :)
Gowie1 has quit [Ping timeout: 276 seconds]
<aszurom>
I wish the content on RubyMonk had gone into file operations
<aszurom>
well, the goal here is that I'm going to pass this code a filename which will be a .csv file. Then I'm going to read the contents of the csv into an array of hashes I think
<rking>
Hahaha
jesly_ has joined #ruby
<bnagy>
aszurom: dream big, man
kish has quit [Read error: Connection reset by peer]
timonv has joined #ruby
<bnagy>
aszurom: check out 'csv' in stdlib. It's pretty darn cool, for free
<aszurom>
the end game here is that I have a csv that has 6 columns. I want the total, average, max and min values of each column
bondar has joined #ruby
<aszurom>
yeah, csv seemed pretty straightforward
keanehsiao has quit [Quit: keanehsiao]
<aszurom>
powershell handled it by actually creating an object that represented the file, and then you'd work methods on the object to manipulate the file
<aszurom>
I dunno if that's real or not, but I'm not going
ken_barber has joined #ruby
kish has quit [Read error: Connection reset by peer]
<rking>
bnagy: I know that one and goatse (← Although I pride myself on never actually having seen it. I survived the great goatse slashdot wave of '00 unharmed)
<aszurom>
Chet from Valve had joked he was going to do something on it
Iicke has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
ananthakumaran has joined #ruby
mengu_ has quit [Quit: Konversation terminated!]
mengu_ has joined #ruby
jrist is now known as jrist-afk
ilyam has quit [Ping timeout: 250 seconds]
<rippa>
rking: have you seen boku no pico?
<rking>
No.
kish has joined #ruby
<rking>
For some reason I'm tempted to search for that one.
<rippa>
you haven't seen anything then
<rippa>
also A Serbian Film
cdepue has joined #ruby
dphase has joined #ruby
kish has quit [Read error: Connection reset by peer]
looopy has quit [Remote host closed the connection]
tewecske has joined #ruby
tewecske has quit [Max SendQ exceeded]
wargasm has quit [Read error: Connection reset by peer]
voodoofish has quit [Ping timeout: 265 seconds]
robert_ has joined #ruby
<aszurom>
Holy Mountain? the one movie I can't make it through
macer1 has quit [Remote host closed the connection]
kish has joined #ruby
dysoco has joined #ruby
ilyam has joined #ruby
<dysoco>
now this is a stupid question, but I just can't remember how do you name the ":name" things ? That are like strings
kish has quit [Read error: Connection reset by peer]
wargasm has joined #ruby
<shevy>
dysoco symbol
<robert_>
shevy: haiii! :D
<dysoco>
shevy, thanks!
<robert_>
so, I have a string formatted a specific way (e.g. "XXX00YYY"), where I need to extract the specific parts, according to a format and shove them into an array (e.g. [ "XXX", "00", "YYY" ]); what's the best way to do this?
<shevy>
dysoco, they always have the same object_id, unlike strings. "foo" has different object id than has "foo" even though both should be the same
<shevy>
heya robert_
sungnyc has quit [Read error: Connection reset by peer]
<robert_>
how goes it? :D
kiwnix has joined #ruby
kpshek has quit []
<dysoco>
shevy, Oh OK, so that's the main difference ?
<shevy>
robert_, hmm... how about ... #pack and #unpack? are there any rules that govern that splitting... split on numbers?
<apeiros_>
so an iphone doesn't have to be that unfamiliar :-p
<robert_>
hah, sweet. :D
kish has joined #ruby
<robacarp>
dysoco: suddenly, 2012!
<dysoco>
IDK, I never used an iPhone :P
<bfrog>
:blah is also called an atom in other languages
<bfrog>
or things like them
<shevy>
me neither but my friends all have those fancy smartphones ... and tablets. you can even play games on the latter, where you tilt the tablet and the snowboarding guy moved another way suddenly. I was quite surprised to see that
kish has quit [Read error: Connection reset by peer]
<bfrog>
schmartfone
liluo has quit [Remote host closed the connection]
shadoi has joined #ruby
<dysoco>
so a Symbol is like a String BUT NOT a string, it's an object, and it's innmutable
<apeiros_>
it's also like an integer, but not an integer
<dysoco>
let's say is some kind of read-only pointer that derreferences a String in C ? Seriously... no idea
bondar has quit []
<apeiros_>
I think that comes pretty close
maesbn has quit [Remote host closed the connection]
<shevy>
dysoco as said before shevy> dysoco, well. symbols are more memory efficient. they also are not that useful at all to know
<shevy>
:)
<shevy>
read-only pointer!
<shevy>
I think you can do more with C pointers than with ruby symbols
<shevy>
symbols sit around here and just stare at me with stupid poppy eyes
<dysoco>
shevy, "are not that useful at all to know" That means you hardly use them ?
<aszurom>
how can you tell what version of ruby you're running?
<shevy>
puppy
<dysoco>
ruby -v
<shevy>
dysoco I use them in hashes usually
<aszurom>
ok, so osx 10.7 comes with 1.8.7
<shevy>
hash[:apeiros] = 'cool swiss'
<apeiros_>
dysoco: they're widely used. but they come quite naturally once you accept that they're useful for identifying stuff, and use strings for everything else.
<shevy>
dysoco, but they are not really something that I find fascinating
<apeiros_>
aszurom: rvm. works fine and gets you the newest rubies with zero hassle.
cableray has joined #ruby
<dysoco>
so they are like "tags", a "slim" version of a String variable
ananthakumaran has quit [Quit: Leaving.]
<Hanmac>
dysoco i use them in my binding for IDs because i think hundreds of Constants are a no-go
<Mon_Ouie>
One of the uses of symbols is similar to enumerations in C
kil0byte_ has quit [Remote host closed the connection]
<shevy>
dysoco, they are kinda used like that, yea, but very dumb tags
<apeiros_>
dysoco: symbols are not variables. symbols are objects.
kish has joined #ruby
<aszurom>
trying to do this: var1, var2 = csv(filename) doesn't work. Says "undefined method 'csv' for mail:Object
<dysoco>
apeiros_, I know
fayimora has quit [Ping timeout: 276 seconds]
<shevy>
dysoco, the more you know about symbols, the more boring you will find them to be :)
<dysoco>
I don't find them exiting actually... :P
fermion has quit [Quit: P]
kish has quit [Read error: Connection reset by peer]
<shevy>
aszurom and where did you see csv() method?
ron has joined #ruby
Guest35872 is now known as neersighted
voodoofish has joined #ruby
<dysoco>
OK I get it: I use symbols when I don't need to change the value of a string, because they consume less memory (I suppose you compare the IDs and not the chars like Strings)
<aszurom>
do you change the working directory by injecting a value into Dir.pwd or something?
jackiechan0 has joined #ruby
ronniy has quit [Remote host closed the connection]
mrwalker has quit [Read error: Connection reset by peer]
jesly has joined #ruby
<Hanmac>
aszurom: Dir.chdir(path)
jesly_ has joined #ruby
elliot98 has quit [Remote host closed the connection]
kil0byte has joined #ruby
elliot98 has joined #ruby
<aszurom>
ok, so Dir is the gateway to the filesystem basically
<Synthead>
anyone know much about net-ssh? I'm about to give up on this
kish has joined #ruby
jackiechan0 has quit [Client Quit]
<seanstickle>
Synthead: questions are better when specific
<Hanmac>
aszurom the other gateways are File, and FileUtils
kish has quit [Read error: Connection reset by peer]
<Hanmac>
FileTest maybe too but its not needed anymore (i think)
jrist-afk is now known as jrist
rbanffy has quit [Read error: Connection reset by peer]
<Synthead>
seanstickle: I'm starting a ssh connection, then forking a background thread that communicates with it. Running anything using the connection tends to lock up (.sftp.upload! for example). Is there something I'm missing?
d3c has joined #ruby
kish has joined #ruby
kish has quit [Read error: Connection reset by peer]
nopoliti1a has joined #ruby
mneorr_ has joined #ruby
nopolitica has quit [Ping timeout: 244 seconds]
DrShoggoth has joined #ruby
schaerli has quit [Remote host closed the connection]
jackiechan0 has joined #ruby
Morkel has joined #ruby
mikepack has joined #ruby
Jake232 has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
alanp has quit [Remote host closed the connection]
mneorr has quit [Ping timeout: 245 seconds]
kish has joined #ruby
kish has quit [Read error: Connection reset by peer]
td123 has quit [Read error: Connection reset by peer]
imami|afk is now known as banseljaj
alanp has joined #ruby
Eldariof27-ru has quit []
td123 has joined #ruby
Urth|Away is now known as Urthwhyte
<aszurom>
so are .collect and .map the same thing?
<yxhuvud>
yes
kish has joined #ruby
mikepack has joined #ruby
<seanstickle>
.map is the typically more preferred
<rking>
seanstickle: Hrm. That's an interesting statement.
Eldariof-ru has joined #ruby
<seanstickle>
That's me. Full of interesting statements.
kish has quit [Read error: Connection reset by peer]
<rking>
collect is more Smalltalk-ish while map is Perlish, I'd say. It's shorter, so it wins by default, but if you look (echo '$ Enumerable#map' | pry) it actually is "enum_collect()" in C.
<seanstickle>
Yep
<seanstickle>
foo.map and foo.reduce are so much nicer than foo.collect and foo.inject
<rking>
Hrm, reduce vs. inject is something I haven't considered.
mengu_ has quit [Quit: Konversation terminated!]
<Hanmac>
imo inject sounds cooler
<rking>
There you lose the terseness advantage.
<rking>
And it's enum_inject() in C. My guess is .collect and .inject came first.
<seanstickle>
They did
<seanstickle>
SmallTalky, as you said
<rking>
Hrm, k.
<seanstickle>
select, reject, collect, inject
<seanstickle>
Rhymey
bglusman_ has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
bosphorus has quit [Remote host closed the connection]
wargasm has joined #ruby
<rking>
Hrm. The lib/ dir of the ruby source puts it at 315 map's and 239 collect's, but I'm not accounting for recentness.
ilyam has quit [Remote host closed the connection]
kish has joined #ruby
mischief has quit [Read error: Connection reset by peer]
bbttxu has joined #ruby
<rking>
47 injects, 6 reduces.
ilyam has joined #ruby
kish has quit [Read error: Connection reset by peer]
ilyam has quit [Client Quit]
<rking>
My Gem dir says: 489 reduces, 700 injects; 8404 maps, 771 collects.
<rking>
So map is the runaway favorite these days, it seems.
netogallo has quit [Ping timeout: 245 seconds]
mikepack has quit [Read error: Connection reset by peer]
<rking>
And actually I think I give it the edge for communicability. "map" is more what you're doing than "collecting". Collect implies some kind of search/evaluate/pick process to me, more like an inverted reject (is there one that's already that?)
<Hanmac>
rking what about find_all and select?
<rking>
Oof, good q.
<Hanmac>
i use map for converting, not for collecting, so collect does not make much sense
<rking>
178 find_all, 3028 select (in gems)
<Beoran_>
Ruby leads more to there is more than one way to do it
jimeh2 has joined #ruby
<rking>
Hanmac: Yeah, I bet Smalltalk chose the name due to /ect$/ hankerings.
kish has joined #ruby
mischief has joined #ruby
<shevy>
humpa humpa
kil0byte has quit [Ping timeout: 240 seconds]
<Hanmac>
rking info about select and find_all, select is implmented directly in array, but it gets find_all with enumerable
kish has quit [Read error: Connection reset by peer]
niklasb has joined #ruby
<rking>
Beoran_: True, but there's this philosophy that has an oriental name that I can't remember for the life of me, "Hold, Break, Release". First you hold to a rule, become disciplined by the standard way. Then you break the rule, feel the pain but feel the adventure. Then, you are released from the rule: freedom and wisdom.
midrange is now known as bradsocks
<Hanmac>
rules are made to be broken ... like the laws of physics
<seanstickle>
I think that is called bullshido
mohits has quit [Remote host closed the connection]
<rking>
Hanmac: Oh, so interesting. I guess Array#select is a speed hack?
jefftrudeau has joined #ruby
akem has quit [Ping timeout: 244 seconds]
<Hanmac>
rking ask pry but i think yes
jtrudeau has quit [Ping timeout: 246 seconds]
<Hanmac>
rking, Enumerable has its own select method
mikepack has joined #ruby
<rking>
Yeah, pry puts $ Enumerable#find_all, Array#find_all, Enumerable#select at enum_find_all(), but you're right, Array#select is its own thing.
netogallo has joined #ruby
<shevy>
seanstickle bullshito???
TheFuzzb_ has quit [Quit: Leaving...]
kevinbond has quit [Quit: kevinbond]
<seanstickle>
shevy: that is the joke, yes
TheFuzzball has joined #ruby
kish has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
<Hanmac>
was he the guy with the iron mask? ... no that was the other one
<Beoran_>
rking yes, that's the basics fro growth. rules are there for education
<Beoran_>
anwya I'll leave it at that
kish has quit [Read error: Connection reset by peer]
nilg has quit [Remote host closed the connection]
sparrovv has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
StoSun has joined #ruby
minijupe has joined #ruby
araujo has quit [Remote host closed the connection]
beneggett has joined #ruby
kish has joined #ruby
hashpuppy has quit [Quit: hashpuppy]
kish has quit [Read error: Connection reset by peer]
d3c has quit [Quit: Quit]
Urthwhyte is now known as Urth|Away
Targen has joined #ruby
sh1ps has joined #ruby
sparrovv has quit [Ping timeout: 265 seconds]
<sh1ps>
hello, I just installed ruby1.9.2 on my machine. ruby -v shows the correct version, but ruby gems is still installing gems to 1.8
mikepack has joined #ruby
<sh1ps>
any advice?
<rking>
sh1ps: How did you install 1.9.2?
<sh1ps>
via apt-get
<rking>
=|
<sh1ps>
yeah i know
<shevy>
nono
<Hanmac>
sh1ps do you install the ruby full package for 1.9.2?
<shevy>
rking did not want to do =|
<shevy>
he wanted to do:
<shevy>
=(
<altiouz>
sh1ps, how do you know that "but ruby gems is still installing gems to 1.8" ?
kish has joined #ruby
<shevy>
like =((((((
<sh1ps>
I'm having to do all of this via teamviewer, so every little thing i do is a giant pain in the ass with a ton of lag
<shevy>
I keep on telling people that it is time to abandon debian
<rking>
shevy: The difference is I'm not emotionally vested in the Debian package. I'm waving from over here in Gentoo+RVMland, and all is well.
<rking>
sh1ps: which gem shows which?
<shevy>
rking yeah. you are a man that can endure the pain, but so many youngsters are being harmed here
kish has quit [Read error: Connection reset by peer]
<rking>
sh1ps: gem -v, for example.
araujo has joined #ruby
araujo has quit [Changing host]
araujo has joined #ruby
<sh1ps>
altiouz: the reason i think it's installing to 1.8 is because, for instance, if i type just gem install … it will show that i don't have permission to write to /var/lib/gems/1.8
<shevy>
debian ruby uses a different default gem path
dr_bob has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
<shevy>
yeah that is the one
<sh1ps>
gem -v shows 1.7.2
<altiouz>
hm. maybe problem with alternatives
<shevy>
typical gem path is at /usr/lib/ruby/gems
kil0byte has joined #ruby
hal-j has quit [Ping timeout: 244 seconds]
elux has joined #ruby
<shevy>
debian prefers /var for reasons noone other than debian understands
<sh1ps>
haha none of this is my preference.
<shevy>
latest rubygem version is 1.8.24 btw
<rking>
sh1ps: I'm /thinking/ that's old. I'm on 1.9.3p195 and I get gem -v of 1.8.24
<shevy>
so I think this must be ruby 1.9.2 or 1.9.1
<pro>
whats difference between p and puts
<sh1ps>
and to top it all off i can't even use ssh directly, hence why i'm having to use teamviewer
<shevy>
pro I think p does .inspect on the object in question, puts calls .to_s
<Hanmac>
sh1ps how do you change that ruby -v shows 1.9.2?
kil0byte has quit [Read error: Connection reset by peer]
<rking>
shevy: pro?
<sh1ps>
i used update-alternatives
kil0byte has joined #ruby
<shevy>
rking, that IRC dude here
<shevy>
pro you can kinda use p to "debug" in a primitive way. if you want it one level nicer, you can use pp rather than p
<rking>
Oh, haha.
havenn has joined #ruby
<shevy>
rking, sometimes I fail at tab completion with xchat :)
kish has joined #ruby
<pro>
okay
<Hanmac>
sh1ps ok, but is ruby1.9.1-full installed?
<sh1ps>
hmm i may have just done ruby1.9.2
<sh1ps>
*1.9.1
kish has quit [Read error: Connection reset by peer]
Urth|Away is now known as Urthwhyte
nik_-_ has joined #ruby
kil0byte_ has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
kil0byte has quit [Ping timeout: 276 seconds]
seanstickle has quit [Quit: Nihil sub sole novum]
kapowaz has joined #ruby
chico_chicote has joined #ruby
statix has quit [Remote host closed the connection]
statix has joined #ruby
nfk has joined #ruby
kirun has joined #ruby
kish has joined #ruby
<sh1ps>
altiouz: that seems close to what I want, but it's saying --slave is an unknown argument
kil0byte has joined #ruby
<altiouz>
hm
kish has quit [Read error: Connection reset by peer]
<sh1ps>
even if i was still having this problem, being able to copy/paste would make this MUCH less frustrating.
<sh1ps>
>.<
ph^ has quit [Remote host closed the connection]
KL-7 has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
adeponte has quit [Remote host closed the connection]
<chico_chicote>
hey guys, what is a good gem for reading pdf files?
kil0byte_ has quit [Ping timeout: 260 seconds]
wargasm has joined #ruby
kish has joined #ruby
kil0byte_ has joined #ruby
eph3meral has joined #ruby
kish has quit [Read error: Connection reset by peer]
<eph3meral>
is rjb on topic in here?
<eph3meral>
jruby works fine for me, but rjb is complaining that JAVA_HOME is not set, but I *know* JAVA_HOME is set, I set it in my ~/.zshrc and echo $JAVA_HOME confirms that.
<Hanmac>
sh1ps ruby chould be register normaly to update-alternatives, so you shound need to run it again
kil0byte has quit [Ping timeout: 256 seconds]
saltnvinegar has joined #ruby
saltnvinegar has quit [Client Quit]
blizzo has joined #ruby
CptJeanLucPicard has joined #ruby
nfk has quit [Quit: yawn]
<zaargy>
eph3meral: you're exporting it to subshells?
kish has joined #ruby
<blizzo>
I am stuck on an error. In a test, trying to extract a zip file thats an attachment on a Mail object, when I try to parse it I get a 'string contains null byte'
eph3meral has quit [Client Quit]
sh1ps has quit [Quit: sh1ps]
<CptJeanLucPicard>
does anyone here have a link to help me better understand mruby and what it can do?
kish has quit [Read error: Connection reset by peer]
cdepue has quit [Remote host closed the connection]
<Hanmac>
mruby is not finish, so you can ignore it today
tatsuya_o has joined #ruby
<havenn>
February 2013 is coming.
<CptJeanLucPicard>
thanks Hanmac
<CptJeanLucPicard>
this summer i swore i will write at least one Ruby library in C
<CptJeanLucPicard>
even if it bnever gets used
<Hanmac>
for c-extendions you should use MRI ... imo its the best currently
<wmoxam>
CptJeanLucPicard: you might want to look at FFI too
kish has joined #ruby
<wmoxam>
although you should probably give that task to Data or Geordi
enroxorz has joined #ruby
ElitestFX_ has joined #ruby
<Hanmac>
FFI is cool, but for bindings maybe not the best (special if you have an c++ lib)
kish has quit [Read error: Connection reset by peer]
nfk has joined #ruby
<enroxorz>
Hanmac: any good sites on how to write C libs for ruby? Not to learn C. THat is a seperate task i am doing this summer...
Prz has joined #ruby
CptJeanLucPicard has quit [Ping timeout: 245 seconds]
<dysoco>
enroxorz, you want to write C libs without knowing C ?
<dysoco>
or you already do ?
<Mon_Ouie>
Anyway, see the README.EXT file
kish has joined #ruby
<enroxorz>
dysoco: I promised myself to really learn C by the end of this year. I know syntactically what I am doing but I have only ever done minimum CLI apps. I want to really learn C and understand the Linux Kernel
uris has quit [Read error: Connection reset by peer]
griffindy has joined #ruby
<dysoco>
enroxorz, then start by learning C ;)
<enroxorz>
dysoco: on it, chief :)
kish has quit [Read error: Connection reset by peer]
banisterfiend has quit [Read error: Connection reset by peer]
<dysoco>
enroxorz, you can't learn C "Syntactically" the way you can learn Java if you know C# , it's somewhat more complicated :P
kaspernj has quit [Ping timeout: 246 seconds]
uris has joined #ruby
bosphorus has joined #ruby
harukomoto has joined #ruby
<enroxorz>
dysoco: i figured as much. i guess i was spouting malarkey when all I really did in C was write a Hello World CLI app
<dysoco>
yeah, I'm also learning
<enroxorz>
I just want to learn more of the low level languages. I have been doing ruby, php, and C#/Java for a long time now. I want to become more than I am right now
kuranai is now known as kuranai|off
deryl has quit [Quit: doing system maintenance. back in 20m or so]
<dysoco>
enroxorz, that's the best you can do: you'll become a better programmer by learning how strings are made of Char's arrays and how Memory Management works
workmad3 has quit [Ping timeout: 260 seconds]
jackiechan0 has quit [Ping timeout: 245 seconds]
<any-key>
become one with the machine
closedbracket has joined #ruby
<enroxorz>
dysoco: im turning 30 this year. i dont want to be 40 and only know the high level. i just had that horrible realization last week. i need to expand my knowledge
beneggett has quit [Quit: Computer has gone to sleep.]
<dysoco>
enroxorz, meh, you've time
kil0byte has joined #ruby
dzhulk has joined #ruby
<pro>
i have ruby installed but writing "ruby" to cmd just gives me unkown command, any ways to fix that?
<pro>
running windows 7
kil0byte_ has quit [Ping timeout: 244 seconds]
<enroxorz>
dysoco: i wish time were more definitive than it ends up being. One day I was 25 and jsut starting my career. Now I am 30 and I feel like time went too fast
<Hanmac>
i learned a bit assambler ... its something you dont want to do it a second time
<enroxorz>
pro: do you have the bin in the EVN Variables?
<enroxorz>
ENV
<pro>
no idea, ho to see that
<pro>
how*
<Hanmac>
you need it in your PATH
<Hanmac>
pro look vor "envionment Variables"
<WalterN>
enroxorz: lol... make a linked list in C and call it good
<pro>
okay thanks
timonv has quit [Remote host closed the connection]
elliot98 has quit [Remote host closed the connection]
<WalterN>
installed RadiantCMS on my server over the weekend
<WalterN>
the more I look at this the more I like it
<enroxorz>
WalterN: just say what you said. and lol. lol ^ n
saltnvinegar_ has joined #ruby
<shevy>
that is a lot of lol
saltnvinegar has quit [Read error: Connection reset by peer]
<shevy>
hmm
saltnvinegar_ is now known as saltnvinegar
<shevy>
lotlol!
schaerli has joined #ruby
<shevy>
I remember someone once saying lol in reallife :(
<enroxorz>
did you destroy them, as written in the tomes of the internet?
mpereira has joined #ruby
aszurom has quit [Quit: Leaving]
saltnvinegar has left #ruby [#ruby]
rippa has quit [Ping timeout: 250 seconds]
zommi has quit [Remote host closed the connection]
catphish has joined #ruby
<catphish>
can string#encode transliterate?
<catphish>
loading iconv now produces a large warning :)
ch4se has joined #ruby
<catphish>
"Ruby 1.9.2 doesn't support transliterate while Ruby 1.9.3 supports transliteration but doesn't have the pre-built tables of Iconv."
<catphish>
if that's true, the deprecation warning seems a little premature :(
Targen has quit [Ping timeout: 250 seconds]
simao has joined #ruby
mvangala has quit [Remote host closed the connection]
mdw has joined #ruby
mdw_ has joined #ruby
Bonkers has joined #ruby
frogstarr78 has joined #ruby
simao has quit [Ping timeout: 245 seconds]
chico_chicote has quit [Ping timeout: 245 seconds]
araujo has joined #ruby
exchgr has quit [Quit: exchgr]
abionic has joined #ruby
mdw has quit [Ping timeout: 276 seconds]
lukeshu`` has quit [Ping timeout: 246 seconds]
ABK has quit [Ping timeout: 250 seconds]
jimeh2 has quit [Ping timeout: 245 seconds]
Eldariof-ru has quit []
mdw_ has quit [Remote host closed the connection]
ezn-01 has joined #ruby
looopy has quit [Remote host closed the connection]
kil0byte_ has joined #ruby
frogstarr78 has quit [Ping timeout: 240 seconds]
snearch has joined #ruby
blizzo has quit [Quit: leaving]
kil0byte has quit [Ping timeout: 276 seconds]
fbernier has quit [Ping timeout: 246 seconds]
jimeh2 has joined #ruby
krusty_ar has quit [Read error: Connection reset by peer]
mdw has joined #ruby
kil0byte has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
snearch has quit [Client Quit]
krusty_ar has joined #ruby
dysoco has quit [Quit: Leaving]
<Mon_Ouie>
Yeah, that annoys me too
bier has quit [Quit: Ex-Chat]
mdw_ has joined #ruby
<Mon_Ouie>
Transliterating is the only reason I'd still use Iconv in 1.9
redgetan has quit [Quit: This computer has gone to sleep]
kil0byte_ has quit [Ping timeout: 260 seconds]
sspiff has quit [Ping timeout: 246 seconds]
krz has joined #ruby
enroxorz has quit [Quit: Page closed]
dr_bob has quit [Read error: Connection reset by peer]
<shevy>
I just wrote a "fix-libtool" script, right now it does nothing than symlink an expected .la file... but one day I plan to replace libtool with it... :P
<catphish>
Mon_Ouie: why is the deprecation warning there is there's no replacement :(
ciopte7 has quit [Read error: Connection reset by peer]
<catphish>
or was someone just being a bit overzealous
<shevy>
1.9.x is very much like a giant patchwork
mdw has quit [Ping timeout: 260 seconds]
ciopte7 has joined #ruby
bier has joined #ruby
Seabass has joined #ruby
fflush has joined #ruby
<Seabass>
yay I figured out how to join Ruby irc
<wmoxam>
Seabass: how were you able to do it?
<Mon_Ouie>
catphish: I'm not sure. I'm also curious what the person who added that warning though about that feature.
<Seabass>
on the top left of my browser by status I clicked the x next to first place I was in then I typed /join #ruby on the page after that
<Seabass>
may have been #Ruby not sure if case sensitive, I'm new to IRC
<Hanmac>
Mon_Ouie whats the Transliterating you are talking about?
<Seabass>
to everyone: is there IRC etiquette I need to know?
<any-key>
don't be a jerk
looopy has joined #ruby
frogstarr78 has joined #ruby
parsifal_ has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
abionic has quit [Read error: Connection reset by peer]
<graspee>
don't join #lisp
<Urthwhyte>
have thick skin
<shevy>
hi Seabass
<Urthwhyte>
although IRC today seems far less hostile than it used to. Declining usership I suppose
<any-key>
mostly just neckbeards
<shevy>
Seabass is not case sensitive, RUBY ruBY and ruby should all work equally well
tvw has quit [Read error: Connection reset by peer]
<wmoxam>
what's wrong with #lisp ?
<graspee>
you haven't joined the right channels recently then, Urthwhyte
<any-key>
they talk funny
jackiechan0 has joined #ruby
<shevy>
Urthwhyte could be freenode policy. I remember I used to be on galaxynet, they were quite strict
<graspee>
there are some groups who are very hostile to newcomers
kb_oe has joined #ruby
<shevy>
wmoxam (#lixp(nothing(wrong(with(it
scriptmonkey_ has joined #ruby
<shevy>
damn
<shevy>
#lisp!!!
<graspee>
don't go there
<graspee>
seriously
kb_oe has quit [Killed (idoru (Spam is off topic on freenode.))]
<philcrissman>
Seabass: only real etiquette to keep in mind (other than just not being a jerk) is not to paste blocks of code into the channel; give a link to pastie.org or a gist or something.
sh1ps has joined #ruby
<Seabass>
I am just starting to learn Ruby. After I become more familiar with the syntax I hope some ppl will be able to assist in my education. philcrissam: I assumed that at start.
ciopte7 has quit [Ping timeout: 252 seconds]
* wmoxam
joins #lisp
<philcrissman>
Seabass: you'd be surprised how many people don't assume that. :)
<parsifal_>
How do I set up associations with a list of records with FactoryGirl 3? I'm able to associate with a single record fine (e.g. association :book, factory: :book), but how do I do it when it's a one-to-many?
<shevy>
Seabass if you have a specific question about something about ruby, the question should be ideally short, and to the point. if you need to demonstrate with code, you can upload to pastie.org and link in #ruby here
<graspee>
they are probably still slagging me off in there
<parsifal_>
it's hard to find details for FG3 online
kil0byte_ has joined #ruby
<graspee>
this channel is uuuuuuuubeer mega amazingly friendly compared to lisp
<graspee>
it's hard to believe it's on the same server
<shevy>
graspee I always go to #emacs and ask whether emacs is better than vim
<shevy>
I also go to #python and ask them sszsHSh shsszss shshshs but they just ignore me :(
<Seabass>
shevy: isn't that like trolling?
<graspee>
i wasn't trolling though
<shevy>
Seabass it's mixed
<shevy>
Seabass I dont use vim or emacs, I think both should die :)))
<parsifal_>
O_O
kil0byte has quit [Ping timeout: 245 seconds]
<graspee>
they were having a discussion about "making a better lisp". i joined in saying stuff about scheme. some people objected to me discussing scheme in a common lisp channel and two people implied i should leave
<graspee>
they said scheme was offtopic in a common lisp channel. geez. narrow focus
<shevy>
I think lisp died many years ago
<graspee>
i have nothing against CL. i love a lot of languages for different reasons. common lisp is one and ruby is another
<graspee>
each language i love offers something new
<Hanmac>
yeah, lisp died ... but it did not notic yet :ü
<philcrissman>
shevy: lisp isn't dead. It just smells funny and doesn't go out much
<shevy>
for them, lisp already is the perfect programming language even if it will be 100 years old and the rest of the world evolved
<Urthwhyte>
parsifal_: You need to do a post-save hook AFAIK
<scriptmonkey_>
what is the best way to handle an objecy initialization that fails? I am creating a hash of objects and if an attempt is made to create one with bad arguments, how does that specifice object get deleted?
<graspee>
we don't need to bash lisp though. that's my point. everyone should be tolerant
<shevy>
philcrissman, yeah well, programming languages don't really die per se... I am more looking at the amount of influx, especially of young people
<graspee>
shevy you forgot to close those brackets
<parsifal_>
which is a slight to Arabic
<philcrissman>
shevy: if you consider that Clojure is effectively a lisp, there's a fair bit of influx to lisp, I'd say.
dhaskew has joined #ruby
<rking>
I wish people would get over the () thing with lisp. That is such a superficial thing.
<graspee>
i agree rking
<rking>
I wonder if anyone's made STFUlisp, that puts the ( on the left of the first term.
<philcrissman>
rking: I like the parens. I think of them as a series of little hugs.
<rking>
Urr, on the right.
<philcrissman>
(((hugs)))
<graspee>
ruby has a lot of parens in it it some situations too
<graspee>
they aren't such a bad thing
<parsifal_>
Urthwhyte: Yeah; that'd allow you to specify the number of records you want at creation, right? Also, shouldn't it be after_build?
<any-key>
any language is like that
<graspee>
i know
<graspee>
because you have to disambiguate
<Urthwhyte>
parsifal_: for my system it has to be after_create
<Urthwhyte>
because of some logic
<Urthwhyte>
after_build should work fine
<parsifal_>
yeah; I'm worried about validations passing
<graspee>
and often it's easier to stick a couple of parens in than trust your memory of the precedence rules of the language you are working in are correct
mdw has joined #ruby
<rking>
Don't get me wrong. I'm a fan of optional: parens, semis, and {}'s (← python's got us beat on that last one)
<any-key>
no parens is only for DSLs
<parsifal_>
Urthwhyte: huh, interesting. Apparently I'm using the bleeding edge of FactoryGirl, and there isn't much docu online
mdw_ has quit [Read error: Connection reset by peer]
<Urthwhyte>
I'm on
<Urthwhyte>
3.1
<Urthwhyte>
it's roughsometimes
<parsifal_>
3.1 is still really new -- should work fine
<shevy>
I dont find the syntax of any programming language superficial at all
<Urthwhyte>
The codebase is fairly easy to read
<shevy>
there is a reason why XML stinks
<parsifal_>
Urthwhyte: apparently FG didn't have dynamic blocks for attrs until 3.2?? crazy
<parsifal_>
I hate that python requires well-formatted whitespace. Almost as bad as emacs
<shevy>
yeah
<Urthwhyte>
whoa there
<Urthwhyte>
Significant whitespace is *awesome*
<shevy>
I would like to omit "end" sometimes
<parsifal_>
hey, I keep my code well-formatted
<rking>
shevy: Syntax:semantics is almost an exact comparison to human looks:insides.
<shevy>
but I dont think any programming language should depend on indent
<parsifal_>
better than most I'd argue. But I don't want to have to worry about the whitespace disrupting compilation
<rking>
That never happens, though.
<parsifal_>
s/compilation/scoping/
<Seabass>
would someone like to look at my first script and see what I am doing wrong?
<rking>
The only time during Python dev I ever didn't like the significant-horizontal-whitespace was for throwing in foo stuff for debugging and not worrying about indent.
<rking>
Seabass: gist it.
<shevy>
take DNA. you have four different base blocks in it (A,T,C,G) and you can create a human or a bacteria or a virus with that
<parsifal_>
rking: I think that's the only time I've ever ran into it as well, to be fair
<shevy>
Seabass, as said use pastie.org
<Urthwhyte>
I like gists a lot more
<shevy>
pastie.org!!!
<shevy>
don't listen to them Seabass !!!!!!!!
<Seabass>
I get whispers I think but I don't know how to pastie org it
wmoxam has quit [Quit: leaving]
<Seabass>
pastie org is what I went to when I started
<shevy>
hmm you load pastie.org (or gist) in your browser, then paste there, then give us the link
<shevy>
Urthwhyte at least he ignored us both equally :-)
<philcrissman>
lol
<Seabass>
lol, fine I choose my own way
libertyprime has quit [Quit: leaving]
<Urthwhyte>
well pastebin is bad and you should feel bad!
<shevy>
Seabass I think you dont indent properly
<shevy>
also you use two return player1 return player2
<rking>
Yep, the indent is wack.
<Urthwhyte>
oof
<shevy>
Seabass, the second return can never be reached
<Seabass>
i confess, I think I got a bit ahead of myself, trying to do things I don't understand by trail and error
<rking>
Vim fixes it with a little gg=G
<shevy>
that's why I like rking
_theriffer_ has joined #ruby
<shevy>
he knows way more than I do
<rking>
\@/
<shevy>
AND he is the ONLY guy here who uses gentoo
<rking>
↑ Brains.
* rking
kids.
<graspee>
i have used gentoo in the past but i'm on fat pangolin at the moment
<Seabass>
lol at rking
Prz has quit [Remote host closed the connection]
<shevy>
pangolin?
<graspee>
ubuntu 12.04
<shevy>
lol
_theriffer_ has quit [Remote host closed the connection]
<shevy>
that name got me all cracked up
<graspee>
my one reason for using gentoo was that i like the word "emerge"
libertyprime has joined #ruby
<shevy>
patty pangolin
<Urthwhyte>
vim can't fix it
libertyprime has quit [Client Quit]
<shevy>
sleeping snake
<shevy>
lying lizard
<shevy>
eeping elephant
<Urthwhyte>
I tried
yxhuvud has quit [Ping timeout: 248 seconds]
<scriptmonkey_>
what is the best way to handle an object that fail the initialization?
<Urthwhyte>
oh ft didn't get set
<Urthwhyte>
hmm
<graspee>
i think it helps stuff to have a cute animal personality. maybe ruby should have an animal
<shevy>
graspee, did you look at GNU Sourcemange? they "cast" spells and "cook" their recipes in a happy boiling witch pot and they use a grimoire to keep a list of their spells
<shevy>
but they use shell scripts for the magic :(
<graspee>
really? that sounds awesome
<shevy>
yeah I <3 the idea... but I dont like shell scripts
<Urthwhyte>
rking: did you manage to get it indented properly?
<Seabass>
how do I send whispers or private tells
<graspee>
./msg graspee thanks, man
hynkle has quit [Quit: hynkle]
<shevy>
Seabass, /query rking
abionic has joined #ruby
<parsifal_>
sleeping snake, that's what they called me in college
Facefox has quit [Ping timeout: 260 seconds]
geekbri has quit [Remote host closed the connection]
<shevy>
scriptmonkey_ best way is to have code that does not fail :)
<shevy>
scriptmonkey_ depends on what you mean with failing precisely. ie. do you mean an exception?
<rking>
Urthwhyte: Yep, sure. In like 1 second. If you have `filetype plugin indent on` in your vim rc files the = cmd is smart, and you can do gg=G
<scriptmonkey_>
yes. for example. I am creating an object that uses an IP. what is the best way to handle a bad IP? test before I create the object?
<scriptmonkey_>
*uses an IP as the argument to create the object
<kenichi>
ugh, who can tell me how to get rvm to properly codesign a ruby bin?
flip_digits has joined #ruby
abionic has quit [Read error: Connection reset by peer]
nlc has quit [Ping timeout: 256 seconds]
vjt has quit [Ping timeout: 272 seconds]
abionic has joined #ruby
<scriptmonkey_>
shevy, are you saying I should check for validity before I try to create the object?
looopy has quit [Remote host closed the connection]
ken_barber has quit [Ping timeout: 260 seconds]
vjt has joined #ruby
daveecee has joined #ruby
cdepue has joined #ruby
mikepack has joined #ruby
davidcelis has quit [Disconnected by services]
daveecee is now known as davidcelis
davidcelis has quit [Changing host]
davidcelis has joined #ruby
davidcelis has quit [Client Quit]
davidcelis_ has joined #ruby
mdw has quit [Remote host closed the connection]
davidcelis has joined #ruby
oneirosFade has joined #ruby
<rking>
Oh, I thougt Urthwhyte answered Seabass so I stopped workingg on it.
<Urthwhyte>
I didn't know there was a question
<rking>
Seabass: If you put p [warstats, arcstats] at the top of Fight#initialize, you'll see that those are Hash objects that you're trying to index as Arrays.
<Seabass>
rking: how do you do that redbeep message? is it private?
<oneirosFade>
Wow... full room here. So, calling on experience from you folks - if I want to write a Lin/Mac/Win app in Ruby with a GUI, which toolkit am I likely to have the best success with these days?
<rking>
Seabass: You want stuff like arcstats['hp'] instead of arcstats[0]
<rking>
Seabass: Yeah, I did /msg Seabass
<rking>
Seabass: Oh, no, the beep might have been me saying "Seabass"
stephenjudkins has joined #ruby
<rking>
Seabass: But for private comms there's /msg and the windowed version: /query
KL-7 has quit [Quit: This computer has gone to sleep]
ZachBeta has joined #ruby
<friskd>
Hey folks, i'm interested in doing some testing on my API. I'd like to be able to send a request like 100 times to my api and have the requests be made in parallel.
<friskd>
perhaps divided up into 10 sets happengin simultaneously
yosinof has joined #ruby
<friskd>
any gems out there that could make this easy for me?
billiamii has quit []
<friskd>
essentially i'm getting duplicate data in my db and I fear its because of simultaneous requests a happenign
<friskd>
i'm looking for a way to replicate requests
piotr__ has quit [Ping timeout: 246 seconds]
Urthwhyte is now known as Urth|Away
jtrudeau has joined #ruby
t0mmyvyo has joined #ruby
albemuth has quit [Quit: Computer has gone to sleep.]
<Veejay>
friskd: Look up Apache Bench
<friskd>
ok
albemuth has joined #ruby
<friskd>
Veejay: any others beside that?
albemuth has quit [Client Quit]
uris has quit [Quit: leaving]
sh1ps has joined #ruby
eywu1 has quit [Quit: Leaving.]
<Veejay>
Probably, don't know on the top of my head
<Veejay>
But then again it's not like ab is complicated
<Veejay>
It has a -c parameter for the concurrency and all
<davidcelis>
avalarion: Gemfile.lock is generated by the most recent successful bundle
jimeh2 has quit [Ping timeout: 265 seconds]
<davidcelis>
It's contains the last known "working" versions of the gems you've bundled to fit your current environment
<davidcelis>
So bundler will look at THAT file when determining what versions of your bundled gems to use
<avalarion>
specs are the installed once?
<avalarion>
ones
<davidcelis>
?
<avalarion>
If I take a look at this file i have got "gem" than "specs" and in "specs" for example "json (1.7.3)"
yosinof has quit [Quit: Leaving]
greyEAX has quit [Remote host closed the connection]
<davidcelis>
Yeah
<davidcelis>
specs is like a tree of gems you have installed and any dependencies of those gems that have been installed
<davidcelis>
and a specified version
pdtpatr1ck has joined #ruby
niklasb has joined #ruby
<avalarion>
is ~> bigger as?
alexim has quit [Read error: Operation timed out]
<davidcelis>
"~> 1.0.2" for example means "at least 1.0.2, but not 1.1 or higher"
<avalarion>
I have installed json 1.7.3 and rdoc requires ( because its has a "child"-element ) json ~> 1.4
<avalarion>
okay...
<avalarion>
so my problem is, that I have got a block
<davidcelis>
so json ~> 1.4 is any version of JSON 1.4
<davidcelis>
1.4.x, basically
<davidcelis>
typically grabs the highest available
<davidcelis>
have you read the Bundler docs?
mattonrails has joined #ruby
<avalarion>
nope. This is the second time I am trying to do things with ruby. My first was installing redmine and writing a bitbucket hook... and now I had to update redmine and the hook throws errors^^
zeromodulus has quit [Remote host closed the connection]
sh1ps has quit [Quit: sh1ps]
nari has joined #ruby
jimeh2 has joined #ruby
<avalarion>
davidcelis: http://pastebin.com/rCK4L07y this is my file. In my opinion I have got a json block with rdoc and the normal installed json, correct?
t0mmyvyo has joined #ruby
<davidcelis>
i suggest taking a look at gembundler.com
zeromodulus has joined #ruby
sh1ps has joined #ruby
cdepue has quit [Remote host closed the connection]
<davidcelis>
what json are you talkinga bout
<davidcelis>
ah
<davidcelis>
possibly
sh1ps has quit [Client Quit]
<davidcelis>
actually, not necessarily
malcolmva has joined #ruby
<davidcelis>
i've got an app where two gems specify multi_json as a dependency
<davidcelis>
but with conflicting versioning
<avalarion>
is there a way to say: "update yourself"?
<davidcelis>
bundle update?
fr0gprince_mac has joined #ruby
Solnse has joined #ruby
xbayrockx1 has joined #ruby
fulmato has joined #ruby
libertyprime has quit [Quit: Lost terminal]
<avalarion>
my gemfile ist uptodate
maxwell_ has joined #ruby
xbayrockx has quit [Ping timeout: 250 seconds]
<avalarion>
but it is where my redmine is... THere is another on my system I guess?
maxwell_ has left #ruby [#ruby]
oooPaul has quit [Quit: Ciao for now!]
EzeQL has quit [Remote host closed the connection]
libertyprime has joined #ruby
Solnse has quit [Client Quit]
cbuxton1 has joined #ruby
cbuxton has quit [Read error: Connection reset by peer]
ramblex has quit [Quit: ramblex]
kil0byte has joined #ruby
tomzx has joined #ruby
weasels has joined #ruby
weasels has quit [Remote host closed the connection]