<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]
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" ?
<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]
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]
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?
<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
<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]
<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
<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 ?
<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>
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…
<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 :)
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
<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 ;)
<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>
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 ;)
<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 ;)
<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...
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
<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).
<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]
<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.
<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?
<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?
<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)
<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
<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]
<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
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
<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]
<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
<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]
<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]
<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 ;)
<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>
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 :)
<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
<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
<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]
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]
<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.]
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.
<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.
<fowl>
you are incorrect my friend, the answer is 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000