<onewheelskyward>
rbenv is another option for ruby management.
<onewheelskyward>
I know it has packages within ubuntu.
DanKnox_away is now known as DanKnox
michalkozminski has joined #ruby
baroquebobcat has joined #ruby
heftig has joined #ruby
<xybre>
rbenv doesn't install rubies, which is the bigger problem he's dealing with. ruby-build does allow you to, but requires additional setup, rvm does everything out of the box without effort.
<postmodern>
why not ruby-install, it also handles installing build dependencies
* xybre
sighs
randomautomator has quit [Ping timeout: 264 seconds]
<postmodern>
chruby+ruby-install works, but RVM is the best if you want a turn-key solution
Ox6abe has quit [Remote host closed the connection]
<|jemc|>
adding ruby-build to rbenv is a one-liner
digital-ghost has quit [Remote host closed the connection]
<|jemc|>
(the fourth code block on the page; the first using #new_cond)
thecodethinker has joined #ruby
codecop has quit [Remote host closed the connection]
ericmathison has joined #ruby
<|jemc|>
to me it makes sense that it would deadlock, given that both the waiting block in the waiting thread and the signalling block in the signalling thread are trying to acquire the same monitor
<bnagy>
I've never seen or heard of that
<|jemc|>
yeah, it doesn
<bnagy>
and it looks like a weird approach
<|jemc|>
't seem well documented
<|jemc|>
and yeah, it's a very forced example
<|jemc|>
but I'm curious about the correct way to be using this object
alexju has quit [Ping timeout: 248 seconds]
ananthakumaran has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
DanKnox_away is now known as DanKnox
codecop has joined #ruby
<|jemc|>
hm. it looks like the wait method actually releases the lock, despite being inside the #synchronize block
<|jemc|>
at least that example isn't deadlocking for me
iliketurtles has joined #ruby
Xeago has joined #ruby
freerobby has quit [Ping timeout: 256 seconds]
m00nlight has joined #ruby
coderhs has joined #ruby
aganov has joined #ruby
fgo has joined #ruby
ta has quit [Remote host closed the connection]
ananthakumaran1 has joined #ruby
ananthakumaran1 has quit [Read error: Connection reset by peer]
ananthakumaran1 has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
Xeago has quit [Remote host closed the connection]
beneggett has joined #ruby
tziOm has joined #ruby
<beneggett>
Anyone know of any great resources for explaining OOP to some programming beginners? (ideally easy to understand videos, or the like)
<beneggett>
if the context is Ruby based, all the better..
powerhead has left #ruby [#ruby]
hamakn has quit [Read error: Connection reset by peer]
hamakn has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
corpuscle has joined #ruby
ananthakumaran1 has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
lemonsparrow has joined #ruby
ananthakumaran has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
<mercwithamouth>
is anyone here reading or already read Kestrels, Quirky Birds, and Hopeless Egocentricity???
<|jemc|>
bnagy: I think I finally got it doing my bidding. it's actually pretty elegant in this context
<bnagy>
I think we may be about to disagree, but gist code :)
<|jemc|>
well, it's in a larger context that is at the moment really messy
<|jemc|>
let me clean up a bit and I'll link it to you
Ubercow has quit [Quit: Computer has gone to sleep.]
<|jemc|>
it's basically a way to avoid busywaiting
<|jemc|>
I've got a future events scheduler that should be sleeping between events
<|jemc|>
but combinations of sleep and logic are always a little thread-unsafe unless the decision to sleep is atomic with the sleep itself
RichardBaker has quit [Quit: RichardBaker]
tjad has quit [Read error: Connection reset by peer]
tjad has joined #ruby
user258467 has joined #ruby
<|jemc|>
that is to say, 'sleep unless @dont_sleep' has a small 'gap' in which an interrupting thread that changes the value of @dont_sleep could screw you up
sarkis has quit [Ping timeout: 256 seconds]
Ubercow has joined #ruby
Ubercow has quit [Max SendQ exceeded]
<|jemc|>
and if you surround that operation with a lock to keep it from being interrupted, that thread holds the lock throughout sleep
zephdev has joined #ruby
<|jemc|>
which means you can't acquire it in the thread that should wake it from sleep if a new future event is scheduled
Teddy2steper has joined #ruby
RichardBaker has joined #ruby
stkowski has quit [Quit: stkowski]
<|jemc|>
so I think the only solution is to tie into the lock object itself
<|jemc|>
which I think I'm accomplishing properly with this #new_cond feature of Monitor
yllox has quit [Quit: Bye!]
LMolr has joined #ruby
<bnagy>
woop, gtg
<bnagy>
but drop the link whenever, sounds interesting
rezzack1 has quit [Quit: Leaving.]
iamjarvo has joined #ruby
<|jemc|>
yeah, I'd be happy to get feedback
<|jemc|>
g'night
somnambulically0 has quit [Quit: somnambulically0]
ru has joined #ruby
ru has quit [Client Quit]
underway47 has joined #ruby
oliver_ has joined #ruby
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
end_guy has joined #ruby
iamjarvo has quit [Ping timeout: 264 seconds]
Teddy2steper has quit [Remote host closed the connection]
end_guy_ has quit [Ping timeout: 240 seconds]
aagdbl1 has quit [Quit: Leaving.]
ta has joined #ruby
razi has joined #ruby
zephdev has quit [Remote host closed the connection]
iliketurtles has quit [Quit: zzzzz…..]
threeturn has quit [Quit: threeturn]
mansi has joined #ruby
|jemc| has quit [Ping timeout: 276 seconds]
Teddy2steper has joined #ruby
sayan has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
mansi has quit [Ping timeout: 256 seconds]
sr78ger has joined #ruby
buibex has joined #ruby
snovak has joined #ruby
toah has joined #ruby
chihhsin has quit [Quit: leaving]
chihhsin has joined #ruby
snovak has quit [Ping timeout: 276 seconds]
workmad3 has quit [Ping timeout: 264 seconds]
T_T has quit [Remote host closed the connection]
relix has joined #ruby
mrsolo has quit [Quit: Leaving]
noop has quit [Ping timeout: 264 seconds]
chopmo has joined #ruby
threeturn has joined #ruby
andikr has joined #ruby
AdmiraI has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
threeturn has quit [Client Quit]
noop has joined #ruby
clocKwize has joined #ruby
tjad has quit [Ping timeout: 245 seconds]
ehaliewicz has joined #ruby
parzo has quit [Ping timeout: 256 seconds]
filipe has joined #ruby
funburn has quit [Quit: funburn]
persand has joined #ruby
ahawkins has joined #ruby
vlad_starkov has joined #ruby
Arreis has quit [Read error: Connection reset by peer]
Arreis has joined #ruby
RichardBaker has quit [Quit: RichardBaker]
Spami has joined #ruby
Spami has quit [Changing host]
Spami has joined #ruby
freerobby has joined #ruby
Elhu has joined #ruby
BadQuanta has quit [Quit: Leaving]
Ripp__ has quit []
headius has joined #ruby
Teddy2steper has quit [Remote host closed the connection]
cutmail has quit [Remote host closed the connection]
Arreis has quit [Read error: Connection reset by peer]
schaerli has joined #ruby
cutmail has joined #ruby
ewnd9 has joined #ruby
fgo has joined #ruby
ru has joined #ruby
c0rn has joined #ruby
apeiros has joined #ruby
Arreis has joined #ruby
_maes_ has joined #ruby
claymore has joined #ruby
dangerousdave has joined #ruby
cutmail has quit [Ping timeout: 245 seconds]
fgo has quit [Ping timeout: 245 seconds]
hanmac has joined #ruby
<ru>
Hi, n00b question here - if I have a completely static class (just using class as a namespace for methods), is it better to `extend self`, or to write `self.x` in the `def` statement for every method?
tjad has joined #ruby
<apeiros>
ru: you can't use extend with a class. the argument to Object#extend must be a module.
<apeiros>
and IMO extend self is an anti-pattern. use module_function instead. that's how core modules like Kernel and Math do it.
cutmail has joined #ruby
<ru>
gah sorry - coming from python/php background - module is what I meant.
<apeiros>
it works like private/protected, means you can just write it once and all subsequently defined methods become module functions.
jamesfung14 has joined #ruby
<apeiros>
e.g. module X; module_function; def foo; end; def bar; end; end
toah has quit [Ping timeout: 248 seconds]
<apeiros>
advantage over extend self: the instance method variant is private, the class method variant is public. that way you don't mess with method_missing when you include/extend it somewhere.
Spami has quit [Quit: This computer has gone to sleep]
<ru>
apeiros: so with the example you gave, what is `module_function` ? I understand that module X contains it, and `foo` is a method within it, but what would module_function.kind_of? give me?
Splourian has quit [Quit: Leaving]
yrp has quit [Quit: Page closed]
Spami has joined #ruby
<xybre>
ru: module_function is a "directive" like "private" or "public", but it defines all following methods in two places, 1 privately on the "instance" space, and publically in the "class" (eigenclass) space.
sayan has joined #ruby
tesuji has joined #ruby
camilasan has joined #ruby
threeturn has joined #ruby
jkline has joined #ruby
<jkline>
What does question mark mean in these contexts ? `if first == ?~`
ewnd9 has quit [Remote host closed the connection]
threesome has quit [Max SendQ exceeded]
aeontech has joined #ruby
cj3kim has joined #ruby
<xybre>
The question mark is a parser hint that the next character is a single character string. Its basically the same as '~'.
threesome has joined #ruby
<jkline>
interesting
dash_ has joined #ruby
<jkline>
ru: the ascii code of tilde? How do you get that?
<xybre>
Maybe ru is using 1.8?
<ru>
I am. apologies if it caused any confusion.
<xybre>
Ahh. It's been like 5 years since I touched 1.8 :)
noop has quit [Ping timeout: 245 seconds]
<xybre>
I swear there was some way to use ?x notation to specify control characters.
<xybre>
But I can't figure out how.
brtdv has joined #ruby
<ru>
really? lucky bastard.. I am doomed to the distributions shipped with the OS, which in almost any case is 1.8 in any enterprise-ready distro I know of.
julweber_ has quit [Remote host closed the connection]
<ru>
maybe ubuntu has 1.9.3
<xybre>
Ew. Why?
wallerdev has quit [Quit: wallerdev]
<jkline>
ok, i see the 1.8 vs 1.9 difference now
hkon has joined #ruby
<ru>
i work for cisco ... :x
ephemerian has joined #ruby
<xybre>
:(
<jkline>
in what city?
<ru>
san jose CA
<jkline>
if you come work with me you can use ruby 1.9… :)
oliver_ has quit [Remote host closed the connection]
* xybre
is in SF
* jkline
is also in SF
aagdbl has joined #ruby
Coffers has joined #ruby
ewnd9 has joined #ruby
<ru>
yeah stay up there. you guys make cool stuff, then it wafts down to the slums in SJ.
jinie has quit [*.net *.split]
flowerhack_ has quit [*.net *.split]
LBRapid has quit [*.net *.split]
kaichanvong has quit [*.net *.split]
maroloccio has quit [*.net *.split]
C0deMaver1ck has quit [*.net *.split]
mark| has quit [*.net *.split]
ddv has quit [*.net *.split]
dangerousdave has quit [Quit: Leaving...]
ddv has joined #ruby
<xybre>
Yeah I don't plan on leaving yet :)
C0deMaver1ck has joined #ruby
kaichanvong has joined #ruby
LBRapid has joined #ruby
mansi has joined #ruby
flowerhack_ has joined #ruby
flowerhack_ has quit [Changing host]
flowerhack_ has joined #ruby
C0deMaver1ck is now known as Guest67358
<jkline>
well, to be fare, it wafted north first
<jkline>
fair?
<jkline>
\ferry?
m00nlight has quit [Read error: No route to host]
mark- has joined #ruby
<ru>
so what is your take on code climate? I thought it was cool when I tried it out, but my first gem did not detect anything about "yo dawg, dont extend self if you dont have to"
jinie has joined #ruby
<ru>
is it completely biased?
freeayu has joined #ruby
aagdbl has quit [Client Quit]
<xybre>
I dig CodeClimate
<apeiros>
I see little value in such tools
maroloccio has joined #ruby
m00nlight has joined #ruby
<xybre>
Especially for pointing out complexity of classes and methods
<apeiros>
but that might be because IMO they're often used inappropriately. as source of "truth", where they're really a guide at max.
<xybre>
Yeah, metrics often become chains, when they should be tools.
aryaching has joined #ruby
<ru>
ok yeah i can see what both of you are saying. I definitely noticed it caught any ghetto stuff easily, but it definitely didnt check best practices.
<ru>
i started ruby like a month ago and it told me on first run my project was a 4.0, which ... yeah you get it. haha
<xybre>
Yeah there are other tools for that. Check out Rubocop, but take it with a grain of salt.
mansi has quit [Ping timeout: 245 seconds]
<Boohbah>
i try to follow worst practices
<xybre>
Well, CodeClimate only detects a few things, and if your project is small and new, it'll probably be a 4.
<xybre>
That will often change as your project grows. The ROM.rb guys follow that suff religiously though, so even though they're making huge complex tools, they enforce the metrics.
oliver_ has joined #ruby
gstamp has quit [Quit: Computer has gone to sleep.]
Es0teric has quit [Quit: Computer has gone to sleep.]
noop has joined #ruby
snovak has quit [Ping timeout: 245 seconds]
oliver_ has quit [Remote host closed the connection]
ta has quit [Ping timeout: 276 seconds]
coderhs has quit [Remote host closed the connection]
aeontech has quit [Quit: aeontech]
<ru>
alright gentlement, i must adjourn. thanks for the tips. beers on me. ttyl
ru has quit [Quit: leaving]
krz has joined #ruby
cam`_ has quit [Ping timeout: 260 seconds]
bluehavana has quit [Ping timeout: 260 seconds]
ix007 has quit [Ping timeout: 260 seconds]
m00nlight has quit [Remote host closed the connection]
flori_ has quit [Ping timeout: 262 seconds]
Martz^ has joined #ruby
m00nlight has joined #ruby
rhys has quit [Ping timeout: 263 seconds]
framling has quit [Ping timeout: 263 seconds]
Drakevr has quit [Ping timeout: 263 seconds]
ix007 has joined #ruby
flori has joined #ruby
XenoWolf has quit [Ping timeout: 260 seconds]
framling has joined #ruby
XenoWolf has joined #ruby
coderhs has joined #ruby
Martz has quit [Ping timeout: 258 seconds]
Martz^ is now known as Martz
Martz has quit [Changing host]
Martz has joined #ruby
canton7 has quit [Remote host closed the connection]
canton7 has joined #ruby
timonv has quit [Remote host closed the connection]
s0ny123 has joined #ruby
k0rupted has quit [Ping timeout: 260 seconds]
RTG` has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
caveat- has quit [Ping timeout: 248 seconds]
decoponio has joined #ruby
threeturn has quit [Quit: threeturn]
mercwithamouth has quit [Ping timeout: 256 seconds]
yeltzooo has joined #ruby
threeturn has joined #ruby
ghr has joined #ruby
ta has joined #ruby
threeturn has quit [Client Quit]
k0rupted has joined #ruby
caveat- has joined #ruby
zeroXten_ is now known as zeroXten
St_Marx has joined #ruby
hkon has quit [Read error: Connection reset by peer]
timonv has joined #ruby
allsystemsarego has joined #ruby
allsystemsarego has joined #ruby
senayar has joined #ruby
senayar has quit [Remote host closed the connection]
senayar has joined #ruby
kaspergrubbe has joined #ruby
hkon has joined #ruby
radic_ has quit [Quit: Verlassend]
rhys has joined #ruby
RDash[AW] is now known as RDash
fgo has joined #ruby
blackmesa has joined #ruby
m00nlight has quit [Remote host closed the connection]
barratt has joined #ruby
m00nlight has joined #ruby
tatsuya_o has joined #ruby
fgo has quit [Ping timeout: 256 seconds]
ferdev has quit [Quit: ferdev]
dash_ has quit [Quit: dash_]
jkline has quit [Quit: jkline]
radic has joined #ruby
yeltzooo6 has quit [Ping timeout: 260 seconds]
jonkri has joined #ruby
hkon has quit [Read error: Connection reset by peer]
oliver_ has joined #ruby
LMolr has quit [Ping timeout: 245 seconds]
dangerousdave has joined #ruby
codecop has quit [Read error: Operation timed out]
codecop has joined #ruby
Nenor has joined #ruby
shaunbaker has joined #ruby
shaunbak_ has joined #ruby
radic has quit [Quit: Verlassend]
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
jacobat_ is now known as jacobat
adambeynon has joined #ruby
cj3kim has quit [Remote host closed the connection]
shaunbaker has quit [Ping timeout: 248 seconds]
radic has joined #ruby
mercwithamouth has joined #ruby
dawkirst has quit [Ping timeout: 245 seconds]
elaptics`away is now known as elaptics
aloshkarev has quit [Quit: aloshkarev]
radic has quit [Client Quit]
radic has joined #ruby
atno has quit [Ping timeout: 276 seconds]
dodosan has quit [Remote host closed the connection]
aagdbl has joined #ruby
noname001 has joined #ruby
razi has joined #ruby
s0ber has quit [Ping timeout: 268 seconds]
atmosx has joined #ruby
<atmosx>
Hi can you check out this web form and tell me if its SSLed? http://getpebble.com/pages/replacement-cable Beucase I get the feeling that it's not and it's asking me for my data (okay) and my credit card right after that.
<atmosx>
and I'm sitting in a public library, jeez
radic has quit [Quit: Verlassend]
radic has joined #ruby
<atmosx>
ah the JS seem to ssled
sayan has quit [Ping timeout: 256 seconds]
mansi has joined #ruby
clocKwize has quit [Quit: clocKwize]
_maes_ has joined #ruby
Kar- has joined #ruby
selim has joined #ruby
ferdev has joined #ruby
atmosx has quit [Quit: Lost in trance]
Drakevr has joined #ruby
Drakevr has quit [Changing host]
Drakevr has joined #ruby
musl has quit [Ping timeout: 260 seconds]
predator117 has joined #ruby
leehambley has quit [Ping timeout: 260 seconds]
Arreis has quit [Read error: Connection reset by peer]
Arreis has quit [Read error: Connection reset by peer]
aagdbl has quit [Quit: Leaving.]
Arreis has joined #ruby
intuxicated has joined #ruby
d34th4ck3r has joined #ruby
kidstark has quit [Quit: kidstark]
lkba has quit [Ping timeout: 245 seconds]
txdv has quit [Ping timeout: 264 seconds]
nari has quit [Ping timeout: 264 seconds]
clocKwize has joined #ruby
gyre007 has quit [Remote host closed the connection]
Arreis has quit [Read error: Connection reset by peer]
cutmail has quit [Remote host closed the connection]
jamesfung14 has quit [Ping timeout: 264 seconds]
aaronmcadam has joined #ruby
Criztian has joined #ruby
fgo has joined #ruby
Arreis has joined #ruby
timonv has quit [Remote host closed the connection]
sevenseacat has quit [Quit: Leaving.]
fgo has quit [Ping timeout: 245 seconds]
aagdbl has joined #ruby
s0ny123 has quit [Quit: leaving]
mklappstuhl has joined #ruby
dsferreira has joined #ruby
s0ny123 has joined #ruby
brugidou has quit [Ping timeout: 245 seconds]
brugidou has joined #ruby
adambeynon has joined #ruby
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
tvw has joined #ruby
elaptics is now known as elaptics`away
headius has quit [Quit: headius]
camilasan has quit [Remote host closed the connection]
camilasan has joined #ruby
elaptics`away is now known as elaptics
Voiden has joined #ruby
fly-away has quit [Remote host closed the connection]
Voiden has quit [Max SendQ exceeded]
LMolr has joined #ruby
Voiden has joined #ruby
threeturn has joined #ruby
Voiden has quit [Read error: Connection reset by peer]
intuxicated has quit [Remote host closed the connection]
buibex has quit [Remote host closed the connection]
buibex has joined #ruby
atno has joined #ruby
hogeo has joined #ruby
marcgg has quit [Remote host closed the connection]
felixjet_ has joined #ruby
julian-delphiki has joined #ruby
bean has quit [Read error: Connection reset by peer]
shaunbak_ has quit [Read error: Connection reset by peer]
ehaliewicz has quit [Ping timeout: 248 seconds]
felixjet has quit [Read error: Connection reset by peer]
shaunbaker has joined #ruby
rippa has joined #ruby
<triptec>
is there anyway to get host from Errno::ECONNREFUSED
<triptec>
?
jibi has quit [Quit: .]
mansi has joined #ruby
leehambley has joined #ruby
LMolr has quit [Ping timeout: 264 seconds]
bricker`LA has joined #ruby
dash_ has joined #ruby
staafl has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
s0ber has joined #ruby
wildroman has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dodosan has joined #ruby
mansi has quit [Ping timeout: 256 seconds]
troessner has joined #ruby
threeturn has quit [Quit: threeturn]
m8 has joined #ruby
<jrobeson>
triptec, why don't you inspect the e and find out?
dv_ has quit [Ping timeout: 256 seconds]
<jrobeson>
that is.. rescue Errno::ECONNREFUSED => e
gyzmodo has quit [Remote host closed the connection]
<mikecmpbll>
triptec: don't think so, afaik Errno exceptions originate from the operating system and are mapped to from the error number that the OS spits out
camilasan has quit [Remote host closed the connection]
<mikecmpbll>
triptec, but you can get the host other ways i'm sure.
camilasan has joined #ruby
dodosan has quit [Ping timeout: 245 seconds]
TheRealPygo has quit [Ping timeout: 245 seconds]
snovak has joined #ruby
vmoravec has joined #ruby
camilasa_ has joined #ruby
dsferreira has quit [Quit: This computer has gone to sleep]
vlad_starkov has quit [Remote host closed the connection]
camilasan has quit [Read error: Operation timed out]
relix has joined #ruby
dv_ has joined #ruby
oliver__ has joined #ruby
cam`_ has joined #ruby
camilasa_ has quit [Remote host closed the connection]
camilasan has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
mengu has joined #ruby
bluehavana has joined #ruby
mengu has quit [Remote host closed the connection]
schaerli has quit [Remote host closed the connection]
<triptec>
involves alot of hassle
Anarch has quit [Read error: Operation timed out]
snovak has quit [Ping timeout: 264 seconds]
mklappstuhl has joined #ruby
oliver_ has quit [Ping timeout: 264 seconds]
selim has joined #ruby
cascalheira has joined #ruby
bigkevmcd has quit [Quit: Ex-Chat]
bigkevmcd has joined #ruby
dangerousdave has quit [Quit: Leaving...]
dash_ has quit [Quit: dash_]
robertjpayne has joined #ruby
<robertjpayne>
Are there any methods in ruby that can compare strings of two different encodings? I'm thinking there must be an easier way than constantly enforcing an encoding and then checking?
mengu has joined #ruby
dangerousdave has joined #ruby
Domon has quit [Remote host closed the connection]
<shevy>
good old encoding...
<shevy>
sweet 1.8.x days
Domon has joined #ruby
aryaching has quit [Ping timeout: 264 seconds]
tomzx_mac has joined #ruby
threeturn has joined #ruby
Domon__ has joined #ruby
<Veejay>
Encodings are the worst
soba has joined #ruby
<Veejay>
I wish we'd all settle for some encoding and be done with it
DaniG2k has joined #ruby
Domon has quit [Read error: Connection reset by peer]
<Veejay>
If only English had more accented characters
<Veejay>
We'd probably be there already
<DaniG2k>
guys I know that if I have a method is_numeric?(str) I can pass in a tring and check its numericality, but what if I want to do str.is_numeric?
<DaniG2k>
how'd I do that?
<DaniG2k>
my method is a one-liner
razi has quit [Ping timeout: 256 seconds]
<DaniG2k>
do I need to do def is_numeric?; regex === self; end ?
<DaniG2k>
it doesnt seem to work though
sergicles has joined #ruby
Domon__ has quit [Remote host closed the connection]
hanmac has quit [Quit: Leaving.]
Anarch has joined #ruby
<canton7>
what's 'regex'?
YaNakilon has quit [Ping timeout: 256 seconds]
fgo has joined #ruby
cj3kim has quit [Remote host closed the connection]
<tobiasvl>
can't you just do this:
<tobiasvl>
class String; def is_numeric?; is_numberic?(self); end; end
<tobiasvl>
s/numberic/numeric
blackmesa has quit [Ping timeout: 240 seconds]
dangerousdave has quit [Quit: Leaving...]
blackmes1 has joined #ruby
Stygia has joined #ruby
dangerousdave has joined #ruby
camilasan has quit [Remote host closed the connection]
sayan has joined #ruby
camilasan has joined #ruby
d34th4ck3r has quit [Quit: d34th4ck3r]
YaNakilon has joined #ruby
camilasan has quit [Read error: Connection reset by peer]
fgo has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby
d34th4ck3r has joined #ruby
alexander25 has joined #ruby
mlpinit has joined #ruby
gyre007 has joined #ruby
ferdev has quit [Quit: ferdev]
d34th4ck3r has quit [Client Quit]
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
musl has joined #ruby
s0ny123 has quit [Ping timeout: 248 seconds]
ferdev has joined #ruby
mlpinit has quit [Ping timeout: 256 seconds]
gyre007 has quit [Ping timeout: 264 seconds]
r0bglees0n has quit [Ping timeout: 245 seconds]
Lindrian_ is now known as Lindrian
alexander25 has quit [Ping timeout: 250 seconds]
Lindrian has quit [Changing host]
Lindrian has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
atno has quit [Ping timeout: 245 seconds]
kaspergrubbe has quit [Remote host closed the connection]
schaerli has joined #ruby
yrp has joined #ruby
aryaching has joined #ruby
wildroman has quit [Remote host closed the connection]
nfk has joined #ruby
mephux has quit [Ping timeout: 260 seconds]
bricker`LA has quit [Ping timeout: 248 seconds]
timonv has joined #ruby
mephux has joined #ruby
mephux is now known as Guest53177
wildroman has joined #ruby
postmodern has quit [Quit: Leaving]
wildroman has quit [Remote host closed the connection]
aryaching has quit [Client Quit]
wildroman has joined #ruby
siwica has joined #ruby
m00nlight has quit [Remote host closed the connection]
Stalkr_ has joined #ruby
hanmac has joined #ruby
ananthakumaran1 has joined #ruby
lkba has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
dhruvasa1ar has joined #ruby
wchun has joined #ruby
wchun has quit [Client Quit]
buibex has quit [Remote host closed the connection]
wchun has joined #ruby
peregrine81 has joined #ruby
Ox6abe has joined #ruby
ananthakumaran has quit [Ping timeout: 264 seconds]
DrCode has quit [Remote host closed the connection]
julweber has joined #ruby
h_kon has joined #ruby
brtdv has quit [Ping timeout: 245 seconds]
atno has joined #ruby
funburn has quit [Quit: funburn]
DrCode has joined #ruby
siwica has quit [Quit: siwica]
dkamioka has quit [Remote host closed the connection]
timonv has quit [Remote host closed the connection]
ananthakumaran1 has quit [Read error: Connection reset by peer]
ismaelrb has joined #ruby
timonv has joined #ruby
blackmes1 has joined #ruby
ismaelrb has quit [Client Quit]
ananthakumaran has joined #ruby
swordsmanz has joined #ruby
timonv has quit [Read error: No route to host]
tagrudev has quit [Remote host closed the connection]
Ox6abe has quit [Remote host closed the connection]
headius has joined #ruby
evenix has joined #ruby
aryaching has quit [Ping timeout: 245 seconds]
julweber has quit [Remote host closed the connection]
aryaching has joined #ruby
tkuchiki has quit [Remote host closed the connection]
hanmac has quit [Quit: Leaving.]
ericmathison has quit [Ping timeout: 256 seconds]
sevenseacat has joined #ruby
emergion has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
dsferreira has joined #ruby
emergion has quit [Max SendQ exceeded]
yacks has joined #ruby
tomsthumb has joined #ruby
emergion has joined #ruby
maasha has joined #ruby
ananthakumaran has joined #ruby
emergion has quit [Max SendQ exceeded]
blackmes1 has quit [Ping timeout: 240 seconds]
mklappstuhl has quit [Remote host closed the connection]
lessless has joined #ruby
emergion has joined #ruby
<maasha>
hi
<lessless>
what's wrong with ["02", "2811", "8.822483102098898"].inject({visits:0}) {|memo, obj| puts memo[:visits] += obj[1].to_i} - it throws NoMethodError: undefined method `[]' for nil:NilClass
emergion has quit [Max SendQ exceeded]
atno has quit [Read error: Operation timed out]
emergion has joined #ruby
<maasha>
I have just discovered a broken test which arose after upgrading from Ruby 1.9->2.0. Array.to_s is no longer invoking the .to_s method of all elements and returning a list of these.
<maasha>
Right?
emergion has quit [Max SendQ exceeded]
emergion has joined #ruby
swordsmanz has quit [Quit: swordsmanz]
emergion has quit [Max SendQ exceeded]
nari has joined #ruby
tomsthumb has quit [Ping timeout: 256 seconds]
<canton7>
lessless, #inject uses the *return value* of the block asmemo for the next iteration
<canton7>
and a hash element assignment return the hash element
<canton7>
see that assignment returns :b, not {:b => :b}
<canton7>
*{:a => :b}
emergion has quit [Max SendQ exceeded]
<lessless>
yeah
<lessless>
this is just me expecting different behavior :)
soba has quit [Ping timeout: 245 seconds]
emergion has joined #ruby
<canton7>
and the way #inject works is "take the return value from the last time the block was called, and pass it in as the first parameter next time to block is called"
<lessless>
ok, i see
<canton7>
like I say, #each_with_object henaves as you expt it
<canton7>
*expect
<lessless>
each_with_objects suits better for my needs
<lessless>
*task
locriani has quit [Remote host closed the connection]
ananthakumaran has quit [Read error: Connection reset by peer]
buibex has joined #ruby
ananthakumaran has joined #ruby
locriani has quit [Ping timeout: 248 seconds]
fgo has quit [Ping timeout: 248 seconds]
sailias has joined #ruby
swordsmanz has quit [Client Quit]
atno has joined #ruby
emergion has quit [Max SendQ exceeded]
Stalkr_ has quit [Read error: Connection reset by peer]
emergion has joined #ruby
LMolr has joined #ruby
vlad_starkov has joined #ruby
mercwithamouth has quit [Ping timeout: 260 seconds]
emergion has quit [Max SendQ exceeded]
hamakn has quit [Remote host closed the connection]
hamakn has joined #ruby
swordsmanz has joined #ruby
emergion has joined #ruby
tkuchiki has joined #ruby
emergion has quit [Max SendQ exceeded]
vlad_starkov has quit [Remote host closed the connection]
dash_ has joined #ruby
obiwahn has joined #ruby
maroloccio has joined #ruby
emergion has joined #ruby
snovak has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
Ox6abe has joined #ruby
emergion has quit [Max SendQ exceeded]
mlpinit has joined #ruby
emergion has joined #ruby
ananthakumaran has joined #ruby
emergion has quit [Max SendQ exceeded]
camilasan has joined #ruby
hamakn has quit [Ping timeout: 260 seconds]
emergion has joined #ruby
hanmac has joined #ruby
zephdev has joined #ruby
<lessless>
hey folks another interesting question
snovak has quit [Ping timeout: 264 seconds]
dash_ has quit [Ping timeout: 256 seconds]
emergion has quit [Max SendQ exceeded]
<lessless>
what is the difference between |(*arr, i), o| and |*arr, i, o| in ["31", "2492", "11.436597110754414", "30", "2443", "13.548915268112976"].each_slice(2).with_index.with_object({date:0, visits: 0, rate: 0 }) { |(*arr, i), o| puts "#{arr.flatten(1).inspect}, #{i}, #{o}"}
ananthakumaran has quit [Read error: Connection reset by peer]
emergion has joined #ruby
emergion has quit [Max SendQ exceeded]
ananthakumaran has joined #ruby
emergion has joined #ruby
Urizen has joined #ruby
m00nlight has joined #ruby
emergion has quit [Max SendQ exceeded]
emergion has joined #ruby
emergion has quit [Max SendQ exceeded]
m00nlight has quit [Remote host closed the connection]
emergion has joined #ruby
blackmes1 has joined #ruby
emergion has quit [Max SendQ exceeded]
mercwithamouth has joined #ruby
fgo has joined #ruby
jgrau has joined #ruby
ldnunes has joined #ruby
emergion has joined #ruby
KobraKao has joined #ruby
<jgrau>
hi group. I have an array of objects that i want to split into two arrays based on a property of the object
<jgrau>
is there a method for that?
emergion has quit [Max SendQ exceeded]
Urizen has quit [Ping timeout: 256 seconds]
<jgrau>
basicly i have a bunch of objects that are either pinned? or not. I want to move all the pinned objects to the beginning of the array
emergion has joined #ruby
<sevenseacat>
just sort them?
hydrozen has joined #ruby
<jgrau>
if I use sort, then for reason my sorting by creation date is no longer working
emergion has quit [Max SendQ exceeded]
<lessless>
sevenseacat, can you look on my last question, please? :)
ksh has quit [Remote host closed the connection]
ananthakumaran has quit [Read error: Connection reset by peer]
emergion has joined #ruby
<lessless>
what is the sense of using braces in (*arr, i) in ["31", "2492", "11.436597110754414", "30", "2443", "13.548915268112976"].each_slice(2).with_index.with_object({date:0, visits: 0, rate: 0 }) { |(*arr, i), o| puts "#{arr.flatten(1).inspect}, #{i}, #{o}"}
sailias has quit [Ping timeout: 245 seconds]
emergion has quit [Max SendQ exceeded]
<sevenseacat>
lessless: if i knew the answer, i would.
<apeiros>
lessless: different destructuring of the array
mklappstuhl has joined #ruby
<apeiros>
|(*arr, i), o| # takes an array with two values, and assigns the first value to (*arr, i) and the second to o
emergion has quit [Max SendQ exceeded]
jibi has quit [Quit: .]
<apeiros>
the first value being assigned to (*arr, i) must be an array too and is further destructured by assigning the last value to i and the rest (via splat) to arr
<sevenseacat>
always :) my general ruby knowledge is a lot weaker than my rails-fu so i try to absorb a lot
gyre007 has quit [Ping timeout: 264 seconds]
ferdev has quit [Quit: ferdev]
mercwithamouth has quit [Ping timeout: 260 seconds]
mansi has quit [Ping timeout: 264 seconds]
<apeiros>
(or pry)
vlad_starkov has joined #ruby
<apeiros>
sevenseacat: for me it's the other way round :)
<apeiros>
the ruby is strong with me, but I feel more comfortable off-rails
ananthakumaran has joined #ruby
<mikecmpbll>
you're off the rails, boy.
<apeiros>
damit, I need wooden swords… (compiling)
<clocKwize_>
anyone use textual?
zephdev has quit [Remote host closed the connection]
<mikecmpbll>
clocKwize_: yep.
<clocKwize_>
I'm trying it.. seems nicer than Colloquay
<apeiros>
no, noone never did
<mikecmpbll>
i like it.
<mikecmpbll>
i still haven't bought it so every two hours i face palm when they disconnect me
KobraKao has quit [Quit: Saindo]
Elhu has quit [Quit: Computer has gone to sleep.]
graydot has joined #ruby
graydot has quit [Client Quit]
jkamenik has joined #ruby
kiri has quit [Ping timeout: 268 seconds]
<sevenseacat>
still havent found a client i like as much as pidgin.
shaunbaker has quit [Remote host closed the connection]
<clocKwize_>
heh
Xeago_ has joined #ruby
Xeago has quit [Read error: Operation timed out]
kayloos has joined #ruby
theRoUS has joined #ruby
<cout>
pidgin didn't work well for me
<cout>
can't remember what didn't work
<cout>
empathy worked but felt klunky
<cout>
but maybe anything is going to feel klunky to someone who grew up on ircII and BitchX
<jrobeson>
i need to setup my xmpp irc gateway again..
<jrobeson>
i used to use gajim for everything via gateways
<jrobeson>
atm i'm using xchat though.. mostly because empathy has no out of the box support for timestamps
<jrobeson>
you have to add a custom adium theme for it
<jrobeson>
and it never looked right
iartarisi has joined #ruby
<jrobeson>
plus.. i like the guide in xchat
<iartarisi>
does ruby have anything similar to clojure's if-let?
<jrobeson>
iartarisi, you'd have to explain if-let .. don't assume people know it
<iartarisi>
it's kinda hard to explain :), basically it checks for a condition and if it's true, it assigns the result of another expression to a variable and executes a block
ananthakumaran has quit [Read error: Connection reset by peer]
buibex has quit [Remote host closed the connection]
mattlins has quit [Client Quit]
JumpMast3r has joined #ruby
jp- has joined #ruby
mattlins has joined #ruby
buibex has joined #ruby
alekst has joined #ruby
lfox has joined #ruby
brain_shim has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
fridim__ has quit [Ping timeout: 264 seconds]
kvirani has joined #ruby
pothibo has quit [Quit: pothibo]
schaerli has quit [Remote host closed the connection]
cody-- has joined #ruby
snovak has joined #ruby
dawkirst has joined #ruby
justsee has quit [Ping timeout: 276 seconds]
Monie has joined #ruby
jamesaanderson has joined #ruby
zarubin has joined #ruby
snovak has quit [Ping timeout: 276 seconds]
girija has quit [Ping timeout: 264 seconds]
adambeynon has joined #ruby
cads has joined #ruby
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Clooth has joined #ruby
Beoran_ has quit [Ping timeout: 246 seconds]
dawkirst has quit [Ping timeout: 245 seconds]
Suit_Of_Sables has joined #ruby
brain_shim has joined #ruby
shaunbak_ has quit [Remote host closed the connection]
Maokomioko has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
dawkirst has joined #ruby
Ox6abe has joined #ruby
kiri has joined #ruby
<Suit_Of_Sables>
might one think of a method yeilding to a block (as in: array.each { |x| puts x } ) as kind of a return value being passed to the block that doesn't terminate the original method? (unlike normal use of the return statement) ??
schaerli has joined #ruby
leehambley has quit [Ping timeout: 256 seconds]
freerobby has quit [Read error: Connection reset by peer]
snovak has joined #ruby
<canton7>
mmm. it's more like syntactic sugar for the block being called (in the same way that one method calls another) with a particular argument
<Suit_Of_Sables>
canton7: ah, so the yield is like a call on the block with whatever it is yielding as a parameter(if of course, the block is set to use them)? Also, the block itself has the same 'scope' as the area in which the method to it's left (the .each call in my above example) was made correct?
jamesaanderson has joined #ruby
LMolr has joined #ruby
<canton7>
"same 'scope' as the area in which the method to it's left"? the block is a closure - it captures the scope at the point at which it is defined
<canton7>
(put very broadly and slightly incorrectly)
aagdbl has quit [Quit: Leaving.]
<canton7>
`def i_call_blocks(&block) ; block.call("yay"); end ` and `def i_call_blocks(); yield "yay"; end` are equivalent
swordsmanz has quit [Quit: swordsmanz]
DaniG2k has quit [Read error: Operation timed out]
<Suit_Of_Sables>
canton7: that is what I ment. meaning if there is a variable 'x' declared before the method-with-{block} statement, x = 3 in the method itself would not affect that original variable, but x = 3 in the block WOULD (unless declared explicitly as local variable with |;x|) right?
pierre1 has joined #ruby
Beoran_ has joined #ruby
gr33n7007h has joined #ruby
swordsmanz has joined #ruby
<canton7>
Suit_Of_Sables, yup sounds about right
jbpros has joined #ruby
DrForr_ is now known as DrForr
girija has joined #ruby
<canton7>
now you get more complex situations where the scoping of a block can be redefined by the method to which it's passed
<canton7>
so you define a block, pass it to a method, the method goes "ok, I'm going to evaluate this block in this other scope I've got"
<canton7>
see instance_eval and friends. they're less common outside of DSLs
shaunbaker has joined #ruby
<Suit_Of_Sables>
canton7: Ok, just seemed counter intuitive to me at first as, if thinking of the yield (or call on the block) as being like a method call I would have thought at first that the scope narrowed from initial method call to block call but in fact it is more of a cycle with the block being almost like snapshot of the preview scope state(unless, as you said, it is overridden) at least that is how it makes sense to me
<Suit_Of_Sables>
now
<Suit_Of_Sables>
canton7: thanks for your help!
oliver__ has quit [Read error: Connection reset by peer]
snath has joined #ruby
oliver_ has joined #ruby
Zai00_ has joined #ruby
polaco_zZz is now known as polaco
Zai00 has quit [Ping timeout: 245 seconds]
Zai00_ is now known as Zai00
<Suit_Of_Sables>
It seems to me that once you have some experience programming most language specific instructional books don't help much outside of a basic intro to syntax. It seems to all be about actually diving into the documentation yourself and learning the API
locriani has joined #ruby
<Suit_Of_Sables>
That is, diving into the documention is what one should do.
iamjarvo has joined #ruby
LMolr has quit [Ping timeout: 260 seconds]
jbpros has quit [Ping timeout: 256 seconds]
cody-- has quit [Quit: derp]
wmoxam_ has joined #ruby
wmoxam has quit [Disconnected by services]
shaunbak_ has joined #ruby
brain_shim has quit [Ping timeout: 276 seconds]
wmoxam_ is now known as wmoxam
wmoxam has joined #ruby
wmoxam has quit [Changing host]
mercwithamouth has quit [Ping timeout: 264 seconds]
locriani has quit [Ping timeout: 256 seconds]
shredding has quit [Quit: shredding]
BizarreCake has joined #ruby
<Ox6abe>
How can I tell in my ruby code whether I am using normal order vs applicative order?
kayloos has quit [Remote host closed the connection]
<Ox6abe>
aka lazy evaluation or not
shaunbaker has quit [Ping timeout: 264 seconds]
cascalheira has quit [Quit: Leaving...]
<hoelzro>
Ox6abe: sorry, could you offer a little more clarification?
<Ox6abe>
so the blocks i am passing will be lazy evaluation since I am passing each one separately to the each function and they are bing called later on the object?
iamjarvo has quit [Remote host closed the connection]
<Ox6abe>
being*
iamjarvo has joined #ruby
<hoelzro>
I wouldn't think of it as lazy evaluation
<a1ph4g33k>
no, the block will be evaluated as the interpretter hits it ... but the block will not be executed until yielded to.
<canton7>
Suit_Of_Sables, yeah that fits with my mental model
<hoelzro>
what a1ph4g33k said
<canton7>
Suit_Of_Sables, hmm yeah, I see learning a language as learning 3 parts: syntax, api, style. books with a lot with the first and a bit with the second two
<Ox6abe>
So it is still all applicative order
<Ox6abe>
Makes sense
<a1ph4g33k>
... yes & no.
<a1ph4g33k>
The bindings won't be resolved until the block is executed.
<canton7>
hmm, stdlib is probably a better word than api
<Ox6abe>
maybe I am still confused on the two then
<a1ph4g33k>
so ... in the normal case, the bindings will stay what they were as the block was defined, if instance_eval or class_eval is used, the bindings will be updated.
Maokomioko has joined #ruby
<hoelzro>
blocks are just closures
peregrine81 has joined #ruby
renanoronfle has joined #ruby
<Ox6abe>
Ruby and closures are still new to me
kayloos has joined #ruby
<hoelzro>
what's your background?
hanmac has quit [Read error: Connection reset by peer]
<Ox6abe>
C, C++, Java
hanmac has joined #ruby
<hoelzro>
hmm
<Ox6abe>
C# etc ...
<hoelzro>
oh, C# might help a bit
mengu has quit [Quit: This computer has gone to sleep]
jlast has joined #ruby
<hoelzro>
I remember it has some sort of lambdas
<hoelzro>
but it's been a while since I've written C#
freerobby has joined #ruby
<hoelzro>
so a closure is a function that "closes over" a set of variables
cascalheira has joined #ruby
devoldmx has quit [Ping timeout: 260 seconds]
mengu has joined #ruby
gyre007 has joined #ruby
vlad_starkov has joined #ruby
<hoelzro>
so a closure can still access the variables it closes over, even if the original stack frame of those variables is gone
<Ox6abe>
Binding the variable to the variable in the closure
devoldmx has joined #ruby
mary5030 has joined #ruby
mary5030 has quit [Remote host closed the connection]
<hoelzro>
in the case of sum = 0; array.each { |x| sum += x }
rickmasta has joined #ruby
<hoelzro>
the block here is a closure which has access to the sum variable in the enclosing scope
mary5030 has joined #ruby
<hoelzro>
so when the each method executes the block (known as "yielding")
<hoelzro>
it can access it
<Ox6abe>
I am guessing the C code it has two pointers then ?
<Ox6abe>
hmmm
<coderhs>
hey how to get session id of a bosh communication from ruby
<hoelzro>
I'm not privy to the details of the implementation
brbcoding has joined #ruby
<Ox6abe>
oh ok
jerius has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
Mokosha has quit [Read error: Operation timed out]
<Suit_Of_Sables>
is the only real difference between array's .map and .each methods that .map returns a new array as modified by the block? Is that about it?
<cout>
yes
<Suit_Of_Sables>
cout: thanks, well that makes it easy to remember
sambao21 has quit [Quit: Computer has gone to sleep.]
anonymuse has joined #ruby
<utdemir>
Hi. On Turkish language I is uppercase of ı and İ is uppercase of i. However, UnicodeUtils.downcase("I", "tr"|"tur"|"turkish") doesn't work, it just converts it to "i" instead of "ı". How can I fix this behavior?
kayloos has quit [Remote host closed the connection]
s0ny123 has quit [Read error: Operation timed out]
tjad has quit [Ping timeout: 276 seconds]
obs has joined #ruby
thecodethinker has joined #ruby
Ox6abe has quit [Remote host closed the connection]
endash has joined #ruby
pushpak has quit [Ping timeout: 240 seconds]
s0ny123 has joined #ruby
gianlucadv has quit [Max SendQ exceeded]
rickmasta has quit [Quit: Leaving...]
dml_ has joined #ruby
gianlucadv has joined #ruby
dawkirst has quit [Ping timeout: 256 seconds]
hogeo has quit [Remote host closed the connection]
<baggypants>
wow this form of docs is way better than ruby-doc.org
RichardBaker has joined #ruby
RichardBaker has quit [Client Quit]
yekta has joined #ruby
relix has joined #ruby
Dave has joined #ruby
dangerousdave has quit [Read error: Connection reset by peer]
hamed_r has joined #ruby
Bira has joined #ruby
Dave is now known as Guest39178
Bira has quit [Remote host closed the connection]
maletor has joined #ruby
RichardBaker has joined #ruby
mansi has joined #ruby
snath has quit [Ping timeout: 248 seconds]
clov3r has quit [Read error: Connection reset by peer]
clov3r has joined #ruby
buibex has quit [Remote host closed the connection]
ssvo has joined #ruby
Xeago has quit [Remote host closed the connection]
JumpMast3r has quit [Quit: JumpMast3r]
Xeago has joined #ruby
noop has quit [Ping timeout: 245 seconds]
buibex has joined #ruby
LMolr has joined #ruby
Bira has joined #ruby
duggiefresh has joined #ruby
noop has joined #ruby
dodosan has joined #ruby
duggiefr_ has quit [Ping timeout: 276 seconds]
Splourian has joined #ruby
Seich has quit [Ping timeout: 245 seconds]
tobago has quit [Remote host closed the connection]
Liquid-- has joined #ruby
dankest has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
sloucher has joined #ruby
g0bl1n has joined #ruby
g0bl1n has joined #ruby
g0bl1n has quit [Max SendQ exceeded]
splud_ has quit [Quit: splud_]
xiphias has joined #ruby
g0bl1n has joined #ruby
Seich has joined #ruby
mklappstuhl has quit [Remote host closed the connection]
Urizen has quit [Ping timeout: 256 seconds]
user258467 has quit [Quit: Quitte]
<Suit_Of_Sables>
my only complaint with ruby is the lack of the ++ or -- unary operators. I know it is silly, I just have an irrational fondness for them
schaerli has quit [Remote host closed the connection]
digital-ghost has joined #ruby
<canton7>
do you know why they don't exist?
nari has quit [Ping timeout: 264 seconds]
<Suit_Of_Sables>
canton7: Oooo, tell me!
Bosox20051 has quit [Read error: Connection reset by peer]
jkline has joined #ruby
<shevy>
because numbers in ruby cheat
<Suit_Of_Sables>
because they are objects?
<shevy>
not so much
<canton7>
++ would mutate the number. mutation isn't a very good idea when you've got lambdas capturing stuff all over the place
<apeiros>
and numbers are immutable
<canton7>
^^ exactly
Speed has joined #ruby
<Suit_Of_Sables>
but you can make method calls on numbers right? like 5.times so they are objects right?
<shevy>
Suit_Of_Sables x = 5.5; def x.hi; puts "hi"; end; TypeError: cant define singleton method "hi" for Float
browndawg has joined #ruby
<|jemc|>
python cheats in the same way, but retains those operators. However, I've never eeven really wanted to use them in ruby because the enumerables are so great
<|jemc|>
I rarely if ever have to increment an index by hand
<Suit_Of_Sables>
I just like how concise and clean n++ looks :p
<apeiros>
there was some rationale why aliasing a++ to (a = a.succ) was a bad idea…
<Suit_Of_Sables>
apeiros: well NOW I'm confused :p
<hanmac>
apeiros: yeah thats what i wanted to show him
<apeiros>
Suit_Of_Sables: `a = 1` -- assignment, not a method call
<apeiros>
Suit_Of_Sables: `x.a = 1` -- method call, not an assignment. calls the method "a=" on the object referenced by the expression `x`
<Suit_Of_Sables>
but because numbers are immutable you can't have stuff like a+!1 to increment it in place?
Lewix has joined #ruby
Spami has quit [Quit: This computer has gone to sleep]
<apeiros>
you can't have e.g. 2.succ!
jprovazn has joined #ruby
alup has quit [Quit: Leaving]
<apeiros>
or `a = 2; a.succ!; a # => 3`
underway47 has quit [Ping timeout: 264 seconds]
dsferreira has quit [Quit: This computer has gone to sleep]
<apeiros>
that's because the object is immutable.
graft has quit [Ping timeout: 264 seconds]
<apeiros>
the distinction between variable and object is important.
<hanmac>
hm you can when you put the 2 into an decorator object that handles the succ! method via method missing
<Suit_Of_Sables>
apeiros: ah, yeah I was just going to ask that
<apeiros>
the only way to change a *variable* is by assignment
<apeiros>
the only way to change an *object* is through mutation
<Suit_Of_Sables>
apeiros: because the variable is only a reference?
<apeiros>
so `a = "hello"; a.succ!` - the variable is untouched. the object itself is being changed
<hanmac>
yeah you get it ! :D
<apeiros>
Suit_Of_Sables: correct
brianpWins has joined #ruby
<Suit_Of_Sables>
yay!
lele has quit [Ping timeout: 245 seconds]
underway47 has joined #ruby
<Suit_Of_Sables>
I must say ruby is the first language I've found where the syntax and method names are intuitive. But I guess that is what they were going for. It almost makes coding... dun!
snath has joined #ruby
<Suit_Of_Sables>
*fun!
<apeiros>
dun dun dun!
<yaymukund>
dun!
<apeiros>
;-)
<yaymukund>
:D
<Suit_Of_Sables>
beethoven's 5th eh?
awarner_ has quit [Ping timeout: 245 seconds]
<hanmac>
hm it also makes "pun" ;D
filipe has quit [Read error: Connection reset by peer]
<apeiros>
wasn't it the 9th?
<apeiros>
blerp
<Suit_Of_Sables>
<-- idiot
<apeiros>
no idea :)
<hanmac>
in ruby everything succs … even symbols :D
Xeago has quit [Remote host closed the connection]
<shevy>
lethjakman dunno, google for to proc conversions
<lethjakman>
ok, thanks guys
LMolr has quit [Remote host closed the connection]
<lethjakman>
interesting way of doing things
<shevy>
it's for lazy people
<ccooke>
some people prefer to call to_proc directly.
<shevy>
in ruby a lot of the magic exists because people are so lazy
<shevy>
now java, these are brave guys
cody-- has quit [Quit: derp]
<lethjakman>
shevy: I don't think I'd use it if it's slower, and harder to read. but I'm sure I'll see it somewhere.
<shevy>
they never get tired of verbose code
<shevy>
lethjakman do you use ruby for the speed?
<lethjakman>
some may say too verbose
AdmiraI is now known as Admiral
T_T has joined #ruby
Speed has left #ruby ["WeeChat 0.4.1"]
<shevy>
lethjakman for the simple examples it is not that much harder to read
<hanmac>
shevy: i will make a ticket so that &:sym should be get the same speed as {|s| s.sym} ;P i mean maybe the parser can be tweaeked in this way ;P
<lethjakman>
shevy: no, but if something saves me < 3 lines and makes an impact I probably won't use it. especially if it affects ureadability.
<shevy>
(&:strip) vs {|_| _.strip}
iartarisi has quit [Remote host closed the connection]
DanKnox_away is now known as DanKnox
Spami has quit [Quit: This computer has gone to sleep]
<Suit_Of_Sables>
wow, the inject method is bananas
<shevy>
& is a bit cleaner and shorter but not that much
<shevy>
it adds a : character which I hate
sarlalian has joined #ruby
<shevy>
well actually
<hanmac>
shevy _ is also an magical variable because ruby does not warn you when use use them multible times in the same block
Ox6abe has joined #ruby
<lethjakman>
Suit_Of_Sables: isn't it cool?
<shevy>
I am fine with : but just not when it is connected with &
Coolhand has quit [Ping timeout: 276 seconds]
jkline has quit [Quit: jkline]
awarner has joined #ruby
yekta has quit [Quit: yekta]
kayloos has joined #ruby
<shevy>
cat = Cat.new; cat.jump_to :home
<shevy>
cat = Cat.new; cat.jump_to(:home)
<shevy>
cat = Cat.new; cat.jump_to(&:home)
EIA has joined #ruby
BillCris_ has joined #ruby
<shevy>
lethjakman have you seen the -> construct yet?
<lethjakman>
shevy: I don't think so.
<shevy>
lethjakman ok... be prepared for REALLY ugly shit ...
<shevy>
_ = ->(x){ x+1 }
<shevy>
there you go!
<lethjakman>
shevy: is that like a lambda?
<lethjakman>
looks like coffeescript to me.
VTLob has joined #ruby
IceyEC has joined #ruby
<shevy>
yeah
<hanmac>
shevy: this one is also an variant that is similar to the first ones: cat = Cat.new; cat.jump_to:home
<shevy>
the above will yield:
<lethjakman>
didn't realize ruby could do that.
<shevy>
#<Proc:0xac13018@(irb):4 (lambda)>
<shevy>
so you can use .call on the result to call the value
kayloos has quit [Remote host closed the connection]
Coolhand has joined #ruby
<shevy>
but I hate this particular syntax
<ccooke>
shevy: it's ugly
<shevy>
p = lambda {|a,b,c| a+b+c}
<lethjakman>
shevy: it's short, but it is ugly.
<shevy>
p = -> a,b,c {a+b+c}
<shevy>
!!!
<shevy>
yeah, it's indeed shorter
<Suit_Of_Sables>
lethjakman: yeah, summing an array with arr.inject(:+) :)
<shevy>
I think in ruby, a major design principle is shortness
<ccooke>
it's not much shorter, and a *lot* less clear
<shevy>
and as a side-effect of that comes elegance hehehe
kilophoton has joined #ruby
<shevy>
except for when new operators are added
<ccooke>
and it's less defendable than &:sym
jkline has joined #ruby
<shevy>
or existing rules behave differently
<shevy>
agreed ccooke
BillCriswell has quit [Ping timeout: 245 seconds]
<shevy>
I am scared of ruby 3.0 already :(
<shevy>
hanmac surely loves it already
<ccooke>
because & has a long history of "hey, I'm probably going to do something with callable code here"
Bira has quit []
<shevy>
lethjakman I think matz indeed thought that -> looks like a lambda character
<ccooke>
(okay, c uses it for an address, but one of the key uses was the address of a function)
nadirvardar has quit [Quit: Computer has gone to sleep.]
noop has quit [Ping timeout: 245 seconds]
Coolhand has quit [Client Quit]
<hanmac>
shevy no you are not scared of ruby3.0 … you are scared what Hanmac will do with ruby3.0 :D
kaspergrubbe has quit [Read error: Operation timed out]
<BraddPitt>
never seen that
iamjarvo has joined #ruby
timonv has quit [Remote host closed the connection]
vmoravec has quit [Quit: Leaving]
<banisterfiend>
Suit_Of_Sables obj-c is cool, you're lucky to learn that
Voodoofish430 has joined #ruby
<banisterfiend>
i really like the obj-c OO model
robertjpayne has quit [Remote host closed the connection]
rins has quit [Ping timeout: 245 seconds]
<Suit_Of_Sables>
banisterfiend: good to hear, I was hesitant
<banisterfiend>
Suit_Of_Sables obj-c and ruby are conceptually very similar
<banisterfiend>
of course their syntax is very different
<banisterfiend>
but they both have smalltalk style OO
kofno has quit [Ping timeout: 245 seconds]
<Suit_Of_Sables>
I should be studying C right now, but Ruby stole my heart
kofno has joined #ruby
DanKnox is now known as DanKnox_away
<Suit_Of_Sables>
Oooh well, my C class is a joke
* hanmac
tamed C and C++ so they workship for me and my evil ruby plans ;D
<banisterfiend>
Suit_Of_Sables C is very important
<banisterfiend>
Suit_Of_Sables if you know C you can do a tonne of interesting stuff in Ruby (write C extensions, hack on internals, debug complicated issues, etc)
Splourian has quit [Quit: Leaving]
noname001 has quit [Ping timeout: 264 seconds]
DanBoy has quit [Remote host closed the connection]
<Suit_Of_Sables>
banisterfiend: I do like C, don't get me wrong. I've been having much more fun working with it than with *shudder* Java
bricker`LA has joined #ruby
<Suit_Of_Sables>
C is one language I want to become more compitent with. Right now I'm trying to maintain focus on it and Ruby
<hanmac>
like banister said "hack on internals" is the veryDarkArt of Ruby … (like changing the ruby class inplace ;P )
bricker`1A has quit [Ping timeout: 256 seconds]
mikepack has joined #ruby
Ripp__ has joined #ruby
freerobby has quit [Quit: Leaving.]
<lethjakman>
Suit_Of_Sables: I'm with you, I feel like C and C++ are a lot more fun to ork in than java.
<Suit_Of_Sables>
I find that learning multiple languages at once is actually helpful. I've even found that to be the case in spoken language. Somehow seeing the differences helps you understand each one that much better and it also makes the similarities that much cleaer
freerobby has joined #ruby
<lethjakman>
Suit_Of_Sables: what languages do you know?
Gooder has quit [Ping timeout: 264 seconds]
DanBoy has joined #ruby
rickmasta has joined #ruby
kofno has quit [Ping timeout: 276 seconds]
pontiki has joined #ruby
iamjarvo has quit [Remote host closed the connection]
<Suit_Of_Sables>
lethjakman: C, Java, Ruby, and a little Python. I only started coding recently. And I'm not very confident in any of them. I want to try a functional language next. I'm leaning towards haskell but I guess I should peek at clojure and scala as well eh?
<BraddPitt>
I don't mind java that much
<BraddPitt>
but i fucking HATE maven
<BraddPitt>
and spring, but to a lesser extent
iamjarvo has joined #ruby
<lethjakman>
Suit_Of_Sables: clojure is really interesting to learn, you'll have a great understanding of some weird concepts if you go with that one.
ddv has quit [Changing host]
ddv has joined #ruby
<lethjakman>
it just lays things out differently.
<lethjakman>
I like it a lot, I wish it were more popular.
girija has joined #ruby
<banisterfiend>
lethjakman weider concepts if he learns haskell instead ;)
<banisterfiend>
weider*
<banisterfiend>
weirder* damnit
pushpak has joined #ruby
<Suit_Of_Sables>
weird is good
<Suit_Of_Sables>
haskell more mathy?
<lethjakman>
banisterfiend: yeah? I don't know haskell. I know they have some odd concepts with their lazy loading though.
<lethjakman>
Suit_Of_Sables: nah.
SJr has quit [Max SendQ exceeded]
<lethjakman>
languages aren't erally mathy unless you're doing math.
SJr has joined #ruby
<banisterfiend>
lethjakman haskell is definitely 'mathy'
<lethjakman>
banisterfiend: how?
<lethjakman>
maybe I don't understand the term mathy.
kevinykchan has quit [Quit: Computer has gone to sleep.]
<Suit_Of_Sables>
well, do some languages have a way of representing infinity built into their core library?
<lethjakman>
banisterfiend: but how is that built into one language differently than another?
<banisterfiend>
lethjakman even its type system (algebraic types) is 'mathy' :)
<lethjakman>
huh
<lethjakman>
sounds like fun, I'll put it on my to play with list.
iamjarvo has quit [Ping timeout: 245 seconds]
<banisterfiend>
lethjakman because it's explicit in haskell i guess, it even uses the same terminology as category theory, functors, applicative functors, monoids, monads
Guest39178 has quit [Quit: Leaving...]
<Suit_Of_Sables>
sorry, this is a very silly and basic question. Can one actually read the source code implementation of all of the built in java classes/methods to see exactly how they are implemented? Is that on the doc site as well?
mercwithamouth has joined #ruby
<banisterfiend>
Suit_Of_Sables java or ruby?
<Suit_Of_Sables>
ruby
<banisterfiend>
Suit_Of_Sables you said java ;)
<banisterfiend>
Suit_Of_Sables yes, check out pry for that: http://pryrepl.org
kidoz has joined #ruby
<Suit_Of_Sables>
Oh, i'm an idiot
<banisterfiend>
Suit_Of_Sables i think some doc sites offer code browsing too, but I'm not sure
DanKnox_away is now known as DanKnox
<Suit_Of_Sables>
banisterfiend: Thanks, I think that will be most helpful in really breaking this down
<hanmac>
Suit_Of_Sables: it depends on the Ruby implementation … the MRI ruby (the reference) is written in C … but there is also JRuby in java and other ones (like Topaz is in Python-like)
chrisja has joined #ruby
girija has quit [Read error: Operation timed out]
geox_ has joined #ruby
senayar_ has quit [Remote host closed the connection]
<geox_>
hey guys, I'm completely new to web programming but I have a projet that I'd like to start to learn with. I've already written a lot of code in python that I want to make usable through a web interface. The thing is, it's computationally intensize--matrix multiplications and things. What's the standard for this kind of thing? Place the burden on the client or server? Is ruby a good fit?
<jgrep>
just moving from perl to ruby
<jgrep>
any idea whats the idea of having a ? in function
rehat has joined #ruby
<jgrep>
like h.has_key?('name')
<jgrep>
its confusing
thecodethinker has quit [Ping timeout: 245 seconds]
<banisterfiend>
jgrep predicate method
<Todd->
jgrep, it's expected that it will return a boolean
thecodethinker has joined #ruby
<banisterfiend>
Todd- or simply that its return value should be treated as boolean
tabolario has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Todd->
banisterfiend, true
dangerousdave has joined #ruby
<jgrep>
so if it returns a int or string then we dont use ?
<crowell>
geox_: why not use python?
Coolhand has joined #ruby
aeontech has joined #ruby
BraddBitt has joined #ruby
<crowell>
if you are already comfortable with it, python's matplotlib is a lot better than anything that ruby has
JJasonClark has left #ruby [#ruby]
<Todd->
banisterfiend, though our internal policy states that methods which are prefixed with ? will always return a boolean
carraroj has quit [Client Quit]
<geox_>
crowell: that's part of my question. If I decide to use python, does that mean I need to use something like django or web2py?
carraroj has joined #ruby
<Todd->
banisterfiend, suffixed rather
apeiros has quit [Remote host closed the connection]
<BraddBitt>
man
<BraddBitt>
why does ruby not have ++/00
<BraddBitt>
er
BraddPitt has quit [Ping timeout: 264 seconds]
<BraddBitt>
--
adambeynon has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RichardBaker has quit [Quit: RichardBaker]
BraddBitt is now known as BraddPitt
<crowell>
geox_: there are plenty of python frameworks
<banisterfiend>
Todd- fair enough, that's only an issue when playing in the console though i expect
saarinen has joined #ruby
<jgrep>
thnx
<crowell>
django, bottle, etc.
Monie has joined #ruby
chopmo has quit [Remote host closed the connection]
<crowell>
geox_: depends on the scale and what you are trying to achieve
saarinen has quit [Client Quit]
<banisterfiend>
Todd- right?
Targen has quit [Ping timeout: 256 seconds]
<jgrep>
crowell: why no just a cgi? it totally depends on what is it you are trying to achieve
<Veejay>
BraddPitt: += does the same thing
kaldrenon has quit [Remote host closed the connection]
<crowell>
jgrep: that too :P, I was thinking more along the lines of using a python framework
<geox_>
jgrep: To clarify, cgi is code that's run server side, requested with some parameters by the client?
<Suit_Of_Sables>
in general will shell scripts run faster on a linux machine than a comperable ruby script? When I write stuff stuff for bash it is just so damn ugly. I guess I shouldn't be concerned about speed.
RichardBaker has joined #ruby
kaldrenon has joined #ruby
<geox_>
Is it necessary that I use a python framework to use the python that I have?
<Suit_Of_Sables>
*comparable
<jgrep>
geox_: doesnt python / ruby also run on the server side
<|jemc|>
Suit_Of_Sables: that might be true but you should value your time more than your processor's time in most cases
Seich has quit [Ping timeout: 264 seconds]
interactionjaxsn has quit [Remote host closed the connection]
<geox_>
jgrep: I'm confused what you're asking. Are you asking if my python code runs on my computer?
aliljet_ is now known as aliljet
cj3kim has quit [Remote host closed the connection]
<Todd->
banisterfiend, I suppose. (sorry for the lag I'm playing with my xchat theme)
<Todd->
banisterfiend, We have less than desirable people working with our framework doing UI testing so... consistency is really important to keep them from doing things incorrectly.
girija has joined #ruby
noop has joined #ruby
Todd- is now known as Todd
kaldrenon has quit [Ping timeout: 240 seconds]
<Suit_Of_Sables>
|jemc|: exactly, I will sacrifice a few milliseconds if it means my code is shorter and/or easier to read
<geox_>
Is it common nowadays for a framework to work with html5? If I want to create a canvas element, specifically a graph, would I be able to do with with django?
alexju has quit [Remote host closed the connection]
<banisterfiend>
Todd fairynuff
<crowell>
geox_: yes
alexju has joined #ruby
tylersmith has joined #ruby
<crowell>
geox_: you can just use the python to create the needed html markup depending on your data
freeayu has quit [Remote host closed the connection]
interactionjaxsn has quit [Ping timeout: 268 seconds]
premera_j_n_h has joined #ruby
vadviktor__ has quit [Read error: Operation timed out]
premera_j_n has quit [Ping timeout: 248 seconds]
DanKnox is now known as DanKnox_away
vadviktor_ has joined #ruby
<hanmac>
jgrep: you assign ObjectA to a, then you assign the object in a (ObjectA) to b, then you assign ObjectB to b … the variable a stays untouched … (i think you may look for the replace method)
Teddy2steper has joined #ruby
optimusprimem has quit [Ping timeout: 245 seconds]
duggiefr_ has joined #ruby
alexju has quit [Ping timeout: 240 seconds]
cody-- has joined #ruby
Teddy2steper has quit [Remote host closed the connection]
duggiefresh has quit [Ping timeout: 245 seconds]
jdeeburke has joined #ruby
ixti has quit [Ping timeout: 256 seconds]
jdeeburke has quit [Max SendQ exceeded]
Bira has quit [Read error: Connection reset by peer]
tonni has joined #ruby
jdeeburke has joined #ruby
jdeeburke has left #ruby [#ruby]
c0rn has joined #ruby
Bosox20051 has joined #ruby
baggypants has joined #ruby
kaldrenon has joined #ruby
Cyrus has quit [Quit: Cyrus.sleep()]
mercwithamouth has quit [Ping timeout: 248 seconds]
Teddy2steper has joined #ruby
alexju has joined #ruby
duggiefresh has joined #ruby
Teddy2steper has quit [Remote host closed the connection]
<BraddPitt>
so for ``private'' in a class, every method UNDER that keyword is private?
<jgrep>
is there some doc whee i can understand things like ! and ? that are used in ruby
saarinen has joined #ruby
mercwithamouth has joined #ruby
<MrZYX>
BraddPitt: if you give no argument to it
Urizen has joined #ruby
freerobby has quit [Quit: Leaving.]
<MrZYX>
jgrep: !smthg is a method call, so look for the ! method on objects. ? in what context?
RichardBaker has quit [Quit: RichardBaker]
ravster has quit [Quit: Leaving.]
<BraddPitt>
MrZYX example of arguments? I'm just learning classes
kidoz has quit [Quit: Ухожу я от вас]
duggiefr_ has quit [Ping timeout: 264 seconds]
<MrZYX>
private :foo makes the method foo private
<BraddPitt>
ah okay, thank you
mark_locklear has quit [Ping timeout: 260 seconds]
RichardBaker has joined #ruby
<Suit_Of_Sables>
for what I'm reading it looks like :method_name is the syntaxed used when passing a method as a parameter (like to an enum or to the inject method). Can you attempt to pass any old method to any other method? Or does one or both of them require some specific implementation (I'm thinking of Interface but that is Java-speak and don't know if it's applicable here) to allow for this sort of behaviour?
Spami has joined #ruby
Spami has joined #ruby
Spami has quit [Changing host]
alexju has quit [Ping timeout: 264 seconds]
<banisterfiend>
Suit_Of_Sables in ruby we don't typically pass methods aronds, we pass blocks around
<Suit_Of_Sables>
hmm are we just passing a symbol in the call arry.inject(:+) and if so, does that symbol refer to the + method?
<hanmac>
you can also pass method objects around ;P like
<Suit_Of_Sables>
or, should I say, the symbol refers to a block that contains the + method?
<Suit_Of_Sables>
so one main difference is that in a java interface, these methods are decalred but not explicitly implemented, while in ruby something that is include inherits a fully implemented method from the included class? (Though I suppose it could be overrided in the class doing the including much like you can override the default .to_s method?) ?? Is that atleast one of the ways in which these concepts don't equate?
<banisterfiend>
Suit_Of_Sables included module*
lukec has quit [Quit: lukec]
<Suit_Of_Sables>
banisterfiend: ooops module, not class
girija has quit [Ping timeout: 240 seconds]
<hanmac>
Suit_Of_Sables: extreme sample:
<hanmac>
>> o = Object.new; o.extend(Enumerable); p o.respond_to?(:sort); o.sort
<banisterfiend>
Suit_Of_Sables and yes the class including the module can provide its own definition
nomenkun has quit [Ping timeout: 260 seconds]
amacgregor has quit [Read error: No route to host]
<banisterfiend>
Suit_Of_Sables module inclusion is more or less equivalent to inheritance, so the module is just inserted into the lookup chain
<Suit_Of_Sables>
banisterfiend: but it comes defined?
nadirvardar has joined #ruby
apeiros has joined #ruby
<banisterfiend>
Suit_Of_Sables yes, if a module defines a method then the class that includes that module will have that method in its lookup chain
rickmasta has quit [Quit: Leaving...]
<reactormonk>
banisterfiend, ok
<hanmac>
the Enumerable module implments the sort method (so respond returns true), but the sort method depends on each which is neigher declared not implemented
<banisterfiend>
reactormonk if u say 'ok' one more time I'm going to beat u
Bira has joined #ruby
hamakn has quit [Remote host closed the connection]
johnjohnson has joined #ruby
dankest has quit [Quit: Peace]
justsee has quit [Ping timeout: 245 seconds]
hamakn has joined #ruby
Targen has joined #ruby
freerobby has joined #ruby
Bira has quit [Remote host closed the connection]
nadirvardar has quit [Max SendQ exceeded]
<Suit_Of_Sables>
thanks for being patient with me folks
<apeiros>
the ruby community is awesome that way ;-)
rins has joined #ruby
optimusprimem has quit [Ping timeout: 245 seconds]
nadirvardar has joined #ruby
<hanmac>
only the rails-tribe are idiots ;O
<hanmac>
;P
<apeiros>
na
<apeiros>
I'd disagree. but, whatever :)
dankest has joined #ruby
<banisterfiend>
hanmac aren't you a php programmer in your day job? :P
allanm has joined #ruby
<hanmac>
banisterfiend: yeah … (also with magento) … and i curse every minute of it ;P
<banisterfiend>
hanmac wouldn't you rather do rails than php?
<SloggerKhan>
Most people who do PHP don't have much of a choice.
hamakn has quit [Ping timeout: 268 seconds]
<hanmac>
banisterfiend: i dont think so … (some rails code i have seen is worse than php)
<lethjakman>
hanmac: oh my god
<lethjakman>
I'm not alone!
<SloggerKhan>
I ended up doing PHP in my first job because I couldn't find Django or Rails jobs without moving to the bay area.
<hanmac>
lethjakman: you also need to do magento?
<lethjakman>
yep. worst framework I've ever seen
<banisterfiend>
SloggerKhan couldn't find a remote job either?
kofno has joined #ruby
sarlalian has quit [Quit: WeeChat 0.4.1]
<BraddPitt>
SloggerKhan move the bay area
<lethjakman>
they could at least release some good documentation...
<BraddPitt>
its beautiful here
sarlalian has joined #ruby
interactionjaxsn has joined #ruby
carraroj has quit [Quit: Konversation terminated!]
<SloggerKhan>
I like where I'm at. I'm getting a nice house with a mortgage that's lower than my rent is biking distance from work.
<SloggerKhan>
And in any case, now I'm starting to use rails at my job.
Ripp__ has quit []
<hanmac>
lethjakman: newest bug i have found in magento: when you make cms pages … and you pastie your code into them, and then save the page and open it again with the editor … the code has changed!!!! and it doesnt even ask you if you wanted that !!!
<SloggerKhan>
*and is
<lethjakman>
hanmac: ....ugh. I don't do the CMS stuff, I'm more data heavy/backend.
<lethjakman>
oh my god...their tables. they couldn't have made them any more inconsistant.
hukl has joined #ruby
platzhirsch has joined #ruby
<platzhirsch>
What's up in the Ruby mine?
<hanmac>
i normally also do not so much cms but i get angry after the wysiwyg editor plays ugly games with me ...
<SloggerKhan>
I have family in the bay area... getting anywhere takes an hour and the cheapest rent is like 3x what it is here for something nice.
<BraddPitt>
where is ``here''
<BraddPitt>
also you sound much older than me so maybe the city doesn't entice you as much as it does me
ghost2060 has joined #ruby
<SloggerKhan>
Eh. I'm in my late 20s... lol.
pel_daniel has joined #ruby
<BraddPitt>
yeah i'm 22, living inSF
<RubyPanther>
Portland has as many Rubyists as SF, very low rent for its size, and an active urban geek culture
girija has joined #ruby
<BraddPitt>
i want to visit portland
<BraddPitt>
but >no surf
<SloggerKhan>
I think Portland would be better than SF.
<platzhirsch>
oh, west coast. I will soon start to prepare for job interviews again
<RubyPanther>
Yeah it is 60 miles and a wet suit away from surfing
RichardBaker has joined #ruby
<ghost2060>
SD, ruby + surf
<BraddPitt>
same with SF but at least we have good waves here
<BraddPitt>
s/good/decent
<BraddPitt>
still would enjoy visiting though
<platzhirsch>
So if anyone is looking for a new grad developer and is able to sponsor H1B, give me a hint :P
<RubyPanther>
Oregon has huge waves, if you're brave enough. The big thing now is kite surfing
<platzhirsch>
BraddPitt: yeah...
<hanmac>
hm it reminds me … i need to collect some ruby developers that want to work on some funny open-source project … (the bad thing is it would be cool if they can do C and C++ too)
Ripp__ has joined #ruby
<RubyPanther>
<3 Ruby C
d2dchat has joined #ruby
<|jemc|>
rubians.collect { |dev| dev.knows? :C }
DanKnox_away is now known as DanKnox
<platzhirsch>
C and Ruby sounds like a nice combination. Strict rules on the one hand and anarchy on the other
kofno has quit [Ping timeout: 260 seconds]
Teddy2steper has joined #ruby
<hanmac>
platzhirsch: its funny what extensions you can build with the mighty Power of C ;D
Monie has quit [Ping timeout: 268 seconds]
<platzhirsch>
but don't mention C++
<platzhirsch>
I'd rather go for object-oriented C :P
geox_ has quit [Quit: Page closed]
sam113101 is now known as sam113101_afk
<ghost2060>
Question: after looping through an array, I test to see if I am at the last item in the array using an unless statement as I don't want to modify that item. When I'm at the last item, it skips the modification which is perfect; however, I get a TypeError: can't convert nil into String since the unless statement returns nil. How can I avoid that?
<crowell>
platzhirsch: go with vala :-)
<hanmac>
platzhirsch: hmhm i dont know obj-C … and the libs i bind are in C++ so i think i do ont have much choice
graft has quit [Ping timeout: 256 seconds]
<crowell>
ghost2060: can you paste the code
<RubyPanther>
the ruby C api provides most of a stdlib replacement, it can useful to embed a ruby interpreter in a C app just for the string processing and GC
<hanmac>
ghost2060: use each_with_index or similar
Teddy2steper has quit [Remote host closed the connection]
Advocation has joined #ruby
awarner_ has joined #ruby
graft has joined #ruby
<BraddPitt>
instance variables can be accessed from anywhere inside the class, right?
<a1ph4g33k>
the script currently uses ARGV.pop to get that file path ...
jgrep has quit [Max SendQ exceeded]
jgrep has joined #ruby
jgrep has quit [Max SendQ exceeded]
<a1ph4g33k>
what is the best way to get the result I want ?
jgrep has joined #ruby
jgrep has quit [Max SendQ exceeded]
<a1ph4g33k>
as in the script can access the filepath ...
jgrep has joined #ruby
jgrep has quit [Max SendQ exceeded]
<a1ph4g33k>
I know I could re-write the script to not receive the configuration on the command line ... but this is just one script within a larger framework and I'm trying to keep the interface between the scripts the same.
jgrep has joined #ruby
jgrep has quit [Max SendQ exceeded]
thecodethinker has quit [Ping timeout: 240 seconds]
jgrep has joined #ruby
Nisstyre-laptop has joined #ruby
ferdev has quit [Quit: ferdev]
hamakn has quit [Ping timeout: 240 seconds]
greenride has joined #ruby
senayar has joined #ruby
ericmathison has joined #ruby
ewnd9 has quit [Ping timeout: 245 seconds]
Zai00 has joined #ruby
duggiefresh has quit [Ping timeout: 264 seconds]
buibex has quit [Remote host closed the connection]
<BraddPitt>
I've finished rubymonk's primer and chris pine's ruby tutorial. Should i move on to a personal project now?
duggiefresh has joined #ruby
<BraddPitt>
or are there better ruby tutorials i could work through?
<a1ph4g33k>
... just figured it out ...
<waxjar>
check out one of the option parser libraries a1ph4g33k (slop and clap are both really nice and light)
Ubercow has joined #ruby
<a1ph4g33k>
thanks anyways ... ( FYI you can provide additional command line arguments when you invoke unicorn )
Ubercow has quit [Max SendQ exceeded]
selim has quit [Ping timeout: 248 seconds]
OneMT has joined #ruby
tabolario has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
[flip] has joined #ruby
fgo has joined #ruby
Minos__ has quit [Ping timeout: 264 seconds]
v0n has quit [Ping timeout: 264 seconds]
enebo has quit [Quit: enebo]
<[flip]>
question.... class AbstractClass; def self.x; self; end; class A < AbstractClass; end .... i want A.x to return A and not AbstractClass... is there a way?
tatsuya_o has quit [Remote host closed the connection]
<apeiros>
[flip]: it does?
<apeiros>
>> class AbstractClass; def self.x; self; end; class A < AbstractClass; end; A.x
<jremi>
just getting my feet wet over the past few weeks, what is a good sample program i should be able to write before i am ready to move on to rails.
<apeiros>
a1ph4g33k: also merge accepts a block which it invokes on collisions. I find that a nice feature. makes a bit less sense on an array, though.
fgo has quit [Remote host closed the connection]
<jremi>
something simple, but would be a good test for learning
aki_ has joined #ruby
devdazed has quit [Read error: Connection reset by peer]
<crowell>
jremi: depends on what you want to learn!
<jremi>
rails
<apeiros>
jremi: your own webframework
<jremi>
I'm getting the basics of ruby
<apeiros>
doesn't need to be as big as rails
<jremi>
then i want to get into rails
decoponio has quit [Quit: Leaving...]
<jremi>
so what would be a good basic ruby program that would be good for learning
<crowell>
jremi: if you want to learn how to rails, just grab rails and start working with it
<a1ph4g33k>
learn to use sinatra & one of the templating libs like erb or haml to build simple web sites.
<a1ph4g33k>
Then you can move into all the bells and whistles of rails.
<jremi>
yeah, i could use sinatra first
<crowell>
if you want just a primer on ruby, take something you've done before and port it
|jemc| has joined #ruby
sayan has joined #ruby
<jremi>
but i have been told that its best to know how to operate the oven before you bake the turkey
devdazed has joined #ruby
<pzula>
jremi: agreed
splittingred has joined #ruby
<pzula>
jremi: try the Jumpstart Lab tutorials
soulcake has joined #ruby
johnjohnson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jremi>
@pzula
<jremi>
let me check
<pzula>
jremi: tutorials.jumpstartlab.com/
<BraddPitt>
jremi irc bot
<BraddPitt>
( ≖‿≖)
Collin has quit [Ping timeout: 248 seconds]
Collin has joined #ruby
<jremi>
so far…. I have completed the Codeacademy Beginners Ruby course…. that was helpful, and have gone thru the first few chapters of the Pragmatics Ruby book
false_economy has quit [Remote host closed the connection]
<a1ph4g33k>
Just play with it until you understand it.
<a1ph4g33k>
build things you need.
<a1ph4g33k>
that's what I do.
Criztian has quit [Remote host closed the connection]
<pzula>
jremi: jremi have you ever programmed before?
<pzula>
it makes a difference
<banisterfiend>
jremi why did you do code academy rather than code school?
Dave has joined #ruby
<jremi>
i started with code school but i actually liked the style of code academy better
<jremi>
so i did that course first
<a1ph4g33k>
sorry, not trying to be noise ... just trying to be helpful.
<jremi>
i have not coded before really
<banisterfiend>
jremi how come?
Dave is now known as Guest52594
<jremi>
just basic stuff
<banisterfiend>
jremi why did you prefer code academy over code school
<pzula>
jremi: then the jumpstart labs will definitely get you there
<jremi>
i was getting annoying reload issues on code school
iliketurtles has joined #ruby
swistak35 has quit [Excess Flood]
<pzula>
jremi: do the Ruby ones
Nisstyre-laptop has joined #ruby
<jremi>
paula, I'm going to review that now
<jremi>
much thanks for the link
<pzula>
jremi: Then under Independent work do those projects too
<jremi>
ok
<pzula>
jremi: when you get stuck, redo the previous tutorials
<jremi>
yeah
<pzula>
jremi: the answers are all within the work you do
swistak35 has joined #ruby
<jremi>
makes sense
<pzula>
jremi: if all else falls, there is always previous people's work on github
<pzula>
jremi: but don't cheat yourself out from learning
<jremi>
yeah i have noticed that if you keep just doing beginner tutorials and reading , you will eventually get the hang of the syntax
<jremi>
and can then begin to construct basic logic
<pzula>
jremi: it's more than sytax
<pzula>
jremi: exactly
<pzula>
jremi: and understanding WHY things do what they do
<jremi>
yeah the logic behind it and how to then apply that later on
<jremi>
yep
Advocation has joined #ruby
Ox6abe has quit [Remote host closed the connection]
<jremi>
u have heard of the book Pragmatic Programmers for Ruby?
saarinen has quit [Quit: saarinen]
<pzula>
jremi: you're off to the right start :) stick with learning ruby before rails and you will have a better understanding of why things are the way they are
<pzula>
jremi: yes, I have
<pzula>
jremi: that is good also
<pzula>
once you get a taste of all of that, move on to Eloquent Ruby
intuxicated has joined #ruby
<jremi>
yeah its good, but a lot of the newer web-based learning tools really are helping alot
dangerousdave has quit [Ping timeout: 264 seconds]
<jremi>
i like the more interactive based tools
alvaro_o has joined #ruby
<pzula>
indeed - and Eloquent Ruby, the book, will help you understand how to write your code
Guest52594 has quit [Ping timeout: 248 seconds]
grzywacz has quit [Ping timeout: 240 seconds]
underway47 has quit [Ping timeout: 276 seconds]
<jremi>
i like this link u gave me with the exercises
Ox6abe has quit [Remote host closed the connection]
noop has quit [Ping timeout: 260 seconds]
sniffingcats has quit [Quit: Til rivido Idisti!]
Steve009 has joined #ruby
<Steve009>
I converted a string into a DateTime using Date.strptime() and when i view the output as a string i get: #<Date: 2010-12-01 ((2455532j,0s,0n),+0s,2299161j)
<Steve009>
any ideas why?
<Steve009>
When i run the same command in another ruby file i get the correct fommating
<Steve009>
Appears to be no difference in my implementation
jbpros has quit [Quit: jbpros]
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
<hanmac>
Steve009: are you sure you want Date.strptime and not DateTime.strptime ?
Seich has quit [Ping timeout: 260 seconds]
<Steve009>
Ya, I am only working with Dates, no times
<Steve009>
No errors of anything have appeared. It is just when you view the data using something like puts dateFormatChangeHash or puts dateFormatChangeHash.to_s
Bry8Star{T2 has quit [Remote host closed the connection]
tvw has joined #ruby
nmabry has joined #ruby
tonni has joined #ruby
senayar has quit [Remote host closed the connection]
girija has quit [Ping timeout: 248 seconds]
brbcoding has quit [Ping timeout: 260 seconds]
Soda has quit [Read error: Connection reset by peer]
ferdev has joined #ruby
splittingred has quit [Ping timeout: 240 seconds]
jdeeburke has left #ruby [#ruby]
splittingred has joined #ruby
grzywacz has joined #ruby
<hanmac>
Steve009: i think his is how the to_s method of Hash works … and your stringbuild should be more ruby like "#{x["_id"]["month"]} #{x["_id"]["year"]}" … or better: x["_id"].values_at('month', 'year').join(" ")
Falcore has quit [Quit: Falcore]
mrsolo has joined #ruby
<hanmac>
Steve009: why dont you use Date.new ?
Bry8Star{T2 has joined #ruby
Criztian has joined #ruby
Criztian has quit [Remote host closed the connection]
Urizen has quit [Ping timeout: 248 seconds]
<Steve009>
I could use Date.new. But my confusion is more about it not working in this new .rb file. The exact code works as expected in another file
ScottRadcliff has quit [Remote host closed the connection]
audibleblink has joined #ruby
<Steve009>
AHHHHH
<Steve009>
just found what caused it
<Steve009>
group date gem was having a impact
<SloggerKhan>
If Net::SFTP with its sftp.file.open and file.puts commands acts like it works, but doesn't, and I can upload a file with an identical name and contents successfully using curl on the command line are there any common culprits?
<Steve009>
If you run the same code as before by without require 'groupdate' it formats in the weird way
fgo has joined #ruby
<Steve009>
When groupdate is required you get: {Wed, 01 Dec 2010=>1, Mon, 01 Aug 2011=>8
Advocation has quit [Quit: Advocation]
hololeap has joined #ruby
tatsuya_o has joined #ruby
vlad_starkov has joined #ruby
axl_ has quit [Quit: axl_]
dsferreira has joined #ruby
fgo has quit [Ping timeout: 268 seconds]
tjad has quit [Ping timeout: 276 seconds]
dangerousdave has quit [Read error: Connection reset by peer]
carlyle has quit [Remote host closed the connection]
dangerousdave has joined #ruby
mahlon_ is now known as mahlon
maroloccio has quit [Ping timeout: 245 seconds]
Advocation has joined #ruby
swordsmanz has quit [Quit: ooh ponies kinkeyyy]
timonv has quit [Remote host closed the connection]
<Bourbon>
workmad3: thanks - I thought it was somehow included as part of Rails' magic
* apeiros_
hates his ISP right now
mando has joined #ruby
vlad_starkov has joined #ruby
<apeiros_>
what's 150MBit/s worth if a 200KB/s (1.6MBit/s) stream is lagging like hell? (and it's not the stream - it worked fine at work on a 10MBit/s line…)
soulcake has quit [Read error: Connection reset by peer]
<|jemc|>
apeiros_: are you being "shaped"?
<apeiros_>
no
<apeiros_>
officially they don't shape
<apeiros_>
and I'm nowhere near exceptional use
<|jemc|>
every ISP shapes
soulcake has joined #ruby
<apeiros_>
also raw throughput isn't the problem
<apeiros_>
it might be an issue related to how caching works. trying to remember the name…
staafl has joined #ruby
maroloccio has quit [Quit: WeeChat 0.4.0]
<apeiros_>
re raw throughput: if I e.g. download stuff from apple store I get ~10MByte/s easily
wmoxam has quit [Read error: Connection reset by peer]
<Eiam>
steam is another nice one to shove down your pipe
<Eiam>
I've seen 50 MB/s from them
angusiguess has quit [Ping timeout: 245 seconds]
swistak35 has joined #ruby
senayar has quit [Ping timeout: 240 seconds]
<Eiam>
buffer bloat huh, thats a new one.
jkline has joined #ruby
aeontech has quit [Quit: aeontech]
jbpros has quit [Ping timeout: 240 seconds]
iamjarvo has quit [Remote host closed the connection]
apeiros_ has quit [Ping timeout: 264 seconds]
jkamenik has quit [Quit: Leaving.]
iamjarvo has joined #ruby
endash has quit [Quit: endash]
pierre1 has quit [Ping timeout: 248 seconds]
gerep has joined #ruby
<gerep>
Hi all. hey, I came to this: "4242424242424242".gsub /^[0-9]{0,12}/, "*" the problem is that it replaces with * only the last of the 12 first characters, the output is *4242 and should be ************4242. Any ideas?
devoldmx has quit [Ping timeout: 260 seconds]
Donovan is now known as dyoung522
soheil has quit [Read error: Connection timed out]
devoldmx has joined #ruby
Xuerian has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 245 seconds]
Bosox20051 has joined #ruby
Bosox20051 has quit [Read error: Connection reset by peer]
soheil has joined #ruby
maZtah is now known as Guest
Xuerian has joined #ruby
<SloggerKhan>
gerep - if you know the length of digits every time using a regex seems excessive
Guest is now known as maZtah
<gerep>
SloggerKhan: it's a credit card number
<gerep>
SloggerKhan: And I need to get the last for and replace the others with *
optimusprimem has joined #ruby
optimusprimem has joined #ruby
optimusprimem has quit [Changing host]
<gerep>
SloggerKhan: I have used this example with a cc with 16 numbers, I'm not sure if all of them have the same amount
<gerep>
SloggerKhan: But if they do, what's the other way I can do it?
<SloggerKhan>
v = '************' + v[12..-1] or something.
<SloggerKhan>
Credit card numbers are all 16 digit now
<SloggerKhan>
Amex used to have a few that were fewer digits but they were phased out
postmodern has joined #ruby
<SloggerKhan>
I think there's probably a more elegant way to do it
chopmo_ has joined #ruby
<SloggerKhan>
but I doubt you really need to use a regex
tatsuya_o has quit [Read error: Connection reset by peer]
chopmo has quit [Read error: Connection reset by peer]
<SloggerKhan>
if you're validating input then you'll know you've got 16 digits to begin with
carlyle has quit [Remote host closed the connection]
g0bl1n has quit [Quit: Ex-Chat]
SHyx0rmZ has quit [Quit: ネウロイを負かさなきゃならないね]
lfox has quit [Quit: ZZZzzz…]
soheil has quit [Remote host closed the connection]
<apeiros>
Todd: I'm sorry, but when I read `self.included`, I already start screaming and run away.
<apeiros>
(I know, not a helpful criticism, sorry. too tired I guess.)
evenix has quit [Remote host closed the connection]
<Todd>
apeiros, well.. *shrug*
<Todd>
apeiros, it's either that or have 600 lines of methods that do the same thing over and over
<Todd>
apeiros, what's another way to do it?
Suit_Of_Sables has quit [Quit: WeeChat 0.4.0]
<apeiros>
Todd: no, the point is `self.included` is the wrong way.
solars has joined #ruby
<Todd>
apeiros, ok then.. what's the right way
<apeiros>
but I'd need to see the whole thing to tell you a better way. and for that, I don't have the energy left today.
<apeiros>
usually it'd be: use extend. but I don't think that applies here.
johnjohnson has joined #ruby
lfox has joined #ruby
saarinen has joined #ruby
jbpros has quit [Quit: jbpros]
dhruvasagar has quit [Ping timeout: 245 seconds]
end_guy has quit [Ping timeout: 240 seconds]
<Todd>
apeiros, hmm
mary5030 has quit [Remote host closed the connection]
<Todd>
apeiros, it's 5pm.. I'm done as well.
<apeiros>
given that you don't seem to rely on anything, it seems to me you could just make it a class method on the module, though
<apeiros>
Foo.improvify_class(klass)
evenix has joined #ruby
<Todd>
I'll have to think about that.
<apeiros>
and then just rename `included` to `improvify` (obviously you should choose a more apt name)
<apeiros>
but what you do doesn't seem to have anything to do with actually including a module.
saarinen has quit [Client Quit]
<apeiros>
it'd also allow you to decouple that @browser hidden in that code
<apeiros>
parametrize it and use @browser as the default
dhruvasagar has joined #ruby
jkline has joined #ruby
<Todd>
if I parameterize it it's available to my page classes
hanmac has quit [Quit: Leaving.]
<Todd>
which I don't want
<apeiros>
o0
end_guy has joined #ruby
codecop has quit [Remote host closed the connection]
<apeiros>
I mean like this: def self.improvify_class(base, browser=@browser); …
aryaching has quit [Ping timeout: 248 seconds]
<Todd>
I suppose my Ruby knowledge is lacking here.
<apeiros>
then in line 19, just use `browser` instead of `@browser`
<Todd>
ah
yekta has quit [Quit: yekta]
<apeiros>
also, define_method accepts a block
<apeiros>
define_method(:foo) { … }
<Todd>
yeah I changed it to a send during troubleshooting
<Todd>
that's what I originally had
<apeiros>
no need to write it verbosely as: define_method(:foo, lambda { … })
<Todd>
I know now :)
theRoUS has quit [Ping timeout: 264 seconds]
<apeiros>
though… not sure whether the latter actually might perform arg-count checking whereas the former does not…
<Todd>
the latter does perform arg-count checks
saarinen has joined #ruby
<Todd>
I've proven that
<apeiros>
define_method always arg-count checks as it seems. even in its block-form.
<apeiros>
(blocks normally don't arg-count check, since they're procs, not lambdas)
<Todd>
yeah I originally had a typo in my CONTROL_ENUMERATORS and got some arg-count errors
<apeiros>
.gsub(/s$/, '') --> .sub(/s\z/, '')
<apeiros>
unless you really mean "at the end of every line"
aeontech has joined #ruby
Xeago has quit [Remote host closed the connection]
tonni has joined #ruby
selim has quit [Read error: Connection reset by peer]
<Todd>
end of string.. interesting
<Todd>
thank you
<Todd>
I will finish this tomorrow. I need to run to the cleaner before they close.
<Todd>
Thank you.
<apeiros>
line 16-21: use map instead of each, lets you drop 2 lines of code and declaring `result`
<apeiros>
kk
mary5030 has joined #ruby
jkline has quit [Quit: jkline]
workmad3 has quit [Ping timeout: 245 seconds]
hamakn has joined #ruby
jkline has joined #ruby
jbpros has joined #ruby
jbpros has quit [Client Quit]
mary5030 has quit [Remote host closed the connection]
jbpros has joined #ruby
maroloccio has joined #ruby
mary5030 has joined #ruby
cj3kim_ has quit [Remote host closed the connection]
sambao21 has quit [Quit: Computer has gone to sleep.]
BillCriswell has quit [Remote host closed the connection]
atmosx has quit [Quit: Lost in trance]
Bira has quit [Ping timeout: 240 seconds]
echevemaster has quit [Ping timeout: 276 seconds]
TehCraw has joined #ruby
hamakn has quit [Ping timeout: 268 seconds]
hololeap has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
osvico has joined #ruby
<TehCraw>
Hmm, this channel is rather quiet for having 854 people on it.
optimusprimem has quit [Ping timeout: 245 seconds]
d2dchat has quit [Remote host closed the connection]
<|jemc|>
all you have to do is say "I miss python because ruby doesn't do #{x}"
alekst has quit [Quit: Computer has gone to sleep.]
<|jemc|>
and you'd be surprised ;)
<TehCraw>
LOL
cody-- has quit [Quit: derp]
<a1ph4g33k>
or some new guy joins the channel and talks too much.
mando has quit [Remote host closed the connection]
<TehCraw>
what if I say that PHP is far better than Ruby? would that get some attention? :D
alekst has joined #ruby
<onewheelskyward>
Probably not.
SHyx0rmZ has joined #ruby
scriabin has joined #ruby
dhruvasagar has quit [Read error: Operation timed out]
T_T has quit [Ping timeout: 248 seconds]
<TehCraw>
Dang, I thought people were usually very passionate about defending their language of choice.
SHyx0rmZ has quit [Client Quit]
Nisstyre-laptop has quit [Quit: Leaving]
<|jemc|>
well, nobody actually feels threatened by php, I would imagine
<TehCraw>
Good point.
carlyle has joined #ruby
coderhs has quit [Ping timeout: 240 seconds]
<TehCraw>
PHP is aweful. And that comes from a guy who spent the last five years using it.
<TehCraw>
>.>
<scriabin>
guys help me get my head straight. In a ruby class, one should only use self if 1.) defining a method which applies to the Class (i.e. def GenClass.hello == def self.hello) 2.) calling a setter method for an attribute (i.e. self.last_name ="Smith" != last_name = "
<apeiros>
scriabin: "an error, I think" - do you get an error or not? also, what error? and don't paraphrase it, copy & paste it verbatim.
renotarize43 has quit [Ping timeout: 248 seconds]
<scriabin>
apeiros:I know but the next thing you'll say is show me some code and I'm not actually asking about the code, I'm asking if it's possible that self.id could be different than id in this context: within a model method, I have DoMagicWorker.perform_async(self.id)
mmitchell has quit [Ping timeout: 268 seconds]
<apeiros>
and "but in one place" - this is absolutely not helpful to people who'd try to help. paste code. state to what line an eventual exception refers to.
TehCraw has left #ruby ["Leaving"]
<apeiros>
scriabin: id and self.id can differ in two cases
tatsuya_o has quit [Remote host closed the connection]
<apeiros>
a) id exists as a local variable, which takes precedence over a method
<apeiros>
b) the method id() is private, then self.id() will raise a NoMethodError
<scriabin>
apeiros: the error is: Deployment#appropriate_roles delegated to application.appropriate_roles, but application is nil
<yaymukund>
couldn't self also be a local variable?
renotarize43 has joined #ruby
<apeiros>
scriabin: yeah, that's totally unrelated to your self.id call I'd say
failshell has quit [Ping timeout: 276 seconds]
Fire-Dragon-DoL has joined #ruby
<apeiros>
you call `appropriate_roles` somewhere in your `Deployment` model
Ox6abe has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
emergion has joined #ruby
kofno has quit [Ping timeout: 248 seconds]
kvirani has joined #ruby
emergion has quit [Max SendQ exceeded]
tealmage has joined #ruby
emergion has joined #ruby
Ox6abe_ has joined #ruby
emergion has quit [Max SendQ exceeded]
emergion has joined #ruby
alekst has quit [Quit: Computer has gone to sleep.]
sambao21 has quit [Ping timeout: 240 seconds]
emergion has quit [Max SendQ exceeded]
Ripp__ has quit []
Akuma has joined #ruby
emergion has joined #ruby
emergion has quit [Max SendQ exceeded]
jbpros has joined #ruby
kvirani has quit [Ping timeout: 276 seconds]
emergion has joined #ruby
<scriabin>
well, I took all the bullshit self references out of my model and I'm still running. Woot!
emergion has quit [Max SendQ exceeded]
<a1ph4g33k>
tjbiddle, there is only a single input param ... @shift_age ... it's either a number or a string ... so, I don't see an easy way to make it do both.
MrThePlague has quit [Remote host closed the connection]
emergion has joined #ruby
<a1ph4g33k>
( and by single ... I mean that both "number of old files" & "daily|weekly|monthly| use a single parameter.
<a1ph4g33k>
so they are mutually exclusive.
butblack has quit [Quit: butblack]
RichardBaker has quit [Quit: RichardBaker]
emergion has quit [Max SendQ exceeded]
<a1ph4g33k>
but, you could also setup a cron job to delete log files...
snovak has joined #ruby
emergion has joined #ruby
momomomomo has quit [Quit: momomomomo]
dangerousdave has quit [Quit: Leaving...]
emergion has quit [Max SendQ exceeded]
robbyoconnor has joined #ruby
Ripp__ has joined #ruby
emergion has joined #ruby
emergion has quit [Max SendQ exceeded]
wesside has quit [Quit: I think I heard an ice cream truck..]
devdazed has quit [Read error: Connection reset by peer]
ferdev has quit [Quit: ferdev]
anonymus_ has quit [Ping timeout: 240 seconds]
<shevy>
hmm http://file.org/extension/pod "POD is an acronym for Plain Old Documentation. The .pod file extension is most commonly associated with the Perl programming language."
<bobinator60_>
cocoapods.org
thecodethinker has quit [Ping timeout: 248 seconds]
ghost2060 has quit [Quit: leaving]
thecodethinker has joined #ruby
<bnagy>
you can access ENV from ruby
<bobinator60_>
i don't know ruby. that's why i'm here
<bnagy>
so I guess you just have some if ENV['blah'] .. do a thing
<bnagy>
it's OK I have NFI about this cocoapod thing :)
bobinator60_ has quit [Quit: bobinator60_]
lethjakman has quit [Ping timeout: 245 seconds]
<shevy>
a cacao pod man that would be sweet...
<bnagy>
nah they're super bitter
<shevy>
true :(
Ox6abe has quit [Remote host closed the connection]
<Eiam>
banister`gym: its the initials of my daughters
anonymus_ has quit [Ping timeout: 264 seconds]
<banister`gym>
Eiam 4 daughters?
<Eiam>
banister`gym: 3+wife
<banister`gym>
Eiam no boys?
<Eiam>
nope
cj3kim_ has joined #ruby
anonymus_ has joined #ruby
anonymuse has quit [Read error: Connection reset by peer]
<banister`gym>
Eiam hehe, i know a family of 4 daughters in my city, it's pretty obvious they kept popping out kids to try to have a son ;)
<banister`gym>
Eiam similar in your case?
devoldmx has quit [Read error: Connection reset by peer]
<Eiam>
I stopped at 3, but yes
<Eiam>
3 was another dice roll.
stevenhaddox has joined #ruby
lfox has quit [Quit: ZZZzzz…]
Guest76113 has joined #ruby
<banister`gym>
Eiam i wouldn't want to be in your shoes once they all turn around 12-13 :)
<bobinator60___>
hayes theorem says that the more girls you have, the more you will have
<bobinator60___>
hayes = bayes
snovak has quit [Ping timeout: 264 seconds]
<Eiam>
bobinator60___: yes, partly why I stopped
justsee has joined #ruby
<shevy>
lol
<Eiam>
the other reason was I didn't want to buy a bigger car
<Eiam>
and I'm already insane, any more I'd have to be committed
<banister`gym>
Eiam i lived with a flat full of women before, it's very strange, but their mensturation all seems to sync up
<Eiam>
banister`gym: no proof to that biologically speaking
<Eiam>
but yes I've heard it mentioned before
<banister`gym>
Eiam yeah maybe, but lots anecdotal evidence from most women i speak to as well as my own experience.
<Eiam>
yep
<Eiam>
I'm okay with staying in a hotel once a month
<banister`gym>
hehe
<Eiam>
or going camping
* Eiam
shrugs
<banister`gym>
g'luck :)
<Eiam>
I don't have any hair to lose
cj3kim_ has quit [Ping timeout: 240 seconds]
ixti has quit [Read error: No route to host]
freerobby has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
yaymukund has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
carlyle has quit [Remote host closed the connection]
nanoxd_ has joined #ruby
<Eiam>
is pry a 501?
<Eiam>
doesn't look like it
mikepack has joined #ruby
saarinen has quit [Quit: saarinen]
mansi has joined #ruby
sarkis has joined #ruby
tomzx_mac has joined #ruby
<banister`gym>
Eiam what?
<Eiam>
501c
rezzack has quit [Remote host closed the connection]
<Eiam>
a non profit
nanoxd has quit [Read error: Operation timed out]
<banister`gym>
i'm not american, is that an american concept?
<popl>
banister`gym: charity
<Eiam>
I guess so =) I was just thinking we do corporate matching with charity donations
flaccid has joined #ruby
<crowell>
banister`gym: yeah, that's an american thing
<Eiam>
so donations are doubled
<banister`gym>
Eiam great, get your boss to send me heaps of money then
<flaccid>
is there a shorter/nicer way to do if foo or not bar ?
<crowell>
501c is nonprofit that doens't have to pay taxes
<flaccid>
sorry if foo and not bar
rezzack has joined #ruby
<crowell>
flaccid: that already seems pretty much as simplified as possible
<Eiam>
^
<banister`gym>
flaccid if foo || !bar
babinho has quit [Ping timeout: 245 seconds]
MrZYX is now known as MrZYX|off
<Eiam>
meh, ! is hard to see there
<Eiam>
prefer the original =)
rezzack has quit [Remote host closed the connection]
superscott[8] has quit [Quit: superscott[8]]
tylersmith has quit [Remote host closed the connection]
funburn has quit [Ping timeout: 260 seconds]
Bira has quit [Remote host closed the connection]
tylersmith has joined #ruby
bradhe has joined #ruby
<flaccid>
actually, i'll give the real example with best i have. its a silly case of having to support false and 'false'. if node['aws_developer_tools']['install_ruby?'] || node['aws_developer_tools']['install_ruby?'] != 'false'