<workmad3>
waxjar: what you need to do is call .join if you need the other thread to have finished before you proceed
Goles has joined #ruby
nari has quit [Ping timeout: 264 seconds]
<workmad3>
waxjar: as that's what .join does... threadB.join will cause the current thread to wait until threadB finishes
<waxjar>
i see
baroquebobcat has quit [Ping timeout: 256 seconds]
jaequery has quit [Quit: Computer has gone to sleep.]
wallerdev has quit [Quit: wallerdev]
wallerdev has joined #ruby
nat2610 has joined #ruby
<breakingthings>
So uh… I'm trying to build an IRC bot with rspec, and I am struggling with how I should set up my tests for my irc connection class
lushious has quit [Remote host closed the connection]
<breakingthings>
Specifically, IRC#connect, which calls TCPSocket#new; I'm not sure how I might properly stub/mock the TCPSocket...
lushious has joined #ruby
<breakingthings>
(IRC#connect being my class)
mergoth has quit [Ping timeout: 264 seconds]
<workmad3>
Spooner_: he could also do t.join in his each block at the end
havenn has joined #ruby
<Spooner_>
workmad3, That would be potentially slower, since each thread would have to finish BEFORE another was started.
DatumDrop has quit [Ping timeout: 240 seconds]
<workmad3>
Spooner_: not in that code
banisterfiend has quit [Ping timeout: 276 seconds]
<Spooner_>
No, but it makes sense to do it in any sort of network blocking code.
templaedhel has joined #ruby
etcetera has joined #ruby
<workmad3>
Spooner_: well, doing a ips.each(&:join) means that all the threads have to finish before anything else proceeds
<Spooner_>
workmad3, But if you join immediately after starting a thread, you might as well not bother with threads.
baroquebobcat has joined #ruby
<workmad3>
Spooner_: I'm not suggesting joining immediately after starting a thread
enebo has quit [Quit: enebo]
templaedhe has joined #ruby
<workmad3>
Spooner_: I'm suggesting joining a specific thread immediately before reading its result
<Spooner_>
Oh sorry, yes, the block at the end. Yes, that would be perfectly fine too.
<workmad3>
:)
emptyflask has quit [Remote host closed the connection]
<breakingthings>
Can anyone help me out with that rspec issue?
<Quadlex>
I can try
banisterfiend has joined #ruby
<Quadlex>
No promises
zph has quit [Quit: Computer has gone to sleep.]
mmitchell has quit [Remote host closed the connection]
<breakingthings>
Quadlex: I'm working on an IRC connection class, and am speccing out the #connect method, and was trying to figure out how I might be able to stub/mock out the TCPSocket#new call
sjk has left #ruby [#ruby]
templaedhel has quit [Ping timeout: 252 seconds]
<nate_h>
ok, so i've got the join working now
<nate_h>
but now its giving me a variable error
jonahR has joined #ruby
<breakingthings>
TCP should receive 2 arguments, one being a server address and the other being a number, but how can I mock that out if I can't give it a server address?
<Quadlex>
And allows you to easily test AND to extend from other code
<Quadlex>
So, in Ruby, we have Duck typing
fyolnish has quit [Remote host closed the connection]
<Quadlex>
If you call #dothething
kiyoura has joined #ruby
<Quadlex>
Any object implementing #dothething is suitable
<breakingthings>
Okay, I'm still a little shaky but I think I kind of get what you're saying, but how does that work in here?
<Quadlex>
So if you have an object that responds to that method and supply it as part of your call to YourClass.new
itsdavem has joined #ruby
<Quadlex>
You can replace it with any other object that responds
soulcake has joined #ruby
<Quadlex>
If you injected a TCPSocket you could instead make a double of it and then inject the double
<breakingthings>
but how does that solve the problem of the nonexistant server string?
<Quadlex>
Other options include stubbing or mocking out any call to TCPSocket
<Quadlex>
In your tests? Just pass in a dummy string
<breakingthings>
and just assert that TCPSocket.should_receive(:new).with(kind_of(String), kind_of(Numeric))?
<Quadlex>
yup
hck89 has quit [Ping timeout: 255 seconds]
<breakingthings>
hm, alright.
<Quadlex>
You're not testing TCPSocket after all
jtgiri_ has quit [Read error: Connection reset by peer]
<Quadlex>
IF you're trying to ensure that a connectable string was being passed it would be a different story
zph has quit [Quit: Computer has gone to sleep.]
jtgiri_ has joined #ruby
<breakingthings>
yeah. I get it.
<breakingthings>
I think I was trying to overthink what I should pass #connect
<breakingthings>
oh, another question
<Quadlex>
God, that's my biggest problem
<breakingthings>
should I use should_receive(:new), or stub(:new)?
<Quadlex>
"LETS OVER DESIGN THINGS! ENGINEERING, FUCK YEAH!"
<breakingthings>
and differences thereof?
templaedhe has quit [Quit: Leaving...]
<Quadlex>
I *belive* that stub doesn't set an expectation
dekroning has joined #ruby
ryanh has joined #ruby
ryanh has quit [Max SendQ exceeded]
elico has quit [Ping timeout: 255 seconds]
<Gate>
breakingthings: should_receive is a test, stub isn't. Use should receieve if it is part of your test that the message gets sent, stub if you just need it to not do anything but what you want
<Gate>
no, stub does not create an expectation
<Quadlex>
Whoo! I was right!
ryanh has joined #ruby
<breakingthings>
expectation == assertion, yeah?
* Quadlex
does the "could have RTFM, didn't, right anyway" dance
<breakingthings>
If so, alright, thanks
<Gate>
basically
sbear has joined #ruby
<breakingthings>
Cool, thanks Quadlex & Gate.
dekroning has quit [Ping timeout: 248 seconds]
epylinkn has joined #ruby
epylinkn has left #ruby [#ruby]
TomyLobo has quit [Quit: Standby mode...]
elico has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
Guest14483 has quit [Quit: Leaving]
NihilistDandy has joined #ruby
andrewhl has joined #ruby
iamjarvo has joined #ruby
bradhe has joined #ruby
brianpWins has quit [Quit: brianpWins]
Proshot has quit [Quit: Leaving]
d2dchat has joined #ruby
ffranz has quit [Quit: Leaving]
rizzy has quit [Quit: Leaving]
moos3 has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
MattRB has joined #ruby
cgcardona has joined #ruby
maletor has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
nkts has quit [Read error: Connection reset by peer]
nkts has joined #ruby
joshman_ has quit [Ping timeout: 255 seconds]
<colonolGron>
is there a difference between TCPSocket.new and Socket.tcp
<colonolGron>
in the underlying architecture
earthquake has joined #ruby
<Quadlex>
NP, breakingthings
bradhe has joined #ruby
xyzodiac has quit [Quit: Computer has gone to sleep.]
aytch has joined #ruby
Goopyo has quit [Ping timeout: 248 seconds]
dougireton has quit [Quit: Leaving.]
bradhe has quit [Ping timeout: 240 seconds]
rboyd has quit [Read error: Operation timed out]
jlast has joined #ruby
cableray has quit [Ping timeout: 252 seconds]
dekroning has joined #ruby
jlast has quit [Read error: Connection reset by peer]
jlast_ has joined #ruby
rookfood has joined #ruby
bradhe has joined #ruby
xyzodiac has joined #ruby
anti_ has joined #ruby
cableray has joined #ruby
templaedhel has joined #ruby
earthquake has quit [Quit: earthquake]
arya has joined #ruby
bradhe has quit [Remote host closed the connection]
dekroning has quit [Ping timeout: 252 seconds]
mikepack has quit [Remote host closed the connection]
arya_ has quit [Ping timeout: 248 seconds]
shorts has joined #ruby
tomzx_mac has joined #ruby
asym has quit [Ping timeout: 245 seconds]
chussenot has quit [Quit: chussenot]
BOTNET-1 has joined #ruby
BOTNET-2 has joined #ruby
BOTNET-0 has joined #ruby
BOTNET-3 has joined #ruby
Spooner_ has quit [Remote host closed the connection]
BOTNET-5 has joined #ruby
BOTNET-7 has joined #ruby
BOTNET-4 has joined #ruby
ericx has joined #ruby
piotr_ has quit [Ping timeout: 240 seconds]
BOTNET-8 has joined #ruby
BOTNET-6 has joined #ruby
BOTNET-10 has joined #ruby
BOTNET-9 has joined #ruby
BOTNET-11 has joined #ruby
BOTNET-13 has joined #ruby
BOTNET-12 has joined #ruby
BOTNET-15 has joined #ruby
BOTNET-14 has joined #ruby
BOTNET-16 has joined #ruby
BOTNET-17 has joined #ruby
BOTNET-18 has joined #ruby
<breakingthings>
oh gob the botnets
BOTNET-19 has joined #ruby
BOTNET-20 has joined #ruby
BOTNET-21 has joined #ruby
<breakingthings>
somebody ehlp
BOTNET-23 has joined #ruby
BOTNET-24 has joined #ruby
BOTNET-22 has joined #ruby
jonathanwallace1 has joined #ruby
BOTNET-25 has joined #ruby
jonathanwallace has quit [Read error: Connection reset by peer]
BOTNET-27 has joined #ruby
BOTNET-26 has joined #ruby
BOTNET-28 has joined #ruby
BOTNET-4 has quit [Read error: Connection reset by peer]
BOTNET-15 has quit [Read error: Connection reset by peer]
BOTNET-2 has quit [Read error: Connection reset by peer]
BOTNET-17 has quit [Read error: Connection reset by peer]
BOTNET-1 has quit [Read error: Connection reset by peer]
BOTNET-20 has quit [Read error: Connection reset by peer]
BOTNET-3 has quit [Read error: Connection reset by peer]
BOTNET-7 has quit [Read error: Connection reset by peer]
BOTNET-14 has quit [Read error: Connection reset by peer]
BOTNET-18 has quit [Read error: Connection reset by peer]
BOTNET-6 has quit [Read error: Connection reset by peer]
BOTNET-11 has quit [Read error: Connection reset by peer]
BOTNET-19 has quit [Read error: Connection reset by peer]
BOTNET-10 has quit [Read error: Connection reset by peer]
BOTNET-0 has quit [Read error: Connection reset by peer]
BOTNET-16 has quit [Read error: Connection reset by peer]
BOTNET-22 has quit [Read error: Connection reset by peer]
BOTNET-27 has quit [Read error: Connection reset by peer]
BOTNET-23 has quit [Read error: Connection reset by peer]
BOTNET-5 has quit [Read error: Connection reset by peer]
BOTNET-13 has quit [Read error: Connection reset by peer]
BOTNET-26 has quit [Read error: Connection reset by peer]
BOTNET-24 has quit [Read error: Connection reset by peer]
BOTNET-8 has quit [Read error: Connection reset by peer]
BOTNET-9 has quit [Read error: Connection reset by peer]
BOTNET-25 has quit [Read error: Connection reset by peer]
BOTNET-21 has quit [Read error: Connection reset by peer]
BOTNET-28 has quit [Read error: Connection reset by peer]
BOTNET-12 has quit [Read error: Connection reset by peer]
<ericx>
LOL
<ericx>
wtf
<atno>
haha, cool shit
<breakingthings>
watevenjusthappen.jpeg
etcetera has quit []
<ericx>
:)
<atno>
just some asshole playing
<ericx>
It was me
<breakingthings>
inb4 b& ericx
<atno>
ericx: say that again ?
<ericx>
?
<ericx>
It was me
<ericx>
I did it
<ericx>
Good
<banisterfiend>
damn
<ericx>
LOL
aedornm has joined #ruby
<ericx>
H4xs
joeycarmello has quit [Read error: Connection reset by peer]
baroquebobcat has quit [Quit: baroquebobcat]
<banisterfiend>
hehe
joeycarmello has joined #ruby
<atno>
and a kick
<Gate>
-_^ am I missing something since I have join/parts ignored?
adeponte has quit [Remote host closed the connection]
<eval-in>
swarles: Output: "/tmp/execpad-eadadff9719f/source-eadadff9719f:1:in `<main>': undefined local variable or method `puts341' for main:Object (NameError)\n" (http://eval.in/7485)
icole has quit [Remote host closed the connection]
ebobby has joined #ruby
bricker is now known as bricker`work
mmitchell has quit [Remote host closed the connection]
<breakingthings>
Speaking of TDD
* breakingthings
breaks things
nari has joined #ruby
<breakingthings>
I am looking for some assistance regarding how I should structure a part of my IRC bot that will handle opening a thread to respond to PING
<breakingthings>
Such that I can sufficiently, like, test it… if it should be tested at all?
ebobby has quit [Client Quit]
itsdavem has joined #ruby
tealmage has quit [Remote host closed the connection]
itsdavem has quit [Remote host closed the connection]
<raz>
hmm, anyone have an idea why it doesn't let me override Thread#initialize? http://pastie.org/5852962
<raz>
gives me "uninitialized thread" on Thread.new then
<raz>
i know i'm probably not supposed to do that, i just wonder if there's an easy way to make it work (or if i'm just overlooking a basic mistake)
dekroning has quit [Ping timeout: 240 seconds]
anarchist has left #ruby ["Konversation terminated!"]
adeponte has quit [Remote host closed the connection]
templaedhel has quit [Quit: Leaving...]
crackfu has joined #ruby
adeponte has joined #ruby
nanothief has joined #ruby
adeponte has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
slainer68 has joined #ruby
jlast has quit [Remote host closed the connection]
cantonic has joined #ruby
reset has quit [Ping timeout: 244 seconds]
havenn has quit [Remote host closed the connection]
breakingthings has quit []
slainer68 has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
jjbohn has quit [Quit: Leaving...]
jekotia has quit [Quit: ChatZilla 0.9.89-rdmsoft [XULRunner 1.9.0.17/2009122204]]
huoxito has quit [Quit: Leaving]
guns has joined #ruby
havenn has quit [Ping timeout: 248 seconds]
DrShoggoth has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
EPIK has quit [Ping timeout: 276 seconds]
chrisja has quit [Quit: Lost terminal]
pu22l3r has joined #ruby
wmoxam has joined #ruby
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
adkron_ has quit [Ping timeout: 276 seconds]
adkron has quit [Ping timeout: 276 seconds]
yacks has quit [Ping timeout: 256 seconds]
jonahR has quit [Quit: jonahR]
adeponte has quit [Remote host closed the connection]
adeponte has joined #ruby
kenneth has quit [Quit: kenneth]
jaequery has joined #ruby
lusory has joined #ruby
xyzodiac has quit [Ping timeout: 252 seconds]
caleb_io has quit [Quit: caleb_io]
dekroning has joined #ruby
MehLaptop has quit [Remote host closed the connection]
dekroning has quit [Read error: Operation timed out]
sailias has joined #ruby
MattRB has quit [Quit: This computer has gone to sleep]
pu22l3r has quit [Read error: Connection reset by peer]
pu22l3r has joined #ruby
jphpsf has quit [Quit: Leaving]
Spillrag has quit [Ping timeout: 276 seconds]
forced_request has quit [Remote host closed the connection]
sailias has quit [Client Quit]
templaedhel has joined #ruby
taoru has joined #ruby
dhruvasagar has joined #ruby
benlieb has joined #ruby
nat2610 has joined #ruby
nga4 has quit [Ping timeout: 256 seconds]
radic has quit [Ping timeout: 246 seconds]
Goles has joined #ruby
Goles has quit [Remote host closed the connection]
megha has quit [Ping timeout: 256 seconds]
n1x has quit [Ping timeout: 248 seconds]
yacks has joined #ruby
templaedhel has quit [Ping timeout: 264 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
nomenkun has joined #ruby
noyb has quit [Ping timeout: 256 seconds]
h4mz1d has joined #ruby
io_syl has joined #ruby
kenneth has joined #ruby
bricker`LA has joined #ruby
bricker`LA is now known as bricker
radic has joined #ruby
elico has joined #ruby
a_a_g has joined #ruby
sorbo_ has left #ruby [#ruby]
benlieb has quit [Quit: benlieb]
bean__ has joined #ruby
beaky has quit [Ping timeout: 276 seconds]
beaky has joined #ruby
Bosox20051 has quit [Remote host closed the connection]
n1x has joined #ruby
megha has joined #ruby
adeponte has quit [Remote host closed the connection]
joeycarmello has quit [Remote host closed the connection]
adeponte has joined #ruby
JumpMast3r has joined #ruby
Rizzle has joined #ruby
ewag has quit [Ping timeout: 256 seconds]
mergoth has joined #ruby
My_Hearing has joined #ruby
My_Hearing has quit [Changing host]
My_Hearing has joined #ruby
fuzai_ has left #ruby ["Leaving"]
adeponte has quit [Ping timeout: 246 seconds]
Mon_Ouie has quit [Ping timeout: 248 seconds]
jtgiri_ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
cableray has quit [Ping timeout: 252 seconds]
cableray has joined #ruby
brianpWins has quit [Quit: brianpWins]
h4mz1d has quit [Ping timeout: 276 seconds]
m4n has joined #ruby
vinax has quit []
arya has joined #ruby
epylinkn has joined #ruby
cevarief2 has quit [Ping timeout: 252 seconds]
dmiller2 has quit [Read error: Operation timed out]
jlast has joined #ruby
hadees has quit [Quit: hadees]
adeponte has joined #ruby
macmartine has joined #ruby
hackerdude has quit [Remote host closed the connection]
wargasm has joined #ruby
jlast has quit [Ping timeout: 252 seconds]
brianpWins has joined #ruby
a_a_g has quit [Quit: This computer has gone to sleep]
cevarief has joined #ruby
adkron has joined #ruby
adkron_ has joined #ruby
tomzx_mac has quit [Ping timeout: 255 seconds]
megha has quit [Quit: WeeChat 0.3.9.2]
caleb_io has joined #ruby
nga4 has joined #ruby
JohnBat26 has joined #ruby
n1x has quit [Ping timeout: 255 seconds]
emergion has quit [Quit: Computer has gone to sleep.]
uris has quit [Quit: Leaving]
maletor has joined #ruby
maletor has quit [Max SendQ exceeded]
frem has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
crackfu has quit [Remote host closed the connection]
crackfu has joined #ruby
adeponte has quit [Remote host closed the connection]
nat2610 has left #ruby [#ruby]
tms1 has joined #ruby
mergoth has quit [Ping timeout: 276 seconds]
<tms1>
hi
<macmartine>
tms1: sup
<tms1>
need help in gem AXElements
Frykt has joined #ruby
Frykt has left #ruby [#ruby]
templaedhel has joined #ruby
<macmartine>
sweet
<tms1>
macmartine: can you help me in this ?
crackfu has quit [Ping timeout: 245 seconds]
<macmartine>
not without knowing the problm
<tms1>
macmartine: sure :)
ilyam has joined #ruby
<tms1>
macmartine: I am using ax_elements in JVM using jruby. and getting this error LoadError: C extensions are disabled, can't load `/Users/test/.rvm/gems/ruby-1.9.3-p194/gems/accessibility_core-0.4.1/lib/accessibility/bridge/bridge.bundle'
ilyam has quit [Remote host closed the connection]
<macmartine>
No idea, but maybe a more thorough question would get a response from others.
<tms1>
macmartine: okay. thanks
<tms1>
Is it possible to use ax_elements while using jruby ?
jean-louis has joined #ruby
yacks has quit [Ping timeout: 248 seconds]
templaedhel has quit [Ping timeout: 252 seconds]
noyb has joined #ruby
tylersmith has quit [Quit: tylersmith]
yacks has joined #ruby
ananthakumaran has joined #ruby
ChampS666 has quit [Ping timeout: 244 seconds]
beaky has quit [Ping timeout: 256 seconds]
drago757 has joined #ruby
mikepack has quit [Remote host closed the connection]
itsdavem has quit [Remote host closed the connection]
<shevy>
heftig do you happen to use ruby-gnome ?
jpfuentes2 has quit [Quit: Computer has gone to sleep.]
jpfuentes2 has joined #ruby
adeponte has joined #ruby
epylinkn has left #ruby [#ruby]
<tms1>
shevy: nop.
<shevy>
tms1 hmm heftig, the guy here :D
<shevy>
it seems as if the total amount of ruby-gnome users on #ruby is ... about zero
<tms1>
shevy: I am extremely sry. I was completely into my jruby and ax_element problem :P
<shevy>
yeah
<shevy>
I would help you if I could and have jruby knowledge, but I hate java, so I cant use jruby
<tms1>
shevy: :)
jinzhu has joined #ruby
<shevy>
there is #jruby however, and the ... what was his name... the main jruby author is here too, I think
<tms1>
thanks a lot
<shevy>
I mean on #jruby and #ruby ... I forgot his name _again_! :(
etcetera has joined #ruby
TheMoonMaster has quit [Excess Flood]
maletor has quit [Quit: Computer has gone to sleep.]
MissionCritical has quit [Ping timeout: 255 seconds]
mafolz has joined #ruby
filipe has joined #ruby
adeponte has quit [Remote host closed the connection]
andrewhl has quit [Remote host closed the connection]
mercwithamouth has joined #ruby
DatumDrop has joined #ruby
xpen has quit [Ping timeout: 245 seconds]
shock_one has quit [Quit: Leaving]
shock_one has joined #ruby
Schmidt has joined #ruby
jduan1981 has quit [Quit: jduan1981]
shock_one has quit [Client Quit]
shock_one has joined #ruby
mockra has joined #ruby
DatumDrop has quit [Ping timeout: 264 seconds]
neurotech has joined #ruby
jean-louis has joined #ruby
mafolz has quit [Ping timeout: 244 seconds]
shock_one has quit [Client Quit]
shock_one has joined #ruby
piotr_ has joined #ruby
shock_one has quit [Client Quit]
shock_one has joined #ruby
shock_one_ has joined #ruby
Mission-Critical has joined #ruby
shock_one has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 252 seconds]
jonathanwallace2 has joined #ruby
jonathanwallace1 has quit [Ping timeout: 256 seconds]
shock_one_ has quit [Client Quit]
shock_one has joined #ruby
lkba has quit [Ping timeout: 264 seconds]
ephemerian has joined #ruby
emergion has joined #ruby
Anderson has joined #ruby
visof has joined #ruby
icole has joined #ruby
TomyLobo has quit [Quit: Standby mode...]
Takehiro has joined #ruby
dyeske has quit [Remote host closed the connection]
shock_one has quit [Quit: Ex-Chat]
shock_one has joined #ruby
Mission-Critical is now known as MissionCritical
jgrevich has quit [Quit: jgrevich]
icole has quit [Ping timeout: 252 seconds]
noxoc has joined #ruby
arkiver has quit [Ping timeout: 255 seconds]
noxoc has quit [Read error: Connection reset by peer]
noxoc has joined #ruby
ionte_ has left #ruby [#ruby]
wudofyr_ has quit [Remote host closed the connection]
dekroning has joined #ruby
TheFuzzball has joined #ruby
wudofyr_ has joined #ruby
arya has joined #ruby
shock_one has quit [Read error: Connection reset by peer]
shock_one has joined #ruby
guns has quit [Quit: guns]
tjbiddle has joined #ruby
arya_ has quit [Ping timeout: 255 seconds]
ryanf has quit [Quit: leaving]
MattRB has quit [Quit: This computer has gone to sleep]
DuoSRX has joined #ruby
lkba has joined #ruby
ebobby has quit [Quit: Lost terminal]
arya has quit [Ping timeout: 255 seconds]
mercwithamouth has quit [Ping timeout: 245 seconds]
bluOxigen has joined #ruby
nomenkun has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mars777 has joined #ruby
arya has joined #ruby
workmad3 has joined #ruby
blueOxigen has joined #ruby
noxoc has quit [Quit: noxoc]
main has joined #ruby
<mars777>
In Rails, do you setup the Controller to find the database record and then in the model you run the query to find it and then display it in the view?
pyro111 has quit [Read error: Operation timed out]
bluOxigen has quit [Ping timeout: 252 seconds]
pnkbst` is now known as pnkbst
mars777 has left #ruby [#ruby]
pnkbst has quit [Changing host]
pnkbst has joined #ruby
mafolz has joined #ruby
blueOxigen has quit []
AwayLex is now known as Quadlex
apeiros_ has joined #ruby
dawkirst has joined #ruby
hoelzro|away is now known as hoelzro
wreckimnaked has joined #ruby
matthewrobbins has joined #ruby
brianpWins has quit [Quit: brianpWins]
osaut has joined #ruby
Elhu has joined #ruby
matthewrobbins has quit [Client Quit]
<tms1>
ninegrid: ok. Thanks for the help
brianpWins has joined #ruby
brianpWins has quit [Client Quit]
ojongeri1s has joined #ruby
<ojongeri1s>
yo, am wondering what ';' does in ruby? pointer to docs would be nice
pyro111 has joined #ruby
<apeiros_>
ojongeri1s: in almost all places the same as a newline would do
timonv has joined #ruby
<apeiros_>
which is why it's often used in irc to "shrink" code to a single line
<ojongeri1s>
ah..
jimeh has joined #ruby
itsdavem has quit [Remote host closed the connection]
slainer68 has joined #ruby
<ojongeri1s>
a colleague thought he was using perl, and did something like 'status == ('solved' || 'closed');'
chussenot has joined #ruby
<ojongeri1s>
i did not work, but was wondering why it did not throw an error
<ojongeri1s>
thanks apeiros_
sporkbomb has quit [Read error: Connection reset by peer]
sporkbomb has joined #ruby
<apeiros_>
`status == ('solved' || 'closed')` is a verbose way to write `status == 'solved'`
DuoSRX has quit [Remote host closed the connection]
<apeiros_>
since `('solved' || 'closed')` evaluates to `'solved'` anyway
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
arkiver has joined #ruby
ahokaomaeha has joined #ruby
fyolnish has quit [Ping timeout: 252 seconds]
Takehiro has quit [Remote host closed the connection]
quest88 has joined #ruby
k610 has joined #ruby
__ru__ has joined #ruby
relixx has quit [Read error: Connection reset by peer]
wf2f has quit [Ping timeout: 276 seconds]
relixx has joined #ruby
rdark has joined #ruby
haxrbyte_ has quit [Remote host closed the connection]
DuoSRX has joined #ruby
Vainoharhainen has joined #ruby
louisror has joined #ruby
xbayrockx has joined #ruby
xbayrockx is now known as wf2f
emergion has quit [Quit: Computer has gone to sleep.]
adambeynon has joined #ruby
Spillrag has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
tatsuya_o has joined #ruby
zigomir has joined #ruby
cdt has joined #ruby
eldariof has joined #ruby
pyro111 has quit [Ping timeout: 244 seconds]
razibog has joined #ruby
sanukcm has joined #ruby
pyro111 has joined #ruby
robotmay has joined #ruby
nat2610 has joined #ruby
cgcardona has quit [Quit: zzzzz]
sbear has quit [Ping timeout: 248 seconds]
quest88 has quit [Quit: quest88]
Xeago has joined #ruby
nat2610 has quit [Ping timeout: 255 seconds]
templaedhel has joined #ruby
blaxter has joined #ruby
shock_one has quit [Ping timeout: 252 seconds]
berserkr has joined #ruby
arya has quit [Ping timeout: 245 seconds]
mrdtt has quit [Quit: mrdtt]
<dawkirst>
hi all, I'm trying to understand something fundamental about Ruby. I've called class method RestClient.post and returned it into a variable. How can I find out how I can interact wit that variable (what attributes and what methods does it have?)
billy_ran_away has quit [Ping timeout: 264 seconds]
<apeiros_>
dawkirst: obj.class tells you its class
<apeiros_>
.methods its methods
<apeiros_>
.instance_variables its instance variables
<apeiros_>
but from .class you should go to the docs and look that class up
Hanmac1 is now known as Hanmac
billy_ran_away has joined #ruby
<dawkirst>
apeiros_, thanks. In this case the docs were written for someone with an intermediate understanding of the class already, so I had to go into the class files itself. Thanks for those methods though, they will help.
<wudofyr_>
apieros: hm… didn't knew you were in #ruby too
<apeiros_>
lol, wudofyr… you have that highlight for wudofry too?
<Hanmac>
hm the doc of the post method should tell you what the method is doing
<Hanmac>
and returning
<apeiros_>
wudofyr_: have been for years ;-)
arya has joined #ruby
<dawkirst>
Hanmac, thanks, I'll check it out.
<apeiros_>
good point Hanmac
nari has quit [Ping timeout: 245 seconds]
<dawkirst>
Hanmac, how do I access the documentation for that particular method though?
aaronmcadam has joined #ruby
<Hanmac>
dawkirst hm you could test out "ri RestClient::post" in your console
<dawkirst>
Hanmac, "Nothing known about RestClient"
williamcotton has quit [Ping timeout: 260 seconds]
<dawkirst>
I've also searched ruby-doc.org, seems like the only documentation is on the GitHub page hosting the source
banseljaj has quit [Ping timeout: 272 seconds]
kenneth has quit [Ping timeout: 264 seconds]
malcolmva has quit [Ping timeout: 248 seconds]
alienvenom has quit [Ping timeout: 260 seconds]
nfk has joined #ruby
arya_ has joined #ruby
<dawkirst>
Hanmac, apeiros_ so here's another fundamental question. If something like RestClient::post returns a string (I assume the API call just returns plain text), must I use string manipulation to get the values out of the response, or is there some fancy method in the object that will help me? (For example, I still don't really understand what :symbols are, but I keep on seeing them).
dqminh has joined #ruby
arya has quit [Ping timeout: 255 seconds]
chussenot has joined #ruby
<Xeago>
symbols are like constants in most other languages
<workmad3>
Xeago: they're nothing like constants... closest they come is to enums
<workmad3>
Xeago: although they're closer to symbols from smalltalk ;)
<dawkirst>
tms1, thanks, that's the same documentation as on GH :)
templaedhel has quit [Quit: Leaving...]
<Xeago>
workmad3: if they were closer to enums I would expect them to be enumerable
<Xeago>
a symbol by itself is not
elaptics`away is now known as elaptics
<Xeago>
an enum type should be
<dawkirst>
Also, say there's an instance method :return!, how can I find out what that does?
<workmad3>
Xeago: I didn't say they were enums... just the closest they come, IMO, is to them
<workmad3>
Xeago: but they're nothing like constants either ;)
<Xeago>
workmad3: I do agree that enums are nowadays more often used than constants (or defines for that matter)
<Xeago>
constants tend to make stuff ugly :)
reinaldob has joined #ruby
<Hanmac>
dawkirst "ri return!" and if that not helps try in irb ".method(:return!).source_location" (that may not work for compiled methods)
* Xeago
YAY! passed with 89/100 for my crypto course!
philips_ has quit [Excess Flood]
malcolmva has joined #ruby
arturaz has joined #ruby
jackyalcine has quit [Quit: Quit]
<workmad3>
Xeago: ah, you're referring to #define CONSTANT num from C :)
tjbiddle has joined #ruby
<Xeago>
or static global final CAPSLOCK = new CapsLock();
<shock_one>
Xeago, public static
<Xeago>
depends on the language
<Xeago>
that was not java :)
dhruvasagar has quit [Ping timeout: 245 seconds]
sleetdro_ has joined #ruby
io_syl has quit [Quit: Computer has gone to sleep.]
<dawkirst>
Hanmac, thanks
dhruvasagar has joined #ruby
tvw has joined #ruby
alienvenom has joined #ruby
lkba has quit [Quit: Bye]
sleetdrop has quit [Ping timeout: 244 seconds]
tjbiddle has quit [Ping timeout: 252 seconds]
banister`sleep has quit [Ping timeout: 252 seconds]
<whowantstolivefo>
hiya again
aaronmacy has quit [Quit: Leaving.]
<whowantstolivefo>
pine,fm learn to program ask me "how many minutes in decade? " my this syntax is true ? >>>> puts ( 1 * 60 ) * ( 24 * 365 + 6) * 10 <<<<
<Hanmac>
why + 6 ?
RagingDave has joined #ruby
<whowantstolivefo>
365 days 6 hours ?
visof has quit [Quit: leaving]
blaxter has joined #ruby
<whowantstolivefo>
wrong i think
banister`sleep has joined #ruby
baphled has joined #ruby
<Hanmac>
ah because of the leap ... (it may still be inaccurate), i think the best way would be to check the years direclty if they are leaping
<Mon_Ouie>
Still, not the point. It doesn't even specify a particular decade.
ephemerian has quit [Quit: Leaving.]
guy has left #ruby ["Leaving..."]
ephemerian has joined #ruby
<banister_>
Mon_Ouie: hey
<Mon_Ouie>
'alut
<banister_>
Mon_Ouie: do you pronounce QT as "cute" or as "cue-tee" ?
nixmaniack has joined #ruby
slainer68 has joined #ruby
<tobiasvl>
banister_: you mean "cute" or "cutie", don't you? ;)
<banister_>
officially it's "cute" but i'd feel like a dick saying that
<Mon_Ouie>
"cue-tee" — but I assume QT is QuickTime, not the toolkit Qt which I pronounce "cute"
<banister_>
Mon_Ouie: no i meant Qt
<banister_>
the toolkit :)
EhyehAsherEhyeh has quit [Read error: Connection reset by peer]
foobar12 has quit [Client Quit]
<shock_one>
How do you pronounce scheduler?
Takehiro has joined #ruby
BulleTime has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
jonahR has joined #ruby
slainer68 has quit [Ping timeout: 244 seconds]
<banister_>
Mon_Ouie: wouldn't you feel embarrassed talking about "Qt" in public? "so, i made this 'cute' application...my mom says it's really nice"
DatumDrop has joined #ruby
<Mon_Ouie>
Somehow I find talking about programming awkward no matter what you're saying
arya_ has quit [Ping timeout: 248 seconds]
biello has joined #ruby
<banister_>
Mon_Ouie: esp in french since all the programmer terms are english, you'd be unable to get a fluid french sentence going as it would be too peppered by our ugly english words
renanoronfle has joined #ruby
eka has joined #ruby
DatumDrop has quit [Ping timeout: 245 seconds]
whitedawg has quit [Quit: Leaving.]
Asher has quit [Ping timeout: 276 seconds]
nixmaniack has quit [Quit: Ex-Chat]
bluenemo has joined #ruby
mockra has joined #ruby
arya has joined #ruby
<banister_>
Mon_Ouie: ooh la-la comci vien le GITHUB et sois SUPERCLASS comma quel le DELEGATE PATTERN tuvois sa bien ITERATOR METHOD
reinaldob has joined #ruby
shock_one has quit [Ping timeout: 252 seconds]
reinaldob has quit [Remote host closed the connection]
pavilionXP has quit [Read error: Connection reset by peer]
<Mon_Ouie>
The alternative solution is to use fancy words nobody ever heard before
Asher has joined #ruby
havenn has joined #ruby
jinzhu has quit [Ping timeout: 252 seconds]
<JonnieCache>
its not different to la weekend
<JonnieCache>
or le parking
blaxter has quit [Ping timeout: 246 seconds]
<JonnieCache>
s/not/no
samphippen has joined #ruby
mockra has quit [Ping timeout: 276 seconds]
<jokke>
hi, is there something like Integer.maxValue in ruby?
havenn has quit [Ping timeout: 255 seconds]
<arturaz>
not really, overflowed ints convert to BigNum s
<arturaz>
irb(main):001:0> 10.class
<arturaz>
=> Fixnum
<arturaz>
=> Bignum
<arturaz>
irb(main):002:0> (10 ** 1000).class
nomenkun_ has quit [Read error: Connection reset by peer]
<jokke>
arturaz: yes, i think that's the best way to go
ananthakumaran has quit [Quit: Leaving.]
F1skr has joined #ruby
blaxter has joined #ruby
<Xeago>
what is the proper spelling of text-analyzation
<Xeago>
text-analysis?
<JonnieCache>
textual analysis
<Xeago>
thanks JonnieCache!
itsdavem has joined #ruby
itsdavem has quit [Remote host closed the connection]
templaedhel has joined #ruby
<Xeago>
my vim shows whitespace on the line I am editing as a period, how can I make it a different color period?
pcarrier has quit []
kevin_e has joined #ruby
browndawg has joined #ruby
browndawg has left #ruby [#ruby]
Choobie has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby
nat2610 has joined #ruby
<Xeago>
what is the difficulty called when someone from another country and language works with local natives?
<Xeago>
e.g. someone from the netherlands works in sweden
<Xeago>
cultural and language difficulties?
templaedhel has quit [Ping timeout: 245 seconds]
_carloslopes has joined #ruby
carloslopes has quit [Read error: Connection reset by peer]
dawkirst has quit [Read error: Connection reset by peer]
nat2610 has quit [Ping timeout: 276 seconds]
<JonnieCache>
that difficulty could be called a "language barrier"
<JonnieCache>
"we had problems with the language barrier"
Virunga has quit [Remote host closed the connection]
<JonnieCache>
but langugae/cultural differences is fine too
browndawg has joined #ruby
browndawg has quit [Max SendQ exceeded]
itsdavem has joined #ruby
browndawg has joined #ruby
heftig has quit [Ping timeout: 245 seconds]
<Xeago>
damnit, 1 jar of herring (1.3 EUR) is not enough for 6 crackers
jonahR has quit [Quit: jonahR]
user666 has joined #ruby
<user666>
Good afternoon
<user666>
I have a multidimentional array, and I wish to loop through it, but my current outcome is not what I expected it to do, could someone shed some light on what I could possibly be doing wrong and point me in the right direction?
<user666>
Array is as follows: [["dabeshu", 1], ["Dwarf", 2]]
<Hanmac>
Xeago: if you have only an normal each, it works allone: so [["dabeshu", 1], ["Dwarf", 2]].each {|k,v| ...} works the same as [["dabeshu", 1], ["Dwarf", 2]].each {|(k,v)| } .... you only need the () when you have more layers like, each_with_object().with_index.inject {|s,(((k,v),o),i) ... }
tatsuya_o has quit [Ping timeout: 276 seconds]
renanoronfle has quit [Quit: This computer has gone to sleep]
renanoronfle has joined #ruby
<user666>
Thanks Hanmac that works :)
<Mon_Ouie>
banister_: It definitely seems to be true
<Mon_Ouie>
A few years ago, I heard a politician say something like "I'll say it in French so I'll only have to say it once…"
browndawg has left #ruby [#ruby]
dhruvasagar has quit [Ping timeout: 245 seconds]
arkiver has quit [Ping timeout: 264 seconds]
<banister_>
Mon_Ouie: why do you think that is? just part of the general french arrogance/disinterest in any language aside from french?
seoaqua has quit [Quit: 离开]
larissa has joined #ruby
dhruvasagar has joined #ruby
samuel02 has joined #ruby
<Mon_Ouie>
I heard about studies saying it's harder to hear other languages when your first language is French due to the small frequency range used in French
browndawg has joined #ruby
tealmage has joined #ruby
martinklepsch has joined #ruby
<banister_>
Mon_Ouie: hehe, good excuse mate :D
nomenkun has quit [Read error: Connection reset by peer]
nomenkun has joined #ruby
<banister_>
Mon_Ouie: though your english is exceptional, what's your spoken english like?
yshh has quit [Remote host closed the connection]
<Mon_Ouie>
I'm not so sure, I very rarely speak English
nkr has joined #ruby
nkr has quit [Client Quit]
kayloos has joined #ruby
mengu has joined #ruby
renanoronfle has quit [Quit: Saindo]
itsdavem has joined #ruby
ananthakumaran has joined #ruby
nkr has joined #ruby
nkr has quit [Client Quit]
Kuifje has joined #ruby
koderde has joined #ruby
jinzhu has joined #ruby
hybris has joined #ruby
itsdavem has quit [Remote host closed the connection]
Virunga has joined #ruby
mockra has joined #ruby
tk_ has joined #ruby
nkr has joined #ruby
tatsuya__ has quit [Ping timeout: 248 seconds]
mockra has quit [Ping timeout: 264 seconds]
itsdavem_ has joined #ruby
terrorpup has joined #ruby
chussenot has quit [Quit: chussenot]
moos3 has joined #ruby
binaryplease has quit [Quit: WeeChat 0.4.0]
tatsuya_o has joined #ruby
binaryplease has joined #ruby
pcarrier has joined #ruby
angusiguess has quit [Ping timeout: 276 seconds]
arya has quit [Ping timeout: 248 seconds]
NuckingFuts has joined #ruby
shock_one has joined #ruby
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
NuckingFuts has quit [Changing host]
NuckingFuts has joined #ruby
NuckingFuts is now known as Nuck
BizarreCake has joined #ruby
tatsuya_o has quit [Ping timeout: 264 seconds]
arya has joined #ruby
rmartin has joined #ruby
ovatsug25 has joined #ruby
Dreamer3 has quit [Quit: Computer has gone to sleep.]
polymar has joined #ruby
gyre007 has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
razibog1 has joined #ruby
razibog has quit [Quit: Leaving.]
tatsuya_o has joined #ruby
baphled has joined #ruby
razibog1 has quit [Client Quit]
razibog has joined #ruby
itsdavem_ has quit [Remote host closed the connection]
<banister_>
Mon_Ouie: do u have a penchant for 'la gamine' ?
arya has joined #ruby
<JonnieCache>
damn
<JonnieCache>
the french have the best words
<JonnieCache>
that is a *useful* word
Virunga has quit [Remote host closed the connection]
JumpMast3r has joined #ruby
chussenot has joined #ruby
ExxKA has quit [Quit: This computer has gone to sleep]
<Mon_Ouie>
I don't know what you meant by that though
Chingy2055 has joined #ruby
melnik has quit [Quit: fault]
Chingy2055 has quit [Read error: Connection reset by peer]
davidboy has joined #ruby
baphled has quit [Ping timeout: 248 seconds]
xpen has joined #ruby
dhruvasagar has quit [Ping timeout: 252 seconds]
dhruvasagar has joined #ruby
banister_ has quit [Remote host closed the connection]
xpen has quit [Remote host closed the connection]
Chingy2055 has joined #ruby
xpen has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
taoru has quit [Remote host closed the connection]
BizarreCake has quit [Ping timeout: 276 seconds]
xpen_ has joined #ruby
Chingy2055 has joined #ruby
tealmage has quit [Remote host closed the connection]
Chingy2055 has quit [Max SendQ exceeded]
chussenot has quit [Quit: chussenot]
Chingy2055 has joined #ruby
chussenot has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
xpen has quit [Ping timeout: 264 seconds]
kpshek has joined #ruby
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
dustint has joined #ruby
banister`sleep has joined #ruby
itsdavem has joined #ruby
marr has joined #ruby
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
<banister`sleep>
Mon_Ouie: est-ce-que tu aimes des gamines
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
pskosinski has joined #ruby
relixx has quit [Read error: Connection reset by peer]
user666 has quit [Quit: Leaving]
relixx has joined #ruby
bel3atar has quit [Ping timeout: 252 seconds]
aknagi has joined #ruby
Dwarf has joined #ruby
Chingy2055 has joined #ruby
itsdavem has quit [Ping timeout: 240 seconds]
Chingy2055 has quit [Max SendQ exceeded]
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
<aknagi>
Hi guys. Is there a nice way to make triplets from an Array so [a,b,c,d,e,f] becomes [[a,b,c],[d,e,f]] ?
BizarreCake has joined #ruby
itsdavem has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Changing host]
tommyvyo has joined #ruby
<GeekOnCoffee>
aknagi: yes
whitedawg has joined #ruby
dhruvasagar has quit [Ping timeout: 240 seconds]
tommyvyo has quit [Client Quit]
bel3atar has joined #ruby
<apeiros_>
aknagi: each_slice(3).to_a
tPl0ch_ has joined #ruby
baphled has joined #ruby
<aknagi>
apeiros_: Thanks! :)
bananastalktome has joined #ruby
mark_locklear has joined #ruby
wreckimnaked has joined #ruby
tPl0ch has quit [Disconnected by services]
Chingy2055 has joined #ruby
tPl0ch_ is now known as tPl0ch
adkron_ has quit [Ping timeout: 245 seconds]
Chingy2055 has quit [Max SendQ exceeded]
adkron has quit [Ping timeout: 252 seconds]
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
xemu has joined #ruby
polymar has quit [Remote host closed the connection]
Chingy2055 has joined #ruby
jaequery has quit [Quit: Computer has gone to sleep.]
mockra has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
yshh has joined #ruby
havenn has joined #ruby
Chingy2055 has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
<nfk>
is there really no way how to get abstract classes in ruby?
<nfk>
or at least abstract methods
<nfk>
i guess same thing
<nfk>
been a long time since i did any real OOP
<hoelzro>
nfk: def my_method raise 'this method is abstract!' end
<hoelzro>
you could easily write a method generator for that, too
tms1 has left #ruby [#ruby]
<hoelzro>
so you could do abstract_method :my_method instead
<nfk>
hoelzro, the stuff on stack overflow was much closer to what i want but horribly bulky and ugly as sin
yacks has quit [Ping timeout: 252 seconds]
<hoelzro>
nfk: well, what do you *want*?
cevarief2 has joined #ruby
angusiguess has joined #ruby
<nfk>
what do you people do when you have multiple similar classes that need to have similar if not those same methods but at the same time time the parent class should not be instantiated as it would make no sense
<Mon_Ouie>
You don't neeed them at all, you can just call the method and expect the object that is passed in to respond to that method
Chingy2055 has joined #ruby
<hoelzro>
there's usually no need to define abstract methods in Ruby; you program assuming that you may call a certain set of methods on an object?
<Mon_Ouie>
See duck typing
<hoelzro>
s/[?]$//
kayloos has quit [Quit: kayloos]
<JonnieCache>
hmmm
Chingy2055 has quit [Max SendQ exceeded]
baphled has quit [Ping timeout: 252 seconds]
<nfk>
hoelzro, my memory is crap, i want ruby to yell at me if i forget to update a child class or something
Chingy2055 has joined #ruby
yshh has quit [Ping timeout: 245 seconds]
<hoelzro>
well, I bet you could do it with meta magic
mockra has quit [Ping timeout: 255 seconds]
<nfk>
i already have half a dozen of them and there's gonna be about as many more yet
havenn has quit [Ping timeout: 248 seconds]
<hoelzro>
but it's probably "against the Ruby way"
<workmad3>
nfk: why do you even need the parent class?
<apeiros_>
nfk: enforcing inheritance is a smell
Chingy2055 has quit [Max SendQ exceeded]
<nfk>
workmad3, because i want stuff to be DRY
<nfk>
you know, the ruby way
<apeiros_>
modules
<workmad3>
^^
<apeiros_>
are the ruby way for shared behavior
<JonnieCache>
im assigning a function to a variable but im having the classic problem that when i call that function from its variable, inside another function, it doesnt respect the reassigned variable. it keeps the value from when the second function was defined. i cant work out how to fix it
<apeiros_>
JonnieCache: s/function/method/
cevarief has quit [Ping timeout: 256 seconds]
<JonnieCache>
(i should admit that im having this problem in javascript but its no different to ruby)
<workmad3>
nfk: if you need a shared set of behaviour, put it in a module and mix it in, if you need an interface then use duck typing (and potentially write a test to verify the duck type interface exists on implementations)
<apeiros_>
JonnieCache: um, yeeees, if you don't speak about ruby in what you say, you should *precede* it with that information…
huoxito has joined #ruby
huoxito has quit [Client Quit]
x0F_ is now known as x0F
Chingy2055 has joined #ruby
<nfk>
workmad3, i'm afraid i'm not familiar with use of modules in ruby and as for duck typing, i can't even at the moment remember what it means
<JonnieCache>
sorry i should have written that first. my problem isnt language dependent though. you could have the same thing in any language with a similar pass-by-value-but-the-values-are-references language
<hoelzro>
because JS scoping is a crock of crap
<nfk>
oh, managed to find some docs
<workmad3>
nfk: either of those is a purely technical aspect though, and shouldn't be shoe-horned into inheritance which should, IMO, be purely for a very strong semantic relationship, not for a simple behaviour sharing across disparate classes
<JonnieCache>
hoelzro: yeah, ive tried various combinations of that stuff, i cant get the right one
Chingy2055 has joined #ruby
Takehiro has quit [Remote host closed the connection]
<nfk>
workmad3, the thing is, those classes are very similar
otters has quit [Ping timeout: 255 seconds]
<nfk>
models in rails
<workmad3>
nfk: and?
puppeh has joined #ruby
Chingy2055 has quit [Max SendQ exceeded]
<workmad3>
nfk: that doesn't change any part of what I just said
<JonnieCache>
hoelzro: of course! the classic self executing function.
<workmad3>
nfk: and DRY is about not repeating concepts, not about avoiding anything that even looks vaguely similar
RagingDave has quit [Quit: Ex-Chat]
Chingy2055 has joined #ruby
Rix has quit [Ping timeout: 260 seconds]
<hoelzro>
I once saw someone do (function() ... end)() in Lua
<nfk>
workmad3, i hate to have similar yet different code in many files
<hoelzro>
poor guy.
Chingy2055 has quit [Max SendQ exceeded]
horofox has quit [Quit: horofox]
Jackneill has joined #ruby
puppeh has quit [Client Quit]
berserkr has quit [Read error: Connection reset by peer]
<nfk>
and i want ruby to literally scream in anger if i forget to update some child class
<apeiros_>
nfk: that's when you figure the pattern, locate the variable parts, and DRY it
<workmad3>
nfk: also 'forget to update some child class'? as in, you want ruby to just know that you were meant to change some behaviour and forgot?
Chingy2055 has quit [Max SendQ exceeded]
<JonnieCache>
hoelzro: im not that much of a noob :)
elico has quit [Quit: elico]
<nfk>
workmad3, also, wouldn't the tests need to know which classes to test for having the right stuff?
ner0x has joined #ruby
<JonnieCache>
but its effectively the same bug in a more complex situation
<nfk>
also i would need to keep the tests up to date
<hoelzro>
I figured =)
<workmad3>
nfk: yes, yes you would
<hoelzro>
JonnieCache: I just updated my gist
<workmad3>
nfk: it's called development :P
<hoelzro>
with a second file
Chingy2055 has joined #ruby
jaequery has quit [Client Quit]
<hoelzro>
god, I hate JS scoping rules.
<nfk>
workmad3, as in if make an abstract some_method and forget to implement in one of the child classes, then ruby should not let that slide
<JonnieCache>
thanks
Chingy2055 has quit [Max SendQ exceeded]
<workmad3>
nfk: and it won't if you lean on duck typing
<nfk>
yes, it would probably crash and burn when it got called but it might not happen for a while
<Mon_Ouie>
Ruby is so dynamizc it will scream at you when you call the methods, not earlier
<workmad3>
nfk: you'd get a NoMethod exception
<nfk>
workmad3, only when called
ananthakumaran has quit [Read error: Connection reset by peer]
<nfk>
what if it's not called for months?
ananthakumaran has joined #ruby
<workmad3>
nfk: right... because at any time before it gets called, it could become valid
Chingy2055 has joined #ruby
<workmad3>
nfk: and that's why you write tests
Jackneill has quit [Max SendQ exceeded]
<workmad3>
nfk: and if you're using duck types, you write a shared behaviour test to ensure the interface is present
<nfk>
workmad3, i'd still like for an optional and sane way to tell: this has to be defined when a child class is instantiated
<nfk>
okay, google fu time
Rix has joined #ruby
<Mon_Ouie>
When you create the subclass, the methods don't exist yet
<shevy>
nfk hmm there is a hook I think
yacks has joined #ruby
<workmad3>
nfk: what you don't do is write a superclass that you want to treat as abstract purely for the purposes of defining an interface, and put all the methods in there
<nfk>
shevy, i guess, i saw some code but it was ugly as sin
<shevy>
yeah
<shevy>
:)
<nfk>
workmad3, what i want is basically java inheritance model
<JonnieCache>
AA
<workmad3>
nfk: use java then
<nfk>
yes, i know, it makes me feel sick and dirty, too
<nfk>
workmad3, at this point? also JSP? i think i'll pass
dawkirst has joined #ruby
Chingy2055 has left #ruby [#ruby]
<workmad3>
nfk: ruby is not the same as java, the object model is substantially different
<nfk>
i have been coding for almost a month, going with something different right now would require really compelling reasons
<workmad3>
nfk: it works differently, and that means the idioms you work with need to change correspondingly
<workmad3>
nfk: attempting to code java in ruby is a sure-fire way to cause yourself annoyance and pain :P
<nfk>
workmad3, yes, but that doesn't stop me from wishing for some quick and easy sanity
<workmad3>
nfk: there is plenty of sanity there... it's just a different sanity to what you're used to ;)
<workmad3>
nfk: the only insanity is attempting to treat ruby as java
<nfk>
workmad3, let's try the initial question differently, what's the ruby way for specifying interfaces? is it duck typing?
<workmad3>
nfk: yes
<nfk>
thanks
blaxter has quit [Quit: foo]
tk_ has quit [Quit: ばいばい]
<workmad3>
nfk: or, more accurately, there isn't a strict, compiler validated way to formally declare an interface in ruby... instead you can treat any set of methods as an implicit interface and treat objects that implement that interface as a duck type for it
d2dchat has joined #ruby
tommyvyo has joined #ruby
terrorpup has quit [Remote host closed the connection]
nat2610 has joined #ruby
ffranz has joined #ruby
girija has left #ruby ["Ex-Chat"]
rippa has quit [Ping timeout: 240 seconds]
banister`sleep has quit [Remote host closed the connection]
ovatsug25 has quit [Remote host closed the connection]
ttt has quit [Read error: Connection reset by peer]
ttt has joined #ruby
nat2610 has quit [Ping timeout: 264 seconds]
Gue______ has joined #ruby
pen has joined #ruby
matchaw_ has quit [Remote host closed the connection]
Goles has joined #ruby
<JonnieCache>
hoelzro: turns out i was actually doing all my l33t javascript functional programming entirely correctly
<hoelzro>
well, that's good.
<JonnieCache>
hoelzro: turns out all my problems were because i forgot that js doesnt implicitly return like ruby does
<JonnieCache>
EPIC FAIL
<shevy>
js must die
<nfk>
JonnieCache, really? i thought it did have that
<JonnieCache>
have you ever looked at how they work out tiobe
terrorpup has joined #ruby
jeffsmykil has joined #ruby
yfeldblum has quit [Ping timeout: 256 seconds]
<JonnieCache>
its such a joke. i cant believe the industry lets them get away with it
<JonnieCache>
they should be stopped
<nfk>
JonnieCache, there you have it, you should have used coffeescript ;P
<Mon_Ouie>
It ranks popularity, not quality
<JonnieCache>
no it doesnt. it ranks google hits
<Mon_Ouie>
(not that it's accurate)
<Mon_Ouie>
My point is it doesn't say a language is better than another
<JonnieCache>
nfk: believe me, id love to be using CS
<nfk>
JonnieCache, if i have less google hits than wikipedia, does that make me more popular than wikipedia?
mrdtt has joined #ruby
<shevy>
but more people use javascript than ruby :(
<JonnieCache>
i bet theres more fortran in production than node
<JonnieCache>
but less google hits
solitude88 has joined #ruby
matchaw_ has joined #ruby
geekbri has joined #ruby
Goles has quit [Read error: Connection reset by peer]
<Xeago>
JonnieCache: at videofyme we're not allowed to use coffeescript, I just compile my coffeescript before checking in
Spooner_ has joined #ruby
krawchyk has joined #ruby
<Xeago>
it atleast makes writing big chunks easier
ttt has quit [Remote host closed the connection]
<tlvb>
just starting out with rack (and ruby in general) is my interpretation correct that you apply all the middleware as a chain on the form MW1.new(MW2.new(... ?
m8 has joined #ruby
ddd has quit [Ping timeout: 245 seconds]
earthquake has joined #ruby
<m8>
Hi, it's a good idea to install gems in default path /var/lib/gems/1.8/gems? Or is better to install in a user path?
shock_one has quit [Read error: Connection reset by peer]
<Xeago>
m8: depends on usage scenario, in general it is seen as a bad practice to write to system paths tho
<m8>
good
<m8>
i've to install redmine
breakingthings has joined #ruby
earthquake has quit [Client Quit]
earthquake has joined #ruby
whitedawg has quit [Quit: Leaving.]
ukd1 has joined #ruby
<m8>
Xeago, thanks Xeago i'll use the --path parameter
itsdavem has quit [Remote host closed the connection]
jeffsmykil has quit [Quit: jeffsmykil]
razibog has joined #ruby
gyre007 has joined #ruby
dmiller2 has joined #ruby
v0n has joined #ruby
juarlex has joined #ruby
chris___ has quit [Ping timeout: 245 seconds]
chris___ has joined #ruby
binaryplease has quit [Quit: WeeChat 0.4.0]
Gue______ has quit [Ping timeout: 245 seconds]
<chris___>
My machine just crashed so I've missed any messages for me? Did anyone say anything?
<hoelzro>
chris___: nope
pyreal has joined #ruby
razibog1 has quit [Ping timeout: 276 seconds]
pheonix has joined #ruby
llaskin has joined #ruby
llaskin has quit [Changing host]
llaskin has joined #ruby
<shevy>
chris___ I was not saying anything as I use ruby mostly just for general purpose stuff, I do not know rails. most railsers tend to be on #ruby-onrails too btw
<chris___>
shevy: yeah i've posted on there too.
dmiller2 is now known as dmiller
<shevy>
hey guys... do you think that this would be useful syntax:
<shevy>
omg... I can define a method called rescue ...
<chris___>
There is a dissapointing lack of applicants for the Ruby/Rails job we're advertisiing.
beiter has joined #ruby
nomenkun has quit [Read error: Connection reset by peer]
<llaskin>
every time I call a method, I want to pass across an optional variable "case_number", is there a way to override some method somewhere to pass the optional case_number to every method call?
nomenkun has joined #ruby
sepp2k has joined #ruby
pskosinski has quit [Ping timeout: 255 seconds]
<llaskin>
as the last variable in the call so method_name(x,y,z, case_number) or you could call it as method_name(x,y,z) without causing an issue
<shevy>
Hanmac, this is the funniest thing: self.send :rescue
pheonix has left #ruby [#ruby]
<shevy>
rescue_error.rb:12:in `send': undefined method `rescue' for main:Object (NoMethodError)
<tobiasvl>
llaskin: def method_name(x, y, z, case_number = default_value)
<pyro111>
create object that holds case_number
<shevy>
but you can define that method, then call it
jeffreybaird has joined #ruby
<llaskin>
yes but tobias, I know that, but I already have a bajillion methods created...and don't want to go about adding that to every method if I don't have to...
nyuszika7h has quit [Quit: Reconnecting]
templaedhel has joined #ruby
<shevy>
llaskin well, if you did not define your method to have a default, then you must change the method definition
<llaskin>
okie dokie
<shevy>
you can use an object for "default_value" holding the data you want to make default, as pyro111 suggested
sambio has joined #ruby
nyuszika7h_ has joined #ruby
<llaskin>
yes I understand, was hoping not to have to do that
<llaskin>
was hoping there was some way to override it, but understand that there isn't
pskosinski has joined #ruby
<tobiasvl>
not sure how that would work
<tobiasvl>
so nope, sorry
carloslopes has joined #ruby
<pyro111>
I thinked about object that takews optional params at .new, than all methods of that object can use it
bean__ has quit [Quit: Computer has gone to sleep.]
nyuszika7h_ is now known as nyuszika7h
<shevy>
llaskin perhaps you could fetch all methods from a .rb file, then redefine them automagically
<shevy>
and changing just the last parameter to each
<shevy>
with alias_method perhaps, I dunno... I have never tried such an idea
arturaz has quit [Ping timeout: 244 seconds]
cevarief has joined #ruby
ukd1 has quit [Read error: Connection reset by peer]
<pyro111>
I think with ruby 2 you can prepend instead of alias_method
_carloslopes has joined #ruby
<shevy>
cool
templaedhel has quit [Ping timeout: 264 seconds]
carloslopes has quit [Read error: Connection reset by peer]
baphled has joined #ruby
Goles has quit [Read error: Connection reset by peer]
cevarief2 has quit [Ping timeout: 276 seconds]
<catphish>
Spooner_: thanks, was puzzling me for ages!
daniel_- has joined #ruby
jrist-afk is now known as jrist
djdarkbeat has joined #ruby
jinzhu has quit [Ping timeout: 256 seconds]
<banister`sleep>
llaskin: yea you can do that using method decorators
<banister`sleep>
llaskin: if you can show me a couple of specs for a minimal test case i can probably code it up 4 u
banister`sleep is now known as banisterfiend
gregor3005 has joined #ruby
baphled has quit [Ping timeout: 256 seconds]
tatsuya__ has quit [Remote host closed the connection]
shock_one_ has quit [Read error: Connection reset by peer]
BulleTime has quit [Ping timeout: 252 seconds]
sayan has joined #ruby
sayan has quit [Changing host]
sayan has joined #ruby
iamjarvo1 has joined #ruby
Goles has joined #ruby
yfeldblum has quit [Quit: Leaving]
<gregor3005>
hi, i bought the book "the rubyist" and tried some examples there. now i have problem with the first "require" usage, here is the code http://fpaste.org/vckJ/
generalissimo has joined #ruby
<gregor3005>
load works, but require didn't find the file. when i use the static path it find it
<gregor3005>
"ruby -e 'puts $:'" don't give me a dot at the laste line, maybe this can be the problem?
<gregor3005>
i use this version: ruby-1.9.3.362-24.fc18.x86_64
clocKwize has quit [Quit: clocKwize]
philcrissman has joined #ruby
DuoSRX has quit [Remote host closed the connection]
iamjarvo has quit [Ping timeout: 252 seconds]
lusory has quit [Read error: Connection reset by peer]
jjbohn has joined #ruby
<pyro111>
may be require_relative
stopbit has joined #ruby
<banisterfiend>
chris___: i looked up some videos on manchester, bleak place.. :)
<JonnieCache>
manchester is great these days
TIBS01 has quit []
<banisterfiend>
looks like a really depressing place to live
Hanmac1 has joined #ruby
<JonnieCache>
those videos were probably taken before the IRA bombed it to hell and they got a lovely new city centre courtesy of the insurance industry
huoxito has quit [Read error: Operation timed out]
<gregor3005>
pyro111: you know a good ide with code completation? i tested eclipse but it didn't give me require_relative as an option
dannluciano has joined #ruby
clooth has quit [Quit: clooth]
Hanmac has quit [Ping timeout: 256 seconds]
Virunga has quit [Remote host closed the connection]
<JonnieCache>
youre never gonna get full java-style completion with ruby
<JonnieCache>
jetbrains is popular
<rmartin>
try rubymine
<rmartin>
it has a very good autocomplete feature
<JonnieCache>
oh yeah rubymine is the one i was thinking of
<rmartin>
yeah
<rmartin>
Jetbrains Rubymine correcttt
pyro111 has quit [Quit: Leaving]
<wunz>
< JonnieCache> youre never gonna get full java-style completion with ruby
<JonnieCache>
id encourage you to just learn the api in your head though
<wunz>
whys that?
yfeldblum has joined #ruby
<gregor3005>
oh, rubymine is not for free :-(
<wunz>
everything's free. just have to properly search for it if you really want it free
<Xeago>
"Earlier investigation showed that the search queries were hammering down the database." I feel that the word hammering is inappropriate in a (scientific'ish) paper
<wunz>
but for such a grea tool i would recommend to show some appreciation towards its dev
<Xeago>
any suggestions
filipe has quit [Ping timeout: 244 seconds]
beiter_ has joined #ruby
<wunz>
"causing a decrease in the database performance"
<banisterfiend>
wunz: static analysis is much easier in java i guess
<banisterfiend>
wunz: you can figure out what methods belong to which object, and always provide teh correct completions. With ruby which is really really dynamic, there'd probably be a subset of stuff you can't properly complete
aedornm has joined #ruby
nomenkun has quit [Remote host closed the connection]
havenn has joined #ruby
mockra has joined #ruby
_nitti has joined #ruby
beiter has quit [Ping timeout: 276 seconds]
beiter_ is now known as beiter
Hanmac1 is now known as Hanmac
larissa has quit [Quit: Leaving]
beilabs has quit [Ping timeout: 248 seconds]
<rmartin>
indeed, banister
Liothen has quit [Remote host closed the connection]
havenn has quit [Ping timeout: 252 seconds]
beliveyourdream has quit [Read error: Connection reset by peer]
<banisterfiend>
Xeago: can't you write our thesis in dutch?
timmow has quit [Quit: has left the building]
<banisterfiend>
your*
mockra has quit [Ping timeout: 264 seconds]
timmow has joined #ruby
chris___ has quit [Ping timeout: 245 seconds]
arya has quit [Ping timeout: 248 seconds]
SegFaultAX has quit [Ping timeout: 276 seconds]
jaimef has quit [Ping timeout: 255 seconds]
kanzure has quit [Ping timeout: 248 seconds]
kn330 has joined #ruby
failshell has joined #ruby
enebo has joined #ruby
sbear has joined #ruby
workmad3 has joined #ruby
SegFaultAX has joined #ruby
arusso has quit [Ping timeout: 245 seconds]
tatsuya__ has joined #ruby
undersc0re97 has joined #ruby
zigomir has joined #ruby
Goles_ has joined #ruby
arya has joined #ruby
jaimef has joined #ruby
tagrudev has quit [Remote host closed the connection]
arusso has joined #ruby
filipe has joined #ruby
mikecmpbll has joined #ruby
Goles has quit [Ping timeout: 244 seconds]
beilabs has joined #ruby
puppeh has joined #ruby
sailias has joined #ruby
kanzure has joined #ruby
__BigO__ has joined #ruby
arya has quit [Ping timeout: 248 seconds]
andrewhl has joined #ruby
interactionjaxsn has joined #ruby
wallerdev has joined #ruby
LineByLine has joined #ruby
dqminh has joined #ruby
kpshek has quit []
nat2610 has joined #ruby
LineByLine has quit [Client Quit]
binaryplease has joined #ruby
beilabs has quit [Ping timeout: 245 seconds]
samphippen has quit [Quit: Computer has gone to sleep.]
LineByLine has joined #ruby
arya has joined #ruby
nateberkopec has joined #ruby
zph has joined #ruby
puppeh has quit [Quit: Leaving...]
dannluciano has quit [Quit: dannluciano]
nat2610 has quit [Ping timeout: 246 seconds]
chridal has quit [Quit: Lost terminal]
adeponte has joined #ruby
thams has quit [Quit: thams]
r0bby has joined #ruby
mark_locklear has quit [Remote host closed the connection]
<llaskin>
banisterfiend, i'm coding you up a sample or two....
robbyoconnor has quit [Ping timeout: 252 seconds]
bean__ has joined #ruby
<banisterfiend>
llaskin: i have a horrible feeling though that what your'e asking might not actually make sense, but i'd be happy if u proved me wrong :D
axl_ has joined #ruby
SCommette has joined #ruby
bluOxigen has joined #ruby
reinaldob has joined #ruby
Goles_ has quit [Quit: Out.]
sbear has quit [Ping timeout: 276 seconds]
<llaskin>
banisterfiend: its nota bout making sense sometimes, but meeting management requests
<workmad3>
llaskin: but basically yes... you want to change a method in order to introduce a non-optional parameter, so you're going to need to go through and modify all the callers to have the correct parameter
<workmad3>
llaskin: there isn't a way around tha
<workmad3>
t
<llaskin>
yea, so basically my life is really gonna suck:(
<llaskin>
ok
<llaskin>
cool
heidar has joined #ruby
Goles has joined #ruby
<banisterfiend>
llaskin: unless the test case number is some kind of global
<workmad3>
llaskin: you could introduce a temporary default for now, if all the current usage is for one test-case
<llaskin>
banister no its not a global.
r0bby is now known as robbyoconnor
ahokaomaeha has quit [Quit: When I come back, please tell me in what new ways you have decided to be completely wrong.]
joofsh_ has quit [Remote host closed the connection]
<banisterfiend>
llaskin: could you store the test case number on the object?
<banisterfiend>
llaskin: then verify_dialog could just grab it as an instance variable
arya has joined #ruby
<llaskin>
no, because the object runs through multiple test cases...
heidar has quit [Quit: leaving]
ChampS666 has quit [Ping timeout: 255 seconds]
<llaskin>
while each method is going to run only 1 test case at a time, the object will run 100+ potentially
Goles has quit [Max SendQ exceeded]
havenn has joined #ruby
clooth has joined #ruby
<lectrick>
I have a question: Say I have a class which I want to unit test. This class inherits from another class, which must be loaded. Is there any way to not have to load that other class, short of opening it and closing it right away myself? I want to reduce coupling.
D4T has quit [Ping timeout: 255 seconds]
<banisterfiend>
llaskin: in the before blok for each test, couldn't you write a proxy object
<banisterfiend>
i guess it might not help
jtgiri_ has quit [Client Quit]
<banisterfiend>
but you could write a wrapper object which has the same method, but also an ivar slot for the test case number
Astralum has quit [Ping timeout: 256 seconds]
<banisterfiend>
set that in your before block
uris has joined #ruby
<llaskin>
also banisterfiend if you can think of a way to store the driver object so that multiple objects can access it easily without using a global, i'm always open(though it would definitely take some convincing) to how to do it: https://gist.github.com/4635547 I use $browser instead of driver used in the example provided because that way I don't have to pass it around between seperate classes and can't define new drivers each time(time consuming and confusing
D4T has joined #ruby
joofsh has joined #ruby
__ru__ has quit [Remote host closed the connection]
jrafanie has joined #ruby
angusiguess has quit [Ping timeout: 246 seconds]
yalue has joined #ruby
heidar has joined #ruby
Umren has joined #ruby
zastern has joined #ruby
ChampS666 has joined #ruby
<lectrick>
aren't variables defined outside classes "global"?
<lectrick>
in scope at least
<apeiros_>
no
frem has joined #ruby
Goles has joined #ruby
<lectrick>
oh, no, no they're not
<lectrick>
ok now I have to ask- why not?
<apeiros_>
because that's not how the language was designed
<apeiros_>
constants are global (+namespaced)
<lectrick>
is this something that has to do with lexical vs. semantic scope?
<apeiros_>
local variables are always local
ewag has quit [Ping timeout: 264 seconds]
ckrailo has joined #ruby
Spooner_ has quit [Remote host closed the connection]
interactionjaxsn has quit [Remote host closed the connection]
<banisterfiend>
llaskin: im not familiar with that library, but maybe you could still inject the dependency but set its default to the global
freeayu__ has quit [Remote host closed the connection]
arya has quit [Ping timeout: 248 seconds]
<lectrick>
apeiros_: does "local" change only when "self" changes?
jtgiri_ has joined #ruby
alv-r- has joined #ruby
<banisterfiend>
llaskin: it might make things easier later on if you do figure out a way to get rid of the global
adeponte has quit [Remote host closed the connection]
interactionjaxsn has joined #ruby
zph has quit [Quit: Computer has gone to sleep.]
aganov has quit [Remote host closed the connection]
<banisterfiend>
MyClass.new(driver=$global)
evanx has quit [Quit: evanx]
angusiguess has joined #ruby
jonathanwallace2 has quit [Ping timeout: 252 seconds]
<banisterfiend>
lectrick: no
eneveu has joined #ruby
eneveu has left #ruby [#ruby]
ukd1 has quit [Quit: leaving]
<banisterfiend>
lectrick: it changes when a new scope is created, a few things define a new scope, class definitions, method definitions, etc
<apeiros_>
lectrick: no, local changes when something introduces a new lexical scope
<apeiros_>
lectrick: e.g. `class X`, `module X`, `def foo`
arya has joined #ruby
<apeiros_>
also every file defines a local scope (toplevel)
ddd has joined #ruby
etcetera has quit []
alex__c2022 has joined #ruby
<apeiros_>
and one speciality of blocks & procs is, that they can close over that scope, and preserve local variables
krawchyk_ has joined #ruby
tPl0ch has quit [Quit: Verlassend]
<workmad3>
banisterfiend: it's specifically the keywords 'class', 'module' and 'def' that create new scopes, afaik
<apeiros_>
lectrick: instance variables are the things that are attached to a `self` (since they belong to an object and self represents that object)
mikepack has joined #ruby
<workmad3>
banisterfiend: so you can create new classes with Class.new do; and the class definition is a closure, same with define_method and Module.new
beneggett has joined #ruby
<apeiros_>
workmad3, banisterfiend - don't forget files. so many people are confused when they define local variables in files, require them and those variables are undefined…
<workmad3>
apeiros_: good point :) I've never experienced that personally
huttan has quit [Quit: leaving]
stkowski has joined #ruby
<Hanmac>
letrick info: an object that is set to a instance does not know that it goes attached to one (and it does not know to which object it does get attached to)
<Hanmac>
workmad3 & apreiros_ do you guys think there should be a callback funktion for that?
huttan has joined #ruby
krawchyk has quit [Ping timeout: 240 seconds]
<workmad3>
Hanmac: not particularly
mockra has joined #ruby
__BigO__ has quit [Remote host closed the connection]
<banisterfiend>
i dont even know what "an object that is set to a instance does not know that it goes attached to one " means :)
<workmad3>
banisterfiend: I think he means @ivar = Object.new
<banisterfiend>
oh ok
<JonnieCache>
javascript sucks. i just wrote a function that returns a function that returns a function
<workmad3>
banisterfiend: and Object.new doesn't get informed that it's now stored in an ivar on self there :)
<banisterfiend>
you can hook stuff like that in objc
<JonnieCache>
several of those functions call themselves
<apeiros_>
Hanmac: no, I think not that that's necessary. Gut-feel tells me that that'd promote rather bad practices.
<banisterfiend>
ah
<JonnieCache>
goddamm
reinaldob has quit [Remote host closed the connection]
<workmad3>
apeiros_: that's what my gut says too :)
mahmoudimus has joined #ruby
io_syl has joined #ruby
<apeiros_>
JonnieCache: o0
BulleTime has quit [Ping timeout: 252 seconds]
<workmad3>
JonnieCache: stop writing shit javascript then :P
arya has quit [Ping timeout: 248 seconds]
__BigO__ has joined #ruby
BizarreCake has quit [Ping timeout: 276 seconds]
AlSquirrel has quit [Ping timeout: 264 seconds]
<lectrick>
apeiros_: OK so then is there a way to have a scoped value that is available and easily changeable everywhere, other than (for example) defining attr_accessor's on Object or using other such singleton-like methods?
<apeiros_>
JonnieCache: re your earlier "js changes this when calling functions" - you can use Function#apply and #call to set "this"
DatumDrop has quit [Remote host closed the connection]
phinfonet has joined #ruby
<JonnieCache>
hmmm yeah i probably could
jgrevich has joined #ruby
drago757 has joined #ruby
<apeiros_>
lectrick: global values should be stored in constants
<apeiros_>
lectrick: global values are a smell, though
<JonnieCache>
what i wrote isnt shit js though. its js best practice.
<apeiros_>
lectrick: information is generally a pass-down thing
rdark has quit [Quit: leaving]
<lectrick>
apeiros_: for example, if I could define classes as class SomeObject < some_dynamic_value, I could stub that out in tests and kill the coupling between SomeObject and whatever it "normally" inherits from, allowing me to unit test it in isolation
<workmad3>
JonnieCache: also there's the _this = this trick to keep access to the context inside a closure
<apeiros_>
JonnieCache: allow me to doubt that :-p
<apeiros_>
workmad3: I usually use self
rdark has joined #ruby
mockra has quit [Ping timeout: 244 seconds]
<workmad3>
apeiros_: I normally use => in coffeescript ;)
<JonnieCache>
its because im doing currying while also needing to avoid scope pitfalls
<workmad3>
apeiros_: which I know compiles down to _this = this :)
<apeiros_>
CS… still should write a bit of code with that
<JonnieCache>
but youre right i could probably do it better
sbear has joined #ruby
<lectrick>
apeiros_: agreed on information pass-down except where it applies to coupling and trying to reduce it to get the extremely fast tests I have been heartily lusting for lately
chrismhough has joined #ruby
berserkr has joined #ruby
<apeiros_>
lectrick: that's not needed for stubbing
AlSquire has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
<apeiros_>
ruby is easily powerful enough to stub/mock/test-spy without changing inheritance
<lectrick>
apeiros_: I don't like the idea of stubbing constants, that feels like a smell to me
<apeiros_>
you usually don't stub *variables*, you stub *objects*
<shevy>
hey you can change constants in ruby any time!
<shevy>
they are quite aptly named
<apeiros_>
I don't think it's even proper terminology to say "stub a variable".
banisterfiend has quit [Read error: Connection reset by peer]
baroquebobcat has joined #ruby
<lectrick>
no, you can't change class constants I don't think... let me try
namxam has quit [Remote host closed the connection]
banisterfiend has joined #ruby
<workmad3>
lectrick: sure you can
<apeiros_>
yes you can
<apeiros_>
just like that if you don't mind ruby complaining. const_remove + const_set if you mind.
asym has joined #ruby
namxam has joined #ruby
<lectrick>
apeiros_: for example if I have to load an ActiveRecord model, when I load it, the first line is "class SomeModel < ActiveRecord::Base". So now I have to load aaallll of ActiveRecord, possibly some of Rails, ActiveSupport, and any and all other codependencies. I could do "module ActiveRecord; class Base; end; end;" in my test before I require the model file,
<lectrick>
but that also seems ugly
krawchyk_ has quit [Remote host closed the connection]
<lectrick>
apeiros_: what if you const_remove a class that other classes already inherited from?
niklasb has quit [Ping timeout: 252 seconds]
<lectrick>
it just hangs around namelessly, never being garbage-collected? :)
krawchyk has joined #ruby
<workmad3>
lectrick: it clears out the constant, but the class stays around as the superclass
<workmad3>
lectrick: because it's still referenced :P
<lectrick>
right
<Hanmac>
lectrick same problem then for the instances
baphled has joined #ruby
bananastalktome has quit [Quit: bananastalktome]
<apeiros_>
lectrick: that's the difference between *objects* and *variables*
<apeiros_>
very important to understand that one
<apeiros_>
anyway, changing inheritance isn't how you normally stub/mock/spy
RagingDave has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<lectrick>
basically, what I want is a way to load a class which may depend on or inherit from other classes, without having it have to cascade-load those other dependencies, and without (ideally) having to open the depended-on classes myself (in order to define them- this is yet more coupling) or use const_remove and const_set (although... in the latter case... let me
<lectrick>
consider)
cevarief has quit [Ping timeout: 276 seconds]
<workmad3>
lectrick: those dependencies are part of the object you're testing
namxam has quit [Ping timeout: 276 seconds]
samphippen has joined #ruby
arya has joined #ruby
<lectrick>
workmad3: that's fine, but if you have to load all the dependencies of a class in order to test the class, it is no longer a unit test, it is an integration test
<workmad3>
lectrick: depends on the type of dependency
<workmad3>
lectrick: when you inherit, you're not merely depending on something, you are declaring that you *are* that thing
DatumDrop has joined #ruby
<workmad3>
lectrick: so it becomes part of the unit
<lectrick>
hmmm
<apeiros_>
lectrick: no
<apeiros_>
if you have that view, *everything* is an integration test.
<apeiros_>
because, d'uh, you test parts of ruby too
<lectrick>
ok so where do you draw the line, then?
<workmad3>
lectrick: if you want to avoid that, you need to break up your class into parts that need that inheritance and parts that don't, and split them into separate objects that collaborates
<workmad3>
*collaborate
<lectrick>
workmad3: such as modules
<workmad3>
lectrick: modules, or smaller, plain ruby objects
plotplanexe has quit [Remote host closed the connection]
<lectrick>
PORO, the unsung hero
angusiguess has quit [Ping timeout: 240 seconds]
dekroning has quit [Ping timeout: 255 seconds]
BizarreCake has joined #ruby
moshee has quit [Read error: Connection reset by peer]
<workmad3>
lectrick: it's also why I treat is as a good idea to relegate inheritance to something other than the first thing to use to pull in behaviour :)
axl__ has joined #ruby
moshee has joined #ruby
beiter has quit [Quit: beiter]
filipe_ has joined #ruby
cawaker has joined #ruby
phinfonet has quit [Ping timeout: 264 seconds]
<lectrick>
workmad3: i am thinking :) thanks.
<lectrick>
So are complex inheritance hierarchies also kind of a smell?
axl_ has quit [Ping timeout: 248 seconds]
Xeago_ has joined #ruby
Xeago is now known as Guest62646
axl__ is now known as axl_
Guest62646 has quit [Killed (brooks.freenode.net (Nickname regained by services))]
Xeago_ is now known as Xeago
<lectrick>
Or anything beyond a certain complexity
<workmad3>
yes, I'd treat complex hierarchies as a smell
maletor has joined #ruby
<workmad3>
I'd also treat a hierarchy where both parent and child are instantiated as a smell
Rizzle has joined #ruby
<lectrick>
interesting
kpshek has quit []
<lectrick>
i recently wrote a class like that :O
<apeiros_>
I think deep hierarchies in ruby are rather rare
filipe has quit [Ping timeout: 245 seconds]
<lectrick>
so instantianting both Hashes and HashesWithIndifferentAccess is smelly?
baphled has quit [Ping timeout: 256 seconds]
<lectrick>
I guess I don't follow on that one
<lectrick>
Or a currency class that inherits from Float?
_nitti_ has joined #ruby
<workmad3>
lectrick: I find either of those as dubious targets for inheritance anyway
hoelzro is now known as hoelzro|away
hck89 has joined #ruby
<whitequark>
lectrick: DO NOT EVER INHERIT CURRENCY FROM FLOAT.
<workmad3>
lectrick: I'd personally approach both as separate classes that hold internally a hash or a number
<lectrick>
whoa whoa it was only an idea off the top of my head whitequark , I've never actually written a currency class lol
<whitequark>
lectrick: Floating point, for example, cannot precisely represent a lot of numbers, like 0.1
<martinklepsch>
using MiniTest, is there a way to set some "global before" to clean the database etc?
<whitequark>
and it does not behave in arithmetics like you think it behaves
noxoc has quit [Quit: noxoc]
<workmad3>
whitequark: it behaves exactly as I think it behaves, unless it's a non-compliant implementation :P
<workmad3>
whitequark: because I think it behaves how the IEEE spec says it behaves ;)
<apeiros_>
lectrick: you should rephrase that as 'currencly class inheriting from bigdecimal'
beaky has joined #ruby
<lectrick>
I would avoid floats in general anyway, I like ints
<whitequark>
workmad3: note that I didn't say that to you ;)
<beaky>
hello
<workmad3>
whitequark: :)
<apeiros_>
"Never forget floating point sucks" - that title suggests that the author doesn't know the topic he's writing about…
<lectrick>
apeiros_: thank you! "currency class inheriting from BigDecimal"
<workmad3>
lectrick: still, I wouldn't inherit a currency class from *any* number class
<apeiros_>
did I really write "currencly"? wtflol
<lectrick>
oh jeez i linked to an aspx page. that's a 50 DKP minus!!
stayarrr has joined #ruby
marius has quit [Ping timeout: 264 seconds]
<workmad3>
lectrick: I'd write a currency class that held internally a value representing the currency amount, probably as an int of the smallest currency unit to consider
<whitequark>
apeiros_: well, you gotta write a catchy headline
_nitti has quit [Ping timeout: 255 seconds]
<lectrick>
floating point is a dirty hack. I read the IEEE spec... or tried to
<apeiros_>
whitequark: yes, it's difficult to do that without looking like an idiot :)
<Hanmac>
lectrick: (and workmad3 and apeiros_) i make an interesting list:
<Hanmac>
>> p (Object.constants - [:Config]).select{|c| Object.const_get(c).is_a?(Class) && !Object.const_get(c).respond_to?(:new)}
<apeiros_>
if you don't understand why Floats precision is limited, you'll fail using bigdecimal classes too
<whitequark>
lectrick: yeah
<workmad3>
floating points are a well engineered standard around the problem of representing a useful subset of the Real number system in finite amounts of space
<apeiros_>
lectrick: try 1/3 with a bigdecimal class, lets see how precise it gets…
koderde has quit [Quit: Leaving]
<lectrick>
whitequark: honestly, I made it through about 1/3 of it before I fell back on my primary design rule, "if it's too complex, it's ugly and there is probably a better way". For me that is ints. I am 99% certain that any algorithm that thinks it depends on floating point in order to work can be rewritten using ints
<gregor3005>
is the latest rails exploit fixed?
cantonic has quit [Read error: Connection reset by peer]
cantonic_ has joined #ruby
<workmad3>
they're also a pretty damn good application of error correcting codes
joeycarmello has joined #ruby
love_color_text has joined #ruby
<apeiros_>
lectrick: with numbers, the following rule applies better: for any complex problem there's a simple solution which is wrong
<whitequark>
lectrick: what workmad3 said about floats is true.
<whitequark>
the format itself is trivial
AlSquirrel has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<workmad3>
lectrick: I can prove you wrong with a pretty simple example
<apeiros_>
gregor3005: #rubyonrails, and the lastest I'm aware of has been for a while
<whitequark>
lectrick: the complexity mainly stems from the need have operations well-defined even in corner cases
<workmad3>
lectrick: drawing a circle using a radius and a centre :P
AlSquire has quit [Read error: Connection reset by peer]
huoxito has joined #ruby
sbear has quit [Ping timeout: 245 seconds]
<whitequark>
workmad3: btw, what's about floats and ECC? I've no idea
<gregor3005>
apeiros_: thx
xpen has quit [Remote host closed the connection]
jmeeuwen has quit [Ping timeout: 240 seconds]
<lectrick>
workmad3: you can represent all needed values as ints as long as they are all expanded out to the same precision, no?
<lectrick>
workmad3: for the circle drawing problem
<whitequark>
lectrick: one word: exponent
<lectrick>
whitequark: yeah, I understand why the complexity is there. it's still ugly. even if it's a good application of ECC :)
tjbiddle has joined #ruby
<lectrick>
whitequark: yes, the exponent of all the numbers used in question must be the same
AlSquire has quit [Read error: Connection reset by peer]
swex has quit [Ping timeout: 245 seconds]
gyre007 has quit [Remote host closed the connection]
<lectrick>
whitequark: OK so first of all, I was joking. Second of all, I not only have German ancestry (my parents drink beer with lunch and dinner), I was also in the USAF AND in a fraternity. I was very anti-drinking in high school but drinking has enabled some very good and interesting experiences for me (as well as any woman I am dating) so if you don't understand
<lectrick>
that then frankly I feel sorry for you because you've missed out on some good times.
jmeeuwen has joined #ruby
<workmad3>
hehe, defensive much? :P
thams has joined #ruby
ryanh has quit [Quit: Computer has gone to sleep.]
<lectrick>
Now, back to math. I was joking about alcohol killing brain cells (mostly). The amount of time since I learned this stuff is probably a factor (25 years is a long time), so stop being a douche by making me feel bad about not remembering the math and just state the facts, sir.
* Hanmac
dont drink alc or does smoke
jaequery has joined #ruby
<whitequark>
sigh
<apeiros_>
do I need popcorn?
<banisterfiend>
Hanmac: Yeah, you're a really boring guy
<whitequark>
oh right, #ruby.
<banisterfiend>
jk :D
<yxhuvud>
apeiros_: I need beer :(
<workmad3>
lectrick: I wasn't trying to make you feel bad
<Xeago>
I'd mind a beer
<lectrick>
All I asked was whether all algorithms that think they depend on real numbers can be rewritten with (very big) ints. A tiny loss of precision is allowed I guess, at a likely massive boost in speed.
<Xeago>
writing blog.xeago.nl/graduation/extended-abstract.html is awful
<workmad3>
lectrick: and no, I don't think that's the case
<Hanmac>
banistefriend why? because i have dreams or moments, where other need drugs for that? :D
<banisterfiend>
Xeago: write it in dutch then pay translators to put it into english
<Xeago>
banisterfiend: I write better in english
<Xeago>
and faster
bluenemo has quit [Remote host closed the connection]
<Xeago>
and most importantly, coherent
<workmad3>
lectrick: if you move to very big ints, you're looking at *much* slower operations
<Xeago>
lectrick: your statement is true for some subset of algorithms
<lectrick>
workmad3: You weren't. whitequark told me to "learn some math" and then says "isn't that a reason to justify not drinking". Sorry, he pushed both my "I am not wrong for liking alcohol" and "I am not wrong for forgetting math" buttons in a very short span of time lol
<Xeago>
rather large subset if you ask me
mockra has joined #ruby
<lectrick>
workmad3: big ints are slower than floating point math? If that is the case, I am surprised.
<workmad3>
lectrick: floating point is supported on chip
<beaky>
does ruby have something like the python range/xrange function?
<workmad3>
lectrick: big ints are implemented in software
<lectrick>
ok forget BigInt, how about a double precision integer, like a 64 bit int?
<Hanmac>
Xeago i like knoflook :P
<Xeago>
workmad3: there are chips that implement big ints, normal software doesn't use it tho
templaedhel has quit [Quit: Leaving...]
<JonnieCache>
lololololololololol
<workmad3>
Xeago: :)
<Xeago>
lectrick: I would hardly call int64 double precision
<JonnieCache>
it really is 5 o clock on friday isnt it
<Xeago>
Hanmac: knoflook makes you stink
<workmad3>
and yeah, 'double precision' refers to doubles, as in double-precision floating point
<banisterfiend>
beaky: in ruby Range is a built-in type: 1..20
<workmad3>
you're thinking of long integers
<beaky>
ah thanks
<Hanmac>
... translate.google is freaky .. i just open it and it knows that i want to translate form dutch into my language .. (without that i type something oO :D)
<beaky>
wow it looks so much neater
<lectrick>
:( argh. ok. longints. i'm sorry
<beaky>
like haskell
<lectrick>
workmad3: you're right re: double prec. my bad.
<apeiros_>
lectrick: the moment you use 2 64bit ints for a rational, you have already at least doubled the number of instructions needed
bradhe has joined #ruby
dqminh has quit [Ping timeout: 252 seconds]
<beaky>
what are some ruby pitfalls that newbies often fall into?
<lectrick>
apeiros_: doesn't it depend on the rational?
<apeiros_>
float most certainly is faster than that
<Hanmac>
beaky: 0 is true
<lectrick>
apeiros_: or does it simply have to do with the fact that floats are implemented in the cpu hardware?
phinfonet has joined #ruby
<Xeago>
lectrick: mostly yes
danshultz has joined #ruby
<beaky>
hah you probably saved me a wtf moment :D
<apeiros_>
lectrick: no, you have to perform all instructions against both, denominator and numerator
<Xeago>
lectrick: there are programs that calculate pi without floats
<workmad3>
beaky: pitfall? they come in here, see us arguing about using floats over ints, etc. and get scared away :)
<beaky>
heh
<lectrick>
Xeago: yeah, that's what I was thinking
<apeiros_>
lectrick: also adding two rationals means you need to normalize the denominator
alvaro_o has joined #ruby
<Xeago>
lectrick: those are used on lowend chips to calculate tangents etc
binaryplease has joined #ruby
<apeiros_>
so adding 2 rationals represented as 2 64bit ints each is most likely more expensive than a float addition
<lectrick>
apeiros_: ok what if you represent the rational as simply an approximation using a 64 bit integer to a given precision?
<Xeago>
where basically everything gets turned into an int with a lowbitcount decimal seperator counter
<lectrick>
("exponent", etc.)
<workmad3>
lectrick: what? you mean like a float? :P
<apeiros_>
lectrick: you're just reinventing float then
<apeiros_>
and somehow we get back to: if you don't understand why/how float is limited…
danneu has joined #ruby
Proshot has joined #ruby
AlSquire has joined #ruby
<Hanmac>
beaky: there is no i++ or i--
<lectrick>
workmad3: apeiros_ Because floats end up having to be ultimately represented as N bits anyway. Got it.
<workmad3>
lectrick: incidentally, the complexity in floats is almost entirely around making sure the approximation is understandable ;)
<banisterfiend>
beaky: if/end does not define a new scope
bradhe has quit [Ping timeout: 244 seconds]
<workmad3>
lectrick: a 32 bit float is simply 32 bits split up into mantissa, exponent and sign
haxrbyte has joined #ruby
cakehero has joined #ruby
<workmad3>
lectrick: and then rules around how they get added, subtracted, multipled, etc
<beaky>
ah
rakl has joined #ruby
adeponte has joined #ruby
<beaky>
those don't seem too wtf coming from python
<workmad3>
beaky: coming from python eh?
<lectrick>
workmad3: Yeah I was just wondering if that "complexity" translated to "increased computation time" and was wondering if just sticking to an int representation would be computed quicker.
peregrin_ is now known as peregrine81
generalissimo has quit [Remote host closed the connection]
rakl has quit [Max SendQ exceeded]
<workmad3>
beaky: then here's your wtf - lambdas are useful :)
fabionl has joined #ruby
AlSquirrel has joined #ruby
<banisterfiend>
beaky: our lambdas let you change the value of a closed over variable
<beaky>
lambdas are awesome
Zolo has quit [Remote host closed the connection]
AlSquire has quit [Read error: Connection reset by peer]
<whitequark>
lectrick: modern CPUs can operate with floats very quickly
<whitequark>
even better, most of them can do floating-point SIMD
<whitequark>
whereas only few have integer SIMD ATM
Zolo has joined #ruby
<whitequark>
and it's generally more restricted
<Hanmac>
beaky: i have an german list there: wiki.ruby-portal.de/Pitfalls
<whitequark>
lectrick: erm. if it has FP SIMD, then floats. If it has integer SIMD, then ints ;)
poikon has joined #ruby
<whitequark>
SIMD is just a lot of ALUs cobbled together
ddd has quit [Read error: Connection reset by peer]
dmiller has quit [Ping timeout: 255 seconds]
<workmad3>
single instruction, multiple data, isn't it?
binaryplease has quit [Read error: Connection reset by peer]
kenichi has joined #ruby
quest88 has quit [Quit: quest88]
<whitequark>
workmad3: yup
<banisterfiend>
yeah, usually operates on a 4 floats simultaneously
<banisterfiend>
which isn't a coincidence, since it's designed for multimedia
<banisterfiend>
and color values are RGBA
<apeiros_>
man, how did that work with bundle and package?
binaryplease has joined #ruby
<apeiros_>
`bundle package` on the dev machine and then `bundle --local` on the server?
a_a_g has joined #ruby
volte has joined #ruby
gyre007 has joined #ruby
<workmad3>
apeiros_: bundle pack --all on the dev, iirc
<lectrick>
ok, thanks for the tangent folks, didn't mean to flood #ruby with #math :)
Zolo has quit [Ping timeout: 245 seconds]
<workmad3>
apeiros_: that way you'll get git and path gems included in the pack
<apeiros_>
workmad3: just noticed
love_color_text has quit [Remote host closed the connection]
interactionjaxsn has quit [Ping timeout: 248 seconds]
volte_ has quit [Ping timeout: 245 seconds]
<apeiros_>
ah f*ck
<apeiros_>
must add a gem I only need on my "server" (really my private laptop without internet access and postgres instead of oracle…)
k610 has quit [Quit: Leaving]
rakl has joined #ruby
<workmad3>
heh
<apeiros_>
yeah, 5h of train driving
ddd has joined #ruby
<apeiros_>
I need some entertainment. is it sad that coding does that for me? :)
<workmad3>
you drive trains?
jtgiri_ has joined #ruby
<apeiros_>
I'm swiss. of course I do.
<apeiros_>
oh
<workmad3>
I'd hope when you drive the trains you weren't distracted :P
<apeiros_>
you mean… language fail
<JonnieCache>
apeiros_: i would say that youre incredibly lucky that your choice of entertainment activity happens to be so lucrative
<apeiros_>
5h of train riding
<apeiros_>
better?
<workmad3>
I'd kinda worry if my train driver was just sat there coding instead of driving the trains ;)
<workmad3>
apeiros_: yeah :D
<LiquidInsect>
workmad3: afraid he might make a wrong turn?
<apeiros_>
it's the same word in german :)
<apeiros_>
LiquidInsect: don't laugh, that's actually possible
<workmad3>
LiquidInsect: or not notice the signal and crash into another train
<LiquidInsect>
Kind of jealous actually, I ride a train for an hour every day and there's not enough room to use a computer usually...
ExxKA has joined #ruby
<Xeago>
LiquidInsect: 1.5-2hours, 1way. I tend to avoid traffic hours
sn0wb1rd has joined #ruby
<LiquidInsect>
maybe if I used ruboto and tried to code on my tablet. Masochistic.
<whitequark>
+1 on avoiding traffic hours
<workmad3>
I've seen commuter trains in the UK
<workmad3>
they're awful
<workmad3>
I have to put up with a bus for 1h each way when I work in the office
<Xeago>
LiquidInsect: even when stuffed, if I can get my laptop out before someone sits around me
<Xeago>
I am fine
danneu has quit [Quit: WeeChat 0.3.8]
goraxe has joined #ruby
<LiquidInsect>
BART, out in the bay area, is standing-room only even at 6:30 AM. I am actually tempted to start using ruboto now...
<workmad3>
but I get on before the real crowds get on at both ends, so I've never had a problem getting a seat (generally upstairs, where they don't allow standing, and so I don't get as crowded)
bradhe has joined #ruby
Xeago has quit [Remote host closed the connection]
tjbiddle has joined #ruby
axl__ has joined #ruby
dr_bob has left #ruby [#ruby]
<whitequark>
upstairs?
interactionjaxsn has joined #ruby
<workmad3>
whitequark: yeah, all the buses out to my house are double-deckers
quest88 has joined #ruby
<whitequark>
oh
dougireton has joined #ruby
<whitequark>
what country is it?
<workmad3>
UK
enebo has quit [Quit: enebo]
Spooner has joined #ruby
blaxter has joined #ruby
<workmad3>
manchester, where we have a lot of decent bus routes :)
quest88 has quit [Remote host closed the connection]
AlSquirikou has joined #ruby
AlSquirrel has quit [Write error: Connection reset by peer]
angusiguess has quit [Ping timeout: 255 seconds]
axl_ has quit [Ping timeout: 276 seconds]
axl__ is now known as axl_
<shevy>
.find vs. .select, .select is used more often or?
<whitequark>
shevy: they have different semantics
<whitequark>
or did you mean #select vs #detect?
Xorlogosh has joined #ruby
Zolo has joined #ruby
<whitequark>
errrr, #find vs #detect.
interact_ has quit [Ping timeout: 252 seconds]
<beaky>
what is the english meaning of japanese terms like heroku or nokogiri?
danneu has joined #ruby
<danneu>
join lodestonesocial
adas has joined #ruby
danneu has left #ruby [#ruby]
Goles has quit [Remote host closed the connection]
zeade has joined #ruby
Goles has joined #ruby
<shevy>
whitequark .find vs. .select, I found myself use .select a lot but barely ever .find
<LiquidInsect>
according to google, nokogiri = saw
tylersmith has joined #ruby
<beaky>
ah
<whitequark>
shevy: these are simply different methods
<beaky>
and i guess heroku is not really a term :(
bigkevmcd has quit [Read error: Connection reset by peer]
tjbiddle has quit [Quit: tjbiddle]
<LiquidInsect>
yeah, it's a portmenteau, looks like
<LiquidInsect>
portmanteau, that is
Takehiro has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
Goles has quit [Max SendQ exceeded]
<beaky>
hehe
havenn has joined #ruby
axl_ has quit [Quit: axl_]
<alv-r->
can someone explain to me why if I use "II" on a multiline statement it works well, but if I use "or" instead it doesn't (returns nil)? if I use a single line for the operation, both work fine. (Example: http://pastebin.com/WphXE8sS )
colonolGron has joined #ruby
<alv-r->
(assuming one of the statements will be true :P)
clooth has quit [Quit: clooth]
peregrine81 has quit [Quit: Computer sleeping.]
<apeiros_>
cya guys
apeiros_ has quit [Remote host closed the connection]
havenn has quit [Read error: No route to host]
hackerdude has joined #ruby
peregrine81 has joined #ruby
clooth has joined #ruby
bradhe has quit [Remote host closed the connection]
megha has quit [Ping timeout: 264 seconds]
filipe_ has quit [Read error: Connection reset by peer]
dekroning has joined #ruby
_carloslopes has quit [Remote host closed the connection]
bradhe has joined #ruby
catphish has quit [Quit: Leaving]
Goles has joined #ruby
tatsuya__ has quit [Remote host closed the connection]
breakingthings has quit []
<LiquidInsect>
alv-r-: you have to remember that and/or and &&/|| are not the same thing
jonathanwallace2 has joined #ruby
Astralum has joined #ruby
joofsh has quit [Remote host closed the connection]
<LiquidInsect>
and/or are better used to chaining things you want to have happen instead of logic: Something.create(args) or raise "couldn't create Something!"
<chrisbolton>
I'm trying to test whether a string has any alphanumeric characters. Is there an inherent Ruby method or should I jump straight to regex?
baphled has quit [Ping timeout: 256 seconds]
<LiquidInsect>
I'd go for a regex for that, but I might be missing something in the String class. Don't see anything that stands out to do what you want
<chrisbolton>
LiquidInsect: Same here.
phinfonet has quit [Read error: No route to host]
nwertman has joined #ruby
hackerdude has quit [Remote host closed the connection]
a_a_g1 has joined #ruby
havenn has joined #ruby
hackerdude has joined #ruby
<whitequark>
chrisbolton: regex
thomsch has joined #ruby
<whitequark>
it is the optimal solution for tasks like the one you have
<chrisbolton>
Thanks. I'm running with Regex.
dougireton has quit [Remote host closed the connection]
<chrisbolton>
Yeah after I asked the question I figured I've got a tool that's built to do exactly what I want might as well take the time and dink around with Rubular.
a_a_g has quit [Read error: Connection reset by peer]
a_a_g1 has quit [Client Quit]
c0rn has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
terrorpup has quit [Ping timeout: 252 seconds]
Vainoharhainen has quit [Quit: Leaving...]
<beaky>
how similar is ruby to smalltakl?
<beaky>
smalltalk*
<banisterfiend>
beaky: message-passing OO model
<havenn>
beaky: Smalltalk is Ruby's mother.
woolite64 has joined #ruby
bricker is now known as bricker`away
megha has joined #ruby
Xeago has joined #ruby
<lectrick>
And Smalltalk's baby daddy is Perl, Lisp, and possibly other men. I mean languages.
<beaky>
hah
<beaky>
no C influence? :D
ngoldman has joined #ruby
undersc0re97 has quit [Quit: "The destruction of balance constitutes leaping forward and such destruction is better than balance. Imbalance and headache are good things." - Mao]
<beaky>
apart from 'puts' and 'gets' >.<
<havenn>
beaky: I've heard folks say that Smalltalk finally became mainstream, we just call it Ruby. :P
<shevy>
hehe
<beaky>
ah
digifiv5e is now known as guyz
<beaky>
smalltalk was much more than just the language; it was this graphical ecosystem of objects messaging each other.
<shevy>
dunno, I feel that ruby is closest to perl
<shevy>
beaky well that would be cool... we shall do that for the RubyOS
ExxKA has quit [Quit: Leaving]
carloslopes has joined #ruby
bradhe has quit [Remote host closed the connection]
cpruitt has joined #ruby
<Hanmac>
beaky ruby is pythons evil twin sister :P
mmitchell has quit [Remote host closed the connection]
undersc0re97 has joined #ruby
terrorpup has joined #ruby
clocKwize has joined #ruby
philcrissman has joined #ruby
jduan1981 has joined #ruby
kevin_e has quit [Quit: Lost terminal]
pskosinski has quit [Ping timeout: 264 seconds]
enebo has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
DatumDrop has quit [Remote host closed the connection]
bean__ has quit [Quit: Computer has gone to sleep.]
banisterfiend has quit [Read error: Connection reset by peer]
rdark has quit [Quit: leaving]
banisterfiend has joined #ruby
aaronmcadam has joined #ruby
Goles_ has joined #ruby
jblack has joined #ruby
Goles has quit [Ping timeout: 252 seconds]
albakry has joined #ruby
kpshek has joined #ruby
answer_42 has joined #ruby
DatumDrop has joined #ruby
hadees has quit [Quit: hadees]
pskosinski has joined #ruby
relixx has quit [Read error: Connection reset by peer]
clocKwize has quit [Quit: clocKwize]
relixx has joined #ruby
banisterfiend has quit [Ping timeout: 264 seconds]
<alv-r->
LiquidInsect: thanks, sorry for taking long to reply
nat2610 has quit [Quit: Leaving.]
peregrine81 has quit [Quit: Computer sleeping.]
nat2610 has joined #ruby
<alv-r->
but still, if "or" is more suited to chain things, it would be more suitable in my example, wouldn't it? still it doesn't work if I use it multiline
mercwithamouth has joined #ruby
peregrine81 has joined #ruby
aherron has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
bcuz has joined #ruby
tjbiddle has joined #ruby
<aherron>
is there any reason that executing a rake task through the command line would create a file (sqlite3), but using Rake::Task[:name].execute would not?
ddd has quit [Quit: Leaving.]
Banistergalaxy has quit [Ping timeout: 264 seconds]
punkrawkR^Home has joined #ruby
chrismhough has quit [Quit: chrismhough]
namxam has joined #ruby
slainer68 has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
relixx_ has joined #ruby
browndawg has quit [Ping timeout: 244 seconds]
Takehiro has quit [Remote host closed the connection]
sepp2k1 has joined #ruby
dougireton has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
razibog has quit [Ping timeout: 245 seconds]
Takehiro has joined #ruby
sepp2k has quit [Ping timeout: 248 seconds]
grzywacz has joined #ruby
cobragoat has joined #ruby
relixx has quit [Ping timeout: 245 seconds]
relixx_ is now known as relixx
dougireton has quit [Client Quit]
bradhe has quit [Remote host closed the connection]
blaxter has quit [Quit: KTHXBYE]
angusiguess has joined #ruby
banisterfiend has joined #ruby
bradhe has joined #ruby
dougireton has joined #ruby
bradhe has quit [Remote host closed the connection]
solitude88 has joined #ruby
Takehiro has quit [Ping timeout: 264 seconds]
Na_Klar has quit [Quit: ChatZilla 0.9.87 [Firefox 17.0.1/20121129164337]]
jrist is now known as jrist-afk
<Xeago>
what is the proper casing of NOSQL? NoSQL? NoSql?
etcetera has joined #ruby
undersc0re97 has quit [Ping timeout: 252 seconds]
ChampS666 has quit [Ping timeout: 255 seconds]
undersc0re97 has joined #ruby
<Xeago>
aherron: the working directory might be different
<Xeago>
and not have write access
vlad_starkov has quit [Remote host closed the connection]
bcuz has quit [Quit: Page closed]
<havenn>
Xeago: NoSQL
chrismhough has joined #ruby
<Xeago>
havenn: reasoning?
dougireton has quit [Quit: Leaving.]
Xeago has quit [Remote host closed the connection]
shevy has quit [Read error: Operation timed out]
jimeh has quit [Quit: Computer has gone to sleep.]
<havenn>
Like PostgreSQL. No is the word "no", so capitalized. SQL is an initialism so upcase.
terrorpup has quit [Ping timeout: 256 seconds]
dougireton has joined #ruby
Neomex has joined #ruby
<havenn>
SQL (Structured Query Language) is an initialism. SeQueL is an abbreviation. Guess it depends how far back you want to look. >.>
Nisstyre has quit [Ping timeout: 255 seconds]
dougireton has quit [Client Quit]
<banisterfiend>
havenn: what's the diff b/w initialism and acronym?
recycle has joined #ruby
<havenn>
banisterfiend: oh, oops, i meant acronym
ChampS666 has joined #ruby
<workmad3>
havenn: bah, SQL should be pronounced SQuirreL
vlad_starkov has joined #ruby
<workmad3>
havenn: so you write squirrel code, and run it against your squirrel database :P
bcuz has joined #ruby
<havenn>
banisterfiend: initialism is pronounced as letters and acronym is spoken (es-que-el versus sequel)
braoru has joined #ruby
<havenn>
**ess-cue-el
<workmad3>
havenn: yeah, I was going to ask you that... isn't an initialism an abbreviation
beiter has joined #ruby
<workmad3>
havenn: and your second definition was an acronym, which is also an abbreviation :)
<havenn>
workmad3: i haven't had my coffee, so i'm mostly speaking gibberish i'm afraid >.>
<workmad3>
:D
* workmad3
got caught out recently by thinking acronyms shouldn't be pronouncable
recycle has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 246 seconds]
jonathanwallace2 has quit [Ping timeout: 245 seconds]
dougireton has joined #ruby
heftig has joined #ruby
browndawg has joined #ruby
recycle has joined #ruby
nkr has joined #ruby
bricker`work is now known as bricker
hybris has quit [Quit: Leaving]
apok has joined #ruby
axl_ has quit [Quit: axl_]
<beaky>
what is the ifference between ruby blocks and lambdas?
Appineer has joined #ruby
namxam has quit [Remote host closed the connection]
shevy has joined #ruby
<banisterfiend>
beaky: blocks are a special-case, they're an especially light-weight lambda syntax when passing to a method
cobragoat has quit [Remote host closed the connection]
Nisstyre has joined #ruby
punkrawkR has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
terrorpup has joined #ruby
binaryplease has quit [Quit: WeeChat 0.4.0]
Appineer has left #ruby [#ruby]
nat2610 has quit [Quit: Leaving.]
Xeago has joined #ruby
browndawg has quit [Ping timeout: 276 seconds]
nat2610 has joined #ruby
<Hanmac>
beaky even ruby says that everything is an object, blocks itself are none, but can be encapsuled into one with proc or lamba
punkrawkR has joined #ruby
nat2610 has quit [Client Quit]
snearch has joined #ruby
punkrawkR^Home has quit [Ping timeout: 255 seconds]
<whitequark>
Hanmac: not that it is particularly correct
punkrawkR has quit [Ping timeout: 252 seconds]
<whitequark>
the fact that blocks aren't objects isn't any more true than the fact that while loops aren't objects
samphippen has joined #ruby
<whitequark>
on the other hand, the fact that blocks aren't internally Procs in MRI is an implementation detail of MRI
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
dhruvasagar has joined #ruby
pu22l3r has joined #ruby
cnrk has joined #ruby
<Hanmac>
whitequark when you do def f; yield 3;end f {|i| p i} the block is not an object, when you do def f(&block);block.call(3);end f {|i| p i} the block is turned into an object
bcuz has quit [Quit: Page closed]
BizarreCake has quit [Remote host closed the connection]
<whitequark>
Hanmac: that is an implementation detail of MRI.
chussenot has quit [Ping timeout: 256 seconds]
pu22l3r has quit [Remote host closed the connection]
<whitequark>
nothing in Ruby requires a block not to be an object, or allows you to observe the difference from inside Ruby
jonathanwallace2 has joined #ruby
mrsolo has joined #ruby
pu22l3r has joined #ruby
dougireton has quit [Quit: Leaving.]
<whitequark>
in particular, my implementation does represent all blocks as objects.
d2dchat has joined #ruby
Neomex has quit [Quit: Neomex]
<jokke>
hi guys, i'm desperate for help.. I have to write a cache simulator in ruby. Or i chose to write it in ruby. In four hour's it's gotta be ready. I wrote the program already, but it gives me wrong hit rates. My tutor had a look at it and said it would "look" right, but he doesn't really know ruby.
<jokke>
canton7: do you understand the task in general?
brianpWins has joined #ruby
<canton7>
jokke, I learnt about those sorts of caches some years ago. I don't have the time now to remember, and work out what you're trying to do i'm afraid
<benlieb>
I'm porting a rails app from 3.0 / 1.8.7 to 3.1 / 1.9.2. I haven't changed the rails version yet, just the ruby version. All my tests are passing except one, in which I get this error: OpenSSL::SSL::SSLError: SSL_connect, but the test passes under 1.8.7. Any suggestions on what might be happening?
<jokke>
canton7: i understand
hadees has joined #ruby
biello has quit [Remote host closed the connection]
havenn has quit [Remote host closed the connection]
Morkel_ has joined #ruby
faisal_khan has joined #ruby
mmitchell has joined #ruby
<benlieb>
The the error happens on this line: response = http.post(url.path, data)
<benlieb>
Is there a difference between http.post in 1.8.7 and 1.9.2
heyitsdave has joined #ruby
Morkel has quit [Ping timeout: 240 seconds]
Morkel_ is now known as Morkel
nat2610 has joined #ruby
Goles has joined #ruby
ebobby has joined #ruby
dougireton has quit [Quit: Leaving.]
bricker_ has joined #ruby
motto has joined #ruby
benlieb_ has joined #ruby
sjkaliski has joined #ruby
jerius_ has joined #ruby
huttan_ has joined #ruby
relixx_ has joined #ruby
Morkel_ has joined #ruby
<whitequark>
jokke: you're fairly unlikely to find much people, if any, with in-depth cache knowledge here
bricker`1way has joined #ruby
arietis has joined #ruby
nwertman has quit [Read error: Connection reset by peer]
hybris has joined #ruby
blacktul_ has joined #ruby
io_syl has quit [Ping timeout: 240 seconds]
Goles_ has quit [Ping timeout: 276 seconds]
alanp_ has joined #ruby
<RubyPanther>
faisal_khan: don't PM people. No need to apologize because I put your IP on ignore and won't hear you.
djdarkbeat__ has joined #ruby
binaryplease has quit [Quit: WeeChat 0.4.0]
swex has joined #ruby
<lectrick>
I need a job where they pay me to try crazy ruby shit all day
nomenkun has joined #ruby
volte_ has joined #ruby
krawchyk has quit [Remote host closed the connection]
<RubyPanther>
lectrick: one word, "residuals"
dougireton has joined #ruby
graft__ has joined #ruby
sanukcm has quit [Quit: Leaving]
faisal_khan has left #ruby [#ruby]
ner0x has quit [Quit: Leaving]
ben225 has joined #ruby
jblack_ has joined #ruby
io_syl has joined #ruby
Banistergalaxy has quit [Ping timeout: 264 seconds]
TheFuzzb_ has joined #ruby
icole has joined #ruby
nwertman has joined #ruby
whowantstolivef1 has joined #ruby
nat2610 has quit [Ping timeout: 276 seconds]
swex has quit [Read error: Connection reset by peer]
banister_ has joined #ruby
<RubyPanther>
benlieb: most of the times when you have an error talking about SSL when you did some http method it means your SSL lib didn't compile correctly, but actually you didn't include the full error so that was my one dart at the board :)
DatumDrop has quit [Remote host closed the connection]
wmoxam has joined #ruby
techlife has joined #ruby
Spillrag has joined #ruby
dougireton has quit [Quit: Leaving.]
maletor has quit [Quit: Computer has gone to sleep.]
faisal_khan has joined #ruby
kpshek has quit []
arturaz has joined #ruby
<benlieb>
RubyPanther: in case you care, I had to add this in ruby 1.9.2: http.verify_mode = OpenSSL::SSL::VERIFY_NONE
thomsch_ has joined #ruby
nateberkopec has joined #ruby
alv-r- has quit [Quit: Konversation terminated!]
kpshek has joined #ruby
kpshek has quit [Client Quit]
kidoz has joined #ruby
faisal_khan has left #ruby [#ruby]
aaronmacy has joined #ruby
thomsch has quit [Ping timeout: 252 seconds]
kpshek has joined #ruby
zph has joined #ruby
timonv_ has joined #ruby
kpshek has quit [Client Quit]
relixx has quit [Quit: relixx]
timonv has quit [Read error: Connection reset by peer]
thomsch_ has quit [Ping timeout: 255 seconds]
m3pow has joined #ruby
jtharris has quit [Quit: WeeChat 0.3.9.2]
alexim has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
cableray has joined #ruby
braoru has quit [Ping timeout: 245 seconds]
carloslopes has quit [Remote host closed the connection]
sayan has quit [Ping timeout: 264 seconds]
jaequery has quit [Quit: Computer has gone to sleep.]
<shevy>
RubyPanther let's have sex
<shevy>
benlieb you got openssl + ruby to work?
<shevy>
I am still trying to find out how to enable a ruby irc bot with openssl enabled...
thomsch has joined #ruby
squidBits has joined #ruby
etcetera has quit []
nat2610 has quit [Quit: Leaving.]
iamjarvo1 has quit [Quit: Leaving.]
kpshek has joined #ruby
Goles has quit [Ping timeout: 252 seconds]
<libryder>
how do you go from propositioning sex to openssl?
etcetera has joined #ruby
undersc0re97 has quit [Quit: "The destruction of balance constitutes leaping forward and such destruction is better than balance. Imbalance and headache are good things." - Mao]
<whitequark>
libryder: I believe that went other way around
dougireton has joined #ruby
rupee has joined #ruby
Goles has quit [Max SendQ exceeded]
Zolo has quit [Remote host closed the connection]
<RubyPanther>
shevy: is the bot in question open source?
Goles has joined #ruby
nimred has quit [Quit: leaving]
sailias has quit [Quit: Leaving.]
BulleTime has joined #ruby
jaequery has joined #ruby
DatumDrop has joined #ruby
<shevy>
RubyPanther well it is actually only one .rb file so far ... I somehow broke my old bot, tried to make a new one, failed at that, lost fun, started again with a minimal bot-like code... here is the incomplete code so far http://pastie.org/5861396 - notice that at line 72, if @use_openssl, I commented out the openssl stuff... I never got it working yet :(
<shevy>
libryder a mix of male programmer. male -> interested in sex, programmer -> interested in code. it's logical!
<RubyPanther>
poor little bot
<shevy>
I blame it all on ruby's awful documentation
failshell has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
<shevy>
or rather
<shevy>
the documentation of ruby code that is not often used
sambio has quit [Ping timeout: 276 seconds]
<shevy>
documentation of array hash string etc... is ok
bradhe has joined #ruby
jaequery has quit [Client Quit]
undersc0re97 has joined #ruby
uris has quit [Ping timeout: 264 seconds]
robotmay has quit [Remote host closed the connection]
rovalent has joined #ruby
osaut has quit [Quit: osaut]
alanp_ is now known as alanp
dougireton has quit [Quit: Leaving.]
cnrk has quit [Ping timeout: 245 seconds]
kirun_ has joined #ruby
sepp2k1 has quit [Remote host closed the connection]
<shevy>
RubyPanther aha interesting, will try that, thanks
answer_42 has quit [Ping timeout: 276 seconds]
ryanf has joined #ruby
<jokke>
hi! i just realized, that when i do something like this: array = Array.new(10) and then array.fill Array.new(4) it fills the array with the same instance that comes out of Array.new(4)
<jokke>
how can i fill it with unique instances?
MattRB has quit [Quit: This computer has gone to sleep]
<jokke>
only with a loop?
<whitequark>
jokke: array.fill { Array.new(4) }
RORgasm has quit [Remote host closed the connection]
<mikeg>
ok. guess rackup was just to run it in the foreground. starting/stopping nginx is how you start/stop the app. makes perfect sense if you have no sense
<mikeg>
</rant>
martinklepsch has quit [Ping timeout: 276 seconds]
zph has quit [Quit: Computer has gone to sleep.]
jaygen has joined #ruby
reset has joined #ruby
<RubyPanther>
(or if you read the manual)
<ruzu>
does the nginx process own appserver processes?
<whitequark>
with passenger, yes
* whitequark
uses thin+proxy_pass
<jokke>
whitequark: thanks!
d2dchat has quit [Remote host closed the connection]
bricker_ is now known as bricker
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
miskander has joined #ruby
DaltonUS has joined #ruby
<beaky>
i love ruby
<Dann1>
hey guys
<Dann1>
if I have a method like
<shevy>
beaky ARE YOU USING IT
<Dann1>
def thing
<Dann1>
stuff
vlad_starkov has quit [Remote host closed the connection]
<Dann1>
end
<beaky>
i am
gnarmis has joined #ruby
<shevy>
Dann1 that is a good method
<beaky>
for writing a simple web application
<shevy>
you did well there
<Dann1>
what is the easy way to make it on a one line
clooth has quit [Quit: clooth]
<whitequark>
Dann1: ;
<Spooner>
Dann1, def thing; stuff end
<Dann1>
def thing; something; end?
<whitequark>
but that is not good style
<shevy>
you could also use this:
clooth has joined #ruby
<shevy>
define_method(:thing) { stuff }
dr_neek has quit [Quit: dr_neek]
<shevy>
but please don't do that
<shevy>
every time someone uses define_method, someone else has to slay one kitten
dougireton has joined #ruby
<Dann1>
Well
<Dann1>
Uhm
* beaky
slays a kitten
<shevy>
:(
F1skr has quit [Quit: WeeChat 0.4.0]
<Dann1>
I don't think I want to use Ruby anyomere then
bradhe has joined #ruby
<shevy>
I use def foo; puts 'hi'; end sometimes <--- on one line
aknagi has quit [Remote host closed the connection]
snearch has quit [Quit: Verlassend]
Xorlogosh has quit [Remote host closed the connection]
<atmosx>
I'd never do that. Looks so ugly to me eyes
<shevy>
atmosx quite fine I think, a bit stressed. having to read lots of shit, actually I am considering shutting off IRC for a while, problem is ... would I come back when I do? hmmm
<shevy>
Dann1 always get a clear picture in your mind of what you want to do, eventually the ruby code you will need to achieve it comes into existances on its own
* Dann1
rushes into his mancave and takes a note
emocakes has quit [Quit: emocakes]
<breakingthings>
dominikh: though I'm not sure I understand the why behind those changes…
<Dann1>
Can I define to variables to the same value with d
chrisbolton has quit [Quit: chrisbolton]
<dominikh>
breakingthings: to be honest: that commit is 2 years old, I didn't write it, I just checked at the time that it made sense. Right now I am as clueless as you why it's in there. All I know is that it handles read timeouts properly :P
<breakingthings>
(Not that I uh, disagree, just that I don't understand because of lack of experience)
<Dann1>
vr1 & vr2 = 'value'
<breakingthings>
hmm
<breakingthings>
alright
<dominikh>
it did fix an issue with not detecting read timeouts
<dominikh>
but yeah, 2 years old etc
<breakingthings>
yeah
<havenn>
a = b = 0
<breakingthings>
thanks for letting me know though, that's pretty cool of you
<breakingthings>
:)
<Dann1>
Thanks havenn
<breakingthings>
And, y'know, the usual thanks for being open source so I can learn by example
<dominikh>
would've let you known earlier, but I didn't see the highlight till now
<breakingthings>
Ah, that's alright, I didn't even know you frequented this channel
<dominikh>
mostly passively :)
<dominikh>
for reasons like this :P
<breakingthings>
heh
<dominikh>
and you're welcome
dougireton has joined #ruby
thone_ has joined #ruby
<Dann1>
Mmm
ChampS666 has quit [Ping timeout: 252 seconds]
jaygen has quit [Remote host closed the connection]
<Dann1>
Is there any sort of constructor for the object class?
freakazoid0223 has quit [Quit: Leaving]
<Dann1>
Like the javascript constructor, maybe
__BigO__ has quit [Remote host closed the connection]
<dominikh>
Object.new ?
<dominikh>
what are you trying to do?
vlad_starkov has joined #ruby
geekbri has quit [Remote host closed the connection]
<puff>
Hey there... I've been working on this little android app that has a web server part. I cobbled together something super-crude out of php and was just looking at rewriting it as a real webapp, for which I was considering getting bogged down in a PHP framework... when I suddenly realized, this is good opportunity to learn ruby!
<puff>
(Since it's a fairly simple web app)
<Mon_Ouie>
You can't just add attributes to aribtrary objects, you need accessors defined in their class
<dominikh>
Dann1: you could use OpenStruct, but it'd be cleaner to have appropriate classes (even if they're just Structs [not OpenStructs])
<puff>
Can somebody recommend a good tutorial that's up to date and has a little bit more than a toy example? basically something like walking through creating a full blog or forum app.
ChampS666 has joined #ruby
GlenK has joined #ruby
dougireton has quit [Quit: Leaving.]
Anderson has quit [Read error: Connection reset by peer]
<puff>
ruzu: Yeah, well I guess I'll have to use gems, unless I want to develop with 1.8.
<puff>
speaking of which, is rails 3 in the mainstream now or is it bleeding edge?
__BigO__ has quit [Remote host closed the connection]
<puff>
(I have enough problems with my own bugs, I don't need to borrow other people's bugs).
workmad3 has quit [Ping timeout: 246 seconds]
<ruzu>
a couple years in internet time is ancient :p
<puff>
Hm, looks like I'll have to start by finding another tutorial about installnig rails.
<ruzu>
"gem install rails" generally works :P
AlSquirikou has joined #ruby
AlSquirrel has quit [Read error: Connection reset by peer]
_nitti has quit [Remote host closed the connection]
<ruzu>
although if you follow a tutorial from 2010 (presumably a 3.0 tutorial) it might be useful to use a Gemfile + bundler (ie bundle install & bundle exec) so that you can follow the tutorial without versioning hiccups
<puff>
hm, looks like ubuntu's got ruby 1.9.3p0, debian's latest is 1.9.2... although installing it appaers to default to 1.8..
carloslopes has quit [Ping timeout: 256 seconds]
kenneth has quit [Ping timeout: 244 seconds]
<puff>
Any major issues there?
mercwithamouth has quit [Ping timeout: 255 seconds]
cevarief has joined #ruby
<puff>
That is, are there any major known "no no, you MUST run rails 3 on 1.9 etc" problems?
<puff>
I vaguely recall rails 2.3 had some issue like that.
<ruzu>
don't think so
kenneth has joined #ruby
danshultz has joined #ruby
alex__c2022 has quit [Quit: alex__c2022]
forced_request has joined #ruby
_nitti has joined #ruby
etcetera has quit []
zph has joined #ruby
ortuna has joined #ruby
mengu has joined #ruby
kpshek has quit []
pavilionXP has joined #ruby
jerius has quit [Read error: Operation timed out]
djdarkbeat has quit [Quit: djdarkbeat]
froy has joined #ruby
kirun_ has quit [Ping timeout: 276 seconds]
dougireton1 has left #ruby [#ruby]
etcetera has joined #ruby
<X-Jester>
can anyone explain the purpose of gecode, and why it might be used by gems?