apeiros_ changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste >3 lines of text on gist.github.com || Rails is in #rubyonrails || Log: http://irclog.whitequark.org/ruby
binaryplease has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
<Gavilan> saneshark: http://pastebin.com/NmcdGLLN
wilmoore has joined #ruby
khakimov has joined #ruby
<Gavilan> application.currentGame().currentRound().dealerHand().first() ?
emmanuel has joined #ruby
<Gavilan> (I like creating tons of tiny objects/classes)
<emmanuel> Hello, how can I force free memory in ruby?
<davidcelis> malloc
<Gavilan> saneshark: There are very good (sometimes not very intuitive) reasons why it's a bad idea to do things like Dealer : User...
Cicloid has quit [Ping timeout: 264 seconds]
<saneshark> Wow, Gavilan, you rock dude… i see what you're doing, you're introducing interfaces, which makes sense since interfaces offer more flexibility than abstract classes
tchebb1 is now known as tchebb
Progster has joined #ruby
macmartine has quit [Quit: macmartine]
<Gavilan> saneshark: It's not about flexibility... It's about... You could have 3 users, and each could be dealer in one hand, while the other 2 play...
<Gavilan> If you do Dealer : User you are saying that a User is always a Dealer or Always a user... It's an absoulte truth, and the user can't stop being a Dealer and start being a Player...
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
ckrailo has quit [Quit: Computer has gone to sleep.]
<Gavilan> And that's false! and it's not actually related to what a Dealer is in reality... So that'll lead to situations that can happen in reality, and your model won't be able to handle....
digitalcakestudi has quit [Remote host closed the connection]
qwerxy has joined #ruby
digitalcakestudi has joined #ruby
<saneshark> Gavilan: Are you more of a java guy?
thomas has quit [Read error: Connection reset by peer]
ben_alman has quit [Excess Flood]
[Tyrant] has joined #ruby
QaDeS_ has joined #ruby
<saneshark> i ask this because as far as i know ruby doesn't really have a "interface" pattern
nari_ has quit [Ping timeout: 246 seconds]
<davidcelis> interfaces and abstract classes aren't really idiomatic ruby
<saneshark> i'll just have to create some general methods
<davidcelis> and there isn't really an interface pattern in ruby; you mix in modules
Cicloid has joined #ruby
<Gavilan> the thing is that a User might need to be a Player sometimes, and a Dealer other sometimes...
<Gavilan> Anyway, I don't really like User implementing Player...
flype has joined #ruby
<Gavilan> Another approach would be to create an abstract class Player and then class UserIsPlaying : Player.... UserIsDealing : Dealer....
<saneshark> Gavilan: i see your point, but for the sake of this exercise i'm content assuming that there is only 1 game, 1 dealer, multiple players
<Gavilan> UserIsPlaying or UserAsPlayer will know the User and will implement all the methods for Player with the help of an user object...
nai has joined #ruby
<Gavilan> saneshark: Sure! but that doesn't mean you can create a class for it :)
<saneshark> as such it seems fair to me for dealer < user and player < user, with the exception of that one stupid statement about user knowing what card dealer is showing
larissa has joined #ruby
nai has quit [Read error: Connection reset by peer]
banseljaj is now known as imami|afk
digitalcakestudi has quit [Client Quit]
QaDeS has quit [Ping timeout: 245 seconds]
ben_alman has joined #ruby
nai has joined #ruby
<saneshark> most of the logic for Dealer and User is identical
<saneshark> i mean Dealer and Player
<Gavilan> saneshark: the other thing about other model, is that you'll really catch the "essence" of dealer, in class dealer, of user in class user, etc...
<saneshark> in fact, Player is pretty much verbatim User… and Dealer has the added caveat that it has to stay on 17
<Gavilan> if you do another design, you'll probably start breaking separation of concerns, single responsibility principle, dry, and a lot of those principles... which are nice to follow....
tds has joined #ruby
<seanstickle> If a Rails app has more than 1 controller, split it into multiple Rails apps.
richo has joined #ruby
richo has quit [Changing host]
richo has joined #ruby
<seanstickle> Because Single Responsibility Principle
pk1001100011 has joined #ruby
<eph3meral> nah, split it in to multiple rack routes :P
<davidcelis> split each action into its own Sinatra app actually
<davidcelis> just eschew rails entirely
<saneshark> Gavilan: agree with your statement in most circumstances, and while i'm still leaning on that statement being an "oversight / typo" by the person who wrote up the read me… i'll probably mention some of these points in the comments of whatever approach i ultimately take
<richo> I'm looking to test a library that does a lot of interaction with subprocesses
<Gavilan> statement being an "oversight / typo" by the person? what statement?
<richo> specifically sending them a bunch of signals that can't be caught
<saneshark> As a User I can see what card the dealer is showing
<richo> should I just mock out all of the signal stuff and assert that it's attempting to send the right signals at the right times?
tds has quit [Client Quit]
<saneshark> i don't think they intended for that to be interpreted the way it is being interpreted by me
<richo> That feels a lot like testing it does what I think it should, not that it necessarily works
<Gavilan> saneshark: so? that does not mean that the object dealer should directly know the card object...
<Gavilan> saneshark: Test only describe functionality... Not how you need to implement things...
<saneshark> it does imply to me that dealer should have a method for showing the card, sure it does
<Gavilan> saneshark: Test don't imply any implementation over another one...
<saneshark> but the way it is written it almost seems to imply that dealers superclass should have this method as well
mxweas_ has quit [Ping timeout: 246 seconds]
<Gavilan> saneshark: that's the reason why most people sux at design...
<saneshark> i agree, but then why say "User should"
<saneshark> it might as well say "Dealer should"
<Gavilan> As a Person, I have a lot of banks accounts, and I want to deposit checks in them....
<Gavilan> and ppl end up doing person.depositCheck(person.bankAccounts().first())
werdnativ has quit [Quit: werdnativ]
<Gavilan> and person shouldn't know its banks account, neither how to deposit a check....
<saneshark> right, but those people are stupid
<Gavilan> saneshark: If whoever gave you the exercise thinks that, then he knows nothing about design nor tests....
carloslopes has quit [Quit: Leaving.]
<Gavilan> test describe what you want to be able to do, not how...
mxweas_ has joined #ruby
v0n has quit [Quit: Quitte]
davidcelis has quit [Ping timeout: 250 seconds]
fbernier has joined #ruby
<saneshark> so in Ruby, usually class first letter of class names are capitalized… User = class, Player = class, Dealer = class…. and the rest of the statements would seem to indicate that Player should inherit from User, Dealer should inherit from User (in the most simplest sense… this exercise isn't designed to take hours to implement and if you take a look at the prewritten code it's all just straight classes)… as such, that statement about User knowing a
<saneshark> method of Dealer is a little confusing, that's all
werdnativ has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
iocor has quit [Quit: Computer has gone to sleep.]
vladiim has quit [Quit: vladiim]
cbuxton has quit [Quit: Leaving.]
<saneshark> Gavilan: another approach, one similar to yours would be to declare Dealer and Player as modules… and mixing the appropriate module for a separate class of… So DealerInstance includes Dealer; includes User
<saneshark> i think that's probably the proper approach to take here
mxweas_ has quit [Ping timeout: 248 seconds]
<saneshark> in the absence of interfaces, I think this would be the "ruby way" of doing what you were proposing
fbernier has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
perryh_away is now known as perryh
pu22l3r has joined #ruby
avandenhoven has quit [Ping timeout: 245 seconds]
vladiim has joined #ruby
saneshark has quit [Quit: saneshark]
perryh is now known as perry
liluo has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
<unixabg> why does #ruby-lang say: #ruby-lang Cannot send to channel ?
<richo> probably not registered nick
<unixabg> richo: thanks
freeayu has joined #ruby
ePirat_ has joined #ruby
tchebb1 has joined #ruby
aantix_ has joined #ruby
Ontolog has quit [Remote host closed the connection]
ben225 has joined #ruby
unixabg has quit [Quit: leaving]
beneggett has quit [Ping timeout: 240 seconds]
ben225 is now known as beneggett
ePirat_ has quit [Remote host closed the connection]
ePirat_ has joined #ruby
austinbv1 has joined #ruby
tchebb has quit [Ping timeout: 246 seconds]
aantix_ has quit [Read error: Operation timed out]
ePirat_ has quit [Client Quit]
mengu has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 240 seconds]
aantix has quit [Ping timeout: 245 seconds]
Guest1779 is now known as graft
savage- has joined #ruby
adamkittelson has quit [Read error: Operation timed out]
macmartine has joined #ruby
mxweas_ has joined #ruby
ephemerian has quit [Quit: Leaving.]
headius has quit [Quit: headius]
bwlang_ has joined #ruby
bolowni has quit [Quit: bolowni]
bwlang has quit [Ping timeout: 244 seconds]
bwlang_ is now known as bwlang
dkissell_ has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.8]
beneggett has quit [Ping timeout: 250 seconds]
dkissell has quit [Ping timeout: 252 seconds]
dkissell_ is now known as dkissell
apok has quit [Quit: apok]
beneggett has joined #ruby
bolowni has joined #ruby
unixabg has joined #ruby
seanstickle has quit [Quit: Nihil sub sole novum]
apok has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
mnaser has quit [Ping timeout: 255 seconds]
dbgster has quit [Quit: dbgster]
apok has quit [Client Quit]
hunglin has joined #ruby
hunglin has quit [Read error: Connection reset by peer]
hunglin1 has joined #ruby
mnaser has joined #ruby
kpshek has joined #ruby
vladiim has quit [Quit: vladiim]
austinbv1 has quit [Ping timeout: 265 seconds]
mxweas_ has quit [Ping timeout: 246 seconds]
cirwin has quit [Read error: Operation timed out]
mxweas_ has joined #ruby
blankverse has joined #ruby
<blankverse> the same error for foreman start
<blankverse> is it an issue with my ruby install, I am clueless what changed in oneday
<blankverse> it was perfectly fine yesterday
<blankverse> the heart of the error seems to be this :
<blankverse> "/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- cgi/core (LoadError) "
kvirani has joined #ruby
liluo has joined #ruby
beneggett has quit [Ping timeout: 244 seconds]
kpshek has quit [Ping timeout: 250 seconds]
Aaton is now known as Aaton_off
savage- has quit [Remote host closed the connection]
mxweas_ has quit [Ping timeout: 264 seconds]
olrrai has quit [Remote host closed the connection]
quest88 has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
rakunHo has joined #ruby
banghouse is now known as banghouseAFK
mxweas_ has joined #ruby
gtuckerkellogg has joined #ruby
beneggett has joined #ruby
olrrai has joined #ruby
ePirat_ has joined #ruby
greendaviddude has joined #ruby
mxweas_ has quit [Ping timeout: 255 seconds]
manizzle has quit [Read error: No route to host]
azm has quit [Ping timeout: 246 seconds]
mxweas_ has joined #ruby
manizzle has joined #ruby
kenperkins has joined #ruby
chienpo has left #ruby [#ruby]
emmanuel has left #ruby [#ruby]
maletor has quit [Quit: Computer has gone to sleep.]
andrewhl has joined #ruby
minijupe has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
iori has joined #ruby
greendaviddude has quit [Ping timeout: 252 seconds]
blankverse has quit [Quit: Page closed]
Xethron has quit []
Tricks_ has joined #ruby
Tricks has quit [Read error: Connection reset by peer]
mxweas_ has quit [Quit: Computer has gone to sleep.]
randomautomator has quit [Remote host closed the connection]
Tricks_ has quit [Remote host closed the connection]
banghouseAFK is now known as banghouse
pu22l3r has quit [Read error: Connection reset by peer]
CheeToS has joined #ruby
rodasc has joined #ruby
AlbireoX`Mac has joined #ruby
wargasm1 has joined #ruby
JustinCa_ has joined #ruby
sonicpon1 has joined #ruby
williamcotton_ has joined #ruby
eregon_ has joined #ruby
pu22l3r has joined #ruby
ohcibi_ has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
Natch_z has joined #ruby
jameshyde has joined #ruby
My_Hearing has joined #ruby
luxurymode has joined #ruby
CoverSli1e has joined #ruby
bricker88 has quit [Quit: Leaving.]
brianpWins_ has joined #ruby
pygospa has quit [Disconnected by services]
stewart_2 has joined #ruby
TheRealPygo has joined #ruby
Bosma_ has joined #ruby
trend_ has joined #ruby
masterhumper has joined #ruby
unixabg_ has joined #ruby
kiela_ has joined #ruby
[Tyrant] has quit [Ping timeout: 264 seconds]
stewart_1 has quit [Ping timeout: 264 seconds]
SirFunk has quit [Ping timeout: 264 seconds]
Natch has quit [Ping timeout: 264 seconds]
williamcotton has quit [Ping timeout: 264 seconds]
Kwpolska has quit [Ping timeout: 264 seconds]
AlbireoX`Laptop has quit [Ping timeout: 264 seconds]
AndChat| has quit [Ping timeout: 264 seconds]
busybox42 has quit [Ping timeout: 264 seconds]
_andyl has quit [Ping timeout: 264 seconds]
CoverSlide has quit [Ping timeout: 264 seconds]
crodas has quit [Ping timeout: 264 seconds]
manizzle has quit [Ping timeout: 264 seconds]
williamcotton_ is now known as williamcotton
unixabg has quit [Ping timeout: 264 seconds]
trend has quit [Ping timeout: 264 seconds]
nyuszika7h has quit [Ping timeout: 264 seconds]
brianpWins has quit [Ping timeout: 264 seconds]
shevy has quit [Ping timeout: 264 seconds]
JustinCampbell has quit [Ping timeout: 264 seconds]
bier__ has quit [Ping timeout: 264 seconds]
kiela has quit [Ping timeout: 264 seconds]
blast_hardcheese has quit [Ping timeout: 264 seconds]
grauwoelfchen has quit [Ping timeout: 264 seconds]
beilabs_ has quit [Ping timeout: 264 seconds]
fowl has quit [Ping timeout: 264 seconds]
wargasm has quit [Ping timeout: 264 seconds]
MetaCosm has quit [Ping timeout: 264 seconds]
Mon_Ouie has quit [Ping timeout: 264 seconds]
sejo has quit [Ping timeout: 264 seconds]
Tasser has quit [Ping timeout: 264 seconds]
Bosma has quit [Ping timeout: 264 seconds]
preller has quit [Ping timeout: 264 seconds]
eregon has quit [Ping timeout: 264 seconds]
cespare has quit [Ping timeout: 264 seconds]
skryking has quit [Ping timeout: 264 seconds]
sonicpond has quit [Ping timeout: 264 seconds]
welterde has quit [Ping timeout: 264 seconds]
beilabs has quit [Ping timeout: 264 seconds]
ohcibi has quit [Ping timeout: 264 seconds]
Kwpolska has joined #ruby
Kwpolska has quit [Changing host]
Kwpolska has joined #ruby
brianpWins_ is now known as brianpWins
Natch_z is now known as Natch
rodasc is now known as crodas
trend_ is now known as trend
fowl has joined #ruby
fowl has quit [Changing host]
fowl has joined #ruby
Tricks has joined #ruby
grauwoelfchen has joined #ruby
manizzle_ has joined #ruby
_andyl has joined #ruby
beilabs has joined #ruby
cespare has joined #ruby
JustinCa_ has quit [Remote host closed the connection]
beilabs_ has joined #ruby
shevy has joined #ruby
MetaCosm has joined #ruby
Banistergalaxy has joined #ruby
preller has joined #ruby
bier__ has joined #ruby
busybox42 has joined #ruby
Goles has quit [Quit: Computer has gone to sleep.]
Targen has joined #ruby
wilmoore has quit [Remote host closed the connection]
Tasser has joined #ruby
SirFunk_ has joined #ruby
[Tyrant] has joined #ruby
nyuszika7h has joined #ruby
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
blast_hardcheese has joined #ruby
hemanth has joined #ruby
RainbowDashh has joined #ruby
L-----D has joined #ruby
QaDeS_ has quit [Quit: Ex-Chat]
welterde has joined #ruby
peregrine81 has quit [Quit: Goodbye.]
nari_ has joined #ruby
LBRapid has joined #ruby
ePirat_ has quit [Ping timeout: 265 seconds]
Hanmac1 has joined #ruby
ePirat_ has joined #ruby
ashenanigan has joined #ruby
Hanmac has quit [Ping timeout: 252 seconds]
tds has joined #ruby
<tds> if i extend an object twice with two distinct objects but they each define a method of the same name, what happens?
<tds> i did a quick test and it looks like they chain, but that seems weird…
<tds> my test consisted of extending twice and having one object's method (the one was extended second) call super
<tds> and it seems like it called the first's method
iori has quit [Read error: Connection reset by peer]
iori has joined #ruby
randomautomator has joined #ruby
fivetwentysix has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
vladiim has joined #ruby
randomautomator has quit [Remote host closed the connection]
radic_ is now known as radic
Cicloid has quit [Remote host closed the connection]
centipedefarmer has quit [Quit: Leaving]
bwlang has quit [Quit: bwlang]
kevinbond has joined #ruby
igotnolegs has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
chico_chicote has joined #ruby
bwlang has joined #ruby
ukd1 has joined #ruby
bwlang has quit [Client Quit]
ukd1 is now known as Guest72495
mxweas_ has joined #ruby
randomautomator has joined #ruby
ben_alman has quit [Excess Flood]
<tds> ah
<tds> looks like extend makes the singleton class of your object a descendant of whatever you extend it with
<tds> hence the chaining
<tds> very cool
noganex has quit [Ping timeout: 252 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
LBRapid has quit [Quit: Computer has gone to sleep.]
noganex has joined #ruby
ePirat_ has quit [Remote host closed the connection]
manizzle_ has quit [Quit: Leaving]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
mxweas_ has quit [Ping timeout: 245 seconds]
maletor has joined #ruby
Enekoos has quit [Quit: Saliendo]
mxweas_ has joined #ruby
Yarou has joined #ruby
Yarou has joined #ruby
banghouse is now known as banghouseAFK
ben_alman has joined #ruby
headius has joined #ruby
tds has quit [Quit: tds]
dankest has joined #ruby
ePirat- has quit [Ping timeout: 246 seconds]
adamkittelson has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
Guest94339 has joined #ruby
_N1X_ has joined #ruby
adamkittelson has quit [Remote host closed the connection]
nai has quit [Remote host closed the connection]
TheHunter_1039 has quit [Quit: TheHunter_1039]
Cicloid has joined #ruby
mxweas_ has quit [Ping timeout: 246 seconds]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
mohits has quit [Quit: Leaving]
Vert has quit [Ping timeout: 252 seconds]
avandenhoven has joined #ruby
mxweas_ has joined #ruby
beneggett has joined #ruby
avandenhoven has quit [Client Quit]
mlue has quit [Remote host closed the connection]
mlue has joined #ruby
Maniacal has quit [Read error: Operation timed out]
wilmoore has joined #ruby
Tricks has quit [Read error: Connection reset by peer]
beneggett has quit [Ping timeout: 246 seconds]
trend has quit [Read error: Connection reset by peer]
trend has joined #ruby
mxweas_ has quit [Ping timeout: 244 seconds]
LBRapid has joined #ruby
nai has joined #ruby
Liothen has quit [Remote host closed the connection]
wargasm1 has quit [Ping timeout: 252 seconds]
mxweas_ has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
Markvilla has quit [Quit: Markvilla]
williamcotton has quit [Quit: williamcotton]
RainbowDashh has quit [Excess Flood]
RainbowDashh has joined #ruby
nwest has quit [Quit: Computer has gone to sleep.]
Tricks has joined #ruby
vladiim has quit [Quit: vladiim]
fbernier has joined #ruby
Vert has joined #ruby
nai has quit [Ping timeout: 246 seconds]
Tricks has quit [Read error: No route to host]
Tricks has joined #ruby
mxweas_ has quit [Quit: Computer has gone to sleep.]
ipoval has joined #ruby
vladiim has joined #ruby
kvirani has quit [Remote host closed the connection]
Vert has quit [Read error: Connection reset by peer]
techhelp has joined #ruby
mnaser has joined #ruby
minijupe has quit [Quit: minijupe]
Spooner has quit [Quit: Miranda IM! Smaller, Faster, Easier. http://miranda-im.org]
nai has joined #ruby
SyntaxNode has quit []
techhelp has quit [Ping timeout: 246 seconds]
Guest72495 has quit [Ping timeout: 245 seconds]
khakimov has joined #ruby
mvangala_home has quit [Ping timeout: 240 seconds]
erichmenge has quit [Quit: erichmenge]
MarcWeber has joined #ruby
MarcWebe1 has quit [Ping timeout: 246 seconds]
mnaser has quit [Quit: Computer has gone to sleep.]
Tricks has quit [Read error: Connection reset by peer]
mockra has joined #ruby
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
ananthakumaran has joined #ruby
Rizzle has joined #ruby
ViperMaul has joined #ruby
brianpWins has quit [Quit: brianpWins]
invsblduck has quit [Ping timeout: 245 seconds]
Rizzle has quit [Ping timeout: 240 seconds]
jfoley has joined #ruby
luxurymode has left #ruby ["Textual IRC Client: http://www.textualapp.com/"]
randomautomator has quit [Remote host closed the connection]
CheeToS has quit [Ping timeout: 246 seconds]
techhelp has joined #ruby
saneshark has joined #ruby
saneshark has quit [Client Quit]
RainbowDashh has joined #ruby
ukd1 has joined #ruby
ukd1 is now known as Guest39514
t3hk0d3 has joined #ruby
waltz_ has joined #ruby
freeayu has quit [Quit: 离开]
sam113101 has quit [Quit: Leaving.]
RainbowDashh has quit [Client Quit]
sam113101 has joined #ruby
cintrikz has joined #ruby
liluo has quit [Read error: Connection reset by peer]
<t3hk0d3> Hello there
liluo has joined #ruby
<t3hk0d3> i've got question: is there way to override only specific module methods?
<t3hk0d3> Actually im messing with ActiveRecord
<t3hk0d3> and my goal is to override create/update methods
<t3hk0d3> if i just include my module as-is
<t3hk0d3> it would override later included modules too
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
shadoi has quit [Quit: Leaving.]
<t3hk0d3> probably i could include my module into persistence directly
<t3hk0d3> *persistence module
<t3hk0d3> but i have include/extend on-demand
<t3hk0d3> current code: https://gist.github.com/3015549
QKO_ has joined #ruby
ipoval_ has joined #ruby
vladiim has quit [Quit: vladiim]
t0mmyvyo has joined #ruby
tommyvyo has quit [Read error: Connection reset by peer]
t0mmyvyo is now known as tommyvyo
austinbv1 has joined #ruby
MissionCritical has quit [Ping timeout: 260 seconds]
ipoval has quit [Ping timeout: 244 seconds]
QKO has quit [Ping timeout: 244 seconds]
ipoval_ is now known as ipoval
manizzle has joined #ruby
LBRapid has quit [Ping timeout: 256 seconds]
beilabs has quit [Remote host closed the connection]
beilabs_ has quit [Remote host closed the connection]
minijupe has joined #ruby
LBRapid has joined #ruby
AlbireoX`Mac has quit [Remote host closed the connection]
RainbowDashh has joined #ruby
nai_ has joined #ruby
nai has quit [Ping timeout: 255 seconds]
AlbireoX`Laptop has joined #ruby
nai_ has quit [Remote host closed the connection]
t3hk0d3|2 has joined #ruby
Guest39514 has quit [Ping timeout: 240 seconds]
Mission-Critical has joined #ruby
CheeToS has joined #ruby
t3hk0d3 has quit [Ping timeout: 246 seconds]
LBRapid has quit [Quit: Computer has gone to sleep.]
<richo> There's an rspec thing to basically raise not imeplemtned yet I think? Can't find it with google
chico_chicote has quit [Ping timeout: 246 seconds]
<richo> found it, pending()
ryanf has quit [Quit: leaving]
graspee has left #ruby [#ruby]
shadoi has joined #ruby
Mission-Critical is now known as MissionCritical
fbernier has quit [Ping timeout: 245 seconds]
PsiliPharm has joined #ruby
andromeda6 has joined #ruby
itnomad has quit [Quit: Leaving]
balki_ is now known as galki
galki is now known as balki
graspee has joined #ruby
Synthead has quit [Remote host closed the connection]
Synthead has joined #ruby
yannis has joined #ruby
PsiliPharm has quit [Ping timeout: 264 seconds]
fbernier has joined #ruby
<richo> https://gist.github.com/3015747 Is there any reason that would sometimes fail with "undefined local variable or method `mainloop' for Thing:Class" ?
[Tyrant] has quit [Ping timeout: 252 seconds]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
RainbowDashh has joined #ruby
minijupe has quit [Quit: minijupe]
[Tyrant] has joined #ruby
andromeda6 has left #ruby [#ruby]
nachtwandler has joined #ruby
CheeToS has quit [Ping timeout: 246 seconds]
macmartine has quit [Quit: macmartine]
<richo> defining mainloop on the class works but seems well.. awful and scary
graspee has quit [Quit: leaving]
macmartine has joined #ruby
frishi has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
DanBoy has joined #ruby
larissa has quit [Quit: Saindo]
macmartine has joined #ruby
L-----D has quit [Quit: Leaving]
AndChat| has joined #ruby
vladiim has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
skryking has joined #ruby
Banistergalaxy has quit [Ping timeout: 240 seconds]
macmartine has joined #ruby
macmartine has quit [Read error: Connection reset by peer]
umttumt has joined #ruby
macmartine has joined #ruby
minijupe has joined #ruby
Araxia has joined #ruby
minijupe has quit [Client Quit]
bolowni has quit [Quit: bolowni]
emmanuelux has quit [Ping timeout: 265 seconds]
jfoley has quit [Quit: jfoley]
mnaser has joined #ruby
subbyyy has quit [Quit: Leaving.]
subbyyy has joined #ruby
MissionCritical has quit [Ping timeout: 252 seconds]
TPFC-SYSTEM has joined #ruby
Araxia has quit [Read error: Connection reset by peer]
Araxia has joined #ruby
hunglin1 has quit [Quit: Leaving.]
Cicloid has quit [Remote host closed the connection]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
umttumt has quit [Remote host closed the connection]
RainbowDashh has joined #ruby
<Paradox> anyone familiar with god? How could i make it send me an email after it attempts to deal with a flap and fails?
fbernier has quit [Remote host closed the connection]
<Paradox> oh duh
<Paradox> c.notify
<Paradox> disregard me
davidcelis has joined #ruby
brianpWins has joined #ruby
Mission-Critical has joined #ruby
freeayu has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
joast has quit [Quit: Leaving.]
freeayu has quit [Client Quit]
voodoofish430 has quit [Quit: Leaving.]
bosphorus has quit [Remote host closed the connection]
davidcelis has quit [Client Quit]
davidcelis has joined #ruby
davidcelis has quit [Changing host]
davidcelis has joined #ruby
freeayu has joined #ruby
Goles has joined #ruby
hemanth_ has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
Mission-Critical is now known as MissionCritical
gtuckerkellogg has joined #ruby
booginga has joined #ruby
kevinbond has quit [Quit: kevinbond]
joast has joined #ruby
eph3meral has quit [Remote host closed the connection]
Tricks has joined #ruby
Chryson has quit [Quit: Leaving]
rakunHo has quit [Remote host closed the connection]
<t3hk0d3|2> anyone have tip how to make proper unit tests for ActiveRecord plugin?
<t3hk0d3|2> i mean mocking database connection, for example
beneggett has joined #ruby
yxhuvud has joined #ruby
Poapfel has quit [Quit: Need a new quit message? Why not Zoidberg?"]
Poapfel has joined #ruby
MissionCritical has quit [Ping timeout: 265 seconds]
andrew9184 has joined #ruby
<andrew9184> if i have "foo.bar.dude" how can i gsub it to replace only the second period so its "foo.bardude"
<davidcelis> second, or last?
tewecske has joined #ruby
<andrew9184> hmm, i only want one period in the string
<andrew9184> so i want to keep the first period only
pcboy_ has quit [Read error: Operation timed out]
pcboy_ has joined #ruby
wallerdev has quit [Quit: wallerdev]
DanBoy has quit [Remote host closed the connection]
tajima-junpei has joined #ruby
invsblduck has joined #ruby
tonini has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
tewecske has quit [Quit: Leaving.]
stewart_2 has left #ruby [#ruby]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
shadoi has quit [Read error: Connection reset by peer]
vladiim has quit [Quit: vladiim]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
nachtwandler has quit [Remote host closed the connection]
MissionCritical has joined #ruby
tchebb1 is now known as tchebb
<davidcelis> words = string.split('.'); first = word.shift; "#{first}.#{words.join('')}"
<davidcelis> that may be kinda dumb but it works, andrew9184
niku4i has joined #ruby
<davidcelis> if your string can have any number of periods
<andrew9184> hmmm
<andrew9184> can emails have two periods
<davidcelis> emails can have however many periods they want
<davidcelis> gmail, for instance, ignores periods
<davidcelis> david.celis@gmail.com == davidcelis@gmail.com
<andrew9184> ah i believe the same with facebook too.
<davidcelis> d.a.v.i.d.c.e.l.i.s@gmail.com
fivetwentysix has quit [Quit: fivetwentysix]
<davidcelis> etc.
<andrew9184> i'm trying to solve the problem of facebook omniauth returning a.b.3213213
booginga has quit [Quit: This computer has gone to sleep]
<andrew9184> so i think i might just do a.b + rand(100)
jduan1981 has joined #ruby
niku4i has quit [Ping timeout: 250 seconds]
timonv has joined #ruby
krusty_ar has quit [Ping timeout: 246 seconds]
Hanmac1 is now known as Hanmac
mockra has quit [Remote host closed the connection]
horrror has joined #ruby
horrror has quit [Client Quit]
vladiim has joined #ruby
mockra has joined #ruby
quest88 has quit [Quit: quest88]
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
techhelp has quit [Quit: This computer has gone to sleep]
mockra has quit [Ping timeout: 244 seconds]
xnm has quit [Quit: WeeChat 0.3.7]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
wvms has quit [Quit: wvms]
<richo> I have a mongoid document that I know has been updated. Can I call a method on it to ask it to update from the db?
<richo> or do I have to fetch the document iwth a matching id
banisterfiend has quit [Remote host closed the connection]
TheFuzzball has quit [Ping timeout: 250 seconds]
wvms has joined #ruby
ananthakumaran has joined #ruby
chson has quit [Ping timeout: 246 seconds]
TheFuzzball has joined #ruby
ryanf has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
ananthakumaran has joined #ruby
andrewhl has quit [Remote host closed the connection]
zx has joined #ruby
<TPFC-SYSTEM> richo: document.reload
<richo> thanks!
mockra has joined #ruby
mockra has quit [Remote host closed the connection]
<richo> just before I committed an awful hack too :)
ebanoid has joined #ruby
azm has quit [Ping timeout: 265 seconds]
banisterfiend has joined #ruby
bosphorus has joined #ruby
abstrusenick has joined #ruby
yonggu_ has quit [Remote host closed the connection]
yonggu has joined #ruby
TheFuzzball has quit [Ping timeout: 250 seconds]
AndChat| has quit [Ping timeout: 240 seconds]
wilmoore has quit [Remote host closed the connection]
TheFuzzball has joined #ruby
ph^ has joined #ruby
perry is now known as perryh_away
werdnativ has quit [Quit: werdnativ]
sepp2k has joined #ruby
L-----D has joined #ruby
timonv has quit [Remote host closed the connection]
nick_h has joined #ruby
dnyy has quit [Remote host closed the connection]
vladiim has quit [Quit: vladiim]
dankest has quit [Quit: Linkinus - http://linkinus.com]
perryh_away is now known as perryh
Targen has quit [Ping timeout: 245 seconds]
fantazo has quit [Remote host closed the connection]
piotr has joined #ruby
austinbv1 has quit [Ping timeout: 255 seconds]
Tricks has quit [Read error: Connection reset by peer]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
LongkerDandy has joined #ruby
macmartine has quit [Quit: macmartine]
liluo_ has joined #ruby
liluo has quit [Read error: Connection reset by peer]
L-----D has quit [Ping timeout: 252 seconds]
RainbowDashh has joined #ruby
dnyy has joined #ruby
manizzle has quit [Read error: No route to host]
brianpWins has quit [Quit: brianpWins]
perryh is now known as perryh_away
burgestrand1 has quit [Quit: Leaving.]
CheeToS has joined #ruby
banisterfiend has quit [Remote host closed the connection]
RainbowDashh has quit [Ping timeout: 246 seconds]
minijupe has joined #ruby
nari_ has quit [Ping timeout: 245 seconds]
ph^ has quit [Remote host closed the connection]
damagednoob has joined #ruby
ph^ has joined #ruby
manizzle has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
abstrusenick has joined #ruby
abstrusenick has quit [Client Quit]
TheFuzzball has quit [Ping timeout: 240 seconds]
abstrusenick has joined #ruby
ohcibi_ is now known as ohcibi
RainbowDashh has joined #ruby
zx has quit [Ping timeout: 246 seconds]
TheFuzzball has joined #ruby
bradhe has joined #ruby
ph^ has quit [Ping timeout: 244 seconds]
Banistergalaxy has joined #ruby
Occult_ has joined #ruby
Morkel has joined #ruby
manizzle has quit [Read error: Connection reset by peer]
Occult has quit [Ping timeout: 246 seconds]
jgrevich has quit [Quit: jgrevich]
Morkel has quit [Client Quit]
dhruvasagar has joined #ruby
Morkel has joined #ruby
BiHi has joined #ruby
nari_ has joined #ruby
gilead has quit [Remote host closed the connection]
jduan1981 has quit [Quit: jduan1981]
ghanima has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
igotnolegs has quit [Quit: Computer has gone to sleep.]
thomas has joined #ruby
damagednoob2 has joined #ruby
TheFuzzball has quit [Ping timeout: 255 seconds]
tau has joined #ruby
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
damagednoob has quit [Ping timeout: 265 seconds]
TheFuzzball has joined #ruby
Banistergalaxy has quit [Remote host closed the connection]
hoelzro|away is now known as hoelzro
Progster has joined #ruby
RainbowDashh has joined #ruby
zommi has joined #ruby
invsblduck has quit [Ping timeout: 264 seconds]
maesbn has joined #ruby
ryanf has quit [Quit: leaving]
workmad3 has joined #ruby
mohits has quit [Read error: Connection reset by peer]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
qwerxy has joined #ruby
schovi has joined #ruby
williamcotton has joined #ruby
ukd1 has joined #ruby
ipoval has quit [Quit: ipoval]
ukd1 is now known as Guest69889
wobr has joined #ruby
ephemerian has joined #ruby
Criztian has joined #ruby
freeayu has quit [Quit: 离开]
CheeToS has quit [Ping timeout: 248 seconds]
tajima-junpei has quit [Quit: さようなら]
thecreators has quit [Quit: thecreators]
ph^ has joined #ruby
jameshyde has quit [Remote host closed the connection]
Eldariof-ru has joined #ruby
abstrusenick has quit [Quit: abstrusenick]
jjp has quit [Ping timeout: 240 seconds]
jjp has joined #ruby
iocor has joined #ruby
federic has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
QaDeS has joined #ruby
prtksxna has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
binaryplease has joined #ruby
qwerxy has quit [Quit: offski]
ssspiff has joined #ruby
sspiff has quit [Ping timeout: 246 seconds]
IPGlider has joined #ruby
croz has joined #ruby
imami|afk is now known as banseljaj
Goles has quit [Quit: Computer has gone to sleep.]
jimeh has joined #ruby
oliwer has joined #ruby
akem has quit [Read error: Connection reset by peer]
akem has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
eurbach has joined #ruby
timonv has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
cintrikz has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby
bier__ has quit [Ping timeout: 244 seconds]
Synthead has quit [Ping timeout: 244 seconds]
wobr1 has joined #ruby
wobr has quit [Ping timeout: 246 seconds]
mucker has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
berserkr has quit [Quit: Leaving.]
ssspiff has quit [Ping timeout: 246 seconds]
bradhe has quit [Remote host closed the connection]
richo has quit [Quit: laterz, norbs.]
tau has quit [Quit: life is funny. if i had a small dick wouldn't like me. i have a big dick they just seem to hate me. maybe, the secret of life is being mediocre.]
ghanima has quit [Quit: Leaving.]
iocor has quit [Quit: Computer has gone to sleep.]
bier__ has joined #ruby
greyEAX has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
blacktulip has joined #ruby
kaspernj has joined #ruby
blumbri has quit [Ping timeout: 246 seconds]
<kaspernj> Is there a Ruby alternative to "Gnome Do"- and "Kupfer"-like apps?
berkes has joined #ruby
blumbri has joined #ruby
burgestrand has joined #ruby
Vendethiel has joined #ruby
mucker has quit [Ping timeout: 244 seconds]
cjk101010 has quit [Ping timeout: 252 seconds]
Guest69889 has quit [Ping timeout: 255 seconds]
greyEAX has joined #ruby
croz has quit [Quit: ircN 8.00 for mIRC (20100904) - www.ircN.org]
hemanth_ is now known as hemanth
<wobr1> Is there a way I can reverse the target of the === method in a case statement. E.g. case x; when y then blah; end. I want it to check x===(y) rather than y===(x) which is what it seems to do
fangwen has joined #ruby
fearoffish has joined #ruby
<fangwen> /join #python
<fangwen>
<arturaz> wobr1, case y; when x then
<arturaz> but that's just lame
<wobr1> arturaz: hmm, yes ok, but if there are many more cases it doesn't work
<arturaz> of course not. You can just use if x === y; elsif...
chill13j_ has joined #ruby
<wobr1> Yes, I think that's what I need to do. It doesn't really fit the case pattern because you are restricted to need support in case parameter for all possible match values.
minijupe has quit [Quit: minijupe]
<chill13j_> what are the best ruby tutorials
<chill13j_> i'm trying to learn
<chill13j_> i know python pretty well
blumbri has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
<chill13j_> so i know OOP and stuff but it's hard to find a fast solution to learn as much ruby as possible
<kalleth> first 6 words
<kalleth> tweeting
chill13j_ has quit [Client Quit]
tatsuya_o has joined #ruby
cjk101010 has joined #ruby
blumbri has joined #ruby
bashdy has joined #ruby
My_Hearing is now known as Mon_Ouie
iocor has joined #ruby
LongkerDandy has quit [Ping timeout: 252 seconds]
iori has quit [Remote host closed the connection]
iori has joined #ruby
iori has quit [Remote host closed the connection]
dnyy has quit [Remote host closed the connection]
<banisterfiend> Mon_Ouie: 'alut!
iori has joined #ruby
qwerxy has joined #ruby
AlbireoX`Laptop has quit [Remote host closed the connection]
greyEAX has quit [Read error: Connection reset by peer]
blacktulip has quit [Remote host closed the connection]
mayankkohaley has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
williamcotton has quit [Quit: williamcotton]
ph^ has quit [Ping timeout: 265 seconds]
Guest45792 has joined #ruby
fangwen has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
gregorg_taf has quit [Changing host]
gregorg_taf has joined #ruby
gregorg_taf is now known as gregorg
thisirs has joined #ruby
berserkr has joined #ruby
etehtsea has joined #ruby
mxweas_ has joined #ruby
tonini has quit [Remote host closed the connection]
djdb has joined #ruby
niklasb has joined #ruby
Criztian has quit [Remote host closed the connection]
plastics has joined #ruby
plastics has quit [Ping timeout: 246 seconds]
lkba has quit [Quit: Bye]
charliesome has joined #ruby
ramblex has joined #ruby
kartouch has quit [Quit: ZNC - http://znc.sourceforge.net]
kartouch has joined #ruby
bluOxigen has joined #ruby
RainbowDashh has quit [Quit: QUIT! Accident or on purpose? :3]
nopolitica has joined #ruby
nari_ has quit [Ping timeout: 248 seconds]
thisirs has quit [Remote host closed the connection]
croz has joined #ruby
mxweas_ has quit [Ping timeout: 255 seconds]
pipopopo has joined #ruby
banseljaj is now known as imami|afk
mxweas_ has joined #ruby
piotr_ has joined #ruby
piotr has quit [Ping timeout: 246 seconds]
fermion has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
flype has joined #ruby
nopolitica has quit [Quit: Lost terminal]
monkegjinni has joined #ruby
virunga has joined #ruby
Guest45792 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
RainbowDashh has joined #ruby
iori has quit [Remote host closed the connection]
wubino has joined #ruby
<wubino> are there any solid bash command line libraries for ruby?
<Paradox> wubino, optparse is built in
mxweas_ has quit [Ping timeout: 265 seconds]
djdb has joined #ruby
mxweas_ has joined #ruby
crankycoder has quit [Remote host closed the connection]
<wubino> is the flying lawnmower any indication of the experience using ruby for bash ops?
mengu has joined #ruby
<wubino> Paradox:
<bnagy> what do you mean by 'bash' ?
<bnagy> like, literally bash, or just commandline type tasks?
LongkerDandy has joined #ruby
olrrai has quit [Ping timeout: 246 seconds]
<Paradox> no
<Paradox> the lawnmower was for a different chan
<Paradox> im trying to wrap my head around ember.js
<Paradox> and everything seems sensible
<Paradox> but then it starts flying away and i'm just left there going 'wut'
mxweas_ has quit [Ping timeout: 264 seconds]
mxweas_ has joined #ruby
liluo_ has quit [Remote host closed the connection]
<wubino> bourne again shell: most common linux command line
<wubino> commmand line tasks
Spooner has joined #ruby
qwerxy has quit [Ping timeout: 244 seconds]
ELFIX is now known as Elfix
workmad3 has joined #ruby
niklasb has quit [Read error: Operation timed out]
TheRealPygo has quit [Quit: leaving]
Guest2026 has joined #ruby
<Guest2026> lista
pygospa has joined #ruby
<Guest2026> diamond mine
Guest2026 has left #ruby [#ruby]
seitensei has joined #ruby
nirakara has joined #ruby
BiHi has quit [Quit: Computer has gone to sleep]
kvirani has joined #ruby
mxweas_ has quit [Ping timeout: 255 seconds]
mohits has quit [Ping timeout: 246 seconds]
vlad_starkov has joined #ruby
_axx has quit [Quit: Changing server]
snearch has joined #ruby
mxweas_ has joined #ruby
execute has joined #ruby
schaary has joined #ruby
IPGlider has quit [Ping timeout: 245 seconds]
execute is now known as _axx
thecreators has joined #ruby
IPGlider has joined #ruby
schaary has left #ruby [#ruby]
thone has quit [Ping timeout: 244 seconds]
etehtsea has quit []
saschagehlich has joined #ruby
thone has joined #ruby
Hanmac has quit [Ping timeout: 244 seconds]
schaary has joined #ruby
schaary has left #ruby [#ruby]
mxweas_ has quit [Ping timeout: 265 seconds]
iocor has quit [Quit: Computer has gone to sleep.]
nirakara has quit [Ping timeout: 264 seconds]
arkiver has joined #ruby
niklasb has joined #ruby
qwerxy has joined #ruby
masterhumper is now known as sejo
dhruvasagar has quit [Ping timeout: 248 seconds]
S2kx has joined #ruby
pk1001100011 has joined #ruby
Vendethiel has quit [Quit: je ne suis plus là, tqvu]
S1kx has quit [Ping timeout: 265 seconds]
banisterfiend has quit [Read error: Connection reset by peer]
lxsameer has quit [Quit: Leaving]
banisterfiend has joined #ruby
ananthakumaran1 has joined #ruby
lkba has joined #ruby
fgwaegeawgfwa has joined #ruby
ananthakumaran has quit [Ping timeout: 244 seconds]
dr0p has joined #ruby
Gavilan has quit [Ping timeout: 265 seconds]
grauwoelfchen has left #ruby ["WeeChat 0.3.5"]
S2kx has quit [Quit: Leaving]
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
Xethron_ is now known as Xethron
eurbach has quit [Read error: Connection reset by peer]
eurbach has joined #ruby
kpshek has joined #ruby
jxpx777|afk has quit [Quit: Be back later]
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
Asher has quit [Quit: Leaving.]
nirakara has joined #ruby
geekbri has joined #ruby
andrewhl has joined #ruby
bambanx has joined #ruby
Asher has joined #ruby
bambanx has quit [Client Quit]
Morkel has quit [Quit: Morkel]
jstew has joined #ruby
LongkerDandy has quit [Quit: Leaving]
bashdy has quit [Quit: bashdy]
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
pu22l3r has quit [Remote host closed the connection]
tk___ has joined #ruby
pu22l3r has joined #ruby
rbanffy has joined #ruby
fgwaegeawgfwa has left #ruby [#ruby]
pu22l3r has quit [Ping timeout: 246 seconds]
ananthakumaran1 has quit [Quit: Leaving.]
CodeVision has joined #ruby
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
andrewhl has quit [Remote host closed the connection]
brendan` has joined #ruby
<dekroning> I want to make a factory class to create Orders... so I have a entity object called Orders, and just created a CreateOrder class, but I was wondering, if this is a factory what do I name the builders? CreateOrder.build(args) CreateOrder.create(args)
<dekroning> or am I totaly wrong in this way of doing it ?
<workmad3> dekroning: what's wrong with Order.new?
<dekroning> workmad3: I thought that calling Order.new from production code is kind of messy
<workmad3> dekroning: no more messy than CreateOrder.build
<dekroning> so when to use a Factory pattern actually?
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
<workmad3> dekroning: typically, when what you're actually constructing needs to be abstracted
<workmad3> dekroning: for example, if you had several types of orders and you had to determine what type of order you actually needed from the arguments... that's when a factory class makes sense
Smirnov has quit [Remote host closed the connection]
<workmad3> dekroning: or if creating an order is non-trivial
<dekroning> workmad3: ah right, so for example if I had LargeOrder, MediumOrder, SmallOrder ?
<dekroning> workmad3: what exactly do you mean with "if creating an order is non-trivial" ?
<workmad3> dekroning: yeah, that sort of thing... or DigitalOrder (that only needs an email) and PhysicalOrder (that needs an address)
IPGlider has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
<dekroning> workmad3: ah cool, example indeed
<workmad3> dekroning: say you needed to contact a stock-checking service, or verify credit-rating or something
<workmad3> dekroning: and that logic is needed when constructing the order, but it really isn't part of the Order class... it's part of a class that has the responsibility for building orders
cakehero has joined #ruby
mvangala_home has joined #ruby
S1kx has quit [Read error: Connection reset by peer]
nirakara has quit [Quit: This computer has gone to sleep]
<workmad3> dekroning: and obviously, with the DigitalOrder and PhysicalOrder example, you can also see that the factory can work out (from the items ordered) if you need a digital or physical order too :)
_axx has quit []
mvangala_home has quit [Remote host closed the connection]
execute has joined #ruby
S1kx has joined #ruby
<workmad3> dekroning: you certainly don't need to create a class just to build a trivial example of another class to avoid Order.new calls
mvangala_home has joined #ruby
<dekroning> workmad3: right, so you would put something infront of the Order class which does the stock-checking service ?
<workmad3> dekroning: yeah, I'd probably wrap that situation up in a builder
<workmad3> dekroning: which would have a stock checker object and it would check stock with it before determining if the order itself can be created
<dekroning> workmad3: so production code, would then never call Order directly, always indirectly via some decorator infront of it ?
<workmad3> dekroning: if you had a system like that, yes
<workmad3> dekroning: but if you don't... wrapping creation methods with a factory is unnecessary
execute is now known as _axx
<dekroning> workmad3: then i'm curious how would you call this then? Perhaps CreateOrder is a good name? which does the stock-checking etc ?
<workmad3> dekroning: I'd probably go for OrderBuilder
<dekroning> workmad3: yeah i understand what you mean now indeed
<workmad3> dekroning: maybe StockCheckingOrderBuilder
<dekroning> workmad3: so if production code, wanted to create an order it would call: order = OrderBuilder(line_items) or something ?
<workmad3> dekroning: depends a lot on the actual code base and the style of names already used though
blacktulip has joined #ruby
kpshek has quit [Remote host closed the connection]
<workmad3> dekroning: order = OrderBuilder.build(line_items)
<dekroning> workmad3: this naming for some reason sounds very important to me, but i'm always getting confused when to use them :)
<workmad3> dekroning: a fairly common style is to have nouns for class names
<workmad3> dekroning: so your classes are 'things' and your methods are stuff that your things do
<dekroning> workmad3: i'm a non-native english speaker, I always need to look up noun and verb :)
<dekroning> workmad3: right so methods (verbs) should be "active" role
<dekroning> actionable
<workmad3> yeah
<dekroning> and a noun would be "descriptive" ?
<dekroning> of the role ?
<dekroning> s/the/it's/
<workmad3> dekroning: yeah, that sort of thing
crankycoder has joined #ruby
krusty_ar has joined #ruby
berkes has quit [Quit: Ex-Chat]
<dekroning> workmad3: when doing TDD, you also have to write test code in order to check the builder? of you unit test just the things OrderBuilder.build calls ?
<workmad3> dekroning: check out the book 'Growing Object Oriented Software, Guided by Tests'
<workmad3> dekroning: and if I'm using a builder, chances are it's because it needs logic... so I'd want to test it
<dekroning> workmad3: I actually just started with that book, awesome. But I wanted to try and get my hands dirty already :-) perhaps I should not and first finished the book a first time
<workmad3> dekroning: I'd probably do some form of focussed integration test rather than unit test it though
jcromartie has quit [Quit: jcromartie]
<dekroning> workmad3: right, so you would set expectations on the Order class for example, to see if the OrderBuilder would call the Order#new method
arkiver has quit [Ping timeout: 246 seconds]
<workmad3> dekroning: no, I'd get it to create an actual Order
<dekroning> workmad3: ah because it's integration testing right ?
<workmad3> dekroning: so I'd check the integration with the order, rather than trying to test it in isolation
<workmad3> dekroning: yeah
kpshek has joined #ruby
frishi has quit [Quit: Leaving...]
vlad_starkov has quit [Remote host closed the connection]
<workmad3> dekroning: obviously, it's a case-by-case thing, but I'd suspect that most of the time, attempting to test a builder in isolation from the thing it's building would be brittle and painful, and would require you to violate the idea of 'mock roles, not objects'
subbyyy has quit [Quit: Leaving.]
<dekroning> workmad3: 'mock roles, not objects' great sentence
<workmad3> dekroning: keep reading GOOS ;)
<workmad3> dekroning: it's referenced in there (I'm not the source)
<dekroning> workmad3: hehe yeah I should indeed :-)
<workmad3> anyway, I'm off for lunch now
<workmad3> hf
<dekroning> ok thanks a lot for the information man
wijnandvn has joined #ruby
<dekroning> made a whoel lot clear
berserkr has quit [Quit: Leaving.]
enroxorz has joined #ruby
enroxorz has joined #ruby
enroxorz has quit [Changing host]
gtuckerkellogg has joined #ruby
jonatha__ has quit [Remote host closed the connection]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
fbernier has joined #ruby
binaryplease has quit [Read error: Connection reset by peer]
binaryplease has joined #ruby
ananthakumaran has joined #ruby
Criztian has joined #ruby
neersigh^ has quit [Ping timeout: 245 seconds]
emmanuelux has joined #ruby
RainbowDashh has joined #ruby
bambanx has joined #ruby
yonggu has left #ruby [#ruby]
bambanx has quit [Client Quit]
jgarvey has joined #ruby
mohits has quit [Ping timeout: 265 seconds]
plastics has joined #ruby
kaspernj has quit [Ping timeout: 240 seconds]
arkiver has joined #ruby
bambanx has joined #ruby
neersighted has joined #ruby
Gadgetoid has joined #ruby
LBRapid has joined #ruby
<Gadgetoid> Ah, Rubyists!
LBRapid has quit [Client Quit]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
LBRapid has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
<banisterfiend> Gadgetoid: sup
neersighted has quit [Max SendQ exceeded]
Morkel has joined #ruby
<Gadgetoid> Ahoy banisterfiend, just here in case I need to pick some brains about GEM packaging best practise :D
<banisterfiend> Gadgetoid: you'er lreaning ruy?
<banisterfiend> ruby*
<banisterfiend> through an online course?
<Gadgetoid> banisterfiend: Nah, Ruby is cake… I'll learn after I've written a dozen things in it ;)
binaryplease has quit [Quit: WeeChat 0.3.8]
<Gadgetoid> Best practise and conventions are the tricky bits
<banisterfiend> Gadgetoid: cool. what languages do you come from?
<Gadgetoid> banisterfiend: mostly heinous horrible web-based abominations like PHP and DotNet
<banisterfiend> Gadgetoid: :)
<Gadgetoid> Although neither of those are necessarily web-only, I think it's fair to say that they're abominations
<banisterfiend> some aspects of ruby might be a head-fuck for you then, but generally it's pretty easy i think :)
<banisterfiend> but ruby is one of those languages that are easy to learn but have surprising depth and so hard to master
Hanmac has joined #ruby
<Gadgetoid> banisterfiend: Yeah, I'm probably encountering some of that depth wrapping up a C library with some helper functions, sanity checks and OO lovliness
<banisterfiend> Gadgetoid: C extenson or FFI?
bambanx_ has joined #ruby
<Gadgetoid> I'm packing up an IO library for the Raspberry Pi into a convenient Ruby gem, to try and give Ruby a gentle push on the Pi as an arduino-like tinkering language
justinmcp has joined #ruby
venkatk_ has joined #ruby
bambanx has quit [Ping timeout: 248 seconds]
fantazo has joined #ruby
TheRealPygo is now known as pygospa
subbyyy has joined #ruby
subbyyy has quit [Remote host closed the connection]
<banisterfiend> Gadgetoid: what's raspberry pi?
RainbowDashh has joined #ruby
<bambanx_> hi
<Gadgetoid> banisterfiend: it's an ultra-low-cost educational ARM computer-on-a-board
Axsuul has quit [Ping timeout: 265 seconds]
<Gadgetoid> See here: http://www.raspberrypi.org/
kaspernj has joined #ruby
linoj has joined #ruby
altious has quit [Quit: Leaving]
Criztian_ has joined #ruby
Criztian has quit [Read error: Connection reset by peer]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
neersighted has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
catphish has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
nanderoo has joined #ruby
Progster has quit [Excess Flood]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
burgestrand has quit [Quit: Page closed]
jonathanwallace has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
bambanx_ has quit [Read error: Connection reset by peer]
Progster has joined #ruby
Progster has quit [Excess Flood]
bambanx has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
<Gadgetoid> … it's a joinpartorama
Progster has joined #ruby
Progster has quit [Excess Flood]
<Gadgetoid> Derp, accidentally pushed my gem files into github
Progster has joined #ruby
Progster has quit [Excess Flood]
busybox42 has quit [Quit: Leaving.]
<Gadgetoid> This is the possible abomination I'm working on: https://github.com/Gadgetoid/WiringPiGem/blob/master/lib/wiringpi.rb
Progster has joined #ruby
Progster has quit [Excess Flood]
busybox42 has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
<Gadgetoid> My main concern regarding best practise, is the inclusion of constants in that file, but it would be inconvenient to tuck them away
Progster has quit [Excess Flood]
mohits has joined #ruby
hynkle has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
neersighted has quit [Ping timeout: 252 seconds]
Kevin___ has joined #ruby
Progster has joined #ruby
geekbri has quit [Remote host closed the connection]
Progster has quit [Excess Flood]
enroxorz has quit [Quit: Leaving]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
busybox42 has quit [Quit: Leaving.]
Progster has joined #ruby
Progster has quit [Excess Flood]
busybox42 has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
neersighted has joined #ruby
<deryl> mmmm raspberry
Progster has joined #ruby
Progster has quit [Excess Flood]
SeanLazer has quit [Quit: SeanLazer]
Progster has joined #ruby
Progster has quit [Excess Flood]
<deryl> so ordering one, myself. got a couple friends using them to build stuff
<banisterfiend> Gadgetoid: hehe
Progster has joined #ruby
Progster has quit [Excess Flood]
bier__ has quit [Read error: Connection reset by peer]
<banisterfiend> Gadgetoid: just letting u know, ruby code is normally only double-spaced :P
<banisterfiend> i mean, 2 space indent
<banisterfiend> Gadgetoid: aside from that, it looks pretty good for one of your first programs!
Progster has joined #ruby
Progster has quit [Excess Flood]
neersighted has quit [Max SendQ exceeded]
Progster has joined #ruby
venkatk_ has quit [Quit: This computer has gone to sleep]
Progster has quit [Excess Flood]
<Gadgetoid> banisterfiend: I'm going to have to process out the indentation I think, it seems to happen as a side effect of the seemingly random editors I use
altious has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
carloslopes has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
<Xethron> lol
<Xethron> umm
<Xethron> thats normal
Progster has joined #ruby
Progster has quit [Excess Flood]
booginga has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
ZummiG777 has joined #ruby
Progster has joined #ruby
<Xethron> heya Progster
iocor has joined #ruby
Progster has quit [Excess Flood]
<Xethron> Bye Progster
<deryl> whats normal? his formatting? not for ruby it isn't
Progster has joined #ruby
<Xethron> heya Progster
Progster has quit [Excess Flood]
<Xethron> Bye Progster
<ZummiG777> Question: I'm working with Ruby ERB templates (in puppet). I'm trying to figure out if in the ERB I can create a local counter and increment it. Is this possible?
Progster has joined #ruby
Progster has quit [Excess Flood]
<Xethron> heya Progster
<Xethron> :(
<Xethron> Bye Progster
BiHi has joined #ruby
busybox42 has quit [Quit: Leaving.]
Progster has joined #ruby
Progster has quit [Excess Flood]
<Xethron> heya Progster :D
<Xethron> :'(
<Hanmac> haha to slow xD
<ramblex> lol
busybox42 has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
<Xethron> lol
<ramblex> ZummiG777: Pretty sure that's possible
<Xethron> How can you tell I'm bored?
Progster has joined #ruby
SeanLazer has joined #ruby
<Kevin___> Zummi: in ERB, you can execute any ruby code between the <% and %> tags. it only gets inserted into the page if you put it between <%= and %> tags.
<Xethron> Progster :D WB
mnaser has joined #ruby
<Xethron> You finally stopped flooding everyone?
<Kevin___> So you could just define a local variable, and then use it anywhere else on the page.
<Xethron> sigh
darthdeus has joined #ruby
* Xethron gets back to scripting his Ruby IRC Bot
snearch has quit [Quit: Verlassend]
hemanth has quit [Read error: Connection reset by peer]
kvirani has quit [Remote host closed the connection]
Tricks has joined #ruby
wub1 has joined #ruby
akem has quit [Ping timeout: 250 seconds]
liuchong has joined #ruby
wub1 has left #ruby [#ruby]
jrist-afk is now known as jrist
wub1 has joined #ruby
wijnandvn has left #ruby [#ruby]
neersighted has joined #ruby
hemanth has joined #ruby
Fraeon has quit [Quit: Lost terminal]
plastics- has joined #ruby
plastics has quit [Ping timeout: 255 seconds]
<Tasser> Xethron, yet another?
wvms has left #ruby [#ruby]
neersighted is now known as neersight[d]
<Xethron> Tasser: Well, this is my first one?
venkatk_ has joined #ruby
pu22l3r has joined #ruby
bambanx has quit []
dsa has joined #ruby
dsa has quit [Remote host closed the connection]
dsa has joined #ruby
EzeQL has quit [Disconnected by services]
dsa has quit [Client Quit]
EzeQL has joined #ruby
bambanx has joined #ruby
schaary has joined #ruby
bolowni has joined #ruby
Kevin___ has quit [Remote host closed the connection]
Targen has joined #ruby
Criztian_ has quit [Remote host closed the connection]
bambanx has quit [Client Quit]
mickn has joined #ruby
elhu has joined #ruby
vlad_starkov has joined #ruby
blacktulip has quit [Remote host closed the connection]
|RicharD| has joined #ruby
<|RicharD|> hello :) i have a problem with this code: http://pastie.org/4171418 i want save at every cycle the permission_id into mask_count…but it replace the previous…where i wrong ?
mnaser has quit [Ping timeout: 248 seconds]
<ramblex> |RicharD|: =+ should be +=
Kevin___ has joined #ruby
<|RicharD|> then it say: undefined method `+' for nil:NilClass
<Gadgetoid> Doing automated testing on a gem that involves hardware output could be exciting...
<ramblex> |RicharD|: @mask_count = 0 then
flype has joined #ruby
<|RicharD|> at top say ?
<|RicharD|> lol fixed
<|RicharD|> the problem was so stupid :S
vlad_starkov has quit [Ping timeout: 245 seconds]
hunglin has joined #ruby
mnaser has joined #ruby
vlad_starkov has joined #ruby
geekbri has joined #ruby
<Gadgetoid> Don't you love it when the 400th time you encounter your inability to grasp the concept of == crops up and you know the solution immediately: jump off a bridge!
<apeiros_> jumping of a bridge is always a great solution. just don't forget the bungee cord…
Tulak has joined #ruby
<ramblex> and don't forget to attach the bungee cord to the bridge
<|RicharD|> umm… if i want put this variable(integer) into a array it's possible ? tasks[:mask] << mask_count (also tried with =) say me: can't convert Symbol into Integer why ? i'm not converting nothing
<apeiros_> |RicharD|: sounds like tasks is an array
<|RicharD|> and plus…maybe its integer -> symbol…not symbol->integer right ?
<apeiros_> and array[:symbol] is not valid
<|RicharD|> yes sure it's array
<|RicharD|> ah array.symbol ?
<apeiros_> no
<Tulak> when i do Float("1.2") i get 1.2 as a float, but when i do a = Float and then a("1.2") i get NoMethodError: undefined method `a' for main:Object
<apeiros_> an array is positional.
<apeiros_> if you want key-value, you need a hash. this ain't php.
<Tulak> how can i do it through som variable ?
venkatk_ has quit [Read error: Connection reset by peer]
<apeiros_> we don't confuse data container names :-p
Kevin___ has quit [Remote host closed the connection]
<|RicharD|> :D
<Hanmac> Tulak: because Float() is a method, but Float is a class
<|RicharD|> so if i remember good should be task{:mask => mask_count}
<apeiros_> no
venkatk_ has joined #ruby
<apeiros_> either task = {:mask => mask_count} # creates a new hash and assigns it to task
<|RicharD|> ah ok
<apeiros_> or: task[:mask] = mask_count # adds the key-value pair :mask, mask_count to an existing hash, referenced by task
<Tulak> Hanmac: aha, and is there any way to convert data types like "1.2".to(Float) instead of "1.2".to_f ?
<canton7> Tulak, you can do something like a = method(:Float). a.call("1.2")
uris has joined #ruby
<Hanmac> a = method(:Float); a["1.2"]
<|RicharD|> but wait a moment so it create a new task and replace the old
Kevin___ has joined #ruby
cpruitt has joined #ruby
kvirani has joined #ruby
tatsuya_o has quit [Remote host closed the connection]
niku4i has joined #ruby
rbanffy has quit [Read error: Connection reset by peer]
Kevin___ has quit [Read error: Connection reset by peer]
Kevin___ has joined #ruby
<apeiros_> |RicharD|: you have to read the complete answer.
<apeiros_> I gave you two ways
maesbn has quit [Remote host closed the connection]
<apeiros_> one to create a new one (and being a *new* one it'll of course replace everything that was in before)
<apeiros_> and one to add to an existing
schaary has quit [Quit: Leaving.]
joch_n has joined #ruby
<apeiros_> (one to create a new hash with 1 task, one to add 1 task to an existing hash)
bambanx has joined #ruby
carlyle has joined #ruby
<|RicharD|> ah oki
rbanffy has joined #ruby
bambanx has quit [Client Quit]
<|RicharD|> but with task[:permission_mask] = mask_count
niku4i has quit [Ping timeout: 264 seconds]
<|RicharD|> give me the same error(not can convert ecc...)
ph^ has joined #ruby
<|RicharD|> your example say: task[:mask] = mask_count
<apeiros_> |RicharD|: again, it requires task to be a hash, not an array
dv310p3r has joined #ruby
<apeiros_> again, an array can NOT store key-value pairs. an array is positional (positive integer index, starting at 0, not sparse)
<|RicharD|> oki if it's a array…there is a method for put it at last ?
<|RicharD|> for example like push o pop
<apeiros_> ary << item
<apeiros_> ary.push item
<apeiros_> both work
<apeiros_> ary[ary.length] = item
<apeiros_> there's probably more
<Spooner> ary += [item] ;)
cantonic has joined #ruby
<|RicharD|> tasks[:permission_mask] << mask_count
<apeiros_> that creates a new array, but yes
<|RicharD|> give same error
<apeiros_> …
itnomad has joined #ruby
<apeiros_> oh… my…
<|RicharD|> oh fuck know
<|RicharD|> :D
<|RicharD|> sorry
<apeiros_> |RicharD|.brain.turn_on!
<apeiros_> :-p
<|RicharD|> -.- :D very ma really sorry ahahah
<|RicharD|> but*
<|RicharD|> fuck i must sleep...
<apeiros_> might not be the worst idea ;-p
cantonic_ has joined #ruby
ZummiG777 has quit [Quit: Leaving]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
Helius has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
moeSeth has joined #ruby
sailias has joined #ruby
rbanffy has quit [Read error: Connection reset by peer]
cantonic has quit [Ping timeout: 264 seconds]
cantonic_ is now known as cantonic
rbanffy has joined #ruby
yonggu_ has joined #ruby
niklasb has quit [Ping timeout: 246 seconds]
xbayrockx has quit []
quest88 has joined #ruby
GuidovanPossum has joined #ruby
rippa has joined #ruby
flype has joined #ruby
altious has quit [Quit: Leaving]
dhruvasagar has joined #ruby
<dekroning> i've got a question, why doesn't the following not work? s = "foo 123 bar baz"; i = 123; s =~ /i/
jcromartie has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
sepp2k1 has joined #ruby
sepp2k has quit [Ping timeout: 246 seconds]
yonggu has joined #ruby
<apeiros_> doesn't not work… does that mean it works? ah wait, no, english doesn't not know no double negation…
<dekroning> ah sorry :-)
<apeiros_> dekroning: define 'work'
booginga has quit [Quit: This computer has gone to sleep]
yonggu has quit [Client Quit]
<apeiros_> "why doesn't this work" is *always* a bad question.
yonggu_ has quit [Ping timeout: 264 seconds]
<dekroning> I should have said, why doesn't my regular expression match ? e.g. why do I get nil ?
kevinbond has joined #ruby
<apeiros_> you match against i, not 123
<dekroning> apeiros_: your right, it works, but just not as I would have expected :)
<apeiros_> you want /#{i}/
<dekroning> ahh
<apeiros_> dekroning: correct. which means you have to state your expectation. and preferably also what happens for you instead.
<apeiros_> and sometimes even that is not enough to make it a good question
tiripamwe has joined #ruby
JustinCampbell has joined #ruby
bolowni has quit [Quit: bolowni]
h4mz1d has joined #ruby
dbck has joined #ruby
<dekroning> apeiros_: wont happen again ;)
dbck has left #ruby [#ruby]
<apeiros_> good for you, since you'll get more & better answers ;-)
h4mz1d has quit [Ping timeout: 245 seconds]
bglusman has joined #ruby
xaq has joined #ruby
bambanx has joined #ruby
internet_user has joined #ruby
mxweas has quit [Ping timeout: 245 seconds]
bambanx has quit [Client Quit]
ipoval has joined #ruby
bolowni has joined #ruby
jstew has quit [Quit: leaving]
vlad_starkov has quit [Remote host closed the connection]
venkatk_ has quit [Quit: This computer has gone to sleep]
bambanx has joined #ruby
bolowni has quit [Client Quit]
Targen has quit [Read error: Operation timed out]
booginga has joined #ruby
joshman_ has joined #ruby
apok has joined #ruby
iToast has joined #ruby
randomautomator has joined #ruby
<iToast> I just started to learn ruby
<iToast> And I'm loving it.
<iToast> I have one complaint again'st ruby sofar.
<iToast> so far*
bambanx has quit [Client Quit]
timonv_ has joined #ruby
timonv has quit [Read error: No route to host]
<iToast> I have to use "hello" instead of just hello.
<iToast> as a string
itnomad has quit [Quit: Leaving]
<iToast> meh :po
hadees has quit [Ping timeout: 244 seconds]
<ramblex> doesn't tcl allow that?
<iToast> I have no idea.
<iToast> Im new to ruby.
<iToast> Thank god, the arrays are LOGICAL
<ramblex> not sure how ruby affects knowledge of tcl..
<iToast> I don't know tcl.
<iToast> >_>
denysonique has quit []
<iToast> I'm making a blind guess on arrays rightnow, but lets say we make a array test with the values of 10 20 30 so test = [10, 20, 30]
ph^ has quit [Remote host closed the connection]
<iToast> can't I use puts test[1] and it'l output 10 as thats the initial value of array
<workmad3> iToast: no
<workmad3> iToast: arrays are 0-indexed
ph^ has joined #ruby
<iToast> So arrays in ruby start at 0?
<iToast> (I've only worked with arrays in php and pawn)
savage- has joined #ruby
<workmad3> iToast: yes... same as in about 90% of commonly used programming languages
<iToast> But it would work and output a value correct?
<rking> iToast: I recommend going through the Ruby Koans if you already know other languages.
<workmad3> iToast: test[1] would give 20
<shevy> iToast if at that slot in the array an object resides, yes. otherwise, if you do array[35789237893] the likely result would be nil
<iToast> workmad3: I understood that, so puts test[0] will put "10"
<workmad3> shevy: array[123456789] = 1 is fun :D
<shevy> iToast good! you understood how array work
<iToast> Ok
denysonique has joined #ruby
<iToast> So how do I add things to a array after I define it?
<shevy> array << "bla"
<iToast> perfect.
<workmad3> or array.push "bla"
<shevy> iToast you can test this in irb
<shevy> << is nicer
<shevy> :>
<rking> iToast: Ruby Koans.
<shevy> but test both .push and << in irb on your own
<workmad3> shevy: unless you're using the array as a queue ;)
timonv_ has quit [Ping timeout: 240 seconds]
<workmad3> shevy: or a stack ;)
ph^ has quit [Ping timeout: 246 seconds]
<iToast> Can a Array have two indexes.
bambanx has joined #ruby
<iToast> so test[1] << 10
ipoval has quit [Quit: ipoval]
<rking> iToast: Ruby Koans.
<iToast> Then test[1] << 20
phantasm66 has joined #ruby
<apeiros_> iToast: you mean two dimensions?
<iToast> Tes.
<iToast> yes*
<apeiros_> test[1] = []; test[1] << 1; test[1] << 2; …
<shevy> iToast you can have arrays within arrays
<apeiros_> since an array is a valid item in an array, that's not a problem.
<iToast> O.o
<iToast> Ok
jwg2s has joined #ruby
timonv has joined #ruby
<iToast> Ruby is the most logical programming language I've tried.
<iToast> C# was *ok* php was great if you didn't mind risking a zombie process
<canton7> "php was great" -- that's something you don't hear a lot around here
<Hanmac> iToast you could even store Classes in Arrays ... [Array, Integer,Float,String] :P
<rking> If you think like Matz Ruby is 100% logical.
timonv_ has joined #ruby
timonv has quit [Read error: Connection reset by peer]
<iToast> Hanmac: :o
<iToast> And I was going to learn c++ x3
<apeiros_> classes are objects. any object is a valid array member
<apeiros_> therefore classes are valid array members :)
<apeiros_> same for hash keys and hash values
ken_barber has quit [Remote host closed the connection]
<rking> canton7: It's so weird… I'm on an unbroken streak of PHP love overhearing. Started with a buddy saying DrupalCon was the most vibrant conference he's ever been to, then another said, "PHP delivers on its humble promise," and so on.
notwen has quit [Remote host closed the connection]
<apeiros_> doc = {Array => "The Array class", Integer => "The Integer class"} # valid
<iToast> php is a great language thats hated on
<apeiros_> ary_class = Array; ary_class.new # => []
<workmad3> iToast: no, it's not
<iToast> I was told to use a more functional language and linked to a rant that said every php function is broken in some way or form.
<workmad3> iToast: PHP is an awful language that's hated on
<jwg2s> I've got a database that maps legacy tables and column names to rails-friendly tables and column names. I'd like to generate views based on these mappings and I'm looking for some direction. While it's generating for rails, it's really a ruby issue
<apeiros_> hmmm, where's that link about php issues…
<iToast> Why does everyone hate php?
ken_barber has joined #ruby
<iToast> it just seems like people HATE to hate.
<ramblex> because it's so inconsistent
<iToast> Look at internet explorer and safari, they've improved but still got hatted on
<apeiros_> iToast: recommended reading
<iToast> apeiros_: Already got sent that...
<kaspernj> PHP is a great language, but its development as a language is long-time dead?
<apeiros_> I did php for ~5-6y and it brought up some bad memories…
<deryl> apeiros_: hah! rockin title!
<iToast> My main love for PHP is its mysql functions.
<Hanmac> if you compare two large strings with numbers, PHP thinks the strings are egual but they are not
flype has quit [Quit: Computer has gone to sleep.]
<apeiros_> iToast: I prefer rubys Sequel lib over that
<apeiros_> a thousand times
<rking> And ActiveRecord » direct SQL
<iToast> lol
<apeiros_> DB[:table_name] << {:first_name => "i", :last_name => "Toast"}
<deryl> ahhh. php. the only reason mysql is as popular as it is :)
<iToast> I wan't to work with sql light
<apeiros_> (of course you can let it execute plain SQL, if you're fancy to do that)
bambanx has quit [Read error: Connection reset by peer]
<apeiros_> iToast: also, sequel allows you to use any db the same way
<workmad3> iToast: people hate PHP because it's a noisy, badly designed language with a lot of cruft and defaults to a document-oriented model for code organisation where your code structure has to reflect your URL structure
ken_barber has quit [Remote host closed the connection]
bambanx has joined #ruby
<iToast> PHP isn't that bad...
<brendan`> each have their own places
<iToast> :P
<kalleth> iToast: get out
<workmad3> iToast: you just need to look at the joke that is PHP's date-handling for an example of it's bad, crufty design
<iToast> Ruby in the web browser.
D4T has joined #ruby
<canton7> iToast, learn more of other languages. it's a realisation that slowly dawns on you
<workmad3> *its
<kalleth> i was literally just having a conversation about this
<kalleth> the best response to anyone who likes php is this article
<workmad3> iToast: that crap really isn't normal :)
<kalleth> ^
timonv_ has quit [Read error: Connection reset by peer]
<brendan`> can
<kalleth> be all and end all response, that article
<iToast> Everyone links me to that.
<canton7> kalleth, read the scrollback ;)
<workmad3> kalleth: already been linked by apeiros_ ;)
<kaspernj> I love how simple PHP is. How easy it is to set up and get far in a very short time.
<apeiros_> kalleth: just been linked ;-)
<brendan`> can't debate its popularity though
<iToast> You're not going to get me to hate php.
<kalleth> DAMMIT
timonv has joined #ruby
<workmad3> iToast: give it time ;)
<kalleth> fs i was having this conversation in another channel about 30seconds ago
ken_barber has joined #ruby
<apeiros_> kalleth: and I agree. it's an excellent article.
<iToast> It gets the job done, I only use it for web pages.
<iToast> if you're using it for CLI, I suggest you stop using php.
<kalleth> if you're using it for *, i suggest oyu stop using PHP
<kalleth> unless, of course, your webapps never need maintaining
<iToast> php with its CLI was HORRID
<apeiros_> iToast: nobody denies that it can be used. it can even be used without too much butt-hurt.
<kalleth> or supporting
<workmad3> kalleth: I was just thinking the same :D
<kalleth> ^5
<apeiros_> but from that it doesn't follow that it is well designed
<kalleth> we should sleep together
<iToast> apeiros_: Did you ever try the php CLI?
<Sigma00> dude, ruby is easy to set up and takes you far quickly, too
<workmad3> kalleth: my wife might complain :P
<iToast> thats why I'm learning it :)
<kalleth> thats fine, bring her too
<apeiros_> iToast: as said, I did php for 6y. I even used it for non-web things.
<canton7> "it gets the job done", and "it's easy to set up" are about the only points going for it. the minute you start doing something complex, suddenly the code verbosity and rate of errors skyrocket, and readability drops through the floor
ken_barber1 has joined #ruby
<iToast> apeiros_: WHY?!
<iToast> apeiros_: Seriously, php CLI was horrid.
<kaspernj> canton7, agree.
<kalleth> 'its easy to setup'
<kalleth> erm
<apeiros_> stupid customers. that's why.
<kalleth> only for development envs
<Hanmac> IToast: in PHP "echo '9223372036854775807' == '9223372036854775808' ? 'True' : 'False';" ... try to guess whats respond
<iToast> I tried it for 10 minutes and hated the CLI.
bambanx has quit [Read error: Connection reset by peer]
<apeiros_> I prefered perl over php back then already.
<kalleth> deploying to production in php is a hellish mess of php.ini, apache modules, etc.
<workmad3> kalleth: 'its easy to setup' == 'shared hosting has it setup for you'
ashenanigan has left #ruby [#ruby]
<kalleth> oh, ok
<apeiros_> seriously, perl kicked php's ass a dozen times even back then.
<kalleth> but when we respond with HEROKU we get 'your argument is invalid'
<kalleth> rite
<workmad3> kalleth: you could deploy a PHP site on heroku... :P
<iToast> My local testbed should have ruby installed.
<iToast> Letme check
<canton7> even when we throw "free hositing" at them :P
<dcope> Heroku is overpriced.
<canton7> *hosting
<iToast> Stupid question, very stupid.
<canton7> dcope, it is. but it's easy, and there's a free tier
<dcope> Seriously, get a VPS, spend 2 hours setting it up and you'll save millions a month.
<workmad3> kalleth: even if they don't support it directly, you could get it set up through phuby on phails :)
<kalleth> haha
jcromartie has quit [Quit: jcromartie]
<iToast> Can you emulate a serial port on *any* supported os in RUBY?
<dcope> canton7: Yeah, with 1 dyno so if no one hits your app it'll shutdown.
<brendan`> i just dual boot ubuntu + win7
Helius has left #ruby [#ruby]
<kalleth> out of interest
<kalleth> say i have a dedi box
<dcope> Then the next request takes days to process because your app has to start back up, canton7
<workmad3> dcope: 1 dyno, no background == free == perfect for testing
<brendan`> running apache on this ubuntu install and good to go for rails
<canton7> dcope, my personal problem is that ruby takes so much damn ram. I'm running a couple of ruby apps on my vps, but I don't have enough ram to run more
CheeToS has joined #ruby
<canton7> dcope, use one of the workarounds :)
<kalleth> can i set up my own 'heroku' so that i can just git push my-server and have it autosetup and run same as heroku?
<dcope> For testing it's not bad but why not just stage locally?
dkissell_ has joined #ruby
<kalleth> anyone know any tools for that?
<dcope> kalleth: Yes.
<kalleth> urlme
bambanx has joined #ruby
bambanx_ has joined #ruby
<dcope> kalleth: Passenger + Capistrano + nginx
<dcope> boom, done.
<workmad3> dcope: because you want to get some initial user testing done with a live URL?
<iToast> wow.
<kalleth> nginx i'm fine with, passengeR? i thought that was apache plugin
<dcope> canton7: "workaround"? :D like what?
<iToast> My ubuntu testbed setup doesnt have ruby...
timonv_ has joined #ruby
<kalleth> Cap i've never used
<iToast> -_-
<canton7> dcope, new_relic with the pinging function enabled. cron job. external ping
<iToast> ubuntu server 10.4 has python by default but not ruby?
<workmad3> kalleth: passenger gives you an apache module, an nginx module and a standalone server (which is really an embedded nginx server with the nginx module setup)
<kalleth> iToast: wget www.ruby-lang.org/ruby.tar.gz && tar zxvf ruby.tar.gz && cd ruby && ./configure && make && make install
<dcope> canton7: ah, very clever :D
<iToast> kalleth: apt-get install ruby
ken_barber has quit [Ping timeout: 246 seconds]
<kalleth> iToast: god no
<kalleth> never, ever
<kalleth> ever do that
<iToast> ...
<iToast> why?
<iToast> :P
<kalleth> EVER
<workmad3> iToast: packaged ruby is bad
<canton7> apt and ruby hate each other
<iToast> apt-get purge ruby
<workmad3> iToast: it's got braindead problems :)
<kalleth> i have no reasonable responses for you, listen to workmad3
<Hanmac> iToast: apt-get install ruby1.9-full is better
<kalleth> i just know its bad
dkissell has quit [Ping timeout: 248 seconds]
dkissell_ is now known as dkissell
<iToast> wget www.ruby-lang.org/ruby.tar.gz && tar zxvf ruby.tar.gz && cd ruby && ./configure && make && make install
<iToast> Il just do that...
<kalleth> mate of mine (C# dev) has just said 'tempted to learn ruby. 3 reasons why i should'
<kalleth> what do i tell him
<canton7> iToast, rvm, rbenv, others...
<workmad3> iToast: it's worse if you try to apt-get rubygems though
<workmad3> iToast: now that really is a hate-hate relationship :D
bambanx_ has quit [Client Quit]
<iToast> Ok
<workmad3> kalleth: 'fun, profit, pleasure'
<iToast> what should I do to install ruby on ubuntu server...
<canton7> kalleth, it's fascinating. blocks mainly, then mixins, and the extreme dynamic nature
<workmad3> iToast: rvm, ruby-build, rbenv, rbfu, or just compile from source yourself
timonv has quit [Ping timeout: 264 seconds]
<iToast> workmad3: :|
<Hanmac> kalleth %w{ 1 2 3 4 7 3 8 6 8 }.map(&:to_i).inject(1,:*)
<Hanmac> ask him if this is that easy possible in C#
bambanx has quit [Client Quit]
<kalleth> i have no idea what that means at first glance
<Hanmac> iToast or get an newer Ubuntu :P
<D4T> whats the best way to query a specific DNS server for the IP of a host?
<kalleth> dig
<workmad3> kalleth: it multiplies all those numbers together
<iToast> Hanmac: why can't I just use apt-get install ruby?!
<canton7> Hanmac, can't you just use #inject(:*) ?
<iToast> What is exactly wrong with that package.
<kalleth> iToast: it's the fault of the maintainers of the 'ruby' package in the debian repos
SQLStud has joined #ruby
<kalleth> it's out of date and contains some dodgy stuff
<kalleth> dont know precisely what
<kalleth> ask workmad3
<canton7> kalleth, well, it converts the strings to ints first
* workmad3 hides
<deryl> that and they chop it up all to hell and back
<workmad3> don't ask me... I'm not that up on it...
<deryl> ruby18, ri18, rdoc18, gem18, etc etc
<deryl> WHY??
<workmad3> it's the chopping up that I'm aware of... apt-get install ruby gives you a bare-minimum, practically useless ruby setup
<Hanmac> canton7 inject(sym) returns nil when the array is empty, inject(start,sym) returns start
<canton7> if you hang out in here for a whle, you'll see a fair few people with problems with apt and ruby
<canton7> Hanmac, aha, cheers :)
crankycoder has quit [Remote host closed the connection]
niku4i has joined #ruby
<workmad3> which isn't too bad... you can get around that if you know what you're doing
<Spooner> the apt-get is very not up to date and it is a pain to manage multiple versions of it without rvm or similar (which installs for you, so you don't need the apt-get one).
<workmad3> it's when you try to install rubygems with apt that apt basically takes a baseball bat to your nuts...
<deryl> i swear the only reason they chop it like that is to uncreate their package count. (then again debian does enough other things i don't agree with it was cause for me to leave the Project)
<kalleth> i don't 'get' RVM atm
<Hanmac> its because of the Ubuntu OS ... in the newest the ruby package is updated to 1.9 too
<kalleth> i mean
<kalleth> for dev env running in an interactive CLI
<kalleth> sure
<workmad3> and yeah, if you need to target multiple ruby versions then apt is not your friend either
<kalleth> i get it
<kalleth> but what about when you deploy to a server
<deryl> workmad3: oh and the disabled update --system as well? :)
<kalleth> how the hell do i use rvm for deployed apps ;(
Vendethiel has joined #ruby
<workmad3> kalleth: pretty much the same way :)
<kalleth> apart from /usr/local/src/rvm/my-ruby-version/bin/ruby PREFIX ALL THE THINGS
<deryl> kalleth: then you didn't read any of rvm.io if thats your stance
<workmad3> kalleth: well, that depends a lot on how you're running your app servers
<shevy> I always keep on telling people that the proper course of action is to
<shevy> remove RVM
crankycoder has joined #ruby
<deryl> shevy: whatever
<shevy> and someone should be murdered for using a path like /usr/local/src/APP_NAME anyway
<workmad3> kalleth: if you use passenger, you specify a single PassengerRuby param in your web server config
hayon has joined #ruby
<deryl> but will limit you to that specific ruby for all apps
<iToast> I found something strange about ruby on windows.
<iToast> when I use def Hello to put hello world as a function
<iToast> when I type Hello it throws a error
<workmad3> kalleth: and if you're using unicorn or thin, then I'd highly recommend something like runit as a process monitor for them and then you can set up the specific env vars you need once in the config file for it
<iToast> when I type Hello() it puts "Hello World!"
<shevy> iToast did you downcase Hello yet
<deryl> better choice being something along the lines of apache2 + mod_proxy + unicorn, or nginx + unicorn allowing for different ruby versions per app
<iToast> shevy: What do you mean?
<shevy> iToast it is very uncommon do upcase the method name
<shevy> Hello vs hello
<iToast> oh
<shevy> do you see?
<canton7> iToast, constants start with a capital
<workmad3> deryl: I was giving examples ;)
<iToast> ah
<iToast> ;)
<deryl> workmad3: oh i know. was adding :)
<shevy> in ruby, classes start with uppercase character. ruby treats these as constants. class Foo, and never class foo
mickn has quit [Quit: Leaving]
<workmad3> deryl: and I was getting onto unicorn... it's the environment stuff kalleth was interested in, I believe ;)
<kalleth> hmm,interesting
<kalleth> i use thin for my rails apps atm
<kalleth> should i consider passenger instead?
<workmad3> kalleth: you can also generate wrapper scripts for specific binaries
<workmad3> kalleth: which will sort out the rvm environment stuff
<kalleth> hmmm
<kalleth> i want to get me a dedi box and set it up as my own personal heroku
<kalleth> i think
<iToast> So in ruby
<kalleth> need to find a howto
<workmad3> kalleth: probably not... passenger is easy to set up, but I wouldn't bother switching to it from another established setup for no real reason
<iToast> Instead of "if" I can just go iToast_Is_Online true: puts "yes!" false: puts "No" ?
<workmad3> kalleth: I've only ever worked on one app that *had* to deploy with passenger :)
<iToast> well
<kalleth> iToast: 100.times { read_book('pickaxe') }
<iToast> you get the jist what I said :P
<iToast> kalleth: Im reading the 20 minute guide
<kalleth> i like ruby koans
<kalleth> as well
<kalleth> teach-by-doing
<deryl> mmmm koans
<iToast> kalleth: Also, I ment something like this: online true; puts "yes" : false; puts "no" ?
<workmad3> kalleth: and that was because of how the authentication worked (it needed shibboleth authentication, which installed as an apache plugin and set certain request environment variables and so required something that worked in the server process rather than proxied to an app server)
<deryl> wow that is utter crap
Helius has joined #ruby
<workmad3> deryl: tell me about it :(
Morkel has quit [Quit: Morkel]
<deryl> no i was referring to the online true comment
<workmad3> deryl: heh :)
<deryl> but yeah your stuff oyu mentioned.. that is crap too
<deryl> err you. wow that typo is damned wlel ingrained aint it
<workmad3> deryl: gotta love institutional authentication systems
<deryl> hehehe i see a big NOT in there ;)
<workmad3> deryl: I'm contractually not allowed to put it in :P
<deryl> oh smack!
<deryl> how much hair you got left?
<iToast> Ruby is the simpliest to learn language of them all O_o
<workmad3> deryl: plenty, it's growing out again now :)
<Tasser> iToast, brainfuck is simpler
<deryl> hahaha awesome. suppose i should cancel that consolation rogaine subscription i was going to get you then
<Xethron> meh
<workmad3> :)
<Xethron> I need some help... again :P
<workmad3> simple != easy
bglusman has quit [Read error: Connection reset by peer]
cl0ckw0rk has joined #ruby
<workmad3> PHP is a simpler language than ruby... ruby is an easier language than PHP...
<kaspernj> workmad3, true.
<Xethron> I am trying to capture a number from a string like such:
<iToast> Tasser: No
<Xethron> if (line =~ /^(\d+) (.*)/)
<Xethron> sql_limt = $1
<iToast> ruby is.
<cl0ckw0rk> is anyone not okay with me linking a programmer demo survey in here?
SeanLazer has quit [Ping timeout: 246 seconds]
bglusman has joined #ruby
apok has quit [Ping timeout: 255 seconds]
<workmad3> iToast: brainfuck is provably simpler than ruby... brainfuck is the simplest possible turing complete language
<Xethron> However, I think ruby makes it into a string instead of a number, because the script crashes when it reaches this line
* deryl surveys in the channel are *rarely* welcome
<workmad3> iToast: you only need to learn 8 symbols for the entire language
<Xethron> if (sql_limt-sql_limb) > 20
<workmad3> iToast: no one said it was easier to program in than ruby though :P
<iToast> ok, workmad3 Type out in brainfuck "The quick brown fox jumped over the lazy dog and ran around the fence" in brainfuck and put it on pastebin then link us it.
<Spooner> Xethron : Yeah, it always becomes a number. Use to_i or to_f on $1
<iToast> ok, workmad3 Type out in brainfuck "The quick brown fox jumped over the lazy dog and ran around the fence" in brainfuck and put it on pastebin then link us it.
<canton7> Xethron, yes, you matched some digits out of a string. they're still a string.
<Spooner> *always comes out of a regexp as a string. Oops.
<workmad3> iToast: just because a language is simple doesn't make it easy ;)
<Xethron> oki, lemme try
<iToast> ;D
<cl0ckw0rk> https://www.surveymonkey.com/s/TFFKHRJ - it's quite literally a 5 second survey...
<Xethron> $1.to_i
<Xethron> like that?
<workmad3> iToast: PHP is simple
<dcope> Xethron: what
<deryl> yay for unsolicited surveys!
<dcope> "1".to_i
<workmad3> it has simple syntax
<iToast> Ima make a blind quess workmad3 I want you do work on it.
<iToast> :)
<shevy> it also has very ugly syntax
<workmad3> shevy: yup :)
<iToast> workmad3: I'm just making a blind guess here, brainfuck is basically shifting cells in memory?
wallerdev has joined #ruby
<shevy> :P
<canton7> iToast, http://pastie.org/4171875
<shevy> brainfuck is what bored programmers come up with
<iToast> Lol
<iToast> Ok.
<deryl> wow, that pastie shows me the language at least is *very* aptly named
<workmad3> shevy: brainfuck is what one bored programmer came up with... there's also Ook, intercal, java2k, whitespace, the shakespear programming language, c++...
<iToast> Write a interpretor in ruby that lets you create functions in plain english.
<canton7> workmad3, haha
<shevy> I dunno
peregrine81 has joined #ruby
<deryl> workmad3: was that a shot over the bow? (c++)
<shevy> brainfuck vs. c++ now that's a tough call
<deryl> don't make me cry
lasermike026 has joined #ruby
<workmad3> deryl: :D
<canton7> deryl, I think it's the most satisfying language I've used. The pure pain of trying to input a string then print it out backwards means a very large rush when it works...
<shevy> oh man
<deryl> canton7: hahahah
<canton7> (in small doses only of course)
<deryl> niiice
<workmad3> shevy: on the one hand, you have arcane programs filled with obscure, meaningless symbols and apparently no way to understand anything
<workmad3> shevy: on the other hand, you have brainfuck...
<iToast> Ima put a challenge up for who ever is willing to take it.
apok has joined #ruby
<shevy> iToast you must solve it
<workmad3> canton7: you should try java2k at some point ;)
graspee has joined #ruby
josefig has joined #ruby
josefig has quit [Changing host]
josefig has joined #ruby
chimkan_ has joined #ruby
<canton7> workmad3, that looks awesome! thanks
ph^ has joined #ruby
<iToast> There is a challenge.
<shevy> noooooo
timonv_ has quit [Read error: Connection reset by peer]
abra has joined #ruby
<iToast> ;)
<iToast> Quite simple.
timonv has joined #ruby
ckrailo has joined #ruby
Kevin____ has joined #ruby
<canton7> not really. very ill-defined
<workmad3> iToast: I give you your solution: http://en.wikipedia.org/wiki/Prolog
<iToast> workmad3: Damn you :P
Synthead has joined #ruby
<apeiros_> iToast: you reinvent hypertalk?
<deryl> workmad3: bwahahaha
<iToast> XD
Kevin___ has quit [Read error: Connection reset by peer]
<workmad3> deryl: everyone loves a bit of prolog, right? :)
<deryl> i flipped back to the channel and saw that. yer funny
<shevy> hypertalk was apeiros_ favourite language long before eiffel
<deryl> hehehe
<iToast> Im guessing apeiros_ is accient?
<iToast> Runing a z80.
<iToast> Still yelling how his 800k of memory is plenty
<shevy> no
<shevy> he runs ruby on rails now
savage- has quit [Remote host closed the connection]
<shevy> that's faster
elliomax has joined #ruby
elliomax has left #ruby [#ruby]
lorandi has joined #ruby
vlad_starkov has joined #ruby
elliomax has joined #ruby
<kalleth> i'm going to watch 'wat' again
<elliomax> That video is leet
elliomax has left #ruby [#ruby]
<shevy> wat
fermion has quit [Quit: P]
<Spooner> iToast i: if gets == "Charlie has a bike" and gets == "What does Charlie have?" then puts "-> bike" end
<Gadgetoid> Haha, love those guys
<iToast> Spooner: Is the first one to do it :D
Kevin____ is now known as musicman
<iToast> We should have quick simple programming challenges in this channel.
<iToast> :)
<Xethron> dcope, Sp4rKy and canton7: thanks, that worked :D
<Gadgetoid> Hmm, to push or not to push, that is the question
<Gadgetoid> Whether it be nobler to suffer the slings and arrows of a broken gem, or sod about actually testing it
<iToast> Thats my question thats way to long to explain on IRC
mengu has quit [Quit: Konversation terminated!]
elhu has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<wobr1> iToast: yes
<dcope> iToast: yes, it's a loop
mdemare_ has joined #ruby
<iToast> dcope: thats not what I ment, wobr1 understood and yea :P
<Xethron> Ok, now, for some reason my prepaired SQL doesn't wanne fetch a row... I checked the SQL statement, it works perfectly, but this one doesn't....
<Xethron> get_info = @config.my.prepare ( sql )
<Xethron> get_info.execute( )
<Xethron> while row = get_info.fetch_row do
Faris has joined #ruby
quest88 has quit [Quit: quest88]
<Xethron> I mean, ruby doesn't wanne go past the while row = get_info.fetch_row do part
<musicman> iToast: sort of. the #each method exists for arrays and other enumerable objects. so as long as @names is an array or similar, it will go through each name, call it "name" for the scope of the block, and execute whatever code is inside the block for each one.
<iToast> musicman: ok
<Synthead> how can I capture the exit status on a PTY.spawn in ruby 1.8 ?
<wobr1> iToast: my answer was the same a dcope
<iToast> lol
akem has joined #ruby
<Gadgetoid> Raspberry Pi owners can now gem install wiringpi or gem update, hurrah!
<iToast> Ok
jslvk has joined #ruby
<canton7> Gadgetoid, oh fantastic, thanks!
<Xethron> Gadgetoid, you have a Rasberry Pi???
<Xethron> :(
<iToast> Last question for that guide.
* Xethron is still waiting for his
<iToast> When you define a variable with @, does it make it local?
liluo has joined #ruby
<canton7> Xethron, really? I've had 3...
ph^ has quit [Remote host closed the connection]
<Gadgetoid> Xethron: yup!
<hoelzro> iToast: it's an instance variable
<Xethron> :O
arkiver has quit [Quit: Leaving]
<Xethron> One of em is mine!!!
Targen has joined #ruby
<musicman> iToast: @ variables are usually used as instance variables in a class.
<Xethron> I guess South Africa isn't a Priority
PaciFisT has quit [Ping timeout: 255 seconds]
<canton7> though I was awake and clicking when they were released
<iToast> hoelzro: So basically it only exists when the function is run?
ph^ has joined #ruby
timonv has quit [Remote host closed the connection]
<Gadgetoid> Driving a serial->VGA adaptor in Ruby is quite shiny… I'm working on a roguelike for luls
mnaser has quit [Ping timeout: 252 seconds]
<iToast> Ok, letme refrase my question and I only want a yes or a no.
<ccooke> Gadgetoid: interesting. What sort of refresh rate are you able to get? :-)
<iToast> a variable starting with a @ only exists when the function / class is used.
timonv has joined #ruby
<iToast> and gets destroyed when the function is over
liluo has quit [Remote host closed the connection]
<musicman> no.
<Gadgetoid> ccooke: the VGA display is being driven by a separate IC, which accepts serial commands for text placement/basic window creation and handles refreshing itself for a stable image
<iToast> musicman: Explain
* ccooke has a raspberry pi that's sitting in its box, becauce I haven't yet had any time to do anything with it. I wDefinitely need to take some holiday soon :-/
<hoelzro> iToast: no; variables are implicitly local in Ruby
<iToast> ok.
<Spooner> A variable starting with i, j or k is an integer :D
<hoelzro> a variable beginning with $ is global
<iToast> Im confused with the @...
<iToast> >_<
<hoelzro> with @ is an instance variable (a property of the object)
<Gadgetoid> ccooke: I'm still experimenting with how fluid I can get an ASCII roguelike, but as the driver board has a buffer I should be able to get good results by just redrawing the bits that change. I'm using this: http://hobbytronics.co.uk/serial-vga
<hoelzro> with @@ is a class variable
<ccooke> Gadgetoid: nice
jgrevich has joined #ruby
<musicman> iToast: AFAIK, @ variables are local to a class. I don't know if they are local in other contexts. let me go check...
<iToast> ok
<iToast> thats all I needed musicman :)
<apeiros_> musicman: wrong
<apeiros_> @ variables are local to an *object*
<canton7> iToast, http://pastie.org/4171960
Tricks has quit [Quit: No Ping reply in 180 seconds.]
Tricks has joined #ruby
<apeiros_> a class is also an object, so yes, it can also be local to a class. but that's only a subset of all objects.
mnaser has joined #ruby
<musicman> apeiros_: oops, my bad. that's right. @@ variables are class variables.
<Gadgetoid> I'll likely wrap up the API into a wiringpi expansion gem, and I'm coaxing the developer to add some drawing functions
Enekoos has joined #ruby
<apeiros_> musicman: yes, and they're not local just to their class. sadly.
<apeiros_> @@vars are shared over the inheritance
<graspee> Gadgetoid: fluity is not a problem with an ascii roguelike in ruby or shouldn't be. i have a roguelike in ruby in opengl that's fluid. admittedly it has no LoS checks yet
<iToast> canton7: So its a locally created variable but can be accessed from other locations.
<iToast> canton7: Also, @time and time will have different values, correct?
<Gadgetoid> graspee: depends what crazy method you're using to do your display output :D
<canton7> iToast, it belongs to the instance of the class. different methods can set and read it, but its state belongs to that class instance
<graspee> i have a 3d dungeon
<iToast> canton7: that makes alot more sense.
ph^ has quit [Ping timeout: 264 seconds]
<iToast> Thanks :)
<graspee> with textured walls and lighting
<iToast> ph^ is having alot of internet problems.
<Xethron> How can I retreive multiple rows with a MySQL Prepared statement?
<Xethron> I used
zommi has quit [Remote host closed the connection]
<Xethron> get_info = @config.my.prepare ( sql )
<Xethron> get_info.execute( )
<Xethron> while row = get_info.fetch_row do
ph^ has joined #ruby
<Xethron> But it fails on the last line
<Gadgetoid> graspee: Doing it via serial has interesting challenges, especially when the driver board seems to choke on ~3000 chars being sent at 115200baud
<graspee> i never had working on ssh as a goal
<graspee> mine is designed to be run locally
<graspee> with all the problems of distribution that entails
<Gadgetoid> graspee: the serial connection is only for display out, I'm basically just trying to do simple things in complex ways to appease my own masochistic programming urges
robin850 has joined #ruby
PaciFisT has joined #ruby
eregon_ is now known as eregon
gianlucadv has quit [Quit: ZNC - http://znc.sourceforge.net]
<graspee> that's... unconvential
<Gadgetoid> graspee: so it is all, in fact, local… I could output it via HDMI using OpenGL or SDL… but that's not painful enough, and doesn't help in testing the serial-vga board
v0n has joined #ruby
macmartine has joined #ruby
<graspee> unconventional*
davidcelis has quit [Ping timeout: 252 seconds]
minijupe has joined #ruby
PaciFisT has quit [Client Quit]
nateberkopec has joined #ruby
PaciFisT has joined #ruby
dsa has joined #ruby
hayon has quit [Quit: hayon]
<Spooner> graspee: Even with LOS and pathfinding, a roguealike would run much faster tahn needed in Ruby. Done a lot more with Ruby myself (in turn and real-time games).
<Xethron> Ok, when I use this it works:
<Xethron> get_info = @config.my.query(sql)
<Xethron> while row = get_info.fetch_row do
D4T has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Xethron> But when I use this, it doesn't:
<Xethron> get_info = @config.my.prepare ( sql )
<Xethron> get_info.execute( )
<Xethron> while row = get_info.fetch_row do
mdemare_ has quit [Quit: mdemare_]
<Xethron> Is there another way to fetch rows with a prepared SQL Statement?
vlad_starkov has quit [Remote host closed the connection]
gianlucadv has joined #ruby
<Spooner> I'd expect there to be a get_info.each_row, but that is just a guess.
Faris has quit [Ping timeout: 246 seconds]
<Xethron> Spooner: while row = get_info.each_row do
<Xethron> like that?
nirakara has joined #ruby
<Sigma00> I'm sure each_row accepts a lambda
<Sigma00> if it exists
niku4i has quit [Remote host closed the connection]
nirakara has quit [Max SendQ exceeded]
baroquebobcat has joined #ruby
EzeQL has quit [Ping timeout: 252 seconds]
niku4i has joined #ruby
<Spooner> No, "while" and "for" isn't very rubyish. (still a guess though; #each might work instead) get_info.each_row do |row|... end
nirakara has joined #ruby
schovi has quit [Remote host closed the connection]
baroquebobcat has quit [Read error: Connection reset by peer]
<apeiros_> Sigma00: the term is "a block"
baroquebobcat has joined #ruby
<apeiros_> a lambda is when you actually create an object, like: x = lambda { … }
<Xethron> Spooner: sec
kzar has joined #ruby
thomas has quit [Quit: leaving]
bambanx has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Faris has joined #ruby
thomas has joined #ruby
<Xethron> Spooner: nope, still not :/
ph^ has quit [Remote host closed the connection]
hoelzro is now known as hoelzro|away
plastics- has quit [Ping timeout: 264 seconds]
williamcotton has joined #ruby
niku4i has quit [Ping timeout: 240 seconds]
mockra has joined #ruby
GuidovanPossum has quit [Quit: GuidovanPossum]
project2501a has joined #ruby
wobr1 has quit [Ping timeout: 246 seconds]
billiamii has joined #ruby
<project2501a> hey guys. i am reading the o'reilly ruby book. i got a question please: class Area ; class << self
<project2501a> that is a def of a class within a class, got that. the << is assignment, got that as well
<project2501a> what is the self token?
<project2501a> what is the self token, please?
<daed> project; to open the Area class
<daed> it's the same as class Area; def self.method(); end; end;
Fraeon has joined #ruby
<daed> if that helps
<project2501a> yeah it does
gianlucadv has quit [Quit: ZNC - http://znc.sourceforge.net]
<project2501a> is that done by reflection?
<project2501a> or recursion?
<daed> not sure
<daed> i see it both ways frequently
<project2501a> alright. ok, that clears things up a bit. thank you.
<daed> generally class << self; if they want to define several different methods at once
timonv has quit [Remote host closed the connection]
<project2501a> daed: so, it's syntactic sugar, basically
<daed> it's possible
<daed> internally it may be more efficient
timonv has joined #ruby
<daed> i'm not sure, would be awesome if someone else chimed in :P
<project2501a> cool. 60 more pages to go.
<project2501a> then onwards to getting a peak at that rails thingies with passenger orwhatevs
bashdy has joined #ruby
Eldariof-ru has quit [Ping timeout: 246 seconds]
<Hanmac> information: this is not the right channel for rails questions
yfeldblum has quit [Quit: Leaving]
<Hanmac> look for #rubyonrails
<project2501a> hai hai
gianlucadv has joined #ruby
Tricks_ has joined #ruby
jfoley has joined #ruby
dsa has quit []
hynkle has quit [Read error: No route to host]
EzeQL has joined #ruby
Tricks_ has quit [Remote host closed the connection]
Helius has quit [Remote host closed the connection]
Tricks_ has joined #ruby
justinmcp has quit [Remote host closed the connection]
<macmartine> If I have a hash of attributes that match the properties of one of my objects, what's the easiest way to make an object out of the values in the hash?
Tricks has quit [Ping timeout: 245 seconds]
artOfWar_ has quit [Remote host closed the connection]
<Xethron> Meh, ok, I tried everything now
<Tasser> macmartine, properties? method names you want to call?
<Xethron> So does a prepared statement and a normal MySQL Query'r result look different?
piotr_ has quit [Ping timeout: 246 seconds]
mockra has quit [Remote host closed the connection]
gianlucadv has quit [Client Quit]
cakehero has joined #ruby
SeanLazer has joined #ruby
khakimov has joined #ruby
kzar has left #ruby ["Killed buffer"]
hynkle has joined #ruby
fearoffish has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
mnaser has quit [Ping timeout: 244 seconds]
gianlucadv has joined #ruby
Habib has joined #ruby
Progster has quit [Ping timeout: 244 seconds]
plastics has joined #ruby
vlad_starkov has joined #ruby
awarner has joined #ruby
mnaser has joined #ruby
<Habib> Hey. Does NetBeans still support Ruby?
umttumt has joined #ruby
Progster has joined #ruby
maletor has quit [Ping timeout: 244 seconds]
<deryl> they pulled the support
hemanth has quit [Read error: Connection reset by peer]
jslvk has quit [Quit: Page closed]
hemanth has joined #ruby
eywu has joined #ruby
Tulak has quit [Quit: Leaving.]
maletor has joined #ruby
robotmay has quit [Remote host closed the connection]
davidcelis has joined #ruby
blumbri has quit [Remote host closed the connection]
lasermike026 has quit [Quit: ChatZilla 0.9.88.2 [Firefox 13.0.1/20120614114901]]
peregrine81 has quit [Quit: Goodbye.]
nirakara has quit [Ping timeout: 245 seconds]
flype has joined #ruby
wallerdev has quit [Quit: wallerdev]
CheeToS has quit [Ping timeout: 246 seconds]
schovi has joined #ruby
mnaser has quit [Ping timeout: 255 seconds]
<iToast> hey.
<iToast> Ok lets say we download a webpage
<iToast> How would I get a url from it?
<iToast> All I wan't is urls.
<davidcelis> what
wallerdev has joined #ruby
mohits has quit [Ping timeout: 264 seconds]
timonv has quit [Remote host closed the connection]
shevy has quit [Read error: Operation timed out]
<iToast> davidcelis: I want to download a webpage
<iToast> and strip the URLS from it
<iToast> I found "URI.extract" but the document think is dead.
mnaser has joined #ruby
<iToast> even then the person pointed out its flaws
<kalleth> net http and nokogiri looking for A tags?
<iToast> what
kenperkins has quit [Quit: Computer has gone to sleep.]
tewecske has joined #ruby
<kalleth> the chicken has a blue panda drum and bass highlighting halo
<iToast> Lets assume we have the webpage stored in a variable like webpage
<iToast> I want to sift through it and pull out any URL's it has.
<kalleth> lets assume you know how to google, and assume you saw my response and went to google.com and typed in 'nokogiri ruby'
<iToast> Those can go into a array and wait to be put into a seperate file.
<iToast> ....
crankycoder has quit [Remote host closed the connection]
<ramblex> iToast: webpage.scan(/http:\/\/\w+/))
<ramblex> probably with a better regex
gtuckerkellogg has quit [Ping timeout: 264 seconds]
tiripamwe has quit [Ping timeout: 246 seconds]
<kalleth> ramblex: ewww, regex ;p
<iToast> ok.
<kalleth> i'd use nokogiri looking for 'a' tags and then strip out the href tags for each a tag i found, storing them in an array
<kalleth> and net-http to retrieve the web page in the first place
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<ramblex> guess it depends if you're looking for a tags or just urls
<kalleth> meh
<kalleth> yeah
<kalleth> i care little /sleep
<iToast> I'm just after all the URLS
maletor has quit [Quit: Computer has gone to sleep.]
<davidcelis> nokogiri.
<davidcelis> or hell, mechanize
schovi has quit [Remote host closed the connection]
<davidcelis> i think mechanize has a method you can call on a Page that literally just gives you an array of links
timonv has joined #ruby
<kalleth> ooh
<kalleth> didnt know that
<kalleth> *googles*
<Habib> can anyone advice me some linux gui ide for ruby?
<kalleth> habib: gvim
<kalleth> DON'T ALL LAUGH AT ONCE
<iToast> Ok
<davidcelis> Yep, it does. Mechanize::Page#links
<davidcelis> lolol
<iToast> Im writing a URL ripper in ruby...
mxweas has joined #ruby
SeanLazer has quit [Ping timeout: 255 seconds]
<iToast> I know there is a huge flaw in it that I need to figure out a solution for.
<banisterfiend> iToast: i dont believe you
<kalleth> habib: seriously, though, people rave about Sublime Text
sailias has quit [Read error: Operation timed out]
<davidcelis> a... URL ripper?
<kalleth> i've taken a look at it, but couldn't handle vim
ben_alman has quit [Excess Flood]
<kalleth> davidcelis: it'll be one of those rentacoder type jobs 'CRAWL THIS WEBSITE GIVE ME THE DATA'
<kalleth> $20
cbuxton has joined #ruby
<Habib> no thnx
<Habib> i used rubymine
<Habib> but it's only for win
<kalleth> ... Sublime Text
<kalleth> i didn't say rubymine
tiripamwe has joined #ruby
<davidcelis> iToast: agent = Mechanize.new; agent.get('http://my.url.com/').links.each { |link| puts link.uri }
avandenhoven has joined #ruby
xnm has joined #ruby
<davidcelis> iToast: holy shit so easy bro omgomgomgomgomg
<kalleth> ruby high
tiripamwe has quit [Client Quit]
<kalleth> 5
<iToast> davidcelis: Im new to ruby
<iToast> Don't be a ass.
<kalleth> an
mnaser has quit [Ping timeout: 265 seconds]
<kalleth> don't be _an_ ass
<iToast> kalleth: I can use either ;P
<kalleth> no, no, you can't
<kalleth> ¬_¬
<iToast> I can. and I did.
yannis has quit [Quit: yannis]
<iToast> umadbro.
<davidcelis> iToast: I'm not being an ass; that's presumptuous of you.
tiripamwe has joined #ruby
<kalleth> well you're wrong.
<wub1> I just installed pry but it is not loading when i $pry
<kalleth> also, calling people an ass when they're helping you is a bit... erm
<wub1> This happened once before but I forgot the fix
<kalleth> ass-like?
workmad3_ has joined #ruby
<iToast> kalleth: I never said I wasn't wrong.
<iToast> davidcelis: is a brogrammer.
<davidcelis> iToast: A problem with people like you on the internet is that you assume negativity from others even when that is a very difficult thing to parse in written language.
<kalleth> davidcelis is my brogrammer HE HOLDS THE BRO TO MY GRAMMER HEART
<iToast> davidcelis: you acted like a ass.
<kalleth> ^5, pour one out for my homie etc
lorandi has quit [Quit: Leaving]
<iToast> Its not a problem with me, you said "[12:09] <davidcelis> iToast: holy shit so easy bro omgomgomgomgomg"
jgrevich has quit [Read error: Connection reset by peer]
<iToast> Thats being a complete ass just because you already know how to do it.
<kalleth> iToast: go back to coding and come back when you have a problem </hypocrite>
<davidcelis> iToast: Mechanize excites me. I'm sorry that you took that as negativity. No, wait, I'm not. I have nothing to apologize for.
<iToast> Loool
<iToast> davidcelis: [12:09] <davidcelis> iToast: holy shit so easy bro omgomgomgomgomg
bradhe has joined #ruby
<kalleth> davidcelis: mechanise excites me too
<kalleth> in fact, brb, toilet, mechanize
<davidcelis> iToast: You already quoted that. Your point?
<Habib> sublime text?
<kalleth> habib: yeah, mates of mine say it's a good editor
<wub1> Any experienced PRY grammers here?
<kalleth> habib: ruby doesn't really _need_ an IDE
mxweas has quit [Ping timeout: 246 seconds]
mnaser has joined #ruby
<kalleth> habib: just a good text editor
<iToast> "holy shit so easy bro omgomgomgomgomg" your acting like I'm doing something so complicated and you just did it easy like you know more then me, I'm just learning the language afterall.
<davidcelis> habib: Sublime Text 2 is fantastic. Definitely check it out.
<Habib> i know
nirakara has joined #ruby
<kalleth> ^
<banisterfiend> wub1: i think davidcelis knows a bit about pry
jgrevich has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
<davidcelis> wub1: Sup?
<kalleth> wub1: he's busy arguing right now, but leave a message...
tiripamwe has quit [Client Quit]
oooPaul has joined #ruby
<davidcelis> kalleth: Nah, I'm done. I tried to show the guy an easy way to do what he was trying to do, and apparently I'm an ass. Good times.
tds has joined #ruby
<Habib> i used to run in terminal but rubimine solved alot of issues like looking for gems in different sources
<iToast> davidcelis: You were not showing me a easy way
<kalleth> davidcelis: i'm pretty sure he just complteely misinterpreted what you said
<iToast> you were being a prick.
<Habib> is it freeware?
<kalleth> iToast: errm, a one liner statement to do exactly what you want, how is that not an easy way?
<davidcelis> habib: RubyMine is kinda bloated; IDEs in Ruby are typically pretty unnecesssary
mxweas has joined #ruby
<iToast> kalleth: the way he put it is rude.
<davidcelis> habib: No, there's a license.
<iToast> kalleth: I'm doing this with raw sockets.
<kalleth> iToast: also, you've misinterpreted the statement you just pasted, it was actually a comment on how easy mechanize makes it, nothing to do with you
<wub1> davidcelis, I just installed pry but it is not starting in the command line
<Habib> ok i'll use notepad ++
booginga has quit [Quit: Leaving]
<deryl> oh christ, grow a set of balls iToast
<deryl> christ
<tds> why is that when you call ancestors on an eigenclass/singleton class, it doesn't include its superclass?
<tds> e.g.
<tds> 1.9.3p194 :014 > eigen(B).ancestors
<tds> => [Class, Module, Object, Kernel, BasicObject]
<tds> 1.9.3p194 :015 > eigen(B).superclass
<tds> => #<Class:A>
<davidcelis> iToast: Nobody else in here thought I was being a prick, dude. You should read a bit about the psychology of interacting with others on the internet.
<kalleth> deryl: methinks a bit of NIH disease
<tds> with class B < A
<iToast> davidcelis: You support internet manners right?
<davidcelis> tds: Please use gist when pasting code that's more than a line; otherwise it gets spammy in here
<deryl> tds: gist.github.com you don't paste to the channel
<wub1> davidcelis: Ruby 1.9.3 Ubuntu 12.04
<kalleth> tds: pastie.org/gist
<tds> davidcelis: sorry :(
<deryl> err so you
<iToast> tds: we all make that mistake.
<davidcelis> iToast: Unless someone is being very obviously negative, you should assume that they are speaking to you with positive intent. Guess what? I was speaking to you with positive intent.
<davidcelis> tds: No worries :)
elhu has joined #ruby
<tds> kalleth: that URL didn't work?
<iToast> davidcelis: You didn't structure it in such a way it'd be a positive intent.
mohits has joined #ruby
<kalleth> tds: pastie.org or gist.github.com
<kalleth> i meant
<iToast> davidcelis: Make it more direct.
<davidcelis> wub1: How are you trying to start it?
<tds> ah
shevy has joined #ruby
<kalleth> i use pastie, people here prefer gists
<wub1> pry
<iToast> Ok now im lost.
<deryl> it will return a HTTPS url. give us that, NOT the git:// link
<iToast> We have gist pastie pastebin piratepaste
<deryl> tds: for future reference :)
<iToast> What paste system do you guys want us to use?!
<davidcelis> iToast: It is not my fault that you interpret "omgomgomgomg" as negativity when it was just that I like Mechanize a lot. Again, I don't feel I was in the wrong or have anything to apologize for. And again, I'm done with this.
<kalleth> iToast: gist permits revisions by other github people, hence why people in here prefer it
<deryl> iToast: most of us will not use anything but pastie.org or gist.github.com
<davidcelis> wub1: Are you getting an error? Or are you just somehow getting a normal IRB?
<iToast> davidcelis: You shouldn't put "omgomgomgomg" then.
<tds> thanks! ill reask with it into a gist
<kalleth> great, tds :)
<iToast> kalleth: deryl makes sense!
<wub1> davidcelis: no error except pry unknown command
<kalleth> iToast: so do i!
<deryl> we don't support ad featuring sites, and generally the other sites do not properly support syntax hilighting, the ability to use a gist as a git repo etc
<davidcelis> wub1: Are you using RBenv?
<wub1> rvm
DrShoggoth has joined #ruby
<iToast> kalleth: you are directly to the point, like ruby.
<davidcelis> wub1: `which pry` shows nothing?
<kalleth> AND LDAP IS LIGHTWEIGHT, RIGHT, GUYS, RIGHT?
iocor has quit [Quit: Computer has gone to sleep.]
<kalleth> (i should have added sarcasm tags there)
<wub1> davidcelis: yep, nothing
ben_alman has joined #ruby
carloslopes has quit [Quit: Leaving.]
<tds> ok
<davidcelis> wub1: How'd you install it?
<wub1> gem install pry
<jwg2s> I want to write a comma at the end of each loop unless its the last iteration, how can i do that?
<tds> can anyone explain this strange behaviour?
ukd1 has joined #ruby
<davidcelis> wub1: I haven't used RVM for a long time, so I'm not really sure... Sorry
<banisterfiend> wub1: why do u want to use pry for anyway, irb is way better
ukd1 is now known as Guest6544
mxweas has quit [Ping timeout: 250 seconds]
saschagehlich has quit [Quit: saschagehlich]
<davidcelis> banisterfiend: lolol
<iToast> perfect
<iToast> i got a ruby array :D
<tds> namely why does eigen(B).ancestors.include?(eigen(B).superclass) == False
bluOxigen has quit [Ping timeout: 246 seconds]
<wub1> I need the colors, when will Ruby devs get IRuby like IPython???
<davidcelis> wub1: wirble
techhelp has joined #ruby
<davidcelis> wub1: Though I wouldn't give up on pry; banisterfiend is just a dumb
kenichi has joined #ruby
neersight[d] has quit [Quit: neerQuit! Liek a Baws!]
<banisterfiend> irb 4 life
<iToast> ughm.
mxweas has joined #ruby
<davidcelis> ughm?
<iToast> I got a tiny problem.
<kalleth> tds: i've looked, but i have no idea, sorry. Ta for putting it in a gist though, someone else might jump in here :)
<kalleth> iToast: we can tell
<deryl> wub1: pry, pry-doc, pry-nav, pry-editline, pry-coolline, pry-stack_explorer, pry-exception_explorer, pry-highlight, pry-syntax-hacks :)
<wub1> Wirble looks interesting but I was just getting used to pry on my desktop... stuck trying to get it running on my laptop
<tds> kalleth: thanks :)
<deryl> full stack for you. and it will give you all the coloring you want
<iToast> webpage.scan, can I use it in a while loop so while i < webpage.scan() i++
<banisterfiend> wub1: hmm what features do you miss from ipython that you dont find in pry?
<davidcelis> deryl: He installed it under RVM but the executables not getting found
<iToast> to continue as long as webpage.scan has links
hemanth has quit [Read error: Connection reset by peer]
<wub1> none, thats why I like it, though a notebook and qtconsole would awesome
<deryl> davidcelis: gem list pry -dl
<davidcelis> wub1: Do your other gems work fine? Is your gem path in your $PATH?
<kalleth> tds: no idea if that'll help
<deryl> if he's in a project directory, he has to add pry to his Gemfile and bundle install for it to be usable
hemanth has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
<tds> kalleth: ah, no that doesn't quite help, but thanks for looking :)
<kalleth> np :)
hemanth has joined #ruby
<davidcelis> kalleth: Sweet post either way, though
<ramblex> iToast: scan returns an array, you can just use .each on it
<kalleth> davidcelis: 5pm on a friday, it's breaking my head :)
savage- has joined #ruby
<tds> i had a bit of a head breaking moment yesterday upon realizing that eigenclasses are infinitely recursive
<kalleth> ah,
<deryl> i still have trouble wrapping my head around them
liuchong has quit [Quit: Leaving]
<kalleth> my head breaking moment came when someone tried to tell me that infinity wasn't necessarily infinity
<kalleth> and that there were multiple types
<kalleth> i felt pretty dumb ;(
mxweas has quit [Ping timeout: 248 seconds]
<deryl> i get their reason for existance and stuff, its the usage pattern that confuses me at times
bricker88 has joined #ruby
<kalleth> you're a step ahead of me then :)
frederike has joined #ruby
<wub1> .rvm/bin is in the path
<Hanmac> banisterfiend pry still not using the newest slop? :/
<frederike> Hi! My ruby & rails installation is broken (Windows 7)
<frederike> don't know how to repair it
<tds> yeah, they are very nebulously defined. apparently they were only an implementation detail of MRI before and not really meant to be accessed by devs
<iToast> frederike: this is ruby, not ruby on rails.
<frederike> ahh ok
<wub1> deryl: pry is listed as a local gem
<davidcelis> iToast: Well if his Ruby installation is broken too, we could likely help him with that here. No need to send him away quite yet
<iToast> frederike: I confused the two :P
<iToast> frederike: I confused them both too* :P
project2501a has quit [Quit: Leaving]
mneorr has joined #ruby
<banisterfiend> Hanmac: we haven't released a new gem yet, it's using slop 3.0 on HEAD
<banisterfiend> Hanmac: we're releasing a new gem soon
emmanuelux has quit [Ping timeout: 246 seconds]
<Hanmac> slop 3.0 seems old again ... 3.3.2 is current :P
<banisterfiend> Hanmac: ew're on 3.3.2
<banisterfiend> i just mean the 3.0 series
Criztian has joined #ruby
maletor has joined #ruby
<frederike> gem list : https://gist.github.com/3018974
<frederike> Output of bundle install: Fetching gem metadata from http://rubygems.org/......... Fetching gem metadata from http://rubygems.org/.. Encoding::UndefinedConversionError: "\x81" to UTF-8 in conversion from Windows-1 252 to UTF-8 An error occured while installing rake (0.9.2.2), and Bundler cannot continue. Make sure that `gem install rake -v '0.9.2.2'` succeeds before bundling.
mnaser has quit [Ping timeout: 264 seconds]
<frederike> don't know what to do
mneorr4 has quit [Ping timeout: 248 seconds]
tiripamwe has joined #ruby
oliwer has left #ruby ["Ex-Chat"]
jfoley has quit [Remote host closed the connection]
jfoley has joined #ruby
fbernier has quit [Ping timeout: 264 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
mxweas has joined #ruby
<kalleth> what's coming in rails 4?
sspiff has quit [Remote host closed the connection]
elhu has quit [Quit: Computer has gone to sleep.]
<kalleth> new ways to drive me to sinatra?
<kalleth> ;/
banghouseAFK is now known as banghouse
mnaser has joined #ruby
<Xethron> Does a prepared statement and a normal MySQL Query'r result look different?
<davidcelis> kalleth: Queueing
demet8 has joined #ruby
<davidcelis> kalleth: Better PSQL support
mxweas has quit [Client Quit]
_N1X_ has quit [Ping timeout: 240 seconds]
timonv has quit [Remote host closed the connection]
<davidcelis> kalleth: http://www.edgerails.info
tiripamwe has quit [Quit: Leaving]
demet8 has left #ruby [#ruby]
davidw has quit [Read error: Operation timed out]
<jwg2s> Trying to only put a comma on a line if it's the last iteration of the loop. Here's what I've tried: https://gist.github.com/3019023
<jwg2s> line 21
crankycoder has joined #ruby
dr0p has quit [Remote host closed the connection]
bashdy has quit [Quit: bashdy]
<jwg2s> if it's not* the last iteration
mengu has joined #ruby
elhu has joined #ruby
<Xethron> Meh, anyone here use MySQL Prepared statements in Ruby?
kenperkins has joined #ruby
<Xethron> Because if I do a normal query like this, it works perfectly!
<Xethron> get_info = @config.my.query(sql)
<Xethron> while row = get_info.fetch_row do
apok has quit [Quit: apok]
<Xethron> But when I do a query like this, it does nothing....
<Xethron> get_info = @config.my.prepare ( sql )
<Xethron> get_info.execute( )
<Xethron> while row = get_info.fetch_row do
larissa has joined #ruby
neersighted|AFK has joined #ruby
<Xethron> And I don't find anything online
neersighted|AFK is now known as neersighted
<jwg2s> Anyone? please i'm stuck, i know it's a common problem but i can't see where my logic is wrong here
<rking> Xethron: I can't really help, but I think whoever can needs to know what MySQL library you're using.
<Xethron> umm
<Xethron> rking, the standard MySQL one?
<Xethron> lol
<Xethron> How can I check?
<rking> jwg2s: Try to figure out a way to get it to be: arr.join ', '
<Spooner> jwg2s : @headers.last == header}" can't be good.
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<rking> Xethron: p @config.my.class
<jwg2s> Spooner: ahh ok, still learning here :)
nirakara has quit [Quit: This computer has gone to sleep]
LBRapid has quit [Quit: Farewell.]
<workmad3_> Xethron: I think he means the mysql gem, or the mysql2 gem
lxsameer has quit [Max SendQ exceeded]
<Spooner> Oh sorry, I'm an idiot. Problem with very long lines :$
yannis has joined #ruby
kaspernj has quit [Ping timeout: 244 seconds]
lxsameer has joined #ruby
lxsameer has quit [Changing host]
lxsameer has joined #ruby
<jwg2s> Spooner: for me?
<ramblex> Xethron: try using fetch instead of fetch_row
<Xethron> ramblex, ok...
crankycoder has quit [Remote host closed the connection]
<Xethron> still the same line?
<Xethron> while row = get_info.fetch do
crankycoder has joined #ruby
<ramblex> get_info.execute.each { |row| p row } seems to work too
khakimov has joined #ruby
jduan1981 has joined #ruby
bglusman has quit [Remote host closed the connection]
<Xethron> ramblex, ok, but where do I place the loop in: get_info.execute.each { |row| p row }
<Xethron> is that a loop?
fulmato has joined #ruby
crankycoder has quit [Remote host closed the connection]
<ramblex> each iterates through the rows
ph^ has joined #ruby
ph^ has quit [Remote host closed the connection]
apok has joined #ruby
<Spooner> jwg2s Yeah, sorry.
ph^ has joined #ruby
LVLAaron has joined #ruby
<LVLAaron> Can anyone help me out with extra credit #3? http://ruby.learncodethehardway.org/book/ex16.html
<Xethron> ramblex: I use the following...
<Xethron> while row = get_info.fetch_row do
<Xethron> res_output = "#{res_output} #{place}: #{row[0]} (#{row[1]});"
<Xethron> place += 1
<Xethron> end
<ramblex> Xethron: http://gist.github.com
<Xethron> How do I change that to work with get_info.execute.each { |row| p row } ?
<Xethron> I'm not sure I understand
<Mon_Ouie> LVLAaron: Could you be more specific about what you don't understand/know how to do?
<LVLAaron> <- day one with ruby. not sure how to do any of it :)
<Mon_Ouie> I'd suggest using an array instead of those 3 variables
<LVLAaron> haven't gotten to arrays yet
mohits has quit [Ping timeout: 246 seconds]
<Xethron> ramblex?
cantonic has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 264 seconds]
cantonic has joined #ruby
burgestrand has joined #ruby
wub1 has quit [Quit: Leaving]
<Mon_Ouie> Ah. Well then the improvement this suggests isn't very big.
<Mon_Ouie> Instead of doing target.write(line1); target.write("\n"); … there's a way to just do target.write("…")
RainbowD_ has joined #ruby
darthdeus has quit [Quit: Linkinus - http://linkinus.com]
darthdeus has joined #ruby
jgill has joined #ruby
catphish has quit [Quit: Leaving]
ben_alman has quit [Excess Flood]
jeff_sebring has quit [Remote host closed the connection]
Hanmac has quit [Ping timeout: 265 seconds]
iocor has joined #ruby
carloslopes has joined #ruby
adeponte has joined #ruby
hemanth has quit [Ping timeout: 248 seconds]
Aaton_off is now known as Aaton
Goles has joined #ruby
<iToast> dax
<iToast> How come its a privacy violation? you can pm it and I only need to know what's connecting on ym specific ip :P
ben_alman has joined #ruby
mnaser has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby
iocor has quit [Client Quit]
schaerli has joined #ruby
arturaz has quit [Ping timeout: 265 seconds]
hemanth has joined #ruby
<icy`> "~>" when installing a gem means 'exact version' or..?
<burgestrand> icy`: ~> 1.0.0 is ~> 1.0.x
<burgestrand> Uh. Yeah. Kind of.
<burgestrand> :p
RainbowD_ is now known as RainbowDashh
<icy`> i added an issue to filmbuff's git -- this is what i mean: https://github.com/sachse/filmbuff/issues/2
mnaser has joined #ruby
<burgestrand> icy`: pretty much only useful if the gem author has some kind of version policy that certain version changes will not break backwards compatibility
<frederike> dam
<frederike> damn
deception has joined #ruby
<icy`> burgestrand, looks like filmbuff author is a pessimist ;P
<icy`> based on that info =D
deception has left #ruby [#ruby]
<burgestrand> :p
Habib has quit [Remote host closed the connection]
<burgestrand> icy`: looks like filmbuff thinks it will only work with 0.7.x, while httparty-icebox thinks it works with 0.8.x
Tricks_ has quit [Read error: Connection reset by peer]
* icy` nods
AlbireoX`Laptop has joined #ruby
Tricks has joined #ruby
<burgestrand> I find it odd that rubygems does no kind of good dependency resolution on this, but I guess this is why you use bundler :p
* Xethron kisses ramblex!!!
iocor has joined #ruby
<Xethron> ramblex, you're my hero!!! :D
* ramblex runs away
* Xethron runs after ramblex with flowres and chocolates
<Xethron> IT WORKS, IT WORKS!!!
* Xethron jumps for joy! :D
<icy`> as temp workaround, i'm trying gem install --version '<0.8' httparty
frederike has quit [Ping timeout: 245 seconds]
dtriley4 has joined #ruby
tzvi has quit [Remote host closed the connection]
<icy`> wait no
<Xethron> :P
<icy`> that would break the icebox thing wouldnt it o.O
<Xethron> anyway, thanks for the trouble ramblex, much appreciated.
<ramblex> np
<icy`> can i have both httparty-0.7.8 and httparty 0.8.3 ?
* icy` answers own question: yes
mengu has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
fulmato has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
kenichi has quit [Read error: Connection reset by peer]
<Mon_Ouie> You can install all the gems you want
<Mon_Ouie> You just can't load all of them at the same time
kenichi has joined #ruby
artOfWar has joined #ruby
dhruvasagar has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
mxweas has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
EzeQL has quit [Ping timeout: 252 seconds]
bglusman has joined #ruby
unixabg_ has quit [Quit: leaving]
mnaser has quit [Ping timeout: 246 seconds]
olrrai has joined #ruby
dankest has joined #ruby
xnm has quit [Read error: Connection reset by peer]
<bambanx> hi
workmad3_ has quit [Ping timeout: 245 seconds]
khakimov has joined #ruby
ringotwo has joined #ruby
philips has quit [Excess Flood]
mnaser has joined #ruby
dhruvasagar has quit [Ping timeout: 245 seconds]
sailias has joined #ruby
BiHi has quit [Quit: bye]
jaredccc has joined #ruby
<jaredccc> In Rails, I have a form in an app, which includes files required for the user to upload. My client wants me to make an intermediate page where the user can review all items before confirming. What is the best way to capture the post data from the form on the original page, and "hold on" to it while the user is reviewing their application?
<jaredccc> at the very end i need to take all that data and send it to an external web service
<jaredccc> the current solution which i'm trying to make work is to have the form POST to the intermediate page, with validation being performed as a :before_filter
<jaredccc> but I got stuck on the part where i get the params hash which the review page has access to, to carry over to the final submit action
<jaredccc> I tried sticking the entire params hash inside the session, but the uploaded files can't be put in there
<jaredccc> any suggestions?
philips has joined #ruby
TechCel has joined #ruby
<ramblex> jaredccc: you might find more help in #rubyonrails
fantazo has quit [Remote host closed the connection]
Morkel has joined #ruby
<jaredccc> ok ty
musicman has quit [Remote host closed the connection]
<jaredccc> my first guess was #rails which is a graveyard with many corpses
Progster has quit [Ping timeout: 272 seconds]
khakimov has quit [Quit: Computer has gone to sleep.]
jaredccc is now known as zizzyx
ramblex_ has joined #ruby
jfoley has quit [Quit: jfoley]
adamkittelson has joined #ruby
<internet_user> zizzyx: I haven't done this in Ruby/Rails, but you could always put a hidden form on the intermediate page, and then when a user clicks "continue" on that page, it'll post the hidden data to the final page.
TechCel has quit [Ping timeout: 240 seconds]
plastics- has joined #ruby
<internet_user> But that's what I've done in the past with a PHP app. Should translate well to ruby with all of the form generators, etc.
plastics has quit [Read error: Operation timed out]
ramblex has quit [Ping timeout: 248 seconds]
Criztian has quit [Remote host closed the connection]
<zizzyx> internet_user: the primary problem with that is the lack of ability to set the value of a file input
ramblex_ has quit [Ping timeout: 250 seconds]
ortho_stice has joined #ruby
<andrew9184> how come i get a wrong arguments error when there is one argument in the method
<internet_user> I guess you could always save the file in a /tmp space, and then pass along the file location with your other params data?
<andrew9184> oops wrong channel
altamic has joined #ruby
altamic has quit [Client Quit]
<internet_user> I wonder if you could serialize and then later deserialize the uploaded file data
<internet_user> haven't done file uploads in ruby, actually. Just PHP so far.
mxweas has quit [Ping timeout: 265 seconds]
mxweas has joined #ruby
<icy`> suppose I changed a gem's .gemspec file , altering its add_dependency . How can I update this information so that ruby knows about it
<icy`> there's no gem reinstall, and gem install --local doesnt seem to be for this type of thing
schaerli has quit [Remote host closed the connection]
Tuxist has joined #ruby
elhu has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
mkultras has joined #ruby
ianbrandt has joined #ruby
Tuxist has quit [Client Quit]
dnyy has joined #ruby
Tuxist has joined #ruby
Tuxist has quit [Client Quit]
Tuxist has joined #ruby
bradhe has quit [Remote host closed the connection]
Tuxist has quit [Client Quit]
Tuxist has joined #ruby
bluOxigen has joined #ruby
lxsameer has quit [Quit: Leaving]
<Xethron> Meh, having some more issues with Prepared statements
Tuxist has quit [Client Quit]
taec has joined #ruby
<Xethron> When there is no value in the array arargs and no ?'s, it works
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
Tuxist has joined #ruby
bluenemo has quit [Remote host closed the connection]
<Xethron> but as soon as I replace a value with a ?, it bombs out
<Xethron> I have the EXACT same setup in another file
<Xethron> Only difference is it collects one line, and this file collects multiple lines
<taec> Is it possible to tell gem, "hey, Ive only got this old gem Y at version X ... only show me gems that have a requirement of Y with a version <= X"
bluOxigen has quit [Client Quit]
gogiel has quit [Ping timeout: 272 seconds]
gogiel has joined #ruby
mucker has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
Tuxist has quit [Client Quit]
Tuxist has joined #ruby
akem has quit [Ping timeout: 246 seconds]
akem has joined #ruby
ChampS666 has joined #ruby
Tuxist has quit [Client Quit]
blacktulip has joined #ruby
Tuxist has joined #ruby
mohits has joined #ruby
Tuxist has quit [Client Quit]
Tuxist has joined #ruby
zizzyx has quit [Quit: Page closed]
gogiel has quit [Read error: Operation timed out]
stickyboot has left #ruby [#ruby]
imami|afk is now known as banseljaj
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
dhruvasagar has joined #ruby
jslvk has joined #ruby
darthdeus has quit [Quit: Leaving...]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
<jslvk> f.write().read is inserting an extra carriage return between each line when i read/write a CSV file
<jslvk> (File)
avandenhoven has left #ruby [#ruby]
shadoi has joined #ruby
cantonic has quit [Read error: Connection reset by peer]
abra has quit [Remote host closed the connection]
abra has joined #ruby
davidw has joined #ruby
davidw is now known as Guest1894
stkowski has joined #ruby
invsblduck has joined #ruby
danishman has joined #ruby
jslvk has quit [Quit: Page closed]
icrazyhack has joined #ruby
Guest1894 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
jrist is now known as jrist-afk
hemanth has quit [Read error: Connection reset by peer]
Hanmac has joined #ruby
hemanth has joined #ruby
mxweas has quit [Ping timeout: 264 seconds]
robotmay has joined #ruby
mxweas has joined #ruby
eaxxae has joined #ruby
chimkan_ has quit [Quit: chimkan_]
axlrosses has joined #ruby
xnm has joined #ruby
gogiel has joined #ruby
iToast has quit [Quit: Page closed]
blacktulip has quit [Remote host closed the connection]
axlrosses has left #ruby [#ruby]
shadoi has quit [Quit: Leaving.]
voodoofish430 has joined #ruby
bosphorus has quit [Remote host closed the connection]
<shevy> let's do the rubyOS
jeff_sebring has joined #ruby
mxweas has quit [Ping timeout: 252 seconds]
cirwin has joined #ruby
cirwin has quit [Changing host]
cirwin has joined #ruby
<davidcelis> rush
mxweas has joined #ruby
ramblex has joined #ruby
davidw has quit [Ping timeout: 265 seconds]
robotmay has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
mxweas has quit [Ping timeout: 246 seconds]
mxweas has joined #ruby
dtriley4 has left #ruby [#ruby]
icrazyhack has quit [Quit: http://www.cnblogs.com/crazyhack]
<Vendethiel> Is anyone here knowing an ORM for ruby, allowing to "see queries as datasource" ?
Tulak has joined #ruby
qwerxy has quit [Ping timeout: 244 seconds]
<Vendethiel> Like Player.top(10).where(name: 'Albert') would be translated to
<Vendethiel> SELECT * FROM (SELECT * FROM players LIMIT 10) WHERE name == 'Albert'
mxweas has quit [Ping timeout: 244 seconds]
damagednoob has joined #ruby
classix has quit [Ping timeout: 246 seconds]
mxweas has joined #ruby
vlad_starkov has joined #ruby
jsime has joined #ruby
damagednoob3 has joined #ruby
mnaser has quit [Ping timeout: 245 seconds]
damagednoob2 has quit [Ping timeout: 240 seconds]
classix has joined #ruby
<gentz> Can case statements be nested? for example: case i\n case j\n when i != j .....
<banisterfiend> gentz: yep
<banisterfiend> same as if statements
<banisterfiend> gentz: and they're not statements,they're expressions :P
<heftig> gentz: not that way
mnaser has joined #ruby
damagednoob has quit [Ping timeout: 250 seconds]
<gentz> is it necessary to place the nested case within a when?
<heftig> yes
<gentz> thanks
mxweas has quit [Ping timeout: 248 seconds]
plastics- has quit [Ping timeout: 246 seconds]
darthdeus has joined #ruby
bier|tp has joined #ruby
mxweas has joined #ruby
<Hanmac> gentz i think an pastie of your code could help ... it could may be optimized
shadoi has joined #ruby
andrew9184 has quit [Remote host closed the connection]
cuit has joined #ruby
mxweas has quit [Ping timeout: 264 seconds]
invsblduck has quit [Ping timeout: 244 seconds]
mxweas has joined #ruby
invsblduck has joined #ruby
abra has quit [Ping timeout: 276 seconds]
LVLAaron has quit [Quit: Leaving]
abra has joined #ruby
mnaser has quit [Ping timeout: 245 seconds]
mxweas has quit [Ping timeout: 246 seconds]
mxweas has joined #ruby
mnaser has joined #ruby
manizzle has joined #ruby
<shevy> gentz is too shy a person to show code
mxweas has quit [Ping timeout: 244 seconds]
bambanx_ has joined #ruby
Tulak has quit [Quit: Leaving.]
<kalleth> welp, that was pretty much the most positive phone interview i've ever had
<kalleth> :awesome:
mxweas has joined #ruby
fbernier has joined #ruby
enherit has quit [Quit: leaving]
bambanx has quit [Ping timeout: 255 seconds]
federic has quit [Remote host closed the connection]
chienpo has joined #ruby
yannis has quit [Quit: yannis]
hadees has joined #ruby
<shevy> "Are you willing to code naked?"
<shevy> -"YES!"
<shevy> "You are hired."
jeff_sebring has quit [Remote host closed the connection]
<cout> I'm not familiar with that programming language
jfoley has joined #ruby
ben_alman has quit [Excess Flood]
mxweas has quit [Ping timeout: 246 seconds]
mxweas has joined #ruby
mayankkohaley has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
Tulak has joined #ruby
prtksxna has quit [Remote host closed the connection]
kvirani has joined #ruby
Progster has joined #ruby
Progster has quit [Excess Flood]
Progster has joined #ruby
Progster has quit [Excess Flood]
aszurom has joined #ruby
mnaser has quit [Ping timeout: 264 seconds]
Progster has joined #ruby
Progster has quit [Excess Flood]
cuit has quit [Quit: Konversation terminated!]
mxweas has quit [Ping timeout: 252 seconds]
mxweas has joined #ruby
mnaser has joined #ruby
Maniacal has joined #ruby
<heftig> so do you have any opinion on www.rust-lang.org ?
<aszurom> I'm reading in a csv file to an array. It's 800 rows deep, and about 30 columns wide. Half of the columns can be dumped, since they're uninteresting. With what's left I want to sort based on column 5 (which is a unique account key) like you'd do in Excel. Is there some built-in method that lets me sort an entire array based on a particular element?
ben_alman has joined #ruby
<fowl> sort_by
<heftig> a.sort_by { |x| x[4] }
<aszurom> cool
<heftig> or sort_by! for the in-place version
<aszurom> easier than I thought
Axsuul has joined #ruby
IPGlider has joined #ruby
shadow_fox has joined #ruby
stephenjudkins has joined #ruby
mxweas has quit [Ping timeout: 246 seconds]
<shevy> heftig hmm dont really like the :: method invocation syntax of rust
wub1 has joined #ruby
<wub1> I cannot get pry to install:
c0rn_ has joined #ruby
<wub1> .rvm/gems/ruby-1.9.3-p0/bin/ruby_noexec_wrapper:14:in `<main>'
<wub1> is the error I get
mxweas has joined #ruby
jcromartie has joined #ruby
<aszurom> can you query an array to return elements "where x[5] = "value" ?
<wub1> which is better then before since no error at all was reported
<ramblex> wub1: is that the full error?
workmad3 has joined #ruby
<fowl> wub1, type /join #pry and appeal to the council of sages
mwilson_ has quit [Excess Flood]
<aszurom> thanks
ramblex has quit [Quit: ramblex]
mwilson_ has joined #ruby
<wub1> there is the error readout
cakehero has quit [Quit: Computer has gone to sleep.]
<aszurom> consumer.rb:20: undefined method `sort_by!' for #<Array:0x10db75f30> (NoMethodError) Hrm...
<aszurom> do I need to require something first?
workmad3 has quit [Client Quit]
workmad3 has joined #ruby
<shevy> aszurom .sort_by! works for me out of the box
<aszurom> I'm on osx so I'm running 1.8.3 I think
<shevy> oh that is very old
<aszurom> maybe that's a 1.9 thing?
<workmad3> aszurom: O.o
<shevy> you sure it is 1.8.3? ruby -v
<workmad3> aszurom: OSX has 1.8.6 on 10.5 and 1.8.7 on 10.6
<aszurom> 1.8.7
mwilson_ has quit [Excess Flood]
<shevy> hmmm
<workmad3> aszurom: you'd have had to deliberately downgraded to get 1.8.3 :)
<shevy> who can test 1.8.7!!!
jarred has quit [Quit: jarred]
<shevy> workmad3, test it!
* shevy spanks workmad3
mwilson_ has joined #ruby
<aszurom> hell, I'd be happy if I could just upgrade my osx to 1.9.3 and be done with it
<workmad3> aszurom: looks like you get sort, sort! and sort_by, but not sort_by! in 1.8.7
<shevy> :)
<shevy> hmm how odd
sj1fiftyseven has joined #ruby
<aszurom> I tried getting RVM on here but apparently I suck at the osx
<shevy> good old 1.8.x
<shevy> feels like waving goodbye to an old lover
<shevy> oh shit
<shevy> :(
<shevy> the last 1.8.x ...
* shevy sheds some tears
<shevy> reaaaadline
Goles has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<aszurom> oh yeah, NOW I remember why RVM bombed? latest version of Xcode hates it
<Hanmac> shevy isnt making 1.8.7 releases some kind of necromantic ?
<workmad3> aszurom: did you install the command line tools for it?
<shevy> Hanmac yeah. it's kinda the living dead now
ben_alman has quit [Excess Flood]
<aszurom> for rvm?
<workmad3> aszurom: for xcode=
<aszurom> I installed whatever was in the app store, with no additional steps
<workmad3> aszurom: so no then
<workmad3> aszurom: latest version of xcode makes gcc an optional extra
<aszurom> ok, how do I obtain it?
tvw has joined #ruby
<workmad3> aszurom: no idea, I'm still on 10.6, but I know you need to install it separately :)
<workmad3> aszurom: and it's pretty hard to compile anything from source without command line compilers ;)
<shevy> wow... the latest 1.8.7 compiles for me again
<shevy> I could switch back to 1.8.7 hmmmm
<workmad3> shevy: give it a last swing around the block, eh?
<shevy> hehe
<shevy> dunno...
dnyy has quit [Remote host closed the connection]
<shevy> I used to need it like 2 months ago, but I ported all my stuff already...
<shevy> there isn't a compelling reason to use 1.8.7 right now :\
Bosma_ has quit [Quit: leaving]
<aszurom> this is gonna make me fire up my ubuntu box, I can feel it
<shevy> \o/
<workmad3> aszurom: you could try googling 'xcode gcc command line' ;)
v0n has quit [Quit: Quitte]
rking has quit [Ping timeout: 246 seconds]
<aszurom> ah, apparently you obtain this officially through the mothership now
<aszurom> developer.apple.com
Enekoos has quit [Remote host closed the connection]
<aszurom> another nifty trick is that Excel doesn't write out a csv with unix line endings, so when you do CSV.read(filename) it explodes
<aszurom> so I had to pass the xls through libreoffice to convert to csv
bosphorus has joined #ruby
<aszurom> unless ruby has a magical xls plugin
mohits has quit [Read error: Connection reset by peer]
uris has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 265 seconds]
<shevy> hehe
geekbri has quit [Remote host closed the connection]
rking has joined #ruby
<brendan`> anyone familiar with paperclip?
ben_alman has joined #ruby
musicman has joined #ruby
<aszurom> Brendan, I see you're asking about paperclip! Would you like to:
<brendan`> question with regards to how it creates/reads directories when creating files
<aszurom> I miss clippy
<Hanmac> aszurom did you read the csv documentation?
ringotwo has quit [Read error: Connection reset by peer]
ringotwo has joined #ruby
<aszurom> apparently not the correct part of it
<xnm> brendan`: what's your question?
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
<aszurom> I'm sure I can specify line ending type in there
bambanx_ has quit [Ping timeout: 255 seconds]
<aszurom> especially if I use faster_csv or something
walbert has joined #ruby
<gentz> i'm trying to overload the index operator to take a list, for example def [](i,j) ... Is this possible?
RainbowDashh has joined #ruby
<Spooner> That works, you call with frog[1, 2] then
<brendan`> xnm, will paperclip error out of a directory its trying to create already exists?
<gentz> Spooner: ah I was doing [i][j]
jgrevich_ has joined #ruby
jonathanwallace has joined #ruby
fbernier has quit [Ping timeout: 264 seconds]
<gentz> Spooner: that works. thanks.
jgrevich has quit [Read error: Connection reset by peer]
jgrevich_ is now known as jgrevich
<Spooner> Yeah, that sends i, then indexes the result of that with j. As you probably guessed.
<xnm> brendan`: why would it do that?
<brendan`> i don't know.. im asking for clarification if it would
<brendan`> i don't think it would, but trying to confirm
mjb2k has joined #ruby
KindOne has quit [Changing host]
KindOne has joined #ruby
mnaser has quit [Ping timeout: 246 seconds]
fbernier has joined #ruby
fayimora has joined #ruby
<brendan`> xnm, can you confirm?
<xnm> brendan`: yeah, i don't know. i don't see that issue ever coming up. directories are uniquely based on model name, model's id attribute, attachment, and style
fayimora_ has joined #ruby
<brendan`> yeah we have like ###/###/### inside that last ### is where the attachment is stored
neersighted has quit [Quit: neerQuit! Liek a Baws!]
<brendan`> but with the indexes being built from there i dont want it to break
<brendan`> :/
mnaser has joined #ruby
heftig has quit [Quit: leaving]
<mjb2k> shevy: you around?
itnomad has joined #ruby
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
<xnm> brendan`: yeah, sorry. i have no idea. I know the newer versions of paperclip switched the directory layout
slicslak has joined #ruby
heftig has joined #ruby
<slicslak> i'm using pry, shouldn't the up key bring up past history? if not, is there an irb app that does?
kirun has joined #ruby
<Mon_Ouie> It should, and does here
Synthead has quit [Remote host closed the connection]
eywu has quit [Quit: Leaving.]
fayimora has quit [Read error: Connection reset by peer]
robin850 has quit [Quit: Konversation terminated!]
fayimora has joined #ruby
minijupe has quit [Quit: minijupe]
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
ianbrandt has quit [Read error: Connection reset by peer]
ianbrandt has joined #ruby
<shevy> hey mjb2k
hemanth has quit [Ping timeout: 250 seconds]
neersighted|AFK has joined #ruby
neersighted|AFK is now known as neersighted
maxmmurphy has joined #ruby
<mjb2k> shevy: I believe you said you use ruby-gnome2 ? have you seen this : http://rubygems.org/gems/gtk3 ?
slicslak has quit [Ping timeout: 265 seconds]
mwilson_ has quit [Excess Flood]
<shevy> hmm I used to use ruby-gtk2 a lot in the past, but since a while I can no longer compile it from source
cakehero has joined #ruby
mwilson_ has joined #ruby
<shevy> mjb2k that is just a stub
<shevy> it installs only a LICENSE file
<fayimora> What is the difference between refactoring and DRYing
mwilson_ has quit [Excess Flood]
<shevy> don't repeat yourself means you reuse components
<fayimora> Oh crap, wrong channel but I hope I can get answers here too :D
mwilson_ has joined #ruby
<shevy> refactoring seems to shuffle around code in the hope of making the new result better than the old result
mxweas has quit [Ping timeout: 244 seconds]
<fayimora> hmmm
kalleth has quit [Ping timeout: 248 seconds]
<fayimora> Would that be DRYin?
Guedes is now known as Guedes_out
mxweas has joined #ruby
<mjb2k> shevy: I thought I read in his docs, that it was minimally functional. Well either way, I'm glad to see more work being done with GTK3 and ruby
Faris has quit [Read error: Connection reset by peer]
bglusman has quit [Remote host closed the connection]
danishman has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
hemanth has joined #ruby
ChampS666 has quit [Ping timeout: 255 seconds]
boobah has quit [Quit: Lost terminal]
musicman has quit [Remote host closed the connection]
<fayimora> shevy: still there?
Synthead has joined #ruby
internet_user has quit [Remote host closed the connection]
<shevy> fayimora seems DRY
nanderoo has quit [Quit: Leaving.]
<shevy> mjb2k yeah, he is on #pry usually
pu22l3r has quit [Ping timeout: 252 seconds]
<shevy> but dunno, it seems way too much work for a single dev
ph^ has joined #ruby
<shevy> and I dont know anything about C :(
<heftig> shevy, mjb2k: i've been following the gir_ffi gem
<heftig> tries to provide an interface to all the gobject-introspection supported libraries
banseljaj is now known as imami|afk
Faris has joined #ruby
mxweas has quit [Ping timeout: 265 seconds]
mxweas has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
umttumt has quit [Remote host closed the connection]
fbernier has quit [Ping timeout: 246 seconds]
maxmmurphy has joined #ruby
trend has quit [Quit: trend]
avandenhoven has joined #ruby
chimkan has joined #ruby
Faris has quit [Ping timeout: 246 seconds]
chimkan has quit [Client Quit]
maxd0ne has joined #ruby
fayimora has quit [Read error: Connection reset by peer]
fayimora has joined #ruby
mxweas has quit [Ping timeout: 264 seconds]
fayimora_ has joined #ruby
boobah has joined #ruby
techhelp has quit [Quit: Leaving]
mxweas has joined #ruby
AtoxHybrid has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
azm has quit [Quit: Leaving]
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
uris has joined #ruby
musicman has joined #ruby
<shevy> hmm
shvelo has joined #ruby
<shevy> I also felt that ko1 no longer had as much time anymore
<shvelo> shevy: hey brother
IPGlider has quit []
mxweas has quit [Ping timeout: 250 seconds]
itnomad has quit [Quit: Leaving]
wub1 has quit [Quit: Leaving]
vlad_starkov has quit [Remote host closed the connection]
Gneiss has joined #ruby
Progster has joined #ruby
<shvelo> installed RVM today
hunglin has quit [Ping timeout: 244 seconds]
<shvelo> but can't use gemsets for some reason
<shevy> hey shvely!
<shevy> shlevy, shevy and shvely! the IRC Team on freenode!
mxweas has joined #ruby
<shvelo> :D
workmad3 has joined #ruby
Bosma has joined #ruby
<Gadgetoid> Should I do: raise ArgumentError, pinError(pin) unless checkPin(pin) ... or should I combine these into a single method?
<workmad3> aszurom: gotten xcode to play ball yet?
<Gneiss> With macruby?
<aszurom> yes!
<Gadgetoid> Seems weird having a method to check params and raise an exception
<workmad3> aszurom: cool :)
mnaser has quit [Ping timeout: 245 seconds]
<Gneiss> Or are you just coding ruby in xcode?
<aszurom> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
<aszurom> boom!
<workmad3> Gneiss: no, lion xcode... no gcc
<workmad3> (by default)
<aszurom> my final error was I was trying to sudo the rvm --default
<Gneiss> wait what?
Faris has joined #ruby
<Gneiss> workmad3: what do you mean?
<workmad3> Gneiss: latest xcode doesn't install the command line gcc unless you go through extra steps
<Gneiss> That is garbage
<workmad3> Gneiss: which means tools like rvm that compile from source don't work...
<aszurom> you can't compile any C++ code on OSX 10.7 until you go to https://developer.apple.com/downloads/index.action and download the separate GCC compiler
<Gneiss> Luckily I'm using snow leopard XD
<shevy> Gadgetoid probably not useful enough if you use it only once
<workmad3> Gneiss: same :) but I knew that xcode did it, thankfully for aszurom :)
<Gneiss> I was going to say "try homebrew"... but you'll need gcc :P
jameshyde has joined #ruby
<Gadgetoid> shevy: going to be calling it a minimum of 10 times, and probably more as I expand things
<aszurom> there needs to be a "scumbag lion meme"
<Gneiss> Hahahaha
mnaser has joined #ruby
<Gneiss> >Buy mac
<Gneiss> >lion comes out next day
<aszurom> we have improved the experience by removing the key components
<Gneiss> >doesn't get free upgrade
<shevy> Gadgetoid then I would definitely use a method. you get the benefit of having to change it only at one point, if you wish to change it at some later point
<workmad3> Gneiss: hahaha
<jameshyde> how do you initialize hashkey's value as array only once inside loop?
<aszurom> there are free upgrades all over bittorrent
<Gneiss> ?
rdg has joined #ruby
<shevy> jameshyde, example code?
<Gneiss> There's free EVERYTHING on bittorrent XD
<Gneiss> '
<workmad3> Gneiss: I got my mac back in 08... not even snow leopard was out then :P
<Gadgetoid> shevy: aye, it just seems weird to raise an argumenterror outside the method that the argument error actually pertains to
prtksxna has joined #ruby
<Gneiss> Was it in the calling method?
<Gneiss> of the method that raises it?
<Gneiss> :P
<Gadgetoid> Call *all* the methods!
<Gadgetoid> Was anyone here at DevsLoveBacon?
<shevy> the supermethod that calls all the methods
<Gneiss> Thats what reflections good for :)
<workmad3> Gadgetoid: did you consider getting checkPin (btw, check_pin would be more idiomatic ruby) to raise an appropriate error for what's wrong with the pin?
blacktulip has joined #ruby
<Gneiss> lol I love one could ACTUALLY write a supermethod that calls all methods
<Gneiss> FUCKYES RUBY IS AWESOME lol
<Gadgetoid> workmad3: I'm a filthy DotNet developer, so I have a thing for camelcase
<Gneiss> Java's reflection is garbage
<workmad3> Gneiss: yes... and then the ruby police would come round and turn you into cat food for gorby :P
<Gneiss> matz shows up in an fbi truck
<workmad3> Gadgetoid: get your CamelCase fix from the class names :P
ryanf has joined #ruby
<Gadgetoid> workmad3: and by "pin" we're talking about a physical electrical connection on a GPIO header; the ArgumentError seems appropriate as the only thing wrong with the value could be that it's out of the range of acceptable pins
shadow_fox has quit [Ping timeout: 265 seconds]
mxweas has quit [Ping timeout: 244 seconds]
<Gneiss> Oh true
<workmad3> Gadgetoid: hmm, I'd still be tempted to have a 'PinOutOfRange' exception
<Gneiss> Has anyone written an arduino API in ruby?
sepp2k1 has quit [Ping timeout: 246 seconds]
<shvelo> Gadgetoid, wait, isn't that PascalCase?
<shvelo> camelCase
<shvelo> or am i wrong
<Gadgetoid> workmad3: Makes sense, I suppose!
<workmad3> Gadgetoid: and your dichotomy gets resolved if check_pin raises it ;)
<Gadgetoid> workmad3: Good point!
<jameshyde> shevy: http://pastie.org/4173414
<workmad3> Gadgetoid: although you could always rename it to 'raise PinOutOfRange(pin) if pin.out_of_range?
<Gadgetoid> I'm somewhat constrained to camelCase, due to attempting to maintain copy-paste compatibility with Arduino code
<workmad3> Gadgetoid: with some appropriate refactoring :)
slicslak has joined #ruby
mxweas has joined #ruby
<Gadgetoid> workmad3: As the pin is a FixNum, I'd feel a bit filthy adding an out_of_range method to it... but the code would look sexy :D
<Gneiss> Gadgetoid, what device are you developing for?
<Gadgetoid> Gneiss: Raspberry Pi
<Gneiss> Gadgetoid: sexy code is what ruby's all about
<Gneiss> Ohhhhh
<Gneiss> How are those?
<Gadgetoid> Sex up the code, and to hell with everything else!
<jameshyde> shevy: it shows a[:c][:d][:e] is still Hash, not Array. How do you initialize it as Array instead?
<Gadgetoid> Gneiss: it's running my blog nicely: pi.gadgetoid.co.uk
<Gadgetoid> Also my IRC bouncer
<workmad3> Gadgetoid: wrap it in a Pin class ;)
<Gadgetoid> workmad3: for reference, I'm working on: https://github.com/Gadgetoid/WiringPiGem/blob/master/lib/wiringpi.rb
<Spooner> I had wondered if they were more than a gimmick (except for the primary audience, the people with hdmi TVs who can't afford a PC :D).
<Gneiss> wow
<workmad3> Gadgetoid: wow, it's a miracle
<Gneiss> Thisfuckingthingispoweringablogwat
<aszurom> ah yes, more fun? so the numerical column in the csv that I'm using sort_by! against (which works now in 1.9.3) is being seen as a string, not integer
<Gneiss> My friend was telling me about how awesome it was
<workmad3> Gadgetoid: I think that's actually a *valid* use for a normal ruby class var!
kalleth has joined #ruby
<Gneiss> but I wsn't really paying attention
jwg2s has quit [Quit: jwg2s]
<aszurom> now I'd guess I would just make that x.to_i
<Gneiss> Gadgetoid: Raspberry pi looks so sick!
<Gadgetoid> Gneiss: love the Pi, it's thrown me into a wonderful world of learning, even though the hardware itself is pretty pointless and mediocre
<workmad3> aszurom: are you applying any filters to the CSV?
damagednoob2 has joined #ruby
<aszurom> no, I read the CSV into an array and that's it
<Gneiss> Gadgetoid: Learning is never pointless :)
<shevy> jameshyde dunno yet... I somehow disabled my arrow-up key in linux, need to solve this first... it annoys me to no ends that I can not scroll up via | up key
rdg has quit [Quit: [quit]]
damagednoob2 has quit [Read error: Connection reset by peer]
<aszurom> it's more the mindset of what I should be doing than the syntax that I'm having trouble with
adeponte has quit [Remote host closed the connection]
<shevy> ahhhh... I just reloaded the pc105 keytable... now it works again
<Gadgetoid> workmad3: I should definitely look into sexing everything up, as I want the library to be extensible- to help me build out IC drivers and things on top of it
<shevy> jameshyde that is awfully complicated code you have there
<workmad3> aszurom: you're using the ruby CSV lib, yeah? so whichever method you're using to read the file, pass it the option ':converters => :all'
<Gadgetoid> Gneiss: it's amazing what the Raspberry Pi community has come up with thus far, it's a nucleus to a wonderful community of intelligent, likeminded people
<jameshyde> shevy: thanks. anyone else knows?
<aszurom> that converts the data type into what it most logically resembles as it's read in?
<workmad3> aszurom: it'll then do sexy things, like convert things that look like numbers into numbers, and dates into dates
<workmad3> aszurom: so yeah, what you said :)
<Gneiss> I'm contemplating getting my own pi :3
damagednoob3 has quit [Ping timeout: 246 seconds]
<Gadgetoid> Gneiss: do it :D need more Rubyists to join the charge!
mpereira has quit [Ping timeout: 248 seconds]
mengu has joined #ruby
<workmad3> aszurom: if you have headers, you can also pass ':headers => true, :header_converters => :symbol' you can access each row in the csv like 'row[:header_name]' ;)
bambanx has joined #ruby
<Gneiss> For sure :D
<aszurom> where do I pass options to the method at?
<workmad3> aszurom: what's your CSV call look like currently+
<aszurom> I don't see an example of it on the csv page
<aszurom> contents = CSV.read(filename)
<bambanx> or use this http://rubydoc.info/gems/ocr/0.3.1/frames i should include 'rubygems' ?
<workmad3> aszurom: CSV.read(filename, :headers => true, :converters => :all, :header_converters => :symbol)
<workmad3> aszurom: the examples are in CSV.new
<aszurom> oh, just like that
<aszurom> yeah I popped the headers off with contents.shift
mxweas has quit [Remote host closed the connection]
<workmad3> aszurom: :)
<aszurom> I'm not entirely sure how I want to manipulate the data, really. Maybe you can put a clue on me
fayimora has quit [Ping timeout: 252 seconds]
<aszurom> here's what's happening in the file...
mxweas has joined #ruby
bradhe has joined #ruby
jrist-afk is now known as jrist
<aszurom> the most important rows are: Billable ID, Account ID, Workload ID
<aszurom> the rest are just detail of the workload, but those are unique keys
<workmad3> aszurom: ah, if those are the titles, don't symbolise, access by string
<aszurom> er, columns not rows
<aszurom> so if I use headers => true will it use the headers to make a hash that I use instead of referring it it as [3]
<workmad3> aszurom: yup
<aszurom> like content[row]["billable id"]
heftig has quit [Ping timeout: 245 seconds]
<aszurom> that's kinda nice, if it tolerates spaces and such
<workmad3> aszurom: you get back one of these when you pass headers as true
Juul has joined #ruby
<aszurom> that looks considerably like what I want
artOfWar has quit [Remote host closed the connection]
musicman has quit [Remote host closed the connection]
larissa has quit [Quit: Saindo]
sepp2k has joined #ruby
Morkel has quit [Quit: Morkel]
musicman has joined #ruby
mxweas has quit [Ping timeout: 246 seconds]
ianbrandt has quit [Quit: ianbrandt]
<aszurom> the end game here is that I want to:
<workmad3> aszurom: are you pretty much just going to iterate over the CSV pulling out the data you need, btw?
eaxxae has quit [Quit: Client Exiting]
<aszurom> well, I'm not sure yet how I want to attack it
<workmad3> aszurom: ah, if so, I'd suggest CSV.foreach personally :)
mxweas has joined #ruby
<aszurom> the "billable ID" is the parent account. You can have child accounts under a parent. And children can have children.
hadees has quit [Quit: hadees]
<workmad3> aszurom: CSV.foreach(path, options) do |row|; puts row["Billable ID"]; end
<aszurom> so if billable-id = account id, then the parent is referencing itself
ChampS666 has joined #ruby
kalleth has quit [Ping timeout: 246 seconds]
<workmad3> aszurom: right... so, how I've attacked that sort of problem in the past in two-stage
zombor has joined #ruby
<aszurom> I could have billable id = 1, with account ID's 1, 2, 3, 4
kalleth has joined #ruby
<workmad3> aszurom: I'd start by building a hash of {:account_id => account_object} with the account object containing all the info
<aszurom> then each account ID can have multiple workload IDs under it
<zombor> can anyone help me with a stupid question, why do i get this: [1..12].map { |x| puts x } ….. 1..12
<workmad3> aszurom: and then have a link/resolve step that will go through, look at the billable_id and set the billable account to the account from the hash with that ID
cantonic has joined #ruby
<workmad3> aszurom: which would give you an in-memory structure to play with :)
<bambanx> guys give me a hand with this pls : http://pastie.org/4173487
musicman has quit [Ping timeout: 265 seconds]
<aszurom> let me switch to /msg so we're not over-spamming the channel
<zombor> dumb, nm
tk___ has quit [Quit: ばいばい]
mxweas has quit [Ping timeout: 240 seconds]
shadow_fox has joined #ruby
Gneiss has quit [Quit: Gneiss]
zombor has left #ruby ["Leaving..."]
fayimora has joined #ruby
mxweas has joined #ruby
Faris has quit [Ping timeout: 246 seconds]
jcromartie has quit [Quit: jcromartie]
prtksxna has quit [Remote host closed the connection]
mxweas has quit [Ping timeout: 245 seconds]
stephenjudkins has joined #ruby
mxweas has joined #ruby
<davidcelis> noooo zombor left
<davidcelis> i wanted to talk to him about retinite
joshman_ has quit [Ping timeout: 264 seconds]
nateberkopec has quit [Remote host closed the connection]
ph^ has quit [Remote host closed the connection]
aszurom has left #ruby ["Leaving"]
ph^ has joined #ruby
fayimora has quit [Ping timeout: 246 seconds]
heftig has joined #ruby
ph^ has quit [Ping timeout: 265 seconds]
mxweas has quit [Ping timeout: 246 seconds]
rippa has quit [Ping timeout: 245 seconds]
Markvilla has joined #ruby
thecreators has quit [Ping timeout: 245 seconds]
sepp2k has quit [Remote host closed the connection]
Faris has joined #ruby
wubino has quit [Quit: Leaving]
sj1fiftyseven has quit [Quit: Page closed]
mxweas has joined #ruby
hunglin has joined #ruby
phantasm66 has quit [Quit: *poof*]
artOfWar has joined #ruby
shvelo has quit [Quit: Leaving]
bradhe has quit [Remote host closed the connection]
ringotwo has quit [Remote host closed the connection]
twock has joined #ruby
Icehawk78 has quit [Ping timeout: 272 seconds]
mxweas has quit [Ping timeout: 264 seconds]
ringotwo has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
classix has quit [Ping timeout: 246 seconds]
pk1001100011 has quit [Ping timeout: 245 seconds]
mxweas has joined #ruby
ChampS666 has quit []
minijupe has joined #ruby
joch_n has quit [Quit: Linkinus - http://linkinus.com]
whowantstolivefo has joined #ruby
Jenny_ has joined #ruby
sailias has quit [Quit: Leaving.]
minijupe has quit [Client Quit]
Jenny_ has left #ruby [#ruby]
<mjb2k> shevy: you ever put out that FTP gem you were talking about?
axl_ has quit [Quit: axl_]
mxweas has quit [Ping timeout: 246 seconds]
<shevy> mjb2k hmm
<shevy> ohhh
<shevy> did not yet, lemme see
hadees has joined #ruby
mxweas has joined #ruby
mockra has joined #ruby
kvirani has quit [Remote host closed the connection]
<shevy> mjb2k, I think there is some problem with it ... last time I wanted to build it, but I stopped before I turned it into a gem because I wanted to fix it first. anyway I published the current status quo https://rubygems.org/gems/ftp_paradise - I'll try to look at it in the coming weeks and fix what wasn't working
<mjb2k> shevy: ok cool, just thought I'd check, I wasn't sure how to find it if it was there
<shevy> yeah
<shevy> I still have not really adjusted to rubygems yet
Dreamer3 has joined #ruby
<shevy> is why my projects lack documentation, as davidcelis pointed out :)
mrsolo has joined #ruby
<Synthead> is there a method or something I could use to make this_time - that_time display as a human-readable time? like 30h 40m 31s
ghanima has joined #ruby
<shevy> I need to auto-generate these things, the skeleton for .gemspec files, via ruby scripts, so I don't forget
carloslopes has quit [Quit: Leaving.]
<Dreamer3> so super runs in the context of the base class?
<Dreamer3> i have a constant defined in both base and subclass and calling super from the subclass is using the base classes contestants… is that correct?
pk1001100011 has joined #ruby
mxweas has quit [Ping timeout: 252 seconds]
<shevy> Synthead hmm you have n seconds and want to display that in hour minutes seconds ?
<shevy> though I am not sure there is something inbuilt to base ruby for that...
<Synthead> shevy: Time objects, like time1 = Time.new; sleep 3; time2 = Time.new; timediff = time2 - time1
<Dreamer3> i have a constant defined in both base and subclass and calling super from the subclass is using the base classes contestants… is that correct?
JustinCampbell has quit [Remote host closed the connection]
Faris has quit [Ping timeout: 246 seconds]
<Synthead> shevy: and H:M:S would be nice. anything that's readable really
jsime has quit [Quit: Leaving]
adeponte has joined #ruby
jsime has joined #ruby
<Dreamer3> hmmm
<Dreamer3> so now maybe it has nothing tod o with super
ben_alman has quit [Excess Flood]
<Dreamer3> and i just don't understand how inheritance works with constants
fayimora has joined #ruby
<shevy> Dreamer3 constants are defined in class or module
chson has joined #ruby
<Dreamer3> right
<Dreamer3> but my sub lass is using my base classes constants
<workmad3> Dreamer3: constant lookup is lexical rather than inherited, iirc
mxweas has joined #ruby
<shevy> Dreamer3, http://pastie.org/4173686 yeah
ben_alman has joined #ruby
silentpost has joined #ruby
chson has quit [Remote host closed the connection]
<shevy> and here we redefine it http://pastie.org/4173692
pk1001100011 has quit [Ping timeout: 245 seconds]
<shevy> and we dont get a warning \o/
<Dreamer3> is that i'm doing
<Dreamer3> sorry didn't change the output
<shevy> ok that wants to call the parent method
<Dreamer3> but the past i.es right
<Dreamer3> i guess i expected the constants to be inherited scoped
<workmad3> Dreamer3: no, constant lookup is done by lexical scope, not by object scope
<workmad3> Dreamer3: annoyingly :)
<Dreamer3> i consider myself schooled
<shevy> the constants seem specific pertaining to the class in use, and where the method is invoked
<workmad3> Dreamer3: that said, it's not so annoying when you consider that creating classes is also constant lookup... and you wouldn't want that to behave in the way you want your code too :)
<shevy> but you could do something like
<shevy> def test(i = FOO) perhaps
<shevy> or you simply use @ivars
mxweas has quit [Ping timeout: 255 seconds]
<shevy> or def test(i = @foo)
<shevy> :)
Tricks has quit [Remote host closed the connection]
Tricks has joined #ruby
mxweas has joined #ruby
frishi has joined #ruby
Tuxist has quit [Remote host closed the connection]
fayimora has quit [Ping timeout: 252 seconds]
mxweas has quit [Ping timeout: 248 seconds]
whowantstolivefo has quit []
pk1001100011 has joined #ruby
mxweas has joined #ruby
Faris has joined #ruby
bosphorus_ has joined #ruby
Nick has joined #ruby
apok has quit [Quit: apok]
bosphorus has quit [Ping timeout: 265 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
musicman has joined #ruby
mxweas has quit [Ping timeout: 264 seconds]
wvms has joined #ruby
mockra has quit [Remote host closed the connection]
mxweas has joined #ruby
avandenhoven has quit [Quit: avandenhoven]
carlyle has quit [Remote host closed the connection]
khakimov has joined #ruby
<bambanx> why i have this error: Decode error - output not utf-8
brendan` has quit [Remote host closed the connection]
monkegjinni has quit [Remote host closed the connection]
schovi has joined #ruby
<apeiros_> because your output is not utf-8?
chrisg has joined #ruby
<mjb2k> and it couldn't be decoded ?
<bambanx> how pls?
<chrisg> pretty new to ruby, anyone got any tips on how I Can test to see if a module or gem is available?
<apeiros_> bambanx: how do you think we can answer this question with the information you have given us?
mxweas has quit [Ping timeout: 250 seconds]
monkegjinni has joined #ruby
<bambanx> apeiros_, do you think i am sure you cannot answer this question with my information?
<apeiros_> that's like going to your garagist, without your car, telling him "why doesn't my car start?!?"
pk1001100011 has quit [Quit: I've got a feeling there's a fish in the floor; I'd better squish it or he'll swim out the door; Sometimes they take me for a walk in the sun; I see my fish and I have to run]
mxweas has joined #ruby
<bambanx> re read my line maybe you can understand
maxd0ne has quit [Quit: Ex-Chat]
minijupe has joined #ruby
<apeiros_> chrisg: you can require it
minijupe has quit [Client Quit]
Enekoos has joined #ruby
WALoeIII has joined #ruby
<WALoeIII> how can I execute a sub command but not wait for it to return?
<apeiros_> if you only care about rubygems, you can also query via Gem's API. but not all files that you can require are gems.
<apeiros_> bambanx: good luck at getting an answer then.
<bambanx> thanks
<chrisg> apeiros_: any other ways? i'm inside a puppet module and i want to confine to the existence of features i have available
balki_ has joined #ruby
balki has quit [Read error: Connection reset by peer]
<chrisg> yeah, i found some examples for gems
<apeiros_> chrisg: a module is usually referenced by a constant
<apeiros_> testing the existence of constants can be done via Module#const_defined?
<chrisg> there's in older versions Gem.available? and then Gem::Specification.find_all_by_name in later vers it'd appear
<mjb2k> Gem::Specification::find_by_name "aes" seems to work for me
<chrisg> apeiros_: ah, i guess i need to figure out what consts i need to test for then
<chrisg> hm
mxweas has quit [Ping timeout: 248 seconds]
Nick has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<mjb2k> Gem.available complains that it's deprecated
<apeiros_> chrisg: note that a file must be required for the constant to appear
<apeiros_> so if you want to test whether something is *installed*, then it's the wrong tool. it can only be used to check whether something is *loaded*
mxweas has joined #ruby
QKO_ has quit [Read error: Connection reset by peer]
<chrisg> oh
<chrisg> hmmmm
<chrisg> darn
ryanf has quit [Quit: leaving]
<apeiros_> chrisg: the most reliable way to test whether something is installed is to actually require it
<apeiros_> and rescue the LoadError
<apeiros_> note that LoadError can't be rescued by a plain `rescue => exception`
virunga has quit [Read error: Connection reset by peer]
mockra has joined #ruby
gtuckerkellogg has joined #ruby
<chrisg> interesting
QKO has joined #ruby
<chrisg> i could put something into a variable in there, and then use that to do my confine in the puppet provider declaration
ChampS666 has joined #ruby
mxweas has quit [Ping timeout: 244 seconds]
dbgster has joined #ruby
jfoley has quit [Quit: jfoley]
mockra has quit [Remote host closed the connection]
mxweas has joined #ruby
jfoley has joined #ruby
PaciFisT has quit [Quit: Leaving.]
kpshek has quit []
yxhuvud has quit [Ping timeout: 252 seconds]
dv310p3r has quit [Ping timeout: 246 seconds]
mxweas has quit [Client Quit]
Juul has quit [Ping timeout: 244 seconds]
jfoley has quit [Client Quit]
blazes816 has joined #ruby
schovi has quit [Remote host closed the connection]
bradhe has joined #ruby
Attic[0] has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
Attic[0] has left #ruby [#ruby]
PaciFisT has joined #ruby
PaciFisT has quit [Client Quit]
randomautomator has quit [Remote host closed the connection]
timonv has joined #ruby
awarner has quit [Remote host closed the connection]
QKO has quit [Read error: Connection reset by peer]
QKO has joined #ruby
AtoxHybrid has quit [Remote host closed the connection]
RainbowDashh has quit [Quit: SLEEP MODE. [NSFW!] [WIERD] [WTF] http://pastebin.com/6L0WjKRk]
silentpost has quit [Ping timeout: 265 seconds]
bambanx has quit [Quit: Saliendo]
gogiel has quit [Ping timeout: 265 seconds]
jsime has quit [Quit: Leaving]
cakehero has quit [Quit: Computer has gone to sleep.]
jgarvey has quit [Quit: Leaving]
wubino has joined #ruby
ChampS666 has quit []
<chrisg> yeah its not very pretty but it seems to work
<chrisg> thanks for the suggestion
uris has quit [Quit: leaving]
workmad3 has quit [Ping timeout: 264 seconds]
<wubino> how do I do this in ruby? http://pastie.org/4173922
Faris has quit [Read error: Connection reset by peer]
Faris has joined #ruby
Axsuul has quit [Read error: Operation timed out]
frishi has quit [Quit: Leaving...]
WALoeIII has left #ruby [#ruby]
emmanuelux has joined #ruby
baroquebobcat_ has joined #ruby
slicslak has quit [Ping timeout: 246 seconds]
<canton7> wubino, is line an array?
<canton7> wait, that doesn't really make sense. did you mean "for line in text"?
baroquebobcat has quit [Ping timeout: 250 seconds]
baroquebobcat_ is now known as baroquebobcat
<canton7> assuming text is an array of lines, constant = lines.find{ |text| text.include?(word) }
<canton7> and key = array.select{ |word| word.include?(key) }
<apeiros_> chrisg: might have something for you…
chson has joined #ruby
<canton7> (or something like that -- it's been a little while since I did list comprehensions. before/after data would be useful)
<wubino> canton7: yes
DrShoggoth has quit [Quit: Leaving]
<wubino> let me rewrite that: http://pastie.org/4173922
jrist is now known as jrist-afk
fayimora has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
<canton7> wubino, and for the first one, I take it you're only interested in the last match? since you're assigning constant for each matching line... or all lines? or the first line?
krusty_ar has quit [Read error: Connection reset by peer]
<blazes816> What's the best way to compute c in this pastie? http://pastie.org/4173984
slicslak has joined #ruby
krusty_ar has joined #ruby
<heftig> blazes816: product
c0rn_ has joined #ruby
<blazes816> heftig: wow. I feel so. stupid.
<blazes816> thanks
<canton7> a scan through the man pages for Enumerable and Array solve most problems, I find
maxmmurphy has joined #ruby
cakehero has joined #ruby
cantonic has quit [Quit: cantonic]
Faris has quit [Read error: Connection reset by peer]
Faris has joined #ruby
cl0ckw0rk has left #ruby [#ruby]
<canton7> wubino, and on line 6, the two references of 'key' -- are they the same variable? Or is it being overwritten? (I suspect the latter)
benlangfeld1 has joined #ruby
maxmmurphy has quit [Client Quit]
musicman has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Leaving...]
ben_alman has quit [Excess Flood]
<benlangfeld1> Hello gents. Does anyone know if it is possible to redefine a block's binding? I'm trying to tackle the problem of leaking a proxied object in callbacks.
<wubino> key = (is a constant)
<apeiros_> benlangfeld1: which binding? self? lvars? ivars? cvars? constant lookup?
<cirwin> benlangfeld1: other_binding.eval(&block)
<wubino> the inline key: "key"
<apeiros_> if self & ivars, then see instance_eval
mkultras has quit [Read error: Operation timed out]
<wubino> a string to find
benlangfeld1 is now known as benlangfeld
benlangfeld has quit [Changing host]
benlangfeld has joined #ruby
fayimora_ has joined #ruby
<apeiros_> cirwin: binding.eval doesn't take a block
<canton7> wubino, I'm afraid that didn'e clarify. the answer is probably key = array.select{ |word| word.include?(key) }
fayimora has quit [Ping timeout: 264 seconds]
fayimora_ is now known as fayimora
<benlangfeld> apeiros_: all of the above
<apeiros_> benlangfeld: then you're out of luck. you can use eval with a string to change lvar binding
<benlangfeld> apeiros_: Though self would be a good start.
<apeiros_> you can use instance_eval to change self & ivar
<wubino> canton7: what if I want to do a split on the line before I bind to the constant?
<cirwin> damn
<cirwin> instance_eval does
<canton7> and the top example is either constant = array.find{ |line| line.include?(word) }, constant = array.select{ |line| line.include?(word) }, or constant = array.reverse.find{ |line| line.include?(word) }, depending on what you want
<apeiros_> but both together is afaik not possible. also cvars and constant is afaik not possible.
<canton7> wubino, like I said, before/after sample data please. it's a lot easier to understand the problem
affix has joined #ruby
Tricks has quit [Ping timeout: 250 seconds]
raul782 has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
mucker has quit [Ping timeout: 248 seconds]
fayimora has quit [Ping timeout: 246 seconds]
ben_alman has joined #ruby
lkba has quit [Ping timeout: 244 seconds]
ianbrandt has joined #ruby
musicman has joined #ruby
<wubino> canton7: http://pastie.org/4173922 updated
dkissell_ has joined #ruby
shadoi has quit [Quit: Leaving.]
shadoi has joined #ruby
blacktulip has quit [Remote host closed the connection]
Kabaka has quit [Ping timeout: 276 seconds]
Faris1 has joined #ruby
<benlangfeld> apeiros_: I know I could call the block via instance_eval, but then I would need to treat passed blocks specially. I'd like to make it transparent somehow. An example: https://gist.github.com/2fc26d60d59fd64ea72e
dkissell has quit [Ping timeout: 245 seconds]
dkissell_ is now known as dkissell
musicman has quit [Remote host closed the connection]
<benlangfeld> I'd like to ensure that any blocks created on a B are scoped to their enclosing A
<heftig> wubino: er, is that right? both ,\n and \n, as delimiters?
mwilson_ has quit [Excess Flood]
<benlangfeld> Which is kinda bending the rules of a closure, but necessary in this case.
mwilson_ has joined #ruby
shadoi has quit [Read error: Operation timed out]
<canton7> wubino, http://pastie.org/4174046
<wubino> heftig: trailing "\n" but no leading I was going to rstrip it
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
Faris has quit [Ping timeout: 246 seconds]
<heftig> wubino: so "," is the delimiter, but it may have trailing \n?
<heftig> what about that 6,\nk ?
<heftig> is the \n then part of the key?
<apeiros_> benlangfeld: I don't follow
<wubino> let me rewrtie the config to reflect the text file format
Tulak has quit [Quit: Leaving.]
<wubino> rewrite
cbuxton has quit [Quit: Leaving.]
<benlangfeld> apeiros_: A proxies B. B is supposed to be totally encapsulated, and accessible only through its A. If a B calls out to some other object, passing a block, that block gets executed by the third party ( C) in the scope of the supposedly encapsulated object, thus leaking it.
<apeiros_> benlangfeld: I think I won't follow anymore today ;-) 0100 here and I'm pretty tired
<apeiros_> sorry, should have said that earlier I guess…
carloslopes has joined #ruby
<benlangfeld> apeiros_: That's cool. 0000 here, should be shutting down myself.
<benlangfeld> It feels like ruby makes this impossible though.
<wubino> heftig: canton7: update for you http://pastie.org/4173922
timonv has quit [Remote host closed the connection]
subbyyy has joined #ruby
jrist-afk is now known as jrist
darthdeus has quit [Read error: Connection reset by peer]
<canton7> wubino, see my last pastie
tvw has quit [Remote host closed the connection]
fayimora has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
<canton7> (updated)
<heftig> config = Hash[ARRAY.map { |line| line.chomp.split("=", 2) }]
<heftig> ah, same code
<heftig> well, except for the ,2
fayimora has quit [Client Quit]
chienpo has quit [Quit: Leaving.]
<canton7> yeah, good call on that
mvangala_home has quit [Ping timeout: 264 seconds]
monkegjinni has quit [Ping timeout: 255 seconds]
gianlucadv has quit [Quit: ZNC - http://znc.sourceforge.net]
<fowl> canton7, what's 0 * 500
<canton7> fowl, 0, why?
<fowl> you are incorrect my friend, the answer is 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<fowl> 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000
<canton7> no, that's '0' * 500
niku4i has joined #ruby
<fowl> you have to think outside the box, string theory!
<canton7> (and couldn't you have chosen 10, and not spammed the channel? :))
<canton7> thankfully, programming languages are consistent and predictable
<heftig> except for PHP
<canton7> (apart from, as I was educated earlier, java2k)
<canton7> ok, bad choice of words :P
<mjb2k> there are quite a few programming languages which are inconsistent and unpredictable
tewecske has quit [Quit: Leaving.]
<canton7> I mean, in general, if '5' is a string at the beginning of a line, it's still a string at the end. ditto 5 (no quotes)
bradhe has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
* apeiros_ thinks fowl's brain wrapped itself around some of those other 10 dimensions
thorncp has left #ruby [#ruby]
thorncp has joined #ruby
slicslak has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
baroquebobcat has joined #ruby
jamesaxl has joined #ruby
benlangfeld has quit [Quit: Leaving.]
mpereira has joined #ruby
mjb2k has quit [Quit: Leaving]
dankest has quit [Quit: Linkinus - http://linkinus.com]
Ethan has joined #ruby
Gavilan has joined #ruby
eurbach has quit [Quit: Leaving.]
cbuxton has joined #ruby
stephenjudkins has joined #ruby
eywu has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
Tulak has joined #ruby
fantazo has joined #ruby
cousine has joined #ruby
SQLStud has quit [Read error: Connection reset by peer]
cousine has quit [Remote host closed the connection]
Progster has quit [Ping timeout: 246 seconds]
|RicharD| has quit [Ping timeout: 265 seconds]
SirFunk_ has quit [Quit: ZNC - http://znc.in]
Markvilla has quit [Quit: Markvilla]
fault has quit [Quit: Leaving.]
bambanx has quit [Read error: Connection reset by peer]
SirFunk has joined #ruby
Progster has joined #ruby
eywu has quit [Remote host closed the connection]
eywu has joined #ruby
oooPaul has quit [Quit: Ciao for now!]
MarcWebe1 has joined #ruby
shadow_fox has quit [Ping timeout: 245 seconds]
bradhe has quit [Remote host closed the connection]
mrsolo has quit [Quit: Leaving]
ephemerian has quit [Quit: Leaving.]
dnyy has joined #ruby
MarcWeber has quit [Ping timeout: 248 seconds]
c0rn_ has joined #ruby
kenperkins has quit [Read error: Operation timed out]
Markvilla has joined #ruby
Faris1 has left #ruby [#ruby]
jimeh has quit [Ping timeout: 252 seconds]
mechanic has joined #ruby
<mechanic> Hi, i have a simple question: I defined a constant MY_PARAMS = ['foor','bar']
<mechanic> and I would like to do MY_PARAMS.each do | k, v | myhash[k] = self.somehowexpand(v).to_s
Tulak has quit [Ping timeout: 244 seconds]
<mechanic> if I try eval('self.#{v}') that yields nothing
<heftig> what is that supposed to do?
<mechanic> v is a method on self
<apeiros_> send
<apeiros_> myhash[k6 = send(v).to_s
<apeiros_> whoops
<apeiros_> myhash[k] = send(v).to_s
<mechanic> ok
<mechanic> hang on
<heftig> except MY_PARAMS is an array, so that iteration will set v to nil
<apeiros_> true
<mechanic> yes sorry
<apeiros_> MY_PARAMS = {keyname: :methodname, key2name: :method2name}
<apeiros_> meh, : : still looks silly :(
<mechanic> MY_PARAMS.each do | param| myhash[param] = send(param).to_s
<mechanic> it needs not be hash, the parameters array is basically attributes accessible on self
kenichi has quit [Remote host closed the connection]
<mechanic> works
<mechanic> self.send(param).to_s
sobol has joined #ruby
<mechanic> thanks
dnyy has quit [Remote host closed the connection]
<mechanic> cool, this makes the code look so much better
<mechanic> so I defined PARAMS as a module variable and the class includes it
<mechanic> is that stylishly ok?
ortho_stice has quit [Ping timeout: 265 seconds]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
<mechanic> are there any good ruby style guides to read?when do you know if your function is too long?
jimeh has joined #ruby
mvangala_home has joined #ruby
Progster has quit [Ping timeout: 255 seconds]
bambanx has joined #ruby
artOfWar has quit [Remote host closed the connection]
<Gavilan> mechanic: When it's not the shortest it could be...
td123 has joined #ruby
macmartine has quit [Quit: macmartine]