fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
bier has joined #ruby
adamkittelson has quit [Remote host closed the connection]
Ethan has joined #ruby
cj3kim has joined #ruby
Ethan is now known as Guest98804
hamfz_ has quit [Ping timeout: 244 seconds]
hamfz_ has joined #ruby
krusty_ar_ has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
levieraf has joined #ruby
mahmoudimus has joined #ruby
<shevy> zastern ruby only treats leading character as constant, if it is upcased. the rest can be mixed case or all upcased, ruby does not care
krusty_ar has quit [Ping timeout: 272 seconds]
<shevy> zastern but class and module names are typically like "class Foo". Then, constants are all UPCASED usually to differentiate from that. class Foo; KEEP_DIRECTORY = true
<shevy> I dont know many people who write class FOO
lae has quit [Quit: bad irssi bad]
ZachBeta has joined #ruby
lae has joined #ruby
lae has quit [Client Quit]
lae has joined #ruby
hamfz_ has quit [Ping timeout: 240 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mxweas has quit [Quit: Computer has gone to sleep.]
mahmoudimus has joined #ruby
BrokenCog has quit [Quit: leaving]
phinfonet has quit [Quit: phinfonet]
nateberkopec has quit [Quit: Leaving...]
linoj has quit [Quit: linoj]
cj3kim has left #ruby ["Leaving"]
cj3kim has joined #ruby
cj3kim has left #ruby [#ruby]
drago757 has quit [Remote host closed the connection]
drago757 has joined #ruby
busybox42 has quit [Ping timeout: 240 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
justsee is now known as justsee|away
BrokenCog has joined #ruby
mxweas has joined #ruby
sgronblom has joined #ruby
Rezwan has joined #ruby
theRoUS has quit [Ping timeout: 264 seconds]
Guedes has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
banisterfiend has quit [Remote host closed the connection]
banisterfiend has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
centipedefarmer has joined #ruby
berserkr has quit [Quit: Leaving.]
minijupe has joined #ruby
justsee|away is now known as justsee
indian has joined #ruby
th3g33k has quit [Quit: Leaving.]
busybox42 has joined #ruby
brianpWins has quit [Quit: brianpWins]
Chryson has joined #ruby
levieraf has quit [Ping timeout: 255 seconds]
mahmoudimus has joined #ruby
monkegjinni has quit [Remote host closed the connection]
shadoi has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
BrokenCog has quit [Read error: Operation timed out]
mxweas has quit [Quit: Computer has gone to sleep.]
Z_Mass has quit [Quit: Leaving]
busybox42 has quit [Ping timeout: 264 seconds]
<Spooner> shevy: I always struggle when the class name is an abbreviation. 'FTP' looks like a constant and 'Ftp' just looks wrong :)
liluo has quit [Remote host closed the connection]
adamkittelson has joined #ruby
JeanMertz has quit [Read error: Connection reset by peer]
JeanMertz has joined #ruby
JeanMertz has quit [Read error: Connection reset by peer]
JeanMertz has joined #ruby
abdulkarim has quit [Ping timeout: 264 seconds]
reuf has quit [Quit: Leaving]
blazes816 has joined #ruby
ThePicard has left #ruby [#ruby]
locriani has quit [Remote host closed the connection]
BrokenCog has joined #ruby
nateberkopec has joined #ruby
booginga has joined #ruby
tonni has quit [Remote host closed the connection]
Hanmac1 has joined #ruby
<shadoi> Spooner: technically if it starts with a capital, it's a constant. So go for FTP every time. :)
Hanmac has quit [Read error: Operation timed out]
julio has joined #ruby
macer1 has quit [Ping timeout: 240 seconds]
xmajoh has joined #ruby
darren has quit [Remote host closed the connection]
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
Matt_S_G has joined #ruby
nobdraisentone has quit [Write error: Connection reset by peer]
<otters> class names are constants
jarred has quit [Quit: jarred]
julio has quit [Ping timeout: 240 seconds]
shadoi has quit [Quit: Leaving.]
liluo has joined #ruby
KindOne has quit [Ping timeout: 260 seconds]
nari has joined #ruby
darren has joined #ruby
nilg has quit [Read error: Connection reset by peer]
niklasb has quit [Ping timeout: 244 seconds]
foEs has joined #ruby
Rezwan has quit [Quit: off to take a nap]
darkc0met has quit [Ping timeout: 260 seconds]
cakehero has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
emmanuelux has quit [Ping timeout: 244 seconds]
booginga has quit [Ping timeout: 244 seconds]
xmajoh has quit [Quit: Lämnar]
mahmoudimus has joined #ruby
booginga has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
darkc0met has joined #ruby
Guedes has quit [Quit: Saindo]
blazes816 has quit [Quit: Leaving]
Spooner has quit [Ping timeout: 244 seconds]
tompsony has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
iori has joined #ruby
mucker_ has joined #ruby
jonathanwallace has joined #ruby
<tompsony> okay. I installed ruby windows 7 and I am with the following error
<tompsony> C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
<tompsony> cannot load such file -- launchy (LoadError)
Doobie has quit [Read error: Connection reset by peer]
eboaz has joined #ruby
xmajoh has joined #ruby
FlyingFoX has quit [Quit: No Ping reply in 180 seconds.]
FlyingFoX has joined #ruby
locriani has joined #ruby
uris has joined #ruby
shadoi has joined #ruby
booginga has quit [Read error: Connection reset by peer]
dhruvasagar has joined #ruby
chson has quit [Remote host closed the connection]
KindTwo has joined #ruby
KindTwo has quit [Changing host]
KindTwo has joined #ruby
KindTwo is now known as KindOne
pac1 has quit [Quit: I got it one line of code at a time]
beakerman has quit [Remote host closed the connection]
uris has quit [Remote host closed the connection]
locriani has quit [Read error: Operation timed out]
uris has joined #ruby
stillEPIK has joined #ruby
EPIK has quit [Ping timeout: 240 seconds]
FlyingFoXy has joined #ruby
FlyingFoX has quit [Read error: Connection reset by peer]
Chryson has quit [Quit: Leaving]
delinquentme has joined #ruby
<delinquentme> if im doing a require 'file' and all code resides in the same dir
<delinquentme> should that require 'file' not load the file.rb as per: http://stackoverflow.com/questions/1692357/linking-to-external-files-in-ruby
<otters> maybe you want require_relative
GlenK has joined #ruby
radic has quit [Disconnected by services]
radic_ has joined #ruby
radic_ is now known as radic
<tompsony> can you help me to install ruby on windows 7 64bit?
<tompsony> otters
<otters> if we can communicate properly
<tompsony> the error says that Launchy is missing
stillEPIK has quit [Ping timeout: 255 seconds]
<tompsony> C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
<tompsony> cannot load such file -- launchy (LoadError)
<tompsony> from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
<tompsony> n `require'
<tompsony> otters
<tompsony> pls look
<otters> yeah, sounds like launchy is missing
<otters> I don't know what launchy is
<otters> can you gem install launchy
dhruvasagar has quit [Ping timeout: 255 seconds]
<tompsony> thank you
<delinquentme> loading a variable ... from an external file
<delinquentme> cant I just load a file ... with require 'blah' and then be able to access that var?
<delinquentme> Or is that a guaranteed namespace issue?
yakko has quit [Read error: Connection reset by peer]
Markvilla has quit [Quit: Markvilla]
sendoushi has joined #ruby
<delinquentme> I want to define a var in another file which isnt under VC
<delinquentme> so that I dont have passwords in files which are VCd
<burgestrand> delinquentme: use a global variable, a method, or a constant
<burgestrand> delinquentme: a local variable won’t be shared with require, but the above three will
<burgestrand> I usually put my passwords in environment variables, and have a file not in VC for local development that modifies ENV
noganex has quit [Ping timeout: 264 seconds]
nateberkopec has quit [Quit: Leaving...]
noganex has joined #ruby
<delinquentme> burgestrand, TYVM i knew it was something simple.. but TIL local vars aren't loaded like that
<delinquentme> environment vars are defined .. what just as constants?
banisterfiend has quit [Remote host closed the connection]
nateberkopec has joined #ruby
<delinquentme> oh stashed in a hash kk
banisterfiend has joined #ruby
julio has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
foEs has quit [Ping timeout: 264 seconds]
ZachBeta has quit [Quit: Computer has gone to sleep.]
bradhe has quit [Remote host closed the connection]
banisterfiend has quit [Ping timeout: 252 seconds]
shadoi has quit [Quit: Leaving.]
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
julio has quit [Ping timeout: 252 seconds]
tompsony has quit [Quit: CyberScript - O ministério da saúde adverte: usar CyberScript causa dependência! (www.cyberscript.org)]
drago757 has quit [Quit: drago757]
centipedefarmer has quit [Ping timeout: 246 seconds]
dhruvasagar has joined #ruby
Rezwan has joined #ruby
blazes816 has joined #ruby
bglusman has joined #ruby
ZachBeta has joined #ruby
bluenemo_ has joined #ruby
bradhe has joined #ruby
Matt_S_G has quit [Quit: Matt_S_G]
bglusman has quit [Remote host closed the connection]
bluenemo has quit [Ping timeout: 272 seconds]
Musok has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
Musok has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
Araxia has quit [Quit: Araxia]
KindOne has quit [Ping timeout: 272 seconds]
hamfz_ has joined #ruby
zastern has quit [Quit: Leaving]
darkc0met has quit [Ping timeout: 272 seconds]
mrdodo has joined #ruby
Rezwan has quit [Read error: Connection reset by peer]
burgestrand has quit [Quit: Leaving.]
Rezwan has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
zemanel has quit [Ping timeout: 264 seconds]
wiskey5alpha has joined #ruby
nateberkopec has quit [Quit: Leaving...]
Progster has joined #ruby
maxmmurphy has joined #ruby
zodiak has joined #ruby
shadoi has joined #ruby
vitor-br has joined #ruby
darkc0met has joined #ruby
mucker has quit [Read error: Operation timed out]
Drunkma is now known as Sigma00
xorgnak has joined #ruby
mucker_ has quit [Ping timeout: 252 seconds]
xorgnak has quit [Remote host closed the connection]
phinfonet has joined #ruby
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
KindOne has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
minijupe has quit [Quit: minijupe]
otters has quit [Read error: Connection reset by peer]
otters has joined #ruby
ananthakumaran has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
julio has joined #ruby
nedbat is now known as therealnedbat
SycPuppy has joined #ruby
therealnedbat is now known as nedbat
Rezwan has quit [Read error: Connection reset by peer]
Rezwan_ has joined #ruby
shadoi has quit [Quit: Leaving.]
davidcelis has joined #ruby
eboaz has quit [Quit: Leaving]
Rezwan_ has quit [Changing host]
Rezwan_ has joined #ruby
vitor-br has quit [Quit: Saindo]
Know1edge has quit []
Araxia has joined #ruby
mockra has joined #ruby
Progster has quit [Ping timeout: 260 seconds]
mehlah has quit [Quit: Leaving...]
julio has quit [Ping timeout: 240 seconds]
brianpWins has joined #ruby
mockra has quit [Remote host closed the connection]
zemanel has joined #ruby
julio has joined #ruby
nedbat has quit [Ping timeout: 245 seconds]
mockra has joined #ruby
xorgnak has quit [Ping timeout: 272 seconds]
mrdodo has quit [Remote host closed the connection]
mrdodo has joined #ruby
phinfonet has quit [Quit: phinfonet]
Cache_Money has joined #ruby
tonni has joined #ruby
Rezwan_ is now known as Rezwan
tonni has quit [Remote host closed the connection]
SycPuppy has quit [Quit: Nettalk6 - www.ntalk.de]
Beoran_ has joined #ruby
krusty_ar_ has quit [Ping timeout: 264 seconds]
savage- has joined #ruby
julio has quit [Ping timeout: 240 seconds]
Beoran__ has quit [Ping timeout: 244 seconds]
gmci has quit [Read error: Connection reset by peer]
Quadlex has joined #ruby
<Quadlex> Hi everyone
minijupe has joined #ruby
<Rezwan> hi Quadlex
cableray has quit [Read error: Operation timed out]
SCommette has quit [Quit: SCommette]
gmci has joined #ruby
hemanth_ is now known as hemanth
<Quadlex> I have a problem
<Quadlex> I feel like my code is... shitty
<Quadlex> Well, rather, that my tests are shitty
<Quadlex> I feel like I don't wuite "Get" unit testing
cakehero has quit [Quit: Leaving...]
cakehero has joined #ruby
cakehero has quit [Client Quit]
Lachryma has quit [Read error: Connection reset by peer]
delinquentme has quit [Read error: Connection reset by peer]
<davidcelis> why
igotnolegs has joined #ruby
Gab0 has quit [Remote host closed the connection]
lldong has joined #ruby
<Quadlex> I have a message handling class
<Quadlex> It has a reply_header method, a generate_metadata method and a handler_add_message method
<Quadlex> I can easily test that reply_Header and gennerate_metadata create what they should by pairing up input and output tests (They're hash builders)
<Quadlex> But to test add_message works I need to ensure it passes another hash to another method. I can mock the reciever out and test it's being called with the expected parameter
<Quadlex> But to do so I have to hand-construct the expected parameter and it just feels clunky
sailias has quit [Ping timeout: 272 seconds]
uris has quit [Quit: leaving]
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 272 seconds]
mikemac has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
cj3kim has joined #ruby
kevinbond has quit [Quit: kevinbond]
justsee is now known as justsee|away
anekos has quit [Remote host closed the connection]
wiskey5alpha has quit [Quit: wiskey5alpha]
mahmoudimus has joined #ruby
minijupe has quit [Quit: minijupe]
anekos has joined #ruby
sailias has joined #ruby
Nanuq has quit [Ping timeout: 245 seconds]
Nanuq has joined #ruby
<_br_> Quadlex: I always found this funny and inspring when thinking about tests. Maybe its interesting for you: http://rubyconf2008.confreaks.com/the-ruby-code-review-a-play-in-three-acts.html
mockra has quit [Remote host closed the connection]
gtuckerkellogg has joined #ruby
koshii has joined #ruby
justsee|away is now known as justsee
ekx has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
rmascarenhas has quit [Ping timeout: 240 seconds]
minijupe has joined #ruby
brg has joined #ruby
<brg> hi
<brg> anybody know what type of interview questions could be asked in ruby?
gtuckerkellogg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
andrewhl has quit [Remote host closed the connection]
adamkittelson has quit [Remote host closed the connection]
<td123> I would worry about focusing on the field and not a specific language
dhruvasa1ar has quit [Ping timeout: 244 seconds]
ananthakumaran has joined #ruby
iamjarvo has joined #ruby
ini has joined #ruby
sinful has joined #ruby
lldong has quit [Ping timeout: 264 seconds]
Rezwan has quit [Quit: quit]
shadoi has joined #ruby
Bosma has quit [Ping timeout: 264 seconds]
Ionic` has quit [Ping timeout: 255 seconds]
jhunter has joined #ruby
Tomasso has quit [Ping timeout: 244 seconds]
brg has left #ruby [#ruby]
mockra has joined #ruby
reuf has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
mockra has quit [Ping timeout: 250 seconds]
shadoi has quit [Quit: Leaving.]
Cache_Money has quit [Quit: Leaving]
Dreamer3 has quit [Ping timeout: 244 seconds]
Dreamer3 has joined #ruby
darren has quit [Remote host closed the connection]
krz has joined #ruby
Guest91275 has joined #ruby
iamlacroix has joined #ruby
Dreamer3 has quit [Ping timeout: 264 seconds]
tvw has joined #ruby
ryh has joined #ruby
RichieEvan has joined #ruby
Dreamer3 has joined #ruby
qwerxy has joined #ruby
_iori_ has joined #ruby
iori has quit [Read error: Connection reset by peer]
Markvilla has joined #ruby
Markvilla has quit [Client Quit]
minijupe has quit [Quit: minijupe]
Eldariof-ru has joined #ruby
Hien_ has quit [Quit: leaving]
Hien has joined #ruby
whowantstolivefo has left #ruby [#ruby]
Guest98804 has quit [Read error: Connection reset by peer]
julio has joined #ruby
noyb has quit [Quit: Leaving.]
blazes816 has quit [Quit: Leaving]
tonini has joined #ruby
scott[8] has joined #ruby
<aces23up> how do I run eval code in the context of the object?
und3f has joined #ruby
eggie5 has joined #ruby
Ethan has joined #ruby
<aces23up> like @object.eval ?
nobdraisentone has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<bnagy> check instance_eval
reuf has quit [Quit: Leaving]
Progster has joined #ruby
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
tomb_ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<aces23up> bnagy also crazy question, but can I change execution of script, by doing a trace of code?
<aces23up> like for instance.
<aces23up> I want to convert a method call
<aces23up> the lines in it.
<aces23up> to asyncronous.
<aces23up> meaning i want to do processing before and after each line in a particular method.
<bnagy> most of that doesn't make sense to me, but the parts that do sound like Doing It Wrong
Crisewng has joined #ruby
yxhuvud has joined #ruby
xmajoh has left #ruby ["Lämnar"]
mxweas has joined #ruby
tonni has joined #ruby
jprovazn_away is now known as jprovazn
mockra has joined #ruby
artOfWar has joined #ruby
maesbn has joined #ruby
savage- has quit [Remote host closed the connection]
<eggie5> I'm writing some code to track follows/friends on twitter over time. I have a DSL working but and just trying to figure out how to persist it: https://gist.github.com/e6d46087596987ad480e
<eggie5> any ideas?
fayimora has joined #ruby
artOfWar has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 245 seconds]
Progster has quit [Ping timeout: 260 seconds]
artOfWar has joined #ruby
goganchic has joined #ruby
mrdodo has quit [Remote host closed the connection]
artOfWar has quit [Read error: Connection reset by peer]
mahmoudimus has joined #ruby
artOfWar has joined #ruby
aganov has joined #ruby
Guest91275 has quit [Quit: Guest91275]
mrdodo has joined #ruby
banisterfiend has joined #ruby
<_br_> eggie5: Do you want to keep all the historical data forever or is it ok to throw it away after some time?
<_br_> eggie5: Possibly you want to throw e.g. the datamapper gem into the mix. Then you can just choose e.g. a sqlite database
cj3kim has quit [Quit: This computer has gone to sleep]
<eggie5> _br_: well the historic data is used to show you if you getting people to follow you back more effectively or not. So i want to keep it, but there can be limits
<eggie5> _br_: so I don't even have to worry about the persistence ?
<eggie5> would it be able to persist that structure I already have?
<_br_> eggie5: go with orm (e.g. datamapper) then you can just choose what database backend you need allowing you to either be flat file (sqlite) or use some other more complex backends. There is also a redis gem you could use.
jeff_sebring has joined #ruby
<eggie5> _br_: i'll look into that
<eggie5> I was thinking redis or some key value store would be a good match for this data, because it's just a big hash table anyways
<_br_> eggie5: With a little rewriting of the User class making it a datamapper resource, I think yes.
igotnolegs has quit [Quit: Computer has gone to sleep.]
<_br_> eggie5: well if you don't want to switch later db's, sure.
<_br_> I wouldn't choose redis for this. A flat file db is perfectly fine imo.
<eggie5> _br_: so you think redis? I was winding what others thought. I think so too
<eggie5> users:XXXX:followers:timestamp:2012.07.23:event = follow
<eggie5> users:XXXX:followers:timestamp:2012.07.23:follower = 4
<eggie5> users:XXXX:followers:timestamp:2012.07.23:followee = 1
<eggie5> that means 4 followed 1
<eggie5> and translates 1:1 w/ the in-memory structre
julio has quit [Ping timeout: 250 seconds]
mxweas has quit [Quit: Computer has gone to sleep.]
thomasfedb has quit [Remote host closed the connection]
<_br_> eggie5: then go for redis I guess. There are tons of key-value db's. If you are sure you don't need a orm because later you change, its fine I suppose.
artOfWar has quit [Remote host closed the connection]
<bnagy> if you use any KV store you can abstract your own access etc
<bnagy> you don't need a 'real' ORM
<eggie5> _br_: well using the ORM would be the easiest choice. I'm not in a rush or anything I want to choose the best fit
jonathanwallace has quit [Remote host closed the connection]
<eggie5> bnagy: and that's what I did already by design the objects first
<bnagy> every single KV store will have get and put primitives which is more or less all you need
<eggie5> My User class inherits from Model which is an empty class as-of-now since I haven't decided on persistance
fayimora has quit [Quit: Busy…..zzzzz]
<bnagy> although, warning, what you're doing sounds relational
<bnagy> but that's based on almost no understandig of it
<eggie5> i just wonder if a a key that long multiplied by X amount keys would be a waste of memory
<eggie5> bnagy: does it???
<bnagy> yeah, to me
<eggie5> it's barely…. Users have many followers and friends
<bnagy> like, I would want to say like 'who followed bob between april and november' etc
sevvie has quit [Quit: sevvie]
tsolan has quit [Ping timeout: 245 seconds]
<bnagy> 'who follows bob that also follows frank'
<bnagy> all that stuff is easier for my brain to model as relational querie4s
<eggie5> bnagy: hmm good point, i'll take note of those examples
Morkel has joined #ruby
<bnagy> in which case go for an ORM or Sequel or something
ekx has left #ruby [#ruby]
<bnagy> you can still swap out DBs with Sequel, but I don't know if it is still cool. I used to love it :(
fralcon has joined #ruby
dhruvasagar has joined #ruby
mxweas has joined #ruby
Eldariof-ru has quit []
vvgomes has joined #ruby
arturaz has joined #ruby
monkegjinni has joined #ruby
mxweas has quit [Client Quit]
<eggie5> bnagy: I added 'should show who followed me between april and november' but the second scenario doesn't fit into my use case
<eggie5> bnagy: thanks though -- that's a good one
tonni has quit [Remote host closed the connection]
<eggie5> bnagy: i was just focused on displaying one big timeline like: https://twitter.com/i/connect
anderse_ has joined #ruby
<eggie5> but i'm not sure if my current object model would support just showing it between certain monthes
adeponte has joined #ruby
goganchic has quit [Ping timeout: 246 seconds]
nicoulaj has joined #ruby
artOfWar has joined #ruby
monkegjinni has quit [Remote host closed the connection]
goganchic has joined #ruby
mxweas has joined #ruby
thomasfedb has joined #ruby
tonni has joined #ruby
<Paradox> shipping a 8 TB drive on 3 day shipping is equivalent to a 246.9 megabit connection
<bnagy> that's nothing compared to ejeculation
JeanMertz has quit [Quit: JeanMertz]
qwerxy has quit [Quit: offski]
Gneiss has joined #ruby
<Gneiss> hello
<Gneiss> anyone here?
<Gneiss> :P
Gneiss has quit [Client Quit]
artOfWar_ has joined #ruby
<bnagy> depends, are you a cop?
<Paradox> bnagy, nope
<Paradox> but the fastest data transfer rate ever recorded
<Paradox> was when google opened up a new european data center and copied some of their data to it
ryanf has joined #ruby
<Paradox> a petabyte or two shipped
<banisterfiend> bnagy: what's ejeculation
<bnagy> banisterfiend: ask your father
<banisterfiend> bnagy: same thing as ejaculation?
<banisterfiend> :P
<Paradox> banisterfiend, when a man and a woman love each other very much, the woman (or man if they are a gay couple) stimulates the mans penis till it shoots ice cream
<bnagy> Paradox: I don't believe that you be the case
<bnagy> s/you/to/
<Paradox> bnagy, tomorrows soup is not flavored of atoms
swarley has joined #ruby
<swarley> Look at the stupid thing i made after half an hour of screwing with objective-c :p http://pastebin.com/GxzcJjJU
artOfWar has quit [Ping timeout: 255 seconds]
TheDeadSerious has joined #ruby
a_a_g has joined #ruby
wm3|zzz has quit [Ping timeout: 255 seconds]
andrewhl has joined #ruby
<Hanmac1> objective-c is nothing i want to see in ruby ... (okay its something i dont want to see in general)
Hanmac1 is now known as Hanmac
<swarley> yeah, i just got bored
<Hanmac> when i got bored i building on my ogre binding
<swarley> all it does is loosely enforce type arguments and return types
<swarley> lol
justsee is now known as justsee|away
qwerxy has joined #ruby
vectorshelve has joined #ruby
<vectorshelve> Hai
<vectorshelve> hemanth: good day :)
hoelzro|away is now known as hoelzro
wallerdev has quit [Quit: wallerdev]
MarGarina has joined #ruby
ryh has quit [Remote host closed the connection]
mockra has joined #ruby
venkatk_ has joined #ruby
<vectorshelve> sevenseacat: I will be testing my app using cucumber and rspec but firstly I would like to create a test harness so that's what I want a reference on. I am very new to Testing :)
TheDeadSerious has quit [Ping timeout: 272 seconds]
Gurpartap has joined #ruby
subbyyy has quit [Read error: Connection reset by peer]
subbyyy has joined #ruby
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
swistak35 has quit [Excess Flood]
subbyyy has quit [Max SendQ exceeded]
subbyyy has joined #ruby
swistak35 has joined #ruby
mockra has quit [Ping timeout: 272 seconds]
subbyyy has quit [Client Quit]
moshef has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
TPFC-SYSTEM has joined #ruby
mxweas has quit [Quit: Leaving...]
Rochefort has joined #ruby
goganchic has quit [Ping timeout: 272 seconds]
digitalcakestudi has quit [Ping timeout: 264 seconds]
fivetwentysix has joined #ruby
<hemanth> vectorshelve, hey
<fivetwentysix> Hi, I'm trying to use the google-ads-common gem, but I can't seem to require of the files in my rails app. I tried require 'google-ads-common' but it tells me it can't be found :(
monkegjinni has joined #ruby
<hemanth> vectorshelve, http://h3manth.com/notes/jq-cs.html
<hemanth> fivetwentysix, require 'rubygems' missing?
<fivetwentysix> hemanth: I'm using 1.9.3
<vectorshelve> hemanth: changed the blog UI ? old one was good
vvgomes has quit [Ping timeout: 264 seconds]
<hemanth> vectorshelve, no, this is notes UI :)
<hemanth> fivetwentysix, did you check your gem path?
anekos has quit [Quit: Tiarra 0.1+svn-39036: SIGTERM received; exit]
andrewhl has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
<fivetwentysix> hemath: never mind i got it, had Google's ruby code is just really confusing
<fivetwentysix> had to require something with a completely different namespace
<hemanth> :)
goganchic has joined #ruby
Ethan has quit [Ping timeout: 240 seconds]
<ini> hi iam new to ruby got a trivial doubt
<ini> what does @foo = bar mean
<hoelzro> ini: it means assign to the instance variable 'foo' the value of bar
<hoelzro> ini: what resource(s) are you using to learn Ruby?
<ini> thanks
elhu has joined #ruby
<ini> i am using a book called begining ruby 2nd edition
<hoelzro> hmm...I'm kinda surprised they didn't teach you that, or at least mention it
<ini> well i am very very new to programming
krz has quit [Quit: krz]
<ini> but could not find any rference to this stuff in the book or online
<Hanmac> hoelzro its in the next chapter
maxmmurphy has joined #ruby
Eldariof-ru has joined #ruby
<Hanmac> ini the tutorial may not be 100% currect to your ruby version ... (what ruby version did you use?)
goganchic has quit [Ping timeout: 272 seconds]
<ini> one moment
blacktulip has joined #ruby
<ini> ruby 1.9.3p125
<ini> and using jetbrains rubymine
<ini> 4.5
<GlenK> anyone familiar with ruby koans? sorta fill in the blanks ruby scripts to teach you some junk? Anyhow, on this one: "assert_equal __, false.object_id", I guess I'm supposed to fill in 0? so it's trying to tell me the false object always has id 0? Sound about right?
<Hanmac> what maybe is different then the tutorial says is ?a ... on your version its not the character code, its only "a"
ph^ has joined #ruby
<ini> another one what does @@foo = 0 mean
<GlenK> gah. seems like a stupid question now that I think about it
timonv has joined #ruby
<ini> i know its quite stupid question, but cant be embarassed if i want to learn :)
<bnagy> ini: actually you can
eggie5 has quit [Quit: eggie5]
maxmmurphy has quit [Quit: maxmmurphy]
<bnagy> if you think it's a stupid question, and feel embarassed you're more likely to find the answer out yourself, which will teach you much more
<ini> hmm good point
pskosinski has joined #ruby
<Hanmac> ini @ and @@ are explained there: http://www.tutorialspoint.com/ruby/ruby_variables.htm
<GlenK> bnagy: ha, nah. I'm not embarrassed. just shoulda thought about it for a second longer because it seems way obvious now.
sevvie has joined #ruby
davidpk has joined #ruby
<bnagy> GlenK: the comment wasn't meant for you :)
<ini> my problem is the overwelhming amount of tutorials, videos and stuff iam trying to use and make sense of
<GlenK> k
cezar has joined #ruby
cezar has quit [Remote host closed the connection]
Ethan has joined #ruby
seoaqua has joined #ruby
banisterfiend` has joined #ruby
tomb_ has joined #ruby
<ini> ok got it m @foo is a instance variable
<ini> @@foo is a class variable
<ini> :)
<ini> i am looking for a learining partner . is there anyone starting to learn ruby and "programming"
D4T has joined #ruby
fralcon has quit [Quit: fralcon]
shopt is now known as aclocal
banisterfiend has quit [Ping timeout: 246 seconds]
<bnagy> I think 'learn to program' by Chris Pine and 'ruby the hard way' by Zed Shaw both start from 0
<bnagy> I don't like a lot of the ruby in the hard way, but the approach is pretty thorough
tatsuya has joined #ruby
<banisterfiend`> bnagy: still in katmandu?
<ini> thanks
<bnagy> banisterfiend`: nah I am in chiangmai still
mrdodo has quit [Remote host closed the connection]
<bnagy> be back in ktm on thurs
hamfz_ has quit [Read error: Operation timed out]
<banisterfiend`> when do u relocate 4 good
anekos has joined #ruby
<banisterfiend`> bnagy: u should move to nz, we have very pretty sheep here and i can hook u up
<bnagy> they took adultsheepfinder.com off the internet :(
<bnagy> we relocate _somewhere_ in jan, just no idea where
Stud has quit [Changing host]
Stud has joined #ruby
<bnagy> I'd move to wellington, I love that town
<bnagy> bit windy, but otherwise nice :)
<bnagy> but I don't know where the wife would find work :)
arturaz has quit [Read error: Connection reset by peer]
<banisterfiend`> bnagy: yeah it's awesome
<banisterfiend`> bnagy: she could be your secretary
<bnagy> for all that paperwork I don't have any of
<banisterfiend`> bnagy: btw, if u have fast internet, watch this: http://www.youtube.com/watch?v=P9sQZLtsfp8
<banisterfiend`> u wont regret it
<bnagy> don't take this the wrong way, but my heuristics have led me to always do the opposite of what you say wrt to videos and images
<bnagy> ooh shit olympics have started I think
bullicon has joined #ruby
<GlenK> so I don't get this statement: Older versions of Ruby - 1.8.x and older - required you to set default values for parameters starting with the last parameter in list and moving backward toward the first. The current version of Ruby (1.9.x) no longer has this limitation
<GlenK> how could you have say a default on the first parameter but not the last.
jimeh2 is now known as jimeh
<Mon_Ouie> def foo(bar = 3, baz); [bar, baz]; end # try that with one and then two argumemnts
<GlenK> hmm. yeah. another stupid question on my part I suppose. I guess as long as it's not ambiguous?
<Mon_Ouie> Yeah. I still wouldn't recommend using that feature though.
Markvilla has joined #ruby
<Mon_Ouie> It's rather confusing that the same parameter can be either the first or the second argument depending on how many you pass
CaptainJet has quit []
rutkla has joined #ruby
* Hanmac likes the pseudo-named parameters :P
<hemanth> Hanmac, example plz
indian has quit [Ping timeout: 252 seconds]
<bnagy> foo cake: :yes_please
companion has quit [Ping timeout: 276 seconds]
<banisterfiend`> Mon_Ouie: wowthat' crazy i didnt know about that
D4T has quit [Ping timeout: 244 seconds]
gokul has joined #ruby
<Mon_Ouie> Actually, me neither; I only knew that the splat argument wasn't required to be the last one anymore.
arturaz has joined #ruby
<hoelzro> hemanth: I think Hanmac means method foo: 17, bar: 18
<hemanth> instead of def foo(bar = 3, baz); ?
anekos has quit [Remote host closed the connection]
<Mon_Ouie> def foo(opts = {})
JohnBat26 has joined #ruby
<hoelzro> it'd be nice if you could do something like def foo(opts = {bar: 1, baz: 2})
<banisterfiend`> Mon_Ouie: can u pls watch this and tell me what u think, i'm entranced by it: http://www.youtube.com/watch?v=P9sQZLtsfp8
<Mon_Ouie> You can
<hoelzro> hmm, I suppose that's valid, but not what I meant
anekos has joined #ruby
<Mon_Ouie> You probably want to use Hash#merge though
<hoelzro> ah, good suggestion
mengu has joined #ruby
companion has joined #ruby
Stud has quit [Changing host]
Stud has joined #ruby
mockra has joined #ruby
BRMatt has quit [Ping timeout: 264 seconds]
ryanf has quit [Quit: leaving]
BRMatt has joined #ruby
Criztian has joined #ruby
baphled has joined #ruby
mockra has quit [Ping timeout: 264 seconds]
wmoxam has quit [Remote host closed the connection]
qwerxy has joined #ruby
wmoxam has joined #ruby
monkegjinni has quit [Remote host closed the connection]
moshef has quit [Quit: moshef]
ephemerian has joined #ruby
nikeita has joined #ruby
justsee|away is now known as justsee
fabrice31 has joined #ruby
williamherry has joined #ruby
<williamherry> does net/scp support wildcard?
gtuckerkellogg has joined #ruby
chussenot has joined #ruby
robozahn has joined #ruby
s1n4 has joined #ruby
sevvie has quit [Quit: sevvie]
robotmay has joined #ruby
D4T has joined #ruby
moshef has joined #ruby
wm3|zzz has joined #ruby
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
br4ndon has joined #ruby
robotmay has quit [Remote host closed the connection]
robotmay has joined #ruby
bier has quit [Remote host closed the connection]
s1n4 has quit [Quit: leaving]
bier has joined #ruby
saschagehlich has joined #ruby
JohnBat26 has joined #ruby
scott[8] has quit [Quit: scott[8]]
Spooner has joined #ruby
moshef_ has joined #ruby
berserkr has joined #ruby
sendoushi has joined #ruby
moshef has quit [Ping timeout: 255 seconds]
moshef_ is now known as moshef
M- has quit [Quit: Leaving]
opus has joined #ruby
tonini has quit [Remote host closed the connection]
nari has quit [Ping timeout: 248 seconds]
tonini has joined #ruby
nyuszika7h has joined #ruby
vlad_starkov has joined #ruby
tonini has quit [Ping timeout: 264 seconds]
[Neurotic] has quit [Quit: need food]
indian has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
mrdodo has joined #ruby
mneorr has joined #ruby
<GlenK> so...seems like the tutorial I'm reading says this should work: "def calculate(*input, flags = {})" It doesn't seem to like me trying to make flags default to an empty hash though.
<GlenK> any advice?
<Mon_Ouie> Where did it say that would work?
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
<banisterfiend`> GlenK: the way ppl do that is: def calculate(*input)
<GlenK> well, I'm supposed to pass it something like so: calculate(0, 0, 0, 0, -10, subtract: true)
chussenot has quit [Read error: Connection reset by peer]
mrdodo has quit [Ping timeout: 255 seconds]
<banisterfiend`> GlenK: and then check that input.last.is_a?(Hash)
nari has joined #ruby
<GlenK> and it just introduced splat and the default hash thing. I figured it wanted me to combine the two concepts to be able to deal with that input.
Markvilla has quit [Quit: Markvilla]
robozahn has quit [Quit: leaving]
<GlenK> banisterfiend`: which is why it seems to make sense that you'd just default to an empty hash.
<GlenK> hmm. seems the splat thing and a default to an empty has are incompatible with each other though?
<GlenK> seems odd that they would be...
<JonnieCache> put them in brackets
<JonnieCache> and splat the brackets
<banisterfiend`> GlenK: it's not valid to have *args, default=blah
Markvilla has joined #ruby
<banisterfiend`> GlenK: so u have to do something like i said..im not sure what JonnieCache means though, maybe u could ask him to explain
cascalheira has joined #ruby
<JonnieCache> sorry i didnt realise exactly what you meant
<Mon_Ouie> Why? It *is* ambiguous — as soon as there's one variable, how do you decide whether to make it be flags or part of input?
<GlenK> hmm. yeah, I guess if you're passing more than one argument it gets sorta messed up with the splat. didn't consider that
<Mon_Ouie> Even with just one argument
<JonnieCache> i thought you were doing the old || {} rather than using default parameters
<Hanmac> Glenk: the best way is input = args[-1].is_a?(Hash) : args.pop : {}
Foxandxss has joined #ruby
<Mon_Ouie> s/:/?/
<Hanmac> yeah, sorry
<GlenK> yeah, this stupid tutorial though. I dunno how it expects me to magically know about is_a?(Hash).
<GlenK> anyhow, thanks all
<oddmunds> how about just putting the hash first in the arguments?
<Mon_Ouie> Can we see the tutorial anyway?
Markvilla has quit [Client Quit]
<oddmunds> def calculate(flags = {}, *input)
mockra has joined #ruby
<Mon_Ouie> oddmunds: In that case it's a required argument since you can't pass any input without first passing the flags
<Mon_Ouie> So you might as well make it the last one to use the fancy hash syntax
<banisterfiend`> GlenK: which part there in particular?
<banisterfiend`> GlenK: cos there's a lot of stuff on that page
<GlenK> banisterfiend`: well, the very last exercise is the one I was sorta stuck on.
<oddmunds> ah
Markvilla has joined #ruby
<GlenK> it's fine now with is_a(Hash). but like I say, seems that isn't a concept I should know about if I'm strictly following the tutorial
locriani has joined #ruby
* Hanmac thinks that he should try to invent typed arguments into ruby :P
<Mon_Ouie> Anyway I'd rather have such methods expect an array than several argument
<Mon_Ouie> arguments*
<wm3|zzz> GlenK: give the guy a break... writing tutorials without assuming knowledge is hard :)
wm3|zzz is now known as workmad3
<banisterfiend`> GlenK: where does it say you should have (*args) there?
<banisterfiend`> GlenK: it just look slike they want (arg1, arg2, arg3, options={})
<GlenK> banisterfiend`: well, if you run it, the input varies anywhere from 2 to 6 arguments. so I'm pretty sure you'll need the splat thing.
locriani has quit [Read error: Operation timed out]
<banisterfiend`> GlenK: for which one exactly? 'a gentle workout' ?
mockra has quit [Ping timeout: 252 seconds]
aTastyCookie has joined #ruby
<banisterfiend`> GlenK: i'm not sure yet, as i cant find quite what u're referring too, but im 99% sure you're wrong ;)
<aTastyCookie> omg
<GlenK> banisterfiend`: yeah. gentle workout
<banisterfiend`> GlenK: ah, actually you could be right
<GlenK> banisterfiend`: well, you can cheat and look at the solution and it has calculate(*arguments)
mehlah has joined #ruby
<banisterfiend`> yes you're right
<banisterfiend`> GlenK: but u really hadn't learned about is_a? yet by chap 19?
opus has quit [Quit:]
<banisterfiend`> sounds wonky
<GlenK> ha, maybe. dunno for sure I suppose. pressing on...
vlad_starkov has quit [Remote host closed the connection]
nikeita has quit [Quit: sleep]
<shevy> on the toilet???
flype has joined #ruby
shashin has joined #ruby
Rochefort has quit [Remote host closed the connection]
<shevy> would this work or did I forget something?
Dreamer3 has quit [Quit: Leaving...]
flype has quit [Client Quit]
franckverrot has joined #ruby
chussenot has joined #ruby
<banisterfiend`> shevy: wont work
<banisterfiend`> shevy: cos 'include' puts it above the class
<shevy> :(
goganchic has joined #ruby
<banisterfiend`> oh it will
<workmad3> shevy: you just need to remember to call 'super' in any initialize methods you put in classes that include it
Vert has joined #ruby
maesbn has quit [Remote host closed the connection]
<shevy> hmm
<shevy> somehow my brain has not picked that up yet
<shevy> but, this way one could avoid having to subclass?
<shevy> I mean via Foo < Bar
maesbn has joined #ruby
sendoushi has quit [Remote host closed the connection]
<Hanmac> shevy ... i will make an script that makes method overloading possible in ruby ... what do you think about that?
<workmad3> shevy: I don't get why you're thinking in terms of 'avoiding' subclassing still...
<banisterfiend`> Hanmac: haha did u see my one already?
<Hanmac> nope
<shevy> workmad3 well, I dont like subclassing much really
<banisterfiend`> Hanmac: https://gist.github.com/3197076
<workmad3> shevy: yeah, that's what I don't get
<banisterfiend`> Hanmac: makes overloading methods based on arity possible
<shevy> if I'd want to have some common instance variables, I'd have to subclass all my classes in a given project, from a base class
<workmad3> shevy: subclassing is a tool... it's not there to be liked or disliked, merely to be used
<workmad3> shevy: right, in that case then yes, modules like the one you showed can provide a different implementation mechanism
<shevy> I cant use things I dislike. I gave up @@ entirely because I dont like it at all
<banisterfiend`> Hanmac: is that what u had in mind too?
<workmad3> shevy: @@ is mostly useless... subclassing is not mostly useless :)
<shevy> yeah
<Hanmac> banisterfiend` hm interesting, but i want to make it possible based on Types
<workmad3> shevy: subclassing is a way of describing relationships...
<workmad3> shevy: in all honesty, what I think you're hitting is more of a lack of understanding of what subclassing actually is
<banisterfiend`> Hanmac: how would u provide the type information? with a class method decorator? or what?
<workmad3> shevy: you know my view is that subclassing is overused... but the response to that isn't to jump ship entirely, it's to actually put thought into when you want and don't want to create a type hierarchy ;)
<banisterfiend`> Hanmac: you can do it like this if you use method_source: def hello(arg1=String, arg2=Fixnum)
<Hanmac> instatt of def i would use def_typed(:name, Float,Integer) {|f,i| ... }
<shevy> dunno
<shevy> I felt constrained by the subclassing pattern in the past
<banisterfiend`> Hanmac: and use clever metaprogramming tricks to rewrite the method
<banisterfiend`> Hanmac: baby doesnt like that, too weird
<workmad3> shevy: again, I don't see why you're so resistant to anything that constrains options
<workmad3> shevy: everything is adding an extra constraint, putting more definition into what you want to express
<Hanmac> your way breaks the default args (ok my way too but i think in my way its manageable)
<banisterfiend`> workmad3: have you seen Asher's parallel ancestry? :P
<workmad3> shevy: subclasses impose certain constraints, yes... which is why you put thought into when you use it, so that you only use it when those constraints make sense
<banisterfiend`> Hanmac: mine will only break defaults in the case the default is a class :P (which is rare as a german speaking horse)
<workmad3> shevy: in the same way that using a symbol imposes constraints
<workmad3> shevy: or that using ruby itself imposes constraints
<shevy> I dont like symbols either
* workmad3 facepalms
<banisterfiend`> workmad3: shevy is insane in the membrane
<workmad3> banisterfiend`: that's becoming increasingly clear
<shevy> other than taking up less memory, I fail to see the cool thing about them
<banisterfiend`> workmad3: would u believe he's been programming ruby for 5 years? :P
<Hanmac> i use symbols as enum replacement
<workmad3> shevy: why do they have to be cool to be useful?
<shevy> workmad3 because they add complexity
<workmad3> shevy: no they don't, they remove it
saschagehlich has quit [Quit: saschagehlich]
<shevy> just as @@ does to
<workmad3> shevy: symbols are immutable, strings aren't
<workmad3> shevy: so passing around a symbol means you can't accidentally leak class internals that can be changed
<shevy> what does this mean?
<shevy> "leak class internals"
<matti> Hi shevy
<shevy> hey matti
<workmad3> shevy: it means if you return a string that's stored inside an instance variable, you have just unwittingly allowed any part of your program to change that without notifying your class
* matti throws some PHP4 code towards shevy
zemanel has quit [Quit: zemanel]
<workmad3> shevy: you've leaked the internals
<Mon_Ouie> https://gist.github.com/3205958 — written a long time ago (so don't worry about the dragons, they're probably dead already)
<Hanmac> shevy like object.imgtype.replace("shit")
<workmad3> shevy: or, in a simpler example: https://gist.github.com/3205964
<workmad3> shevy: that sort of leak can't happen with a symbol because symbols are immutable values
<shevy> hmm
<JonnieCache> the web audio api is fun: http://jsfiddle.net/DJZLS/2/
mneorr1 has joined #ruby
<Mon_Ouie> shevy: How could you not like symbols? They have a pretty color in almost all color themes, surely they must be nice!
nateberkopec has joined #ruby
<shevy> complexity is the root of all evil
<banisterfiend`> Mon_Ouie: haha that's some scary code monny!!!!!!!!!!!
<fivetwentysix> rubygems down?
<fivetwentysix> lol
mneorr has quit [Ping timeout: 252 seconds]
<Hanmac> Mon_Ouie your gist looks funny ... can i use it as inspiration?
<workmad3> shevy: stop making all forms of complexity the same
<Mon_Ouie> Hanmac: Sure
<workmad3> shevy: and stop assuming that just because some detail carries some extra complexity that it automatically makes everything it touches more complex (it's a false assumption)
arkiver has joined #ruby
Araxia has quit [Quit: Araxia]
fixl has joined #ruby
bwwrd has joined #ruby
<banisterfiend`> Hanmac: by 'funny' u mean 'fun' ?
<Hanmac> funny is an adijective
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<banisterfiend`> Hanmac: 'funny' and 'fun' mean quite different things :P but foreigners often mess them up
x0F_ is now known as x0F
<banisterfiend`> Hanmac: if something is 'funny' it means it's humorous and makes you laugh
<banisterfiend`> if something is 'fun' it means you find it entertaining/enjoyable
<banisterfiend`> they're quite different
<Hanmac> i think its both :P
<Mon_Ouie> I think being able to do a_string_or_an_integer_or_a_class is pretty funny
<banisterfiend`> hehe ok
Crisewng has quit [Quit: Leaving.]
robotmay has quit [Ping timeout: 264 seconds]
mucker has joined #ruby
catphish has joined #ruby
<Hanmac> i prefer: when_given(String, Integer) { |s,i| ... }, and maybe this: when_given(:to_f, :to_i) { |f,i| ... }
<banisterfiend`> Hanmac: it's a cute project but i dont think anyone would actually use it
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<catphish> is anyone here familiar with mikel's mail and character encoding?
<Hanmac> when its finish i will post it to http://bugs.ruby-lang.org/issues :D
<banisterfiend`> Hanmac: i think u should make it a decorator
<banisterfiend`> Hanmac: like this:
Gurpartap has quit [Quit: Page closed]
<banisterfiend`> params :arg => String, :arg1 => Fixnum
<banisterfiend`> def hello(arg, arg1)
<banisterfiend`> end
elhu has quit [Quit: Computer has gone to sleep.]
<banisterfiend`> Hanmac: and use the method_added hook, combining my trick + the type information
<banisterfiend`> for more natural and less DSL-y overloading
<banisterfiend`> the less DSL-y the better
<banisterfiend`> DSLs suck 9"
<workmad3> banisterfiend`: and don't forget to throw errors if params haven't been provided, or don't match the argument list cardinality :)
<banisterfiend`> workmad3: Yeah, they'd be 'compile time' errors too, which is cute
<Mon_Ouie> That reminds me of something else I saw
<workmad3> banisterfiend`: :D
<dominikh> Mon_Ouie: haha.
<dominikh> I sincerely hope nobody is using that
<dominikh> I also hope nobody seriously considers doing decorators in current ruby
<dominikh> pointless hack
<banisterfiend`> yeah it's all pointless, method_added hook is pretty much useless
<banisterfiend`> IMO, as u have to take so much care to keep other method_added hooks alive
<workmad3> dominikh: why? that looks awesome!!!
<dominikh> what banisterfiend` said
ZachBeta has joined #ruby
<workmad3> dominikh: but I wants proper, validated keyword args!
<dominikh> it's also incredibly magically. means, nobody knows what is going on
<Spooner> The way options lists are managed are pretty dreadful at the moment, but yes, that isn't a great alternative.
<Mon_Ouie> And anything that relies on the method_added hook tends to be fragile
companion has quit [Read error: Operation timed out]
<banisterfiend`> dominikh: out of interest why do you use: default_arguments {{a: 1, b: 2, c: 3}}
<banisterfiend`> instead of just: default_arguments a: 1, b: 2, c: 3 ?
greyEAX has quit [Ping timeout: 246 seconds]
robotmay has joined #ruby
<banisterfiend`> you're defining a hash instead a block there?
<dominikh> I've had a reason for the proc. no idea why anymore
<Spooner> A block with a hash in it, by the looks of it.
<dominikh> but yeah, block with hash in it indeed
<banisterfiend`> dominikh: maybe cos u wanted to re-evaluate the defaults each time the method was called
<banisterfiend`> like: def hello(x = rand())
<dominikh> yes, that's why
<Spooner> Maybe you wanted to allow the user to have _different_ default args based on magic?
<workmad3> banisterfiend`: that's what I was thinking :)
<banisterfiend`> is reevaluated each time you call hello()
<dominikh> banisterfiend` is right
bj0ern has joined #ruby
<workmad3> but I like Spooner's suggestion...
<workmad3> you could have a proc with a counter, so you can have a default arg consisting of how many times the default args have been used! :D
<Spooner> A fiber would be even better.
<workmad3> can anyone tell it's monday morning and I'm waiting for a long test suite to finish running? :)
<banisterfiend`> i love fibers too bad they dont like me
ananthakumaran has quit [Quit: Leaving.]
yakko has joined #ruby
<Spooner> I have found them very useful.
<Spooner> Thankfully they don't segfault Gosu any more :)
ephemerian1 has joined #ruby
<banisterfiend`> i just keep getting ridiculous errors when using them
ephemerian1 has quit [Client Quit]
<Spooner> I'm surprised you haven't tried any of your mad hacks with them.
<banisterfiend`> error: fiber called across stack rewinding barrier
bosphorus has joined #ruby
<workmad3> banisterfiend`: still getting that one? was it to do with 'next' throwing a symbol? :)
TPFC-SYSTEM has joined #ruby
<banisterfiend`> workmad3: yeah, it's something deep in ruby-debug internals
<Spooner> Oh, I remember you saying that. I've not had any unexpected behaviour, but they are a little fiddly to use.
mockra has joined #ruby
<Hanmac> someday i want to make a ruby thing similar to Towlies Book ... "a million little Fibers" :P
<banisterfiend`> that i cant be bothered figuring out, if i use pry-nav (which is set_trace_func-based) instead of pry-debugger (which is ruby-debug based) then it works fine and i dont get the error
companion has joined #ruby
<workmad3> banisterfiend`: debuggers have, I believe, a good history of completely buggering up when encountering threads and fibers :)
goganchic has quit [Ping timeout: 255 seconds]
ephemerian has quit [Ping timeout: 264 seconds]
yakko has quit [Remote host closed the connection]
<banisterfiend`> yeah..i dont really need fibers anyway, they were just a bit cuter
vlad_starkov has joined #ruby
flype has joined #ruby
<Spooner> I mainly found them useful for doing long tasks, such as preloading assets, interlaced within the Gosu Window#update call, without the pain of using Threads and synchronisation.
red-panda has joined #ruby
<banisterfiend`> Spooner: how does it help there
mockra has quit [Ping timeout: 252 seconds]
<Spooner> Well, if I do it all at once, then it takes, say 2s, and gives 0FPS lockup. By putting it in a fiber, I can call the fiber until a time-frame has passed (say 20ms).
ananthakumaran has joined #ruby
<catphish> is it possible to set default behaviour for string#encode?
<Spooner> However, that use-case could be managed just as well with a big queue of procs, but it would be more ugly.
mobilegamelabs has joined #ruby
<Spooner> It also is guaranteed to work with non-thread-safe libraries, like Gosu :)
<hoelzro> catphish: what kind of default behavior?
<banisterfiend`> Spooner: so u mean the main loop of the game is resuming the fiber?
<Spooner> banisterfiend` : Yeah.
<banisterfiend`> Spooner: why not just use lazy loading for assets instead
<banisterfiend`> rather than a weird staggering
<banisterfiend`> it doesnt' seem like a normal use case for a fiber
<Spooner> BEcause if you do that, you end up with pauses when somethign wants to make a death sound :)
<catphish> hoelzro: i have a library that calls string.encode('UTF-8') a lot, and I want it to use :invalid => :replace by default
bwwrd has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<banisterfiend`> Spooner: ah ok
<hoelzro> ah ha
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
<Spooner> banisterfiend`: Specifically, I have that fiber running in the menu too, rather than in-game. I want to preserve some FPS there, but I don't want it to lock up. IF they skip right into the game, then it defaults to either loading it when the level loads (which takes N seconds, like all the graphics) or when needed (like sounds)
moshef has quit [Ping timeout: 244 seconds]
<catphish> looks like i can probably override the library methods instead
yxhuvud has quit [Ping timeout: 252 seconds]
bigkevmcd has quit [Quit: outta here]
br4ndon has joined #ruby
goganchic has joined #ruby
<Spooner> banisterfiend` : I also used them for queing actions in-game. You'd have a queue of action fibers (like move from a to b at speed c, do this for n seconds, move to whereever). I'd just run the first one until it ended, then move to the second. Anyway, rather specific use-cases I'm talking about here :)
<Hanmac> catphish i would call if from an global method ... like my_own_encode(str)
<banisterfiend`> Spooner: cool, sounds lik eu're making good use of them anyawy
Rochefort has joined #ruby
<Hanmac> Spooner so are Fibers interesting when you does not have the control over the main loop ?
<Spooner> At least for me, they don't acheive anything I couldn't do in another fashion, but they do make it more simply. Like Threads really - nothing in a thread couldn't be written without them, but it would be painful :)
tonini has joined #ruby
<Spooner> Hanmac : In my case, they work where Threads wouldn't since I need to make non-thread-safe calls in them, which might happen when the main loop isn't active. Admittedly, I suppose I could mutex it when I am "active", but it just adds unnecessary complexity.
<ini> anyone in here from coimbatore?
saschagehlich_ has joined #ruby
bluOxigen has joined #ruby
<Hanmac> ok this could be interesting in my case because i bind something big as Ogre :P
mehlah has quit [Quit: Leaving...]
liluo has quit [Remote host closed the connection]
<Spooner> Hanmac : Ogre? You mean you have implemented Shrek?
<banisterfiend`> Spooner: in my situatino i had to use fibers in order for things to execute in the right order, since i need to get pry to read a line of input, then do its little repl thingy, then read another line of input, and so on https://gist.github.com/fd345efdabcb63255014
<banisterfiend`> should be do |input|
<Hanmac> Spooner: similar :P www.ogre3d.org/
Morkel has quit [Quit: Morkel]
<Spooner> Hanmac : Ah, I'm happy with Gosu in 2D (and maybe some bespoke 3D in Opengl when I can be bothered :D).
<Hanmac> hm yeah gosu is fine, but i dont like the swig part ...
<banisterfiend`> Hanmac: do you use Mon_Ouie's ray library instead?
<Hanmac> hm i tryed it ... but i dont understand it yet
<Spooner> What precisely is wrong with SWIG? I have only hand-bound libraries, so I haven't encountered difficulties.
abra has joined #ruby
<banisterfiend`> Hanmac: the problem with all Mon_Ouie's software is that even though it's awesome, he only writes the documentation in french
<banisterfiend`> and archaic french too, so google translate has trouble with it
ephemerian has joined #ruby
monkegjinni has joined #ruby
<Hanmac> Spooner: maybe i have something like this: child = window.getChild(name), what did you expect when you call it again? on my bindings the child is the same ruby object
<Spooner> banisterfiend` : I'm not entirely sure how your example relates to fibers.
<Spooner> Oh, I see. That would be pretty dumb - SWIG would give you the same C object, wrapped in a different Ruby object wrapper?
<banisterfiend`> Spooner: everytime an `input << blah` line is encountered the fiber yields
<Hanmac> excact ... when i write my bindings from hand i can add more *magic*
<banisterfiend`> Spooner: and that line is immediately executed by pry
<banisterfiend`> Spooner: then when the next line is wanted, the fiber is resumed again
<Spooner> Oh, I think I see, yes.
<Spooner> Hanmac : I didn't realise that, but Gosu doesn't really have any objects that you access like that. Still, it is a tiny library compared to most things, so I can't see any reason not to bind it manually.
<Spooner> Hanmac : Maybe someone should write their own Ruby bindings for C++/Gosu then :)
<Hanmac> i tryed it :D
<Hanmac> but i paused that project until gosu implments the new glfw lib
<Spooner> I think 0.8 and glfw will appear to signal the next ice age :)
<Hanmac> you mean this year ? D
<Spooner> Good point!
williamherry has quit [Remote host closed the connection]
<banisterfiend`> Hanmac: what does 'hanmac' mean
sendoushi has joined #ruby
<Hanmac> first three characters of first name + first three characters of surname ... is was an suggestion from suse long time ago
<Spooner> Hank Macbeth?
<Hanmac> yeah somethink like that :P
<banisterfiend`> Spooner: not germanic enough
chussenot has quit [Quit: chussenot]
<aTastyCookie> Hans
abra has quit [Ping timeout: 276 seconds]
Criztian has quit [Remote host closed the connection]
cantonic has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
vitoravelino`afk is now known as vitoravelino
lkba has quit [Quit: Bye]
arietis has joined #ruby
Guest91275 has joined #ruby
<Hanmac> Spooner when the C++lib allows it then i try to add a freature that the c++ object force the ruby object to stay alive :P (its protected from the GC as long the c++ lives)
<Spooner> Yes, you just attach it as a structure on the Ruby object.
<Hanmac> i do it backwards .. i add the ruby object in a stucture to the c++ object :P
<Hanmac> so when the c++ object dies, it deletes the stucture and this removes the object from my protection hash
<workmad3> ah, good old RIAA principles in c++ :)
<Spooner> That makes more sense so ou can pass out the object. You don't need to do that though; just have to use the mark method.
<Spooner> *mark function.
<Spooner> Which is a lot simpler.
<Hanmac> i didnt manage the mark method yet :(
sgronblom has quit [Ping timeout: 272 seconds]
<Spooner> You bind a free function, don't you? When you attach the C++ structure to your Ruby object?
<Hanmac> no, because the c++ structure may be deleted without that ruby notic it ... (and then i get an double deletion)
<Spooner> But you won't, since the C++ structure keeps the Ruby object alive via the mark function.
sgronblom has joined #ruby
<Hanmac> hmmmm can you make a sample with using mark?
Morkel has joined #ruby
<Spooner> There, the C structure (texture) owns the Ruby object rb_cache.
nari has quit [Ping timeout: 245 seconds]
cousine has joined #ruby
mockra has joined #ruby
<Spooner> Admittedly, I haven't been working on C extensiosn very long, but I'm pretty sure that is correct.
fermion has joined #ruby
mpereira has quit [Ping timeout: 272 seconds]
mockra has quit [Ping timeout: 245 seconds]
elhu has joined #ruby
<Hanmac> hm i think the mark stuff would not work for me directly ... but nice idea
flype has quit [Quit: Computer has gone to sleep.]
<Spooner> Well, that is for owning other Ruby objects, not the bound object. I'm sure that Data_Make_Struct binds the C structure to the Ruby object it creates already though.
gokul has quit [Quit: Leaving]
mneorr1 has quit [Quit: Leaving.]
<Spooner> But you could use it when, for example, you have a container class that needs to keep all the contents objects alive (by marking).
rippa has joined #ruby
<Spooner> Where those contents objects are referenced only in the underlying C, of course, not between the Ruby wrappers directly.
mneorr has joined #ruby
<Mon_Ouie> You should never override new
<Mon_Ouie> Define the allocator and let ruby take care of the rest
<Spooner> Define the allocator?
<Hanmac> in one of my bindings i override new but only because it does not work better ... :(
EPIK has joined #ruby
<Mon_Ouie> rb_define_alloc_func
<hoelzro> Mon_Ouie: that's just the malloc abstraction, right?
gregorg has joined #ruby
<Mon_Ouie> What do you mean?
<Mon_Ouie> It allows to allocate objects without having to call initialize
<Spooner> Mon_Ouie : Ah, thanks. It wasn't telling me to do it that way in the tutorials I was reading.
<Mon_Ouie> Which is required if you want to implement #initialize_copy and friends
goganchic has quit [Quit: leaving]
aTastyCookie has left #ruby [#ruby]
Markvilla has quit [Quit: Markvilla]
red-panda has quit [Remote host closed the connection]
nfk has joined #ruby
<nfk> i forgot, what were my options when it comes to opengl (es2?) with ruby?
Juul has joined #ruby
<nfk> ruby-opengl seems kinda dead
<Spooner> "opengl" is its 1.9 successor.
<Spooner> It works fine.
<Hanmac> allocate methods are not so good when you need to create the object with some kind of Manager ...
<nfk> so it's built in?
<Hanmac> nfk no but its another gem
<Spooner> Built in? No, the "opengl" gem is the 1.9 version of "ruby-opengl",.
<nfk> i see
<nfk> ERROR: Could not find a valid gem 'opengl' (>= 0) in any repository
<Spooner> gem install opengl --pre
<nfk> hmm...
<Spooner> I've been using it and it seems to work fine though.
<nfk> is it expected that gem is of version 1.8.24?
<nfk> gem as in gem itself
<Spooner> No, it is 0.8.0.pre1
<nfk> not the package
nedbat has joined #ruby
<nfk> Spooner, anyway, --pre did the trick
<nfk> thanks
<Spooner> Gem is at 1.8.24, yes
<workmad3> nfk: sounds about right
<nfk> btw, where do i find documentation for opengl? google returns only ruby-opengl
<Spooner> The API is identical.
<nfk> cool
<Spooner> It is just a fork for 1.9
<nfk> so still no real opengl 3.0?
<Spooner> Because the ruby-opengl dev went to the moon.
<Spooner> Nope, not unless you want to do it yourself.
<nfk> well, i guess that's still better than nothing
<Spooner> I thought you were after es 2.0 though :)
<nfk> well, 3.0 would be fine
<Spooner> I've only used it up to regular 2.0, since I want any toaster to run my code.
<nfk> and 4.0 just peachy but the stuff i need is so basic es2 should do the trick too
<workmad3> I should get back into opengl coding at some point
<workmad3> haven't done any for years
vlad_starkov has quit [Remote host closed the connection]
np_complete has joined #ruby
vlad_starkov has joined #ruby
tk__ has joined #ruby
jrajav has joined #ruby
Jacob_ has joined #ruby
Jacob_ is now known as ecksit
<np_complete> hey, I do "<<" to a string inside aloop, but it wont hold what I pass when the loop finishes. the var is defined outside the loop
banisterfiend has joined #ruby
<Spooner> I'm making a C extension, so I'm using the opengl gem to develop, then I have it linked to opengl/glee for when I re-implement each bit in C.
<Spooner> np_complete : You need to give an example of code (possibly in a pastie).
cantonic has quit [Quit: cantonic]
<Spooner> Sounds like it should work though :)
Axsuul has quit [Ping timeout: 255 seconds]
ecksit has quit [Client Quit]
chussenot has joined #ruby
Jacob_ has joined #ruby
Jacob_ is now known as ecksit
peterhellberg has joined #ruby
<Hanmac> i dont use opengl directly ... i use other libs for that ... (gosu or ogre for the Engine, and CEGUI for the GUI)
banisterfiend` has quit [Ping timeout: 252 seconds]
<workmad3> Hanmac: opengl is fun though :D
charlies_ has joined #ruby
geekbri has joined #ruby
<Spooner> Right, I'm building some extension and high level stuff onto Gosu, so I sort of need to use OpenGL directly, at least in the library, so I don't have to use it in my actual code :)
nikeita has joined #ruby
<workmad3> that said, I was starting to move away onto more physics simulations when I stopped really playing with opengl and graphics
<banisterfiend> i wanna do some opengl for a data visualization app i'm writing for ipad
Axsuul has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
charlies_ is now known as charliesome_
geekbri has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
<workmad3> banisterfiend: funky 3d visualisations? :)
<np_complete> Spooner code is here
<Spooner> Mon_Ouie : Ha, it seemed that re-writing .new was what you did in 1.6. I have not been so out of date... Ha!
<np_complete> Spooner: floor_init wont hold its value after the loop
<banisterfiend> workmad3: i think so..i have to learn a bit about data visualization before i start it, might not have to be too fancy so long as it's easy to navigate
<Spooner> np_complete : Rogue-alike?
vlad_starkov has joined #ruby
<np_complete> yes
<Spooner> Well, I would suggest the most likely think is that line 28 is not matching.
geekbri has joined #ruby
<workmad3> np_complete: floor_init is inside the each_line block
<workmad3> np_complete: so it'll be reset on each loop through
<Hanmac> workmad do you found some good physics engine? (i heard that bullet is nice)
indian has quit [Ping timeout: 255 seconds]
<Spooner> Ha, yes, it is.
<np_complete> ouch! I make a mess with so much indentation!
<workmad3> Hanmac: I was playing around with my own physics resolvers rather than an engine :)
jeff_sebring has quit [Quit: Leaving]
<workmad3> Hanmac: and this is going back a few years now... the only one really in use and open source at the time was havok iirc
Axsuul has quit [Ping timeout: 250 seconds]
`brendan has joined #ruby
<workmad3> Hanmac: I do have the 3 books on engines and game physics by eberly too... should crack them open at some point and see about applying some of it to ruby :)
<banisterfiend> workmad3: do u do any non-ruby dev?
jstew has joined #ruby
<banisterfiend> ios or android?
<banisterfiend> or has rails taken over ur brain? :P
<workmad3> banisterfiend: I did... but not at the moment
<banisterfiend> ah ok
<workmad3> rails has mostly taken over my brain :)
<banisterfiend> rubymotion might be a good way to escape
<banisterfiend> assumingu want to
<Spooner> I needed to do arbitrary collisions with a randomly generated texture, so I thought it would be easier to just use a signed distance field, rather than chipmunk, but I'm beginning to regret that decision.
tommyvyo has joined #ruby
<banisterfiend> Spooner: isn't texplay fast enough 4 u
<Spooner> Well, Ashton is massively faster than TexPlay and generating an equivalent SDF in Texplay would take an hour :)
mpereira has joined #ruby
lorandi has joined #ruby
<Spooner> Well, several minutes, anyway (compared to 20ms in GLSL :D).
<banisterfiend> Spooner: what kind of collisions?
<banisterfiend> Spooner: i dont think ashton would be faster than texplay for get_pixel
<banisterfiend> it's O(1) in texplay
beakerman has joined #ruby
<Spooner> Actually, it is significantly faster.
<banisterfiend> for get_pixel?
<Spooner> But that is because it is not doing exactly the sdame thing.
<banisterfiend> we're talking about get_pixel *after* the image is already cached i hope
nikeita has quit [Quit: sleep]
<banisterfiend> it's silly to include caching times into your benchmarks
<banisterfiend> since that's a one-off cost
<Spooner> banisterfiend https://gist.github.com/3170006
Juul has quit [Ping timeout: 240 seconds]
<banisterfiend> and only occurs the first time u run it
<Spooner> I don't include that (I cache too).
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<banisterfiend> Spooner: i dont see get_pixel there, i guess image[x, y] is that though?
nikeita has joined #ruby
<Spooner> Yes.
<banisterfiend> Spooner: 0.00303 vs 0.00293
<Spooner> It is just an alias, I think.
<workmad3> Spooner: all done on the GPL?
<banisterfiend> is not 'massively faster' ;)
krusty_ar has joined #ruby
<Spooner> I fail to see your ability to read.
Shrink has joined #ruby
<workmad3> err, GPU
<workmad3> #fail
<workmad3> man, that's a real monday typo there :/
<Spooner> 0.00303 vs 0.00664 Gosu::Color vs [1.0, 1.0, 1.0, 1.0]. And then 0.00078 vs 0.00674 [255, 255, 255, 255] vs [1.0, 1.0, 1.0, 1.0]
<Spooner> And we arent' even getting to the level of Texture#transparent?(x, y) 0.00029, which is what you'd use for collisions.
sendoushi has quit [Read error: Connection reset by peer]
<workmad3> Spooner: now... what does a benchmark of 1,000,000 of each call look like, to get to more stable times? :)
venkatk_ has quit [Quit: This computer has gone to sleep]
crankycoder has joined #ruby
<Spooner> Which give 2, 10 or 20 times faster.
sendoushi has joined #ruby
<Spooner> workmad3 : That is for 100k calls.
<workmad3> Spooner: ah, fair enough :D
<Spooner> Though less for the longer running stuff (like dup) since I want to get it done before I die :)
crankycoder has quit [Remote host closed the connection]
<np_complete> hey Spooner! how to run ur game in linux
<workmad3> hehe
crankycoder has joined #ruby
<banisterfiend> Spooner: well i dont understand that as it's just an array lookup
<banisterfiend> Spooner: could be that the Image#[] wrapper is causing a slowdown for whatever reason, best to probably use get_pixel()
<Spooner> I can't re-run it because my devpack is broken and so I need to re-bloody-install Ruby :)
fantazo has joined #ruby
venkatk_ has joined #ruby
<Spooner> Actually, no, I just can't recompile the .so with Mon_ouie's correction.
vlad_starkov has quit [Remote host closed the connection]
Progster has joined #ruby
mneorr has quit [Quit: Leaving.]
bigkevmcd has joined #ruby
<Spooner> banisterfiend : get_pixel runs identically.
vectorshelve has quit [Quit: Page closed]
<Spooner> Remember that pushing out floats is not fast in Ruby and the method is so simple that that difference is significant.
chussenot has quit [Quit: chussenot]
<banisterfiend> float arithmetic is slow
<Spooner> rb_float_new() is slow :)
<banisterfiend> why?
<banisterfiend> i guess it's allocating memory on the heap
<Spooner> It is slower than INT2NUM(n), anyway, since that is just n * 2 + 1 (or whatever it is).
<banisterfiend> Yeah, whereas a float is proper ruby object
moshef has joined #ruby
moshef has quit [Client Quit]
<Spooner> But bear in mind that generating Gosu::Color object is 2x faster than generating 4 floats.
`brendan is now known as brendan`
<Spooner> *4 floats in an array.
arkiver has quit [Ping timeout: 246 seconds]
nwest has joined #ruby
<Spooner> But the way I do that is pass a 0xffffffff to Color.new, which means I don't need an array or any floats or anything. You'll notice that my Texure#draw is massively slower than Gosu::Image's one so I'm not always winning in C :)
tonni has quit [Ping timeout: 272 seconds]
arkiver has joined #ruby
<Spooner> I think that is because I have to mess around with Window#gl blocks though (should we take this discussion to #gosu? :D).
hunglin has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
tonni has joined #ruby
hunglin has left #ruby [#ruby]
mockra has joined #ruby
<Bofu2U> mornin
zealinux has joined #ruby
vvgomes has joined #ruby
geekbri has quit [Remote host closed the connection]
GlenK has quit [Ping timeout: 246 seconds]
Gavilan has left #ruby [#ruby]
geekbri has joined #ruby
withnale has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
mockra has quit [Ping timeout: 264 seconds]
withnale has joined #ruby
<dagobah_> Anyone interested in £50 free VPS credit?
catphish has quit [Quit: Leaving]
<withnale> Simple question... is there a purer way of writing this...
<withnale> if asset_element.attributes['file']
<withnale> @assets[asset_name].file = asset_element.attributes['file']
<withnale> end
wangr has joined #ruby
<banisterfiend> withnale: if bing = asset_element.attributes['file']; @assets[asset_name].file = bing; end
cantonic has joined #ruby
bluenemo_ has quit [Remote host closed the connection]
GlenK has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
tonni has quit [Remote host closed the connection]
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
macer1 has joined #ruby
tommyvyo has joined #ruby
mneorr has joined #ruby
Criztian has joined #ruby
cousine has joined #ruby
<shevy> Ruby 1.9 no longer allows the implicit conversion of Exception to String.
<shevy> anyone knows why?
justinseiter has joined #ruby
<banisterfiend> shevy: what do u mean
justinseiter has left #ruby [#ruby]
np_complete has quit [Quit: Leaving]
wataken44 has quit [Remote host closed the connection]
bullicon has quit [Quit: Computer has gone to sleep.]
timonv has quit [Remote host closed the connection]
<shevy> banisterfiend there is an example
<shevy> e = Exception.new("not really an exception")
<shevy> msg = "Error: " + e # String concatenation with an Exception
<shevy> this works in 1.8 but not in 1.9
<zealinux> How to read the core rails3 source?
<banisterfiend> zealinux: go to the github page
wataken44 has joined #ruby
<Hanmac> Spooner: PS: i like to prefer to write my bindings in c++ ... so i can use namespaces to group the code
<shevy> zealinux you find the source and read it with your eyes? :) "gem install rails", then go into cache/ subdirectory and extract the .gem archive, then enter that directory and start exploring
<Spooner> Hanmac : It does seem sensible. Have you looked at Rice, by the way?
baphled has quit [Ping timeout: 246 seconds]
centipedefarmer has joined #ruby
Juul has joined #ruby
<Hanmac> Spooner i do ... but there are thinks in rice i do not like ...
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
<Hanmac> shevy try this: msg = "Error: #{e}"
<Spooner> Doing it manually does seem sensible on small projects though. Not sure I'd want to maintain a large project though, if there was even a poorly implemented automated alternative.
carloslopes has joined #ruby
lkba has joined #ruby
<shevy> Hanmac do you know why this behaviour was changed in 1.9?
iamjarvo has quit [Quit: Leaving...]
<Hanmac> spooner you mean large as this: https://github.com/Hanmac/rwx/tree/master/ext ?
enroxorz has quit [Client Quit]
<Spooner> Hanmac : Yar, like that :P
cousine has quit [Remote host closed the connection]
arkiver has quit [Ping timeout: 240 seconds]
Markvilla has joined #ruby
<Hanmac> Spooner i prefer to have the control :D
<JonnieCache> zealinux: https://github.com/rails/rails
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
mneorr has quit [Quit: Leaving.]
<JonnieCache> zealinux: there is a branch for each version
runa has left #ruby [#ruby]
<workmad3> yeah, and shevy's suggestion won't give you much code, because there's very little code in the 'rails' gem anymore (it's all in separate gems like railties, actioncontroller, etc)
<Spooner> cd ..
<Spooner> oops :$
<workmad3> Spooner: no, keep going, this is your terminal... now use this command line prompt to log into your bank...
<workmad3> bank details:
* workmad3 is the worst phisher in the world
vvgomes has quit [Ping timeout: 244 seconds]
<Spooner> You nearly got me there, workmad3
<Spooner> Good job I got enough sleep last night :D
<workmad3> aww, you're just saying that to make me feel better, aren't you :P
digitalcakestudi has joined #ruby
strife25 has joined #ruby
linoj has joined #ruby
bullicon has joined #ruby
<JonnieCache> best phisher ever: http://www.youtube.com/watch?v=LgHQDhoAc6s
jrist-afk is now known as jrist
Juul has quit [Ping timeout: 240 seconds]
locriani has quit [Remote host closed the connection]
<Spooner> workmad3 : was marginally more convincing than that.
<workmad3> :D
<Spooner> Marginally.
verto|off is now known as verto
bluOxigen has quit [Ping timeout: 256 seconds]
greyEAX has joined #ruby
kpshek has joined #ruby
<workmad3> Spooner: welcome to your banking IRC channel. Please enter your bank account details and answers to any security questions you are aware of in order to continue
hynkle has joined #ruby
<Spooner> You've missed your opportunity there.
<JonnieCache> thats #bitcoin-otc youre thinking of
<JonnieCache> where they actually do transactions in the channel
jonathanwallace has joined #ruby
<JonnieCache> its a bit more secure than that though
<workmad3> heh
<nikeita> it is possible in ruby to make something like this?
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
<shevy> man I swear
<nikeita> with obj do
<shevy> I will never ever again rewrite a project from scratch
<nikeita> method call
<nikeita> method call
<nikeita> end
<shevy> what is with
<shevy> a method?
<shevy> and obj is the argument to that method?
<JonnieCache> with is a keyword from python
<nikeita> no…i was asking
<nikeita> i ruby have this syntac
<nikeita> x
<Spooner> nikeita : I think you are talking about instance_eval
<shevy> you can do this in ruby
<shevy> def with(i)
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<shevy> yield if block_given
<shevy> end
<shevy> block_given?
<JonnieCache> yeah you probably want instance_eval
genetic has joined #ruby
<genetic> anyone here use Radiant CMS?
locriani has quit [Read error: Connection reset by peer]
<shevy> I dont know what you mean with "method call"
<Spooner> shevy: That will give you "with object do |obj|"
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<workmad3> Spooner: it won't even give that... no argument to the yield :)
r0bby has joined #ruby
cousine has joined #ruby
<Spooner> nikeita : You simply want obj.instance_eval do ... end
<nikeita> simply i do not want to repeat the reference to call methods one after anothr
<Spooner> workmad3 : Oh, no, I couldn't have imagined that was missing :D
justsee has quit [Quit: Leaving...]
<nikeita> do not like for example: app = new App ; app.welcome ; app.init ; app.someothermethod etc. etc.
genetic has left #ruby [#ruby]
<JonnieCache> nikeita: that speaks of bad design tbh
<workmad3> ^^
<JonnieCache> the App should be responsible for setting itself up
<nikeita> sorry read… App.new
<Spooner> It isn't uncommon to do it that way though. Quite often "App.new do |a| a.x; a.y; end" though
<shevy> nikeita, pls
<shevy> new App
<shevy> what is this
<shevy> you are not thinking in ruby
ini has quit [Quit: Leaving]
<workmad3> Spooner: that's more commonly used for config rather than setup control flow though
robbyoconnor has quit [Ping timeout: 255 seconds]
<shevy> nikeita I usually bundle the logic into a method called run()
<Spooner> workmad3: Oh true. I didn't read the exmaple properly.
brendan` has quit [Read error: Connection reset by peer]
brendan` has joined #ruby
mneorr has joined #ruby
<Spooner> Anyway, nikeita, did we answer your question or did shevy think in Ruby at you too hard to make out the answer? :D
<withnale> How can I make a logger object that will send INFO to STDOUT and everything else to STDERR?
<kalleth> shevy: i use semicolons and brackets EVERYWHERE in my ruby code
<kalleth> how does that make you feel
<shevy> the semicolons want me to kill you
jonathanwallace has quit [Remote host closed the connection]
<shevy> brackets, dunno. I think they are ugly, but they don't annoy me that much
<withnale> ... or do I need two logger objects?
<kalleth> i also have a getFactory().obtainInstanceFor("String").new({myparams}) methods
<nikeita> look at this
<Spooner> Yes, I told you how to do that.
devdazed has joined #ruby
<Mon_Ouie> withnale: I don't think the Logger class in Ruby allows that, but you can write your own that will do just that easily
carlyle has joined #ruby
<kalleth> Spooner: couldn't you in initialise do 'yield instance_eval' ?
<nikeita> but your solution still need a reference
<kalleth> or smth
<nikeita> in the block
<kalleth> wondering how to get it working precisely
swarley has quit [Read error: Operation timed out]
<workmad3> kalleth: arrrgh!!!! camelCase!!!
<kalleth> workmad3: AND FACTORIES
<Spooner> kalleth : No, it would be instance_eval; yield; end, but yes.
d3vic3 has joined #ruby
julio_ has joined #ruby
<kalleth> Spooner: what i'm wondering is if there's a way to make the 'API' (for want of a better word) respond precisely as described
<Mon_Ouie> It would instance_eval(&block)
DrShoggoth has joined #ruby
<workmad3> Spooner: even that wouldn't work (I've tried it before, it switches block context when you hit the field)
<kalleth> ohhh, Mon_Ouie, nice
<workmad3> *yield
<Spooner> What do you mean? I use it all the time.
<kalleth> ^ so that would work?
<Spooner> Mon_Ouie Oh crap, yes. Ha, I suck badly, though I do do it that way all the time.
Russell^^ has joined #ruby
<kalleth> although i need a block arg to init
<workmad3> Spooner: instance_eval {yield} ?
<workmad3> Spooner: you do that? :/
<Spooner> No, I mean the way Mon_Ouie said.
<Mon_Ouie> You need to actually get the block first
<Mon_Ouie> It's not a magical variable
robotmay has quit [Read error: Connection reset by peer]
<workmad3> Spooner: ah, good :) yes
robotmay has joined #ruby
<Spooner> I meant I do it properly in code, but not when asked :)
<kalleth> Mon_Ouie: yeah, hence 13:24 < kalleth> although i need a block arg to init
<workmad3> Spooner: hah
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
<nikeita> ok, thanks..so this is a trick not a language support in itself.
<nikeita> i'm talking about syntax.
asobrasil has joined #ruby
cantbecool has joined #ruby
<Spooner> nikeita : I do it this way: http://pastebin.com/MDyp8f9T (then the user can decide how they want the API to be).
maesbn has quit [Read error: Connection reset by peer]
i0n has quit [Read error: Connection reset by peer]
maesbn has joined #ruby
beakerman has quit [Read error: Connection reset by peer]
sailias has quit [Quit: Leaving.]
<Mon_Ouie> I think I used to use that, but ended up not liking the way it was trying to be "too" smart — which makes it harder to predict
mockra has joined #ruby
beakerman has joined #ruby
vlad_starkov has joined #ruby
a_a_g has quit [Quit: Leaving.]
uris has joined #ruby
zealinux has quit [Ping timeout: 264 seconds]
<Spooner> Well, everything in Ruby is a trick :) There are no truely "built-in" functions per se (though I'm sure mon_ouie will correct me).
bluenemo has joined #ruby
<shevy> what is happening
vvgomes has joined #ruby
<shevy> have we found out what nikeita wants?
<Mon_Ouie> If you insist: there are no functions in Ruby in the first place, and methods… well… obviously aren't part of the syntax
xorgnak has quit [Remote host closed the connection]
<banisterfiend> Spooner: you mean there's no keywords?
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
<banisterfiend> :P
<Spooner> Oh good point, there is magic like "alias".
<nikeita> yes, shevy it is sufficient :P
<Hanmac> kalleth works in ruby you could do it similar to F(:String).new myparams , or F::klass using const_missing
mockra has quit [Ping timeout: 246 seconds]
<Mon_Ouie> F::klass is a method call
enroxorz has quit [Ping timeout: 264 seconds]
flype has joined #ruby
<kalleth> i have literally no idea what is going on
<kalleth> Hanmac: was that in response to my joke about factories and java antipatterns? :P
<kalleth> yeah, i was just trolling shevy
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
Edijus has joined #ruby
<kalleth> i don't _actually_ have camelCased code with factories ;)
Edijus has left #ruby [#ruby]
sendoushi has quit [Remote host closed the connection]
nwest has quit [Read error: Connection reset by peer]
<Hanmac> Mon_Ouie yeah, but he could also do ::Klass or something
nwest has joined #ruby
<Spooner> nikeita : If you want something closer to Python's with, without editing the object's #initialize, you can do CommanderBaconWing.new.tap { |f| f.cheese }
<y2k> hello everyone!
monkegjinni has quit [Read error: Connection reset by peer]
monkegjinni has joined #ruby
<otters> hi
ecksit has quit [Quit: Laters.]
centipedefarmer has quit [Quit: This computer has gone to sleep]
GeekOnCoffee has quit [Read error: Connection reset by peer]
enroxorz has joined #ruby
GeekOnCoffee has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
<nikeita> thanks Spooner and all
nikeita has quit [Quit: sleep]
kpshek has quit [Ping timeout: 252 seconds]
harcher has joined #ruby
harcher has left #ruby [#ruby]
virunga has joined #ruby
kpshek has joined #ruby
bgupta has quit [Read error: Operation timed out]
stopbit has joined #ruby
bluenemo has quit [Remote host closed the connection]
strife25 has quit [Quit: Computer has gone to sleep.]
xclite has joined #ruby
iamjarvo has joined #ruby
zealinux has joined #ruby
<shevy> otter!!!
<shevy> come here you cuddly otter!
<shevy> who in his mind names a class CommanderBaconWing
<banisterfiend> Mon_Ouie: can u fix a bug 4 me pls
<chiel> shevy: sounds like something why would do.
<chiel> :P
bowlowni has joined #ruby
_iori_ has quit [Remote host closed the connection]
<shevy> yeah
<shevy> Spooner must be one of his famous students
<Mon_Ouie> banisterfiend: Is that like fixing a cat?
<banisterfiend> Mon_Ouie: yes except i want u to wear a french maid's outfit and pretend u cant speak english
<Hanmac> shevy maybe its a T-Fighter made of Bacon :P
<banisterfiend> Mon_Ouie: no, i want u to patch 'debugger' so it doesnt freak out when i use fibers
greenarrow has quit [Ping timeout: 244 seconds]
<banisterfiend> it's too stupid that it's doing that
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
mrwalker has joined #ruby
<Mon_Ouie> I probably can't
<shevy> everything becomes too complex
* Hanmac thinks that "fixing a cat" could be very worse :P
sendoushi has joined #ruby
Ionic` has joined #ruby
devdazed has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> Life is too complex, we should get rid of some fetaures to make it work better
<shevy> life is extremely simple. it can be described as a chain of 4 different nucleotides
devdazed has joined #ruby
<banisterfiend> Mon_Ouie: i agree, we should start by deprecating french
Tomasso has joined #ruby
<banisterfiend> make sure everyone in the world just speaks amurcan
guyvdb_ has joined #ruby
guyvdb_ has quit [Remote host closed the connection]
<bnagy> french is the language of diplomacy
dhruvasagar has quit [Ping timeout: 246 seconds]
<shevy> I thought it is the language of love
<bnagy> plus it is awesome to be able to write poetry when every verb has a for that sounds like 'ay'
<bnagy> *form
sevvie has joined #ruby
dhruvasagar has joined #ruby
<Mon_Ouie> (There are formal rules that actually forbid from making words of the same nature rhyme in French.)
strife25 has joined #ruby
<rking> Mon_Ouie: Wait what?
<Mon_Ouie> You can't make verb rhyme with another verb, you must find a noun or an adjective or anything else
joshman_ has joined #ruby
<Mon_Ouie> (Not that *every* famous poet followed those rules)
<bnagy> I was about to say .. :)
<rking> Mon_Ouie: Is it an arbitrary constraint to make the task more challenging?
<Mon_Ouie> To force variety I believe
<bnagy> I think it just looks lame if you are like 'j'aime jouer, ma souer puer, ou j'rai...'
charliesome_ has quit [Quit: Textual IRC Client: www.textualapp.com]
iamlacroix has quit [Remote host closed the connection]
und3f has quit [Quit: Leaving.]
<bnagy> but the same could be said of english
cloud|droid has joined #ruby
<shevy> english is very simple
<bnagy> we'd just call it 'doggerel'
fantazo has quit [Remote host closed the connection]
<bnagy> actually english is impossibly complex
<rking> I see.
<bnagy> it's just that germans / austrians think because they have declensions they are supermen
<bnagy> news flash? Not That Tricky
<shevy> man, it's always "the" in english
<shevy> it's very efficient, your brain does not have to waste any time
<Muz> Meh, Finnish has it too.
<shevy> finnish is difficult
<bnagy> Muz: articles, or declensions?
<shevy> but funny
<Muz> bnagy: declensions.
<bnagy> finnish is NOT difficult
<bnagy> it's just bizarre
<Muz> Finnish is pretty easy once you get to grip swith the grammar system.
<bnagy> it's ~german / latin level
<shevy> this is how I learn finnish - http://www.youtube.com/watch?v=fFVW2AA6ID4
<Muz> It's just very different to most other European languages.
<bnagy> just that your knowledge of finnish is never going to be good for anything else
<Muz> If that's the disco video, I'm going to hit you, shevy.
<shevy> haha
sailias has joined #ruby
<bnagy> I'm hungarian background, and they say we're alike
<Muz> bnagy: heh yeah, god knows why I spent years learning it.
<Muz> In terms fo grammaticaly structure, they are.
<bnagy> but having hung out with a lot of finns, that's a bunch of crap
cjlicata has joined #ruby
<bnagy> I understand 0.000
<shevy> I found hungarian easier than finnish
<Muz> The vocabulary isn't going to be similar :p
<bnagy> stupid linguists
carlyle has quit [Ping timeout: 264 seconds]
nedbat has quit [Disconnected by services]
nedbat_ has joined #ruby
maxmmurphy has joined #ruby
<shevy> dynamic constant assignment
<shevy> hah!
cakehero has joined #ruby
<shevy> now I recall why I did not want to use constants for my config stuff
<bnagy> ?
<shevy> I am rewriting a large old project
<shevy> from scratch
<bnagy> shevy: are you on the pot?
methoddk has quit [Ping timeout: 244 seconds]
nopper has quit [Ping timeout: 244 seconds]
GeekOnCoffee has quit [Ping timeout: 244 seconds]
GeekOnCoffee has joined #ruby
<shevy> no
<shevy> I have joyful deja vu's everywhere
methoddk has joined #ruby
bluenemo_ has joined #ruby
nopper has joined #ruby
akem has quit [Quit: Forget progress by proxy. Land on your own moon.]
D4T has quit [Ping timeout: 244 seconds]
dpritchett has joined #ruby
busybox42 has joined #ruby
bluenemo_ has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 250 seconds]
Sou|cutter has joined #ruby
mockra has joined #ruby
iamlacroix has joined #ruby
xorgnak has joined #ruby
tonini has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
mockra has quit [Remote host closed the connection]
akem has joined #ruby
xorgnak has quit [Remote host closed the connection]
xorgnak has joined #ruby
xorgnak has quit [Remote host closed the connection]
qwerxy has joined #ruby
julio_ has quit [Ping timeout: 250 seconds]
monkegjinni has quit [Remote host closed the connection]
SCommette has joined #ruby
strife25 has quit [Quit: Computer has gone to sleep.]
<shevy> what
<shevy> class Config; end
<shevy> ohhhh
<shevy> :(
<shevy> gotta namespace it...
crankycoder has quit [Remote host closed the connection]
qwester has quit [Quit: Linkinus - http://linkinus.com]
xorgnak has joined #ruby
iamlacroix has quit [Remote host closed the connection]
Russell^^ has quit [Quit: Russell^^]
strife25 has joined #ruby
dekroning has joined #ruby
<dekroning> hi all
Criztian has quit [Remote host closed the connection]
xorgnak has quit [Remote host closed the connection]
<dekroning> I'm trying to write a game, where one player challenges another player. Now I have a spec saying that challenge = player.challenge(player) however i'm wondering how to "test" that my code actually challenges this other player?
<hoelzro> dekroning: check the resulting challenge object?
<dekroning> since there are multiple ways to test it
paoloooo has joined #ruby
abdulkarim has joined #ruby
<dekroning> hoelzro: test if that challenge object as my "opponent" player inside it ?
cloud|windoze has joined #ruby
cloud|windoze has quit [Client Quit]
<dekroning> hoelzro: or should I "test" for some message expectation on the challenge object ?
mikepack has joined #ruby
strife25 has quit [Client Quit]
icambridge has joined #ruby
Ionic` is now known as Ionic
strife25 has joined #ruby
<hoelzro> dekroning: it depends on how your application will be using your challegnge object
<hoelzro> uh, can't spell.
<hoelzro> *ugh
<dekroning> hoelzro: np I had the same with that same word hehehe :)
paoloooo has quit [Client Quit]
<hoelzro> yeah, but English is my native language, so I have no excuse =)
paoloooo has joined #ruby
Ionic is now known as Ionic`
billiam has joined #ruby
<dekroning> hoelzro: well, actually I want to have this domain concept of "challenge" object... however i'm currently specing out the Player object, and for this reason I want to some how mock/stub out the Challenge object behavior, so that I can continue working on the Player behavior
julio_ has joined #ruby
<hoelzro> I see
<dekroning> hope that makes a bit of sense
ananthakumaran has quit [Quit: Leaving.]
<hoelzro> dekroning: so you want to test Player's behavior with mock Challenges?
<dekroning> so then I was thining, if I want to mock out the challenge object, then in order to test it. I must inject it into the Player#challenge() method
mars__ has joined #ruby
xorgnak has joined #ruby
vish has joined #ruby
<dekroning> hoelzro: well I want players to be able to challenge other players with the #challenge method. I want this method to create an Challenge object
<hoelzro> dekroning: why do you need to mock the challenge object, though?
<dekroning> hoelzro: because if I want to implement my #challenge method, I need to do something like this: def challenge(opponent); Challenge.new(self, opponent); end
asobrasil has quit [Ping timeout: 244 seconds]
<dekroning> hoelzro: but then I need to create the Challenge object first before i'm able to continue. I was hoping I could find someway to continue without having to implement this Challenge object, and be able to test my Player object in isolation
<dekroning> so something like: def challenge(challenge_service, opponent); challenge_service.new(self, opponent); end
shashin has quit [Ping timeout: 245 seconds]
<dekroning> so then I would be able to mock the challenge_service object, and test against that mocked object in my Player tests
<dekroning> but then I got all confused, and started wondering if this is good way to approach it :)
<hoelzro> I'm still not sure why you can't test player with live challenge objects
xorgnak has quit [Remote host closed the connection]
sailias has quit [Quit: Leaving.]
<dekroning> hoelzro: because couple of reasons, I'm trying to get loose coupling by not having to call Challenge object directly in my Player objects
bairui has quit [Ping timeout: 255 seconds]
zealinux has left #ruby ["ERC Version 5.3 (IRC client for Emacs)"]
<dekroning> hoelzro: because then I would need to first start creating the Challenge class before I can continue, which in turn could have more classes it needs, thus I have to go towards the lowest class before i'm able to finish my Player object
gmci has quit [Ping timeout: 252 seconds]
jorge has joined #ruby
<dekroning> does that make sense?
kevinbond has joined #ruby
<hoelzro> dekroning: well, you could just create a skeleton version of Challenge, and use it from Player
<dekroning> if not i'm might be getting it all wrong as well :)
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<hoelzro> and then fill it out to make your tests pass
SQLStud has joined #ruby
asobrasil has joined #ruby
<dekroning> for some reason it feels incorrect to create the Challenge object, because I feel as if I should fake that object, in order to focus on my Player object, and gradually (by mocking/stubbing) discover how the actually Challenge object should look like, after i'm done with my first Player behavior
gmci has joined #ruby
<dekroning> anyone else with TDD experience that could shed some light on his/her perspective as well?
flype has quit [Quit: Computer has gone to sleep.]
strnx has quit [Excess Flood]
<dekroning> hoelzro: when you write your code TDD style, you just write the minimal needed in descendant objects?
<dekroning> hoelzro: skeleton's lik eyou said
<hoelzro> pretty much
jrajav has quit [Quit: The best darkness is strange and surprising]
<hoelzro> just to get method calls to not fail
<dekroning> hoelzro: you use any mocking/stubbing at all?
<hoelzro> I tend to avoid it
<dekroning> ok
andrewhl has joined #ruby
<hoelzro> but that's just me
cj3kim has joined #ruby
<dekroning> out of curriosity, why? (i'm trying to learn TDD/BDD but constatnly get confused ;-))
d3vic3 has quit [Quit: leaving]
julio_ has quit [Ping timeout: 248 seconds]
berserkr has quit [Quit: Leaving.]
<hoelzro> dekroning: I feel that the more I mock, the less likely I am to catch real issues
<hoelzro> because mock objects might not behave the same way as the real thing
<hoelzro> granted, some things you *have* to mock
cj3kim has quit [Client Quit]
<hoelzro> production DB access and the linke
<hoelzro> *like
verto is now known as verto|off
Araxia has joined #ruby
awarner has joined #ruby
SQLStud has quit [Quit: Leaving]
SQLStud has joined #ruby
kevinbond has quit [Read error: Connection reset by peer]
kevinbond has joined #ruby
<Muz> You're just not mocking enough behaviour and covering enough with your tests.
<Muz> Moc /everything/ ;)
macer1 has quit [Ping timeout: 264 seconds]
<workmad3> hoelzro: two things: 1) don't mock what you're testing, 2) make sure you write tests for integrating bits together, not just unit tests
adeponte has quit [Remote host closed the connection]
Araxia has quit [Quit: Araxia]
wallerdev has joined #ruby
iori has joined #ruby
carloslopes has quit [Ping timeout: 246 seconds]
chson has joined #ruby
tk__ has quit [Quit: ばいばい]
<hoelzro> workmad3: integration tests are what I tend to focus on
<hoelzro> which is probably why I don't use mocks much =)
jrajav has joined #ruby
<workmad3> hoelzro: :)
<workmad3> hoelzro: I tend to mostly end up with acceptance tests and integration tests, with some unit tests of bits that are more complicated
cjlicata has quit [Remote host closed the connection]
<otters> my irb isn't printing out error messages until I quit it
<otters> then it prints them all out at once
<otters> what gives?
jorge has quit [Remote host closed the connection]
internet_user has joined #ruby
carlyle has joined #ruby
<hoelzro> otters: you're not piping IRB through anything, are you?
<otters> no
<otters> and it suddenly started working again...
<hoelzro> workmad3: yeah, I tend to do the same, with unit tests for things that shouldn't change (much)
<otters> heh
<banisterfiend> otters: irb is for noobs anyway, u should be using a repl with real power
<otters> like what
strife25 has quit [Quit: Computer has gone to sleep.]
<banisterfiend> otters: a heart breaking work of staggering genius, of course: http://pry.github.com
shevy has quit [Ping timeout: 264 seconds]
jprovazn is now known as jprovazn_away
<otters> wow
<hoelzro> banisterfiend: *so* modest =P
kevinbond has quit [Quit: kevinbond]
<banisterfiend> hehehe
<otters> it has a nice logo
<otters> who made it
<banisterfiend> otters: a fren
davidcelis has quit [Quit: K-Lined.]
ckrailo has joined #ruby
<otters> guess I'm sold
nateberkopec has joined #ruby
<otters> oh and it syntax highlights stuff you wrote
flype has joined #ruby
<otters> syntax highlighting isn't live though
<otters> what a piece of crap
<banisterfiend> otters: it is live with pry-coolline
strife25 has joined #ruby
<banisterfiend> otters: it has a bunch of plugins
<hoelzro> otters: why don't you try implementing live syntax highlighting? =P
<banisterfiend> hoelzro: it's already implemented ;) thanks to Mon_Ouie
<otters> what envvar does it use to figure out my editor?
<hoelzro> I'm just saying it's not *that* easy
<banisterfiend> yeah it wasn't easy, Mon_Ouie had to write an entire replacement for Readline
<hoelzro> you'd need to
macer1 has joined #ruby
<otters> banisterfiend: ^
<banisterfiend> otters: either $EDITOR or you can set Pry.config.editor = "emacsclient" in your ~/.pryrc
<hoelzro> and then .inputrc probably doesn't work
<rking> hoelzro: It doesn't. And it has no vi keys. =(
<hoelzro> and some keybindings might not work
<hoelzro> re-implementing readline *sucks*
<banisterfiend> hoelzro: all the important emacs ones work
<banisterfiend> so, the default Readline keybindings work
bradhe has quit [Remote host closed the connection]
blazes816 has joined #ruby
<Mon_Ouie> It's not meant to behave exactly like Readline anyway
markizko___1 has joined #ruby
<Mon_Ouie> And it does provide ways of adding keybindings as you need
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
<hoelzro> that's handy
<enroxorz> hey guys, is anyone here relatively good with Sinatra?
<rking> enroxorz: Just ask.
niklasb has joined #ruby
iori has quit [Remote host closed the connection]
bluenemo_ has quit [Read error: Connection reset by peer]
<enroxorz> How can I access a HTML element from within the code block in Sinatra? basically, I have a status checker that checks to see if a server is running a task. if it does, nothing shows. If not, a red message saying Job Running shows. Currently it works with jquery in all browsers except pre IE-9, and the majority of my users are on IE8
<Hanmac> enroxorz why didnt you ask in #sinatra?
<enroxorz> Hanmac, good point. thanks
<Spooner> Everything works everywhere except on IE < 9 :)
rudle has quit [Ping timeout: 260 seconds]
<enroxorz> I hate IE8
luckyruby has quit [Remote host closed the connection]
<enroxorz> I have spent 2 hours on this non issue
fearoffish has joined #ruby
<markizko___1> hi, I've hit a weird bug with ruby:
<markizko___1> Quick google gave one tweet on that from a guy who had the same bug on mac (I'm on mac too) and some automated build system report for 2.0. I can easily reproduce the bug on my machine, but I can't minimize it to testcase yet. I wonder if any of the core team could jump in with some instructions to pinpoint the bug source.
<markizko___1> /Users/mark/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/thread.rb:72: [BUG] pthread_cond_wait: Invalid argument (EINVAL)
<rking> enroxorz: Have you tried modernizr.js (or maybe selectivizr.js) ?
<Hanmac> IE <9 are not your fault :P when the browser dont want to folow the rules its there problem
locriani has quit [Remote host closed the connection]
<markizko___1> or wait, that's not ruby-core channel
<markizko___1> never mind
<enroxorz> rking, not yet
shevy has joined #ruby
<rking> http://laughingsquid.com/overly-judgemental-internet-explorer-6-splash-pages/ ← About IE6, but it was several years ago, so maybe we can s/6/8
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<enroxorz> crap i have the answer. i gotta set this in CSS.
<shevy> how do I intercept undefined methods again?
rutkla has quit [Ping timeout: 252 seconds]
<shevy> foo.not_existing_method_call_here
<Spooner> shevy you wave some bacon in the air, then lick it to see which methods have stuck to it.
maesbn has quit [Remote host closed the connection]
<hoelzro> shevy: method_missing?
<Spooner> Or you could use method_missing
<shevy> ewww I hate bacon
<dekroning> Muz: you Mock everything as well?
crankycoder has joined #ruby
<Muz> dekroning: No. I was joking.
a_a_g has joined #ruby
<Muz> When Mocking or providng test coverage, it's a careful art of only covering so much that it' actually worthwhile.
<dekroning> Muz: not mockign at all then ? :)
<dekroning> Muz: for this you should be using your integration tests right ?
<Muz> Depends on what your project is.
infinitiguy has joined #ruby
<dekroning> Muz: I was thinking you should always start with end-to-end testing a.k.a. Integration testing no matter what project
blazes816 has quit [Ping timeout: 248 seconds]
cakehero has quit [Ping timeout: 244 seconds]
<dekroning> workmad3: hey how are you doing?
<Hanmac> shevy dont forget the sister method: respond_to_missing
<banisterfiend> otters: you're meant to be telling me how awesome it is, etc
<otters> banisterfiend: sorry, I got into a little disagreement with GNU screen
aganov has quit [Quit: aganov]
otters has quit [Quit: WeeChat 0.3.8]
pdtpatrick has joined #ruby
<ekaleido> my company just listed multiple openings for cobol programmers
<banisterfiend> :P
ryh has joined #ruby
<ekaleido> i feel like imstanding on a raft in the ocean and the water is up to my forehead
markizko___1 has left #ruby [#ruby]
a_a_g1 has joined #ruby
<rking> Hanmac: Interesting that they'd go so negative on their own campaign.
a_a_g has quit [Ping timeout: 246 seconds]
<Hanmac> rking its because even Mircosoft wants IE6 to die :P
lorandi has quit [Quit: Leaving]
<shevy> hehe
cek has joined #ruby
<Hanmac> and only because that you need to buy an newer windows to get an newer Browser :P
<Muz> Not true.
lorandi has joined #ruby
strnx has joined #ruby
<Muz> Windows XP has had IE8 in Windows Update for months now.
MasterIdler has joined #ruby
venkatk_ has quit [Quit: This computer has gone to sleep]
<cek> i'm distributing python script with my gem, how do I find it's path after install? It's in binaries.
otters has joined #ruby
<rking> cek: From within what context? Are you inside Ruby at this point?
<cek> yes, inside ruby code
<rking> cek: Then you can do it relative to __FILE__
johnlcox has joined #ruby
<cek> file can change, it could be a test case
<shevy> hmm ok, that was easy via method_missing()
<rking> Then set a global in the normal case, and override it in your test helper.rb
<Mon_Ouie> That it's in a test case doesn't prevent you from being able to use __FILE__
headius has joined #ruby
wvms has quit [Quit: wvms]
<rking> Yeah, actually. If you set it from lib/fnoo.rb, that __FILE__ will always be fnoo.rb, even if it's run from a test case or wherever else.
strife25 has quit [Quit: Computer has gone to sleep.]
sailias has joined #ruby
cantbecool has joined #ruby
<cek> => "(irb)"
johnlcox has quit [Client Quit]
<i0n> does #{} always put things into a string?
<Hanmac> i0n yeah because it uses the to_s method
maxmmurphy has quit [Quit: maxmmurphy]
blazes816 has joined #ruby
<Hanmac> cek __FILE__ only works in file itself, not in irb directly
iori has joined #ruby
<bnagy> eh?
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
<bnagy> oic different definitions of 'works
carlyle has quit [Ping timeout: 248 seconds]
<xclite> well, what's the file in irc? haha
<xclite> irb*
<dekroning> i'm trying to create a game where two players can challenge each other, however i'm trying to approach this with TDD, on my first spec i'm trying to get a player to challenge another player, by creating a challenge. However I don't want to couple to Challenge object directly to my player objects, so i'm trying to seperate them with a challenge_manager object, however i'm not sure what would be a nice way to inject it. Into the player constructor, or durin
x77686d has joined #ruby
<rking> dekroning: Look at it from the perspective of code that calls the stuff
Stalkr_ has joined #ruby
<rking> dekroning: Like, what is it right now, a command-line client? A web thinger?
<dekroning> rking: so that would be: challenger.challenge(challenge_manager, opponent) ?
<Hanmac> xclite as i said irb directly cant say about file, you could try __FILE__ in ruby directly
jwmann has joined #ruby
<dekroning> rking: at the moment, it's logic only. Not thinking about the delivery mechanisms yes (cli or web)
<rking> dekroning: I'm never thrilled with classes named like ".*Manager". It's too abstract and too concrete at the same time.
x77686d has quit [Client Quit]
<shevy> class Waiter
<Hanmac> *Manager classes looks toomuch after c++
<dekroning> rking: what would you call it perhaps? ChallengeController ?
carloslopes has joined #ruby
<dekroning> rking: or just Challenge ?
<shevy> class Dragonslayer
luckyruby has joined #ruby
johnlcox has joined #ruby
<Hanmac> shevy: class Maid
<shevy> hehe
mengu has quit [Remote host closed the connection]
<rking> dekroning: Just sketching here, I'd maybe start with Game.new initator: player1, challenged: player2
<dekroning> Hanmac: better options are welcome :-)
x77686d has joined #ruby
<xclite> Hanmac I was agreeing
<xclite> Hanmac more towards bnagy's "different definition of 'works'"
<dekroning> rking: you would provide the Game constructor with a hash?
<rking> dekroning: A "Game" is a thing that is concrete enough to be understandable, yet abstract enough to have value as a class.
nedbat_ is now known as nedbat
<rking> dekroning: Yep, but that's because I assume I'll provide a hash to any method with more than one parameter (because Smalltalk's selectors were right all along)
<Hanmac> dekroning Challange::Interface or something else?
<dekroning> rking: intrestting thought :-) ive been thinking about this as well, but somehow never started using it
crankycoder has quit [Remote host closed the connection]
<dekroning> Hanmac: ... intrestting :-)
<dekroning> Hanmac: why not call it ChallengeInterface?
tayy has joined #ruby
tayy has quit [Remote host closed the connection]
crankycoder has joined #ruby
<dekroning> Hanmac: also "Interface" make it sounds to me like it's more of an abstract thing, which someone will need to implement, like the ChallengeManager behaves_like_a ChallengeInterface
tayy has joined #ruby
carloslopes has quit [Client Quit]
<cek> that's incorrect. here's the correct asnwer: Gem::Specification.find_by_name('gemname').bin_dir
crankycoder has quit [Remote host closed the connection]
carloslopes has joined #ruby
<rking> dekroning: Keep it simple (both in terms of complexity of implementation and in terms of conceptual mindbendiness). All you're doing is starting a new game, so trying to pull the event of a "Challenge" into its own class probably won't have useful standalone meaning.
<dekroning> rking: so everything in your code has just a single argument then right?
jhunter has quit [Ping timeout: 272 seconds]
crankycoder has joined #ruby
crankycoder has quit [Remote host closed the connection]
<Hanmac> dekroning i thought that Challange is a class/module too so you could use it as a namespace ...
<dekroning> rking: well i'm creating a Turnbased Game, so I would have a concept of challenges, which will take some time to get accpeted
<rking> dekroning: Bad: A giant list of params, OK: A list of "named" params that are a hash, better: a single param, better still: no params, best: no code.
<Hanmac> and i thought about the interface as some kind of Listener
cloud|droid has quit [Quit: Leaving]
<dekroning> rking: and if some named params are a required you do this kind of validation checking in your constructor ?
jhunter has joined #ruby
<rking> dekroning: I'd still consider those Game's, only ones in a different state than active games.
tayy has quit [Read error: Connection reset by peer]
fivetwentysix has quit [Quit: fivetwentysix]
Morkel has quit [Quit: Morkel]
<rking> dekroning: Wait, what validation?
luckyruby has quit [Remote host closed the connection]
fivetwentysix has joined #ruby
<dekroning> rking: required paramaters to a function, when using a hash as single argument
bgupta has joined #ruby
<dekroning> rking: e.g. Game.new(initiator: player1) while Game.new would need also a challengee
fivetwentysix has quit [Client Quit]
qwerxy has quit [Ping timeout: 240 seconds]
crankycoder has joined #ruby
<dekroning> Game.new(initiator: player, challengee: player2)
fbernier has joined #ruby
ananthakumaran has joined #ruby
johnernaut has quit [Ping timeout: 264 seconds]
artOfWar_ has quit [Ping timeout: 246 seconds]
maxmmurphy has joined #ruby
a_a_g1 has quit [Quit: Leaving.]
<dekroning> rking: ow btw, another thing, this would be a fighting game, in which you'll play a "Duel" ... so a challenge would later be converted into a duel, just to make things more complicater I hear you think hehehe :)
iori has quit [Remote host closed the connection]
Jay_Levitt has joined #ruby
syamajala has joined #ruby
syamajala has quit [Remote host closed the connection]
qwerxy has joined #ruby
syamajala has joined #ruby
Spooner_ has joined #ruby
peterhellberg has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
Rochefort has quit [Remote host closed the connection]
benson has joined #ruby
tomb_ has quit [Quit: Computer has gone to sleep.]
Spooner has quit [Ping timeout: 272 seconds]
krusty_ar has quit [Read error: Connection reset by peer]
bglusman has joined #ruby
krusty_ar has joined #ruby
robotmay has quit [Remote host closed the connection]
kenichi has joined #ruby
qwerxy_ has joined #ruby
Spooner_ is now known as Spooner
JohnBat26 has quit [Read error: Operation timed out]
qwerxy has quit [Ping timeout: 244 seconds]
<enroxorz> is divmod a core function in ruby?
<enroxorz> if not, what do i have to require from standard lib?
<Mon_Ouie> It is
<blazes816> #modulo
davidcelis has joined #ruby
<enroxorz> damn. for some odd reason I get an undefined method when i use it
<enroxorz> 187 btw
<blazes816> and many others
w400z has joined #ruby
<Spooner> enroxorz : How are you using it?
<blazes816> ah
Eldariof-ru has quit [Read error: Operation timed out]
<Spooner> should be div, mod = 15.divmod(4)
<enroxorz> simple enough, converting seconds to hh:mm:ss using divmod (mm,ss = ss.divmod(60), hh,mm = mm.divmod(60)
<Spooner> enroxorz : You have a COMMA after the first divmod, not a ;
<Spooner> Unless that was a typo.
<enroxorz> that it was
<enroxorz> i can pastebin teh bit if you want
<Spooner> Well, that looks right to me then.
<Spooner> You can pastie if if you want.
<shevy> div div divmooooooooooooooooooooooooooooooooooooood
a_a_g has joined #ruby
qwerxy has joined #ruby
qwerxy_ has quit [Ping timeout: 244 seconds]
fralcon has joined #ruby
<Spooner> That works. I expect that "seconds" isn't a Numeric then.
minijupe has joined #ruby
<enroxorz> hmm. let me try something. brb
bradhe has joined #ruby
kenichi has quit [Remote host closed the connection]
<shevy> why can I not use load() or require() in mirb ?
fabrice31 has quit [Remote host closed the connection]
chclto has quit []
<Spooner> incidentally, enroxorz, that won't format correctly. You probably want: "%2d:%2d:%2d" % [hh, mm, ss]
locriani has quit [Ping timeout: 255 seconds]
kenichi has joined #ruby
<Spooner> Oops "%02d:%02d:%02d" % [hh, mm, ss]
<enroxorz> chrimey, your right
kenichi has quit [Read error: Connection reset by peer]
kenichi has joined #ruby
kenichi has quit [Client Quit]
kenichi has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
Gab0 has joined #ruby
sncz has joined #ruby
gregorg has quit [Ping timeout: 250 seconds]
paoloooo has quit [Ping timeout: 245 seconds]
savage- has joined #ruby
ken_barber has joined #ruby
gregorg has joined #ruby
gregorg has quit [Changing host]
gregorg has joined #ruby
<enroxorz> Now I have the oddest issue. basically in sinatra I have @counter += 1 (it is initialized, i tested that, and i tested just setting the number to a fixed number). When I run the web app it says NoMethodError - undefined method `+' for nil:NilClass
codezombie has quit [Quit: Linkinus - http://linkinus.com]
maletor has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
<Sou|cutter> I'm going to go out on a limb and say @counter is nil
<enroxorz> I would take this to #sinatra, but they seem rather idle there.
<enroxorz> Sou|cutter, nope
<enroxorz> its init to 0
t0mmyvyo has joined #ruby
<Muz> How are you initialising it as 0?
<enroxorz> hold on
<enroxorz> i think i screwed up...
<enroxorz> ok, i see it now
dhruvasagar has joined #ruby
ken_barber has quit [Remote host closed the connection]
<enroxorz> Sou|cutter, you are right. i didnt set it where it should have been set...
ken_barber has joined #ruby
iori has joined #ruby
artOfWar has joined #ruby
<bnagy> lulz
fralcon has quit [Ping timeout: 244 seconds]
shadoi has joined #ruby
Morkel has joined #ruby
shadoi has quit [Client Quit]
<bnagy> NO IT IS NOT THE OBVIOUS THING THE UNIVERSE IS BROKEN....OWAIT...
jstew has quit [Read error: Connection reset by peer]
Fretta has joined #ruby
dpritchett has quit [Quit: Linkinus - http://linkinus.com]
baroquebobcat has joined #ruby
vlad_starkov has joined #ruby
locriani has quit [Ping timeout: 240 seconds]
aantix has joined #ruby
t0mmyvyo has quit [Quit: http://twitter.com/tommyvyo]
ianbrandt has joined #ruby
Squarepy has joined #ruby
verto|off is now known as verto
Squarepy has quit [Changing host]
Squarepy has joined #ruby
ramblex has joined #ruby
headius has quit [Quit: headius]
jorge has joined #ruby
adeponte has joined #ruby
flype has quit [Quit: Computer has gone to sleep.]
sailias has quit [Quit: Leaving.]
statarb3 has joined #ruby
flype has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
asdhakjdlsad has joined #ruby
<asdhakjdlsad> Hi, is this the right channel to get some help on understanding something?
<Hanmac> depending what is it ... if you want to understand women then this is the wrong channel
<hoelzro> asdhakjdlsad: as long as it's Ruby-related, yes =)
<asdhakjdlsad> Cool
hynkle has quit [Ping timeout: 250 seconds]
<asdhakjdlsad> So I was reading the pickaxe book, and I came across this snippet: http://pastie.org/private/0hnz37jyfuwhb9kbi6ela
<asdhakjdlsad> I don't fully understand that variable 'observers,' from the book, it notes that it would be local.
<bnagy> Hanmac: it's OK, man, I can field the questions on women if you're scared
<asdhakjdlsad> So how is it being accessed across methods if it's not an instance variable
<asdhakjdlsad> (Like the @observer_list)
<hoelzro> asdhakjdlsad: observers is a method
Bauer has joined #ruby
<hoelzro> so when you say observers << obj, it calls observers, and appends obj to the result
<asdhakjdlsad> How is it able to use that operator then?
hynkle has joined #ruby
mokolabs has joined #ruby
<hoelzro> think of it this way:
<blazes816> observers returns the @observer_list array
<asdhakjdlsad> Is it because that function returns @observer_list?
<hoelzro> (observers()).push(obj)
<asdhakjdlsad> Dope.
mokolabs has quit [Client Quit]
<Hanmac> i saw little errors in the pastie ... replace "mode" with "module", and "Obj" with "obj"
<Bauer> guys, in order to install redmine and satsify the ruby requirements herE: http://www.redmine.org/projects/redmine/wiki/RedmineInstall is it enough to follow the instructions on http://www.simb.net/2007/08/21/installing-ruby-and-rubygems-on-centos-5/ ? because I dont see anything explicity for rubygems
<asdhakjdlsad> yeah, it was just quickhand
hoelzro is now known as hoelzro|away
<asdhakjdlsad> Writing ruby is a bit weird coming from C++
Morkel has quit [Quit: Morkel]
<workmad3> asdhakjdlsad: yeah, but you get used to it, and probably find it fun :)
baroquebobcat has quit [Quit: baroquebobcat]
<asdhakjdlsad> Thank you though, hoelzro|away and blazes816
<workmad3> asdhakjdlsad: think of it this way... at least you aren't going to hit 1000 line long error outputs from templates ;)
<asdhakjdlsad> ha!
<Hanmac> asdhajdlsad you could use your c++ skills to make funny things in ruby too -> "c-extension"
ada2358 has quit [Ping timeout: 244 seconds]
SCommette_ has joined #ruby
<workmad3> Hanmac: C extensions that generate 1000 line long template errors? :D
<GlenK> I'm stuck on this bonus question here: http://www.fpaste.org/M0wg/ Can someone enlighten me?
statarb3 has quit [Ping timeout: 240 seconds]
beakerma_ has joined #ruby
<Hanmac> workmad3 i had some extensions that create so much error log that i need to pipe it into a file to read it
<workmad3> GlenK: it's better for your soul if you work it out yourself ;)
<workmad3> GlenK: as a hint though... did you try inlining it to see what happens?
SCommette has quit [Ping timeout: 246 seconds]
nedbat has quit [Disconnected by services]
laen_ has quit [Read error: Connection reset by peer]
asdhakjdlsad has quit [Quit: Page closed]
nedbat_ has joined #ruby
mengu has joined #ruby
<GlenK> workmad3: yeah, it still works. which is why I'm confused.
<workmad3> GlenK: hmm, interesting
<Bauer> ok, so ruby still not working - gem command is not available, which package is it in?
beakerman has quit [Ping timeout: 240 seconds]
<Mon_Ouie> Because you get a crazy long line when you don't split it up?
<bnagy> that about all I can see
<workmad3> GlenK: I think the problem they anticipated was it being interpreted as a block... but looking at it, that wouldn't happen there
<Hanmac> Bauer on debianoid systems its in ruby-full
<GlenK> k, well, thanks anyway.
bier has quit [Ping timeout: 272 seconds]
strife25 has joined #ruby
bier has joined #ruby
friskd has joined #ruby
<Bauer> Hanmac: I am on centos, and doing yum search ruby|grep -v eruby looks likve I've got ruby installed :( yet no gem command (there is a ruby command however)
br4ndon has quit [Ping timeout: 244 seconds]
Eldariof-ru has joined #ruby
mneorr has quit [Quit: Leaving.]
<Hanmac> Bauer did you intstall "ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc" too?
<Bauer> Hanmac: yes its already installed
emsilva has joined #ruby
br4ndon has joined #ruby
<GlenK> gem comes in rubygems on fedora. seems like centos would be the same. unless it's an old as dirt centos install
binaryplease has joined #ruby
rutkla has joined #ruby
<bnagy> centos is automatically old as dirt
<Hanmac> Bauer whats your centos version?
<GlenK> Bauer: and for future record: yum provides *bin/gem
<bnagy> have they made the big jump to 2.6 kernel yet?
bosphorus has quit [Remote host closed the connection]
<Bauer> GlenK and bnagy: CentOS release 5.4 (Final
<Hanmac> http://www.freshblurbs.com/install-ruby-1-9-centos << then this is maybe your help
<Hanmac> ps: your centos version may be outdated too
fivetwentysix has joined #ruby
locriani has joined #ruby
carlyle has joined #ruby
<bnagy> 5.4??
ephemerian has quit [Quit: Leaving.]
<bnagy> ye gods
locriani has quit [Client Quit]
<Bauer> thanks Hanmac, I will compile from sources
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
emmanuelux has joined #ruby
<bnagy> Bauer: you should run an OS from this century
ramblex has quit [Remote host closed the connection]
mars__ has quit [Quit: Leaving]
<Hanmac> bnagy arent centOS shipend on stone-plates?
fivetwentysix has quit [Client Quit]
Squarepy has quit [Read error: Connection reset by peer]
stkowski has joined #ruby
Squarepy has joined #ruby
<GlenK> ha, centos 5 is probably still more current than debian stable
<Bauer> bnagy: its a production server, unfortunately I did not create it :( perhaps in the future would migrate to a Debian server.. will see. problem is that I am not the sys admin, but the developer doing stuff, and doing admin work needed for things to work :)
xnm has joined #ruby
hynkle has quit [Ping timeout: 264 seconds]
w400z has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
statarb3 has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
vish has quit [Quit: vish]
qwerxy has quit [Ping timeout: 244 seconds]
SegFaultAX|work2 has joined #ruby
bluenemo_ has quit [Quit: Verlassend]
w400z has joined #ruby
hynkle has joined #ruby
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
savage- has quit [Remote host closed the connection]
arturaz has quit [Ping timeout: 240 seconds]
adeponte has quit [Remote host closed the connection]
savage- has joined #ruby
cakehero has joined #ruby
adeponte has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
elhu has quit [Quit: Computer has gone to sleep.]
TPFC-SYSTEM has joined #ruby
madhatter has quit [Ping timeout: 265 seconds]
workmad3 has quit [Ping timeout: 246 seconds]
madhatter has joined #ruby
<zii> I did some debugging trickery with ENV.[] and I called puts caller when my conditions are met. And the caller was "(erb):33", what is that?
<zii> one of the records, that is
iori has quit [Remote host closed the connection]
morpheu has joined #ruby
syamajala has quit [Remote host closed the connection]
<Mon_Ouie> ERB is a templating engine (part of Ruby stdlib)
<zii> Myeah, but how can it be the entry point, if I called script/rails?
revans has joined #ruby
fbernier has quit [Ping timeout: 240 seconds]
Morkel has joined #ruby
mneorr has joined #ruby
chrisbolton has joined #ruby
kidoz has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.8]
mrdodo has joined #ruby
v0n has joined #ruby
jameshyde has joined #ruby
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
tatsuya has quit [Remote host closed the connection]
fralcon has joined #ruby
robert- has joined #ruby
robert- has quit [Client Quit]
jrajav has joined #ruby
robert- has joined #ruby
baroquebobcat has joined #ruby
blazes816 has quit [Quit: Leaving]
rking has quit [Quit: Resetting tmux]
baroquebobcat has quit [Client Quit]
<Mon_Ouie> I don't know much about Rails; I'm guessing you might be calling your code from an ERB template.
<Mon_Ouie> That's hard to know without seeing your code — and even more without knowing Rails, so check #rubyonrails
revans has quit [Ping timeout: 252 seconds]
rking has joined #ruby
baroquebobcat has joined #ruby
fbernier has joined #ruby
mrdodo has quit [Remote host closed the connection]
itnomad has joined #ruby
brianpWins has quit [Quit: brianpWins]
rking has quit [Client Quit]
ryh has quit [Read error: Connection reset by peer]
<zii> Why do #ruby'ists get all scared, when rails is mentioned? This has got nothing to do with rails, rails is just some code anyway. The problem's that caller doesn't include the script entry point and my question's how can that be?
ryh has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<Mon_Ouie> Again, nobody can say without seeing your code
bullicon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<GeekOnCoffee> zii: there's so much to rails, and there are rooms dedicated to it
<Spooner> zii because not all Rubyists use Rails (not even all of us do any web dev). The assumption that Ruby == Rails == Ruby isn't terribly helpful.
fbernier has quit [Ping timeout: 264 seconds]
rking has joined #ruby
headius has joined #ruby
banisterfiend has joined #ruby
<Hanmac> zii its because some of us are never touched rails
jameshyde has quit [Quit: Leaving]
Progster has quit [Ping timeout: 240 seconds]
mobilegamelabs has quit [Quit: Angry Polygon (iPhone/Android/Mac) - http://www.MGGGGG.com/ap #ratingexchange]
DDAZZA has joined #ruby
<zii> I'm talking about this particular case, which doesn't involve rails more than that the script I'm calling's coming from rails.
<Harzilein> how about making a minimal example them (i did not find your question at the first glance)
<zii> Ah, damn. caller doesn't include entry point.
<Harzilein> then*
<Hanmac> imo the most problem about rails are there users ... they looked at rails and they think that they understand ruby
<zii> Hanmac: That's quite true, yes.
<Harzilein> heh, while really _looking_ at rails' innards should prove to anyone they only know tiny parts of ruby ;)
Morkel has quit [Quit: Morkel]
<shevy> every simple problem can be made more complicated via code
opus has joined #ruby
Vakaris has joined #ruby
ph^_ has joined #ruby
flip_digits has joined #ruby
<shevy> and erb should die
cbuxton has joined #ruby
<zii> When I run app X and CI=1 env is passed to the executable, stuff goes wrong. I'm using this http://sprunge.us/LLEY to try to debug it, but it(caller) has only "(erb):33", how sad. Any ideas how to catch where it's called?
cakehero has quit [Quit: Computer has gone to sleep.]
morpheu has left #ruby [#ruby]
laen_ has joined #ruby
mrdodo has joined #ruby
<Mon_Ouie> Maybe the code is run before you redefine []
jbw has quit [Ping timeout: 272 seconds]
<zii> Nope, because it catches it.
mrsolo has joined #ruby
<Mon_Ouie> Or it *is* in some ERB template
Spooner_ has joined #ruby
Musok has joined #ruby
apok has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
<zii> But still, shouldn't there be seomthing before the template. Something should've called that template rendering, no?
cjlicata has joined #ruby
ph^ has quit [Ping timeout: 272 seconds]
<GlenK> so if I have a function that takes a string as an argument, but I'm having trouble adding it to the String class. I'm assuming I just go with "def func", no arguments or anything. But then what goes inside that? "func(self)" isn't working out. seems to be calling the String method, not the one I already defined.
Spooner has quit [Ping timeout: 264 seconds]
<GlenK> ha, crap. that make a shred of sense?
mrdodo has quit [Remote host closed the connection]
mrdodo has joined #ruby
<zii> What do you mean by adding it to the String class?
fasta has joined #ruby
<fasta> Can I test for whether something runs in irb?
<Mon_Ouie> You can call Kernel.func(foo)
carlyle has quit [Ping timeout: 264 seconds]
<GlenK> zii: so right now I can just do a func("some string"). I want to be able to do "some string".func
Spooner_ is now known as Spooner
sailias has joined #ruby
qwerxy has joined #ruby
<fasta> Or even better: whether it is not running in any binary starting with the name ruby<..>?
<Mon_Ouie> I would suggest not to monkey patch string
<zii> GlenK: Ah, class String; def func; *do something with self*; end; end
<GlenK> zii: I'm that far. it's the do something with self part that's getting me. As I said, "func(self)" isn't working out.
cespare has joined #ruby
<zii> What do you want to do with the string?
<GlenK> Mon_Ouie: that's telling me the method is private.
<Mon_Ouie> The Kernel.func only works if you defined the global method as a module_function on Kernel though (but you should rather define it as a module_function anyway; maybe not on Kernel)
lkba has quit [Ping timeout: 244 seconds]
<Mon_Ouie> def foo; end globally is a bad idea (partly) for that reason
<GlenK> zii: run my function on it, but with the dot operator or whatever it's called.
sevvie has quit [Quit: sevvie]
statarb3 has quit [Quit: Leaving]
<zii> GlenK: Yeah, you need do either differeniate function names(both shouldn't be func) or specify that you want the func out of kernel, not string.
<zii> Hmm, really private.
fbernier has joined #ruby
<nwest> does anyone know of a good gem/library to cleanse explicit words from an input string?
ryh_ has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
Stalkr_ has quit [Quit: Linkinus - http://linkinus.com]
<Mon_Ouie> def foo; end outside of any module/class defines a private instance method in Object
<nwest> I found https://github.com/rgrove/sanitize/ but that doesnt include a base reference library
ryh has quit [Read error: Connection reset by peer]
voodoofish430 has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
robert_ has joined #ruby
jstew has joined #ruby
<Mon_Ouie> https://gist.github.com/3208686 I'd do it like that
wallerdev has quit [Quit: wallerdev]
<GlenK> zii: I'm not so sure. I mean, here's the instructions from the assignment: http://www.fpaste.org/VJo7/
<GlenK> zii: huh? "foo" isn't the same as "func".
rakm has joined #ruby
centipedefarmer has joined #ruby
<zii> hmm, sorry
<GlenK> zii: if you read those instructions though, it's obvious they don't want me to copy all of my function into the String class.
kidoz has quit [Quit: Ухожу я от вас]
<zii> If you rename that foo into func it'll still work. I just had defined the same thing with func earlier in the shell.
xaq has joined #ruby
cantonic_ has joined #ruby
jbw has joined #ruby
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
cantonic has quit [Client Quit]
flype has quit [Quit: Computer has gone to sleep.]
<shevy> coding coding coding
<robert_> indeed
mrsolo has quit [Quit: This computer has gone to sleep]
<robert_> so I'm trying to parse down this string format that I have
jrajav has joined #ruby
<Spooner> GlenK All they are asking for is to add your palandrome?(string) function to the String class as palandrome? where you operate on 'self' rather than 'string'. It isn't as complex as you seem to be making it.
kirun has joined #ruby
mrsolo has joined #ruby
cek has quit [Quit: жопа диридай диридиридай]
<Mon_Ouie> I'm not a fan of assignments that require something that is mostly considered a bad practice
kpshek has quit []
fralcon has quit [Read error: Connection reset by peer]
Vert has quit [Ping timeout: 252 seconds]
fralcon has joined #ruby
kpshek has joined #ruby
phinfonet has joined #ruby
<Spooner> Well, on one level it is using String as an example of how Ruby convention operates via object methods rather than global functions, unlike other languages. I'm also not convinced it is bad practice to open classes like that, if you are writing an application rather than a library.
<GlenK> Spooner: I didn't think so either. but like I said, what I expected to work, namely "palindrome?(self)" doesn't. so I'm a bit stuck.
bradhe has quit [Remote host closed the connection]
<Spooner> For the same reason when writing an application there shouldn't be any problem with not using a namespace, since libraries should all be using namespaces, so the global should be clean for you.
Vakaris has quit [Ping timeout: 248 seconds]
baphled has joined #ruby
<Spooner> GlenK : You don't need to be explicit about "self" in a method on an object. They should have explained OO a bit better to you ;)
Vakaris has joined #ruby
jrist is now known as jrist-afk
headius has quit [Quit: headius]
<GlenK> Spooner: I don't follow. what am I supposed to pass to that function then?
<Spooner> But I imagine you are still trying to write it as a global method, not a method on String?
<GlenK> yeah, right
<Spooner> You don't pass anything to it. Self is implicit.
dhruvasa1ar has quit [Read error: Connection reset by peer]
<Spooner> If I call "frog".empty?, it calls String#empty?() wherein self is set to "frog"
Hawklord has joined #ruby
minijupe has quit [Read error: No route to host]
minijupe has joined #ruby
<Spooner> If you call palandrome?("frog") it calls your def palandrome?(string) where string = "frog"
<GlenK> sure. but I'm wanting String#palindrome? to just pass the buck to the global palindrome? function. so I would think I'd need to pass that self, no? it seems to just be calling String#palindrome? however.
<Spooner> Does that make any sense at all?
dhruvasagar has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
Hawklord has quit [Client Quit]
MarGarina has quit [Read error: Operation timed out]
<Spooner> In that case, you just need String#palindrome to do: palandrome?(self)
Hawklord has joined #ruby
baphled has quit [Ping timeout: 252 seconds]
<shevy> what is palandrome
<shevy> is that like a palatschink
<Spooner> Though I don't believe they are asking you to keep the global palindrome method.
<GlenK> but then it complains about not enough arguments. so I'm pretty sure String#palindrome is just calling String#palindrome again
venkatk_ has joined #ruby
<shevy> GlenK, how comes you need palindromes btw?
<GlenK> shevy: a test to see if something is the same forward as it is backward.
venkatk_ has quit [Client Quit]
bradhe has joined #ruby
<GlenK> shevy: an assignment.
<shevy> I know what a palindrome is, I just was not sure about the palandrome ;-)
<Spooner> Oh, I see. That makes sense. Sorry! Yes, you'd need to call ::palindrome?(self)
<GlenK> Spooner: they'd almost have to be asking for me to keep the global. it says 5 lines should do the trick
<Spooner> But as I said, I believe they want you to move the code, not redirect.
<GlenK> Spooner: why would it say only 5 lines then?
<Spooner> I have no idea.
Vakaris has quit [Ping timeout: 240 seconds]
<Spooner> It is 5 lines if you have the method body in one line, which is all you need.
blazes816 has joined #ruby
<Spooner> Sorry, I'm struggling to help and not do it for you :)
Vakaris has joined #ruby
<GlenK> ha. I guess it is a one liner. I seem to recall my palindrome function being longer than that.
Progster has joined #ruby
<GlenK> probably because it was at first.
<Spooner> It is one liner in Ruby. Might be more if you write it in another language's style.
centipedefarmer has joined #ruby
bosphorus has joined #ruby
virunga has quit [Ping timeout: 240 seconds]
minijupe has quit [Ping timeout: 272 seconds]
Squarepy has quit [Ping timeout: 244 seconds]
opus has quit [Ping timeout: 252 seconds]
centipedefarmer has quit [Client Quit]
williamcotton has quit [Ping timeout: 246 seconds]
phinfonet has quit [Quit: phinfonet]
Markvilla has quit [Quit: Markvilla]
<Mon_Ouie> Or because it was to check palindromes for numbers?
<Mon_Ouie> (without turning them into string, that is)
tewecske has joined #ruby
ryanf has joined #ruby
w400z has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Squarepy has joined #ruby
locriani has quit [Remote host closed the connection]
saschagehlich_ has quit [Ping timeout: 248 seconds]
mdickens has joined #ruby
Vert has joined #ruby
adamkittelson has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
williamcotton has joined #ruby
elhu has joined #ruby
<Spooner> Mon_Ouie : The instructions clearly referenced strings though :) But yes, with numbers it would be maybe a line or two more.
bosphorus has quit [Ping timeout: 248 seconds]
wallerdev has joined #ruby
wallerdev has quit [Remote host closed the connection]
wallerdev has joined #ruby
<emsilva> Can someone with experience on both please share pros and cons on Datamapper vs Sequel?
<fasta> How can I run a script and then get a prompt after the last instruction?
fermion has quit [Quit: P]
Ionic` has quit [Ping timeout: 240 seconds]
qwerxy has quit [Quit: offski]
<fasta> I have irb and also some fancy new replacement for it.
<Spooner> fasta : Not sure what you are asking for.
<fasta> Spooner: I want to get an irb prompt in the context of the script.
DDAZZA has quit [Quit: Leaving]
<fasta> Spooner: that should be understandable if you know what all the words mean.
schickung has joined #ruby
Hawklord has quit [Ping timeout: 276 seconds]
dv310p3r has joined #ruby
<banisterfiend> fasta: put a binding.pry at the last line of your file you want to load
<Spooner> What you want is not to run the script from Pry directly, but to require 'pry' and binding.pry at the end of your scritp.
<fasta> By 'a' you mean that literal string?
burgestrand has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
<emsilva> I hear a lot (and I mean a lot) of praise on Sequel, but most implementations are see are either using AR or DM. So I'm trying to understand why Sequel is not as wide spread.
ukd1 has joined #ruby
<Spooner> Nobody mentioned 'a', fasta
<Spooner> I mean put this at the end of your script: require 'pry'; binding.pry
<fasta> Spooner: banghousedid.
<Spooner> Oh, sorry, I must be netsplittedified.
<ukd1> How can I convert a UTC unixtime stamp to a Time object?
<fasta> Spooner: banisterfiend did
<burgestrand> ukd1: Time.at(your_timestamp)
<burgestrand> ukd1: the Time you receive will be in your local timezone, however. Use Time#utc to get a Time object in UTC.
<banghouse> drush cc all
<banghouse> lol
bbttxu has joined #ruby
Banistergalaxy has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
digitalcakestudi has quit [Quit: Leaving.]
banisterfiend has joined #ruby
centipedefarmer has joined #ruby
<banisterfiend> fasta: or u coudl do: pry -r ./bleb
<GlenK> gah. so downcase works inside my String method. reverse works. But if I go with self.gsub() then I get some weird #<Enumerator:0x000000015f9500> being spit out.
<blazes816> GlenK: gist some code please
abdulkarim has quit [Ping timeout: 264 seconds]
<Hanmac> Enumerators are mostly the best thing that ruby has
<banisterfiend> Hanmac: not yet, maybe in 2.0
brianpWins has joined #ruby
<banisterfiend> they're a bit crippled still
beneggett has joined #ruby
<Hanmac> banisterfiend tell me whats wrong with them
<blazes816> banisterfiend: any docs about what will be changed for the better?
<banisterfiend> Hanmac: not enough lazy variations, and you cant chain enumerators together (in the sense of +)
<blazes816> GlenK: 500 error
<GlenK> oops
<banisterfiend> Hanmac: 2.0 has a lazy method that returns a lazy version, and it allows u to chain then together with + :)
<blazes816> GlenK: gist.github.com
<GlenK> too late
noganex has quit [Ping timeout: 272 seconds]
<blazes816> GlenK: gsub takes 2 arguments
opus has joined #ruby
<blazes816> or 1
<banisterfiend> Hanmac: (1..Float::INFINITY).lazy.select { |v| v.even? }.map { |v| 100 * v + 6 }.take(5)
<blazes816> and if you give 1, it returns and enumerator
<GlenK> hmm. it works fine in my global function.
<blazes816> GlenK: it probably enumerates over matches, but not sure
<blazes816> right
<blazes816> sorry, wrong window
noganex has joined #ruby
<blazes816> unless you pass it a 2nd arg or a block it will return an Enumerator
<Hanmac> banister you need chunk not select
vvgomes has quit [Ping timeout: 252 seconds]
<GlenK> blazes816: thanks
<blazes816> np
minijupe has joined #ruby
<blazes816> banisterfiend: so they're more 'generators' than 'enumerators'?
<banisterfiend> Hanmac: i was giving an example of lazy enumerators in 2.0 fucko
<blazes816> where is the best place to keep up with ruby 2 developments? that isn't japanese
xnm has quit [Quit: WeeChat 0.3.7]
<shevy> japan
<Hanmac> blazes816 i think they are both
<Hanmac> and what is the big difference then lazy enum or normal enum ?
<blazes816> I want to say they have a predominately japanese culture
ada2358 has joined #ruby
<shevy> blazes816, I usually check what matz is doing https://github.com/mruby/mruby/
<banisterfiend> blazes816: enumerators are already generators
<GlenK> ha, man I suck at Ruby. that took entirely too long for 4 lines of code
<burgestrand> Hanmac: if you map over a collection of infinite numbers and then take the first five it will only need to map over the first five instead of the set of infinite numbers
minijupe has quit [Client Quit]
<blazes816> i mean in the python sense, where the next element doesn't exist until it's needed. obviously that wouldn't be the case for every (or most?) enums
<blazes816> shevy: thanks
<banisterfiend> blazes816: (1..10).each.tap(&:next).tap(&:next).next #=> 3
bradhe_ has joined #ruby
<blazes816> ok, good point
<shevy> that is long
<bnagy> twss
<blazes816> how else are you going to increment a number twice?
<shevy> until the target number has been reached
<banisterfiend> blazes816: you mean a custom generator?
adeponte has quit [Remote host closed the connection]
<blazes816> oh, no, I was just kidding about shevy pointing out the length of your example
<banisterfiend> blazes816: you can do that using: Enumerator.new { |y| loop { y << rand(10) } }
abdulkarim has joined #ruby
<blazes816> so then, what is it that ruby 2 is changing exactly?
<blazes816> is there a blog post or something somewhere detailing it?
<Mon_Ouie> I think there should be a method in Enumerable to get the nth elemnt actually
<banisterfiend> blazes816: so, assuming i saved that generator to 'e' we can then do this: e.take(10)
<banisterfiend> blazes816: and u have 10 random numbers
bradhe has quit [Ping timeout: 246 seconds]
bj0ern has quit [Quit: bj0ern]
<burgestrand> xx((((**11((**((**
hoelzro|away is now known as hoelzro
<burgestrand> ..sseeyy ……≥≥
mrsolo has quit [Quit: This computer has gone to sleep]
<Mon_Ouie> Hi burgestrand's cat!
<burgestrand> ..ddrraaoobbyyeekk ddrriieeww ttssuujj ,,ttaacc ooNN
burgestrand has quit [Quit: Leaving.]
<blazes816> eh, I don't know lisp....
<bnagy> burgestrand are you on the pot?
<banisterfiend> Mon_Ouie: should we call the police?
<banisterfiend> we might have just witnessed a rape
ken_barber has quit [Remote host closed the connection]
burgestrand has joined #ruby
<burgestrand> How odd is that. My text was duplicated and reversed.
<burgestrand> Best bug ever.
<banisterfiend> haha
ken_barber has joined #ruby
<Mon_Ouie> Oh, didn't notice it wasn't random gibberish
<burgestrand> Only the first one :d
<banisterfiend> Mon_Ouie: yeah i agree
williamcotton has quit [Ping timeout: 252 seconds]
baphled has joined #ruby
<banisterfiend> Mon_Ouie: and there should be first and last, and if you call last on an infinite sequence, then tough luck :P
<Mon_Ouie> There are already methods that can result into infinite loops in Enumerable
<Hanmac> banisterfiend it works without lazy when you put the take in the middle: (1..Float::INFINITY).each.chunk { |v| v.even? || nil }.take(5).map{|_,(v)| 100* v + 6}
<Mon_Ouie> #map for starters
froy has joined #ruby
<Hanmac> there is #cylcle too :P
williamcotton has joined #ruby
<banisterfiend> Mon_Ouie: yeah in general, if Enumerators supported more of Array API by default
beneggett has quit [Ping timeout: 248 seconds]
mrsolo has joined #ruby
mrdodo has quit [Remote host closed the connection]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
cakehero has joined #ruby
<shevy> can someone kill burgestrand's cat pls
beneggett has joined #ruby
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<burgestrand> Don’t have a cat, only dogs. D:
<blazes816> that's a very inspirational quit message
<Mon_Ouie> Oh, then you're fine; dogs have no interest in using keyboards.
Bosma has joined #ruby
Gab0 has quit [Ping timeout: 250 seconds]
alienaut has joined #ruby
<banisterfiend> blazes816: no one really uses generators in ruby though
<Hanmac> cats are interested in computer mices
<alienaut> hello
<banisterfiend> in comparison to their update in python anyway
<banisterfiend> uptake
<blazes816> banisterfiend: I know, that's why I was wondering if they were trying to get it going in the ruby world
<alienaut> how can define a class variable as Array?
<banisterfiend> blazes816: well, can u give an example of where it's used in python? cos iirc they often use generators as a poor man's co-routine, but ruby has fully fledged co-routines in the form of fibers
<crazed> hey, when using bundler, has anyone successfully used environment variables to configure bundle?
<alienaut> like class Foo; @bar = Array,new; end ?
<Hanmac> alienaut i dont think you realy want an class variable
<crazed> i don't want to check in .bundle/config, nor do i want to run bundle install
<shevy> gem uninstall bundle
opus has quit [Quit:]
<shevy> (2) ???
<shevy> (3) Profit
zemanel has joined #ruby
<alienaut> Hanmac, i gave not working example just before you
<shevy> alienaut Array,new ?
<shevy> class variable is @@foo btw not @foo
<alienaut> sorry Array.new
tomb_ has joined #ruby
abdulkarim has quit [Ping timeout: 260 seconds]
<shevy> class Foo; @@array = Array.new; end
<shevy> Foo.class_variables # => ["@@array"]
<alienaut> hum i also have a method => def bar; @bar; end
<shevy> also class variables are kind of useless
<bnagy> or just @@dont_do_this=[]
<shevy> yes and @bar is an instance variable
<blazes816> banisterfiend: there are no good reasons to have another construct for it in ruby afaik. in python they're normally used just like ruby's Enumerable
Neil_ has joined #ruby
beneggett has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<alienaut> oh.
<blazes816> banisterfiend: the main usecase for them is the same. adding iteration to objects
<shevy> what are decorators in python?
<alienaut> how can i create instance variable as Array then?
darren has joined #ruby
<bnagy> @ivar=[]
<shevy> :)
Gab0 has joined #ruby
<shevy> it's kind of funny that he even had an (almost) working example before ;)
<blazes816> shevy: they're a fancy syntax for passing a method to another method on declaration
<ukd1> exit
ukd1 has quit [Quit: leaving]
<shevy> rescue!
<shevy> argh too late
<shevy> the void took him away from us
<shevy> blazes816, hmmmm
<shevy> a method calling another method?
<alienaut> humm, lol. checking my code again then. give me a second
<sernin> a method that 'filters' another method is the way i like to think of it
<sernin> shevy: but essentially yes
<blazes816> shevy: well, it doesn't have to call it, but usually. let me dig up some code
syamajala has joined #ruby
Criztian has joined #ruby
jrajav has quit [Ping timeout: 248 seconds]
<sernin> shevy: http://pastie.org/4360806 <- like that.
<blazes816> man, I wrote a sweet api client for openstack but they seem to have destroyed it
CannedCorn has joined #ruby
syamajala has quit [Remote host closed the connection]
niklasb has quit [Ping timeout: 244 seconds]
<blazes816> it had a good use of decorators
<blazes816> or example at least
<shevy> sernin, hmmm strange
<zaargy> feels like there should be a better way to do this? https://gist.github.com/2d05622e54afd4d28525
<banisterfiend> blazes816: have u felt a need for decorators in ruby?
<alienaut> here is my code https://gist.github.com/3209253 btw please dont give me complete solution, this is my homework. otherwise i cheated
<blazes816> banisterfiend: not once
<shevy> alienaut this is awful
<shevy> attr_name= attr_name.to_s
<shevy> attr_reader attr_name
<alienaut> aww :/
<shevy> alienaut, what is attr_reader doing
<shevy> come on man!
nedbat_ is now known as nedbat
locriani has quit [Remote host closed the connection]
<alienaut> it does returns value of attr_name
<sernin> shevy: feels natural to me. It's used a lot in django, typically to wrap a request method (like, @is_authorized) etc
<blazes816> idk if it's a gist formatting issue or not, but stick to 2 or 4 spaces tabs. preferably 2 for ruby
<alienaut> when called class_name.attr_name
cantonic has joined #ruby
<sernin> shevy: but then again, I haven't worked with python in a long time, and this isn't #python. :)
<shevy> sernin hmm
ananthakumaran has quit [Quit: Leaving.]
<alienaut> it is home work about how we use class_eval
<shevy> Foo.class_eval { def do_it ; puts "class hi!" ; end }
<shevy> wait
<shevy> class Foo; end; Foo.class_eval { def do_it ; puts "class hi!" ; end }
<shevy> there
<shevy> Foo.new.do_it
Vakaris has quit [Read error: Connection reset by peer]
<shevy> class Bar; end; Bar.class_eval { def self.do_it ; puts "class hi!" ; end }
<shevy> Bar.do_it
kvirani has joined #ruby
<alienaut> if want add functions like attr_reader?
<shevy> class Foo; attr_reader :foo; def initialize; @foo = 5; end; end; Foo.new.foo # => 5
<shevy> you first need to understand what attr_reader is doing, and where you can use it
<alienaut> i have attr_accessor_with_history method
abdulkarim has joined #ruby
<shevy> this is what I wrote today
<alienaut> attr_reader creates method def bar; return @bar; end?
<shevy> depends on the name
<shevy> attr_reader :bar
<shevy> yes
<shevy> attr_reader :fo
<shevy> no
<shevy> :P
<shevy> but good, I see you now understand attr_reader
<shevy> now you have to call it in the proper context
opus has joined #ruby
<shevy> @data.each_pair.each { |key, value|; self.class.class_eval {; add_getter_method(key); add_setter_method(key); }; }
<shevy> def self.add_setter_method(i)
<shevy> define_method("#{i}=") { |inner_val| @data[i] = inner_val
<shevy> and you add whatever code you need within define_method
<Spooner> alienaut : You've set him off :)
<alienaut> oh.
Guest91275 has quit [Quit: Guest91275]
fridim_ has joined #ruby
<shevy> it's just copy paste really
<shevy> my brain is already in hibernation mode again
<alienaut> oo...
<shevy> I am about to train sleep-coding
<alienaut> i did not understand your codes.
Gab0 has quit [Ping timeout: 260 seconds]
jwg2s has joined #ruby
<jwg2s> I have an array that is like this [table, column, table, column, table, column] and i'd like it to be [ [table, column], [table, column] ]
<alienaut> another question then
jarred has joined #ruby
<jwg2s> Isn't there a way with zip to do this?
<alienaut> what ruby book i should buy
nyuszika7h has joined #ruby
<alienaut> i already know some basic ruby
<Spooner> jwg2s : a = a.each_slice(2).to_a
<jwg2s> thanks i'll give that a shot
<Mon_Ouie> zip is when you have two collections
<shevy> alienaut the pickaxe is ok
<sernin> alienaut: Programming Ruby 1.9, and The Well-Grounded Rubyist imo
bluenemo has quit [Remote host closed the connection]
<alienaut> and off topic question. nook is a good device to reading programming books?
dekroning has quit [Read error: Connection reset by peer]
a_a_g has quit [Quit: Leaving.]
timepilot has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
timepilot has quit [Client Quit]
<alienaut> btw thanks guys!
<shevy> nook?
michaelgamble has joined #ruby
<michaelgamble> hey
<Squarepy> I would say no
<michaelgamble> got a question
Vert has joined #ruby
<Squarepy> kindle can read pdf in landscape mode, nook can't
<Spooner> michaelgamble : Ask the question, not whether you can ask. You are only ask one question a day, but you've already wasted it :P
fayimora has joined #ruby
<michaelgamble> whats the best way to detect device type across multiple platforms ie tvs, mobile, tablets, pc
<michaelgamble> for an html front end
<davidcelis> user agent headers
<alienaut> i mean thier screen looks like a smaller for a programming books
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
manizzle has joined #ruby
<alienaut> their*
<michaelgamble> but that generally provides OS, and specific device code… is their a database or something to cross reference to get a better sense of if its a tv or tablet or mobile?
hynkle has quit [Quit: Computer has gone to sleep.]
x77686d has quit [Remote host closed the connection]
blacktulip has quit [Remote host closed the connection]
<Squarepy> alienaut, crop the pdf first then switch it on the side (landscape mode), then 50% of the books are fine
blacktulip has joined #ruby
<Squarepy> use f.i. 'briss' to crop off the white space
<alienaut> oh ok
williamcotton_ has joined #ruby
hynkle has joined #ruby
williamcotton has quit [Ping timeout: 260 seconds]
williamcotton_ is now known as williamcotton
x77686d has joined #ruby
indian has joined #ruby
krz has joined #ruby
virunga has joined #ruby
<alienaut> how can define array with its first value is nil
mikepack has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
opus has quit [Ping timeout: 248 seconds]
<sernin> michaelgamble: javascript and screen size combined with user agent
<darren> micharelgamble: Are you thinking about css media queries? http://www.w3.org/TR/css3-mediaqueries/
<michaelgamble> only thing about javascript thats sucky is its client side requiring a redirect
<virunga> Hi, how can i load a script in the interpreter at open time?
elhu has quit [Quit: Computer has gone to sleep.]
<virunga> ruby -r script.rb?
lupine_85 has quit [Excess Flood]
<michaelgamble> don't think media query works, looks like wurfl might be what I'm looking for
carloslopes has quit [Quit: Leaving.]
skrite has joined #ruby
ryanf has quit [Ping timeout: 246 seconds]
lkba has joined #ruby
fayimora has quit [Ping timeout: 250 seconds]
macmartine has joined #ruby
Axsuul has joined #ruby
<alienaut> oh, ok. i found it.
cascalheira has quit [Remote host closed the connection]
hoelzro is now known as hoelzro|away
<shevy> virunga without -r
<shevy> with -r, you load the file as a library
<shevy> ruby -r /std/foo.rb bla.rb
<shevy> which should be the same as require '/std/foo.rb' in ruby code
macer1 has quit [Ping timeout: 264 seconds]
<virunga> shevy: but after that command it doesn't start the interpretr
niklasb has joined #ruby
<virunga> i'd like the script loaded in the interpreter
<shevy> virunga, what is the exact command you use
<burgestrand> virunga: irb -r/path/to/file
Criztian has quit [Remote host closed the connection]
lupine_85 has joined #ruby
<bnagy> you use this word but I do not theenk it means what you theenk it means
Stud is now known as thomas
Araxia has joined #ruby
<shevy> virunga!!! wake up man
ryanf has joined #ruby
infinitiguy1 has joined #ruby
<virunga> burgestrand: shevy irb -r worked
<shevy> hehe
<virunga> :)
<shevy> virunga you can call any method in any .rb file from the commandline btw
<shevy> via -r
moos3 has joined #ruby
fayimora has joined #ruby
flagg0204 has quit [Quit: leaving]
<virunga> nice
CannedCorn has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<shevy> I use aliases like "install_flash", which in essence calls a ruby method, in a .rb file, that does copy the things
jonathanwallace has joined #ruby
infinitiguy has quit [Ping timeout: 246 seconds]
carloslopes has joined #ruby
vvgomes has joined #ruby
fantazo has joined #ruby
jrist-afk is now known as jrsit
jrsit is now known as jrist
<virunga> the irb's man say nothing about flag options though
dereknelson has joined #ruby
<virunga> at least mine :)
flagg0204 has joined #ruby
<dereknelson> Can anyone help me w/ some rake/rake-pipeline stuff I am new to ruby and having some trouble
Vert has quit [Ping timeout: 252 seconds]
fayimora has quit [Quit: Be back in a gifii]
jorge has quit [Remote host closed the connection]
Hawklord has joined #ruby
<skrite> can i tell with one line whether a variable can be made into a float or not ?
<skrite> like if there are letters or somesuch, it cannot be.
kevinbond has joined #ruby
<banisterfiend> skrite: Float("sdf")
paolooo has joined #ruby
robert- is now known as revans
<Hanmac> or skrite: !("a" =~ /d+/)
<paolooo> hello
<shevy> Float(1/0) ZeroDivisionError: divided by 0
macmartine has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> That regexp doesn't work — "a34b" =~ /\d+/
mneorr has quit [Quit: Leaving.]
<shevy> Hanmac has been doing too much C++
<paolooo> How do I create a <select> day form field in ruby? <option> values are from 1 to 31
<Mon_Ouie> You need anchors, and also to account for decimal point, and possibly the sign
ph^_ has quit [Remote host closed the connection]
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
<Mon_Ouie> /\A[+-]\d+(?:\.\d+)\Z/ should cover most of it
<Hanmac> paolooo you are in the wrong channel ... goto #rubyonrails
<paolooo> sorry :) thanks
fralcon has quit [Quit: fralcon]
johnlcox has quit [Read error: Operation timed out]
Hawklord has joined #ruby
<Hanmac> shevy did you see? #goto works on irc
ph^ has joined #ruby
<shevy> wat
<otters> how should I redirect stdout to nowhere
rippa has quit [Ping timeout: 264 seconds]
<otters> in a single thread
rakm has quit [Quit: Computer has gone to sleep.]
<banisterfiend> otters: send it to StringIO.new
fralcon has joined #ruby
<otters> okay, that's something
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
<Hanmac> otters: STDOUT.reopen(File::NULL)
<skrite> Hanmac: banisterfiend thanks !
billiam has quit [Ping timeout: 255 seconds]
<Mon_Ouie> that or $stdout = File.open(File::NULL)
<Mon_Ouie> (the latter still allows you to write to STDOUT if for some reason you really need to)
<banisterfiend> Mon_Ouie: what's your guess
opus has joined #ruby
niklasb has quit [Ping timeout: 252 seconds]
<Hanmac> File::NULL is more cool then some empty StringIO
fralcon has quit [Ping timeout: 252 seconds]
jorge has joined #ruby
<Mon_Ouie> Yeah, especially because the StringIO is going to waste memory
<banisterfiend> what is File::NULL on windows?
<Mon_Ouie> "NUL"
fralcon has joined #ruby
<Hanmac> it gives the OS what the OS wants :P
<banisterfiend> Hanmac: what if the OS just wants to lay down and die without being pestered by germans
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<alienaut> how can define a method works like this "string".my_method
billiam has joined #ruby
<Mon_Ouie> You can define a method in String like in any other class
<Mon_Ouie> Does this have to do with palindromes? :p
<banisterfiend> alienaut: what course is this for? an online one?
<alienaut> oh yes :D Saas course
<banisterfiend> alienaut: coursera?
<alienaut> yeap
<alienaut> it is great
echobravo has joined #ruby
abdulkarim has quit [Ping timeout: 260 seconds]
<banisterfiend> yeah coursera stuff is good
<virunga> a course about ruby?
yugui_zzz is now known as yugui
<alienaut> ruby and ruby and rails
<alienaut> software engineering for saas is the full name of course
<virunga> Martin Odersky's teaching a course on coursera in september about Scala
<banisterfiend> virunga: awesome!
<virunga> yep
<banisterfiend> i'll definitely be doing that
<virunga> :D
<banisterfiend> virunga: how many weeks?
<banisterfiend> i hate the really long ones
<virunga> i dont remember
<banisterfiend> 10 weeks is too large a chunk of life
fralcon has quit [Ping timeout: 260 seconds]
<virunga> Scala's fantastic
mneorr has joined #ruby
imami|afk is now known as banseljaj
<banisterfiend> virunga: 7 weeks
<banisterfiend> that's just pushing the 'too long' button
<virunga> banghouse: :D
sgronblo1 has joined #ruby
CannedCorn has joined #ruby
adeponte has joined #ruby
lorandi has quit [Remote host closed the connection]
CannedCorn has quit [Client Quit]
saschagehlich has joined #ruby
<virunga> banisterfiend: the programming in scala book of Odersky is nice. You won't only learn scala but also the functional programming
enroxorz has quit [Quit: Ex-Chat]
sgronblom has quit [Ping timeout: 246 seconds]
emsilva has quit [Read error: Operation timed out]
sepp2k has joined #ruby
<fasta> I have something which takes a block as an argument; I just want it to test for condition a && b, but apparently that's a syntax error. I am using it like something_expecting_a_block { a && b}
<fasta> Scala is overly complex.
lorandi has joined #ruby
<fasta> Scheme is a simple functional programming language.
<burgestrand> fasta: show your real code, and the real error
<Hanmac> fasta : UnknownError: error message was not given
<virunga> lol
paolooo has quit [Quit: Page closed]
nateberkopec has quit [Quit: Leaving...]
<burgestrand> fasta: if it’s a syntax error, I assume your method takes an argument apart from the block?
<virunga> fasta: Scheme runs on JVM?
<fasta> burgestrand: it doesn't.
<fasta> virunga: some do
<fasta> burgestrand: something_expecting_a_block { a } works.
<burgestrand> fasta: then show your real code instead, we can’t guess from a bad example. Your code runs.
<fasta> burgestrand: should my code work according to that assumption?
niklasb has joined #ruby
abdulkarim has joined #ruby
Gab0 has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
opus has quit [Quit:]
Progster has quit [Read error: Operation timed out]
jwbuurlage has joined #ruby
<burgestrand> fasta: without your real code you’re just wasting time.
rd1 has joined #ruby
burgestrand has quit [Quit: Leaving.]
<Hanmac> and the real error message
jarred has quit [Quit: jarred]
statarb3 has joined #ruby
elhu has joined #ruby
<rd1> is there any way to suppress a trace when I call exit 1?
Progster has joined #ruby
<virunga> Italy's third in the medals classific!! Go Italy!!
<virunga> :D
<Hanmac> virunga it seems that they realy need the "gold" :P
strife25 has quit [Quit: Computer has gone to sleep.]
jarred has joined #ruby
<virunga> Hanmac: eheh.. Yes, we do
ortho_stice has joined #ruby
<virunga> like half Europe
<virunga> though
<virunga> hihih
danielpunt has joined #ruby
jeff_sebring has joined #ruby
Gab0 has quit [Ping timeout: 255 seconds]
vlad_starkov has joined #ruby
statarb3 has quit [Remote host closed the connection]
<Hanmac> you could ask the vatican ... they have heaped it like madges
burgestrand has joined #ruby
<ortho_stice> I have a question about 'bundler'. I'm using a tool that relies on bundler (veewee). As far as I can tell, bundler relies on the current directory to determine what sets of gems to load. Is there any way around that? Another tool relies on eth current directory as well, and they will never agree.
kevinbond has left #ruby [#ruby]
<burgestrand> ortho_stice: you can set an environment variable for bundler to know where to find the Gemfile.
<burgestrand> ortho_stice: let’s see if I can find it, it’s in the documentation.
nateberkopec has joined #ruby
<ortho_stice> bundler's documentation?
locriani has joined #ruby
<burgestrand> ortho_stice: yep.
Gab0 has joined #ruby
ttilley is now known as ttilley_off
<ortho_stice> OK, I'm reading at http://gembundler.com/
<burgestrand> ortho_stice: BUNDLE_GEMFILE, if you point that environment variable to where your Gemfile resides bundler will use that directory at it’s base.
michaelgamble has quit [Quit: michaelgamble]
vlad_starkov has quit [Ping timeout: 246 seconds]
rakm has joined #ruby
reuf has joined #ruby
i0n has quit [Quit: Lost terminal]
jgrevich has joined #ruby
johnlcox has joined #ruby
<ortho_stice> burgestrand: well, that seems like the right direction to go in... though now I get a stack level too deep exception
Neil_ has quit [Remote host closed the connection]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
benson has quit [Ping timeout: 264 seconds]
Squarepy has quit [Quit: Leaving]
fbernier has quit [Ping timeout: 240 seconds]
darren has quit [Remote host closed the connection]
jwbuurlage has quit [Quit: jwbuurlage]
Eldariof-ru has quit []
benson has joined #ruby
blacktulip has quit [Remote host closed the connection]
jrajav has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
yakko has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
BrokenCog has quit [Quit: leaving]
Vert has joined #ruby
internet_user has quit [Remote host closed the connection]
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
geekbri has quit [Remote host closed the connection]
mehlah has joined #ruby
opus has joined #ruby
Progster has quit [Ping timeout: 248 seconds]
joast has quit [Quit: Leaving.]
capotej has joined #ruby
<aces23up> how do i return the string found with
<aces23up> line =~ /(.*)\(/
<capotej> $1
<aces23up> is that thread safe?
<capotej> no idea
<aces23up> can i load it to a local somehow?
n8ji has joined #ruby
n8ji has quit [Remote host closed the connection]
hynkle has quit [Quit: Computer has gone to sleep.]
saschagehlich has quit [Quit: saschagehlich]
n8ji has joined #ruby
<Tasser> aces23up, yes, it is
<Tasser> aces23up, and why not line[/(.*)\(/,1]
GlenK has quit []
b26 has joined #ruby
kiwnix has joined #ruby
xaq has quit [Remote host closed the connection]
xaq has joined #ruby
Ste11a has quit [Ping timeout: 255 seconds]
sirecote has quit [Ping timeout: 244 seconds]
n8ji is now known as ngoldman
mpereira has quit [Ping timeout: 252 seconds]
<aces23up> Tasser new to regex i will try that, thanks.
lorandi has quit [Quit: Leaving]
Eiam has quit [Ping timeout: 244 seconds]
nikeita has joined #ruby
nopper has quit [Ping timeout: 244 seconds]
brendan` has quit [Ping timeout: 244 seconds]
jhchabran has quit [Ping timeout: 244 seconds]
dhodgkin has quit [Ping timeout: 244 seconds]
blast_hardcheese has quit [Ping timeout: 244 seconds]
thedonvaughn has quit [Ping timeout: 244 seconds]
b26 is now known as brendan`
DarthGandalf has quit [Ping timeout: 240 seconds]
AlbireoX has quit [Ping timeout: 240 seconds]
xaq_ has joined #ruby
y2k has quit [Quit: changing servers]
AlbireoX has joined #ruby
rachet has quit [Ping timeout: 244 seconds]
TorpedoSkyline has joined #ruby
<TorpedoSkyline> so what is 'result'?
y2k has joined #ruby
nw has quit [Remote host closed the connection]
UNIXgod has quit [Ping timeout: 244 seconds]
nw has joined #ruby
jhchabran has joined #ruby
maletor has quit [Ping timeout: 244 seconds]
thone_ has quit [Ping timeout: 244 seconds]
rachet has joined #ruby
<Tasser> TorpedoSkyline, where?
UNIXgod has joined #ruby
nopper` has joined #ruby
<Hanmac> TorpedoSkyline: ToFewInformationError
sailias has quit [Quit: Leaving.]
<TorpedoSkyline> Tasser, result << fn.call(pair[0], pair[1])
thone has joined #ruby
<TorpedoSkyline> Let me paste bin some code.
<Hanmac> result is some kind of array that collects the output
shashin has joined #ruby
matti has quit [Ping timeout: 244 seconds]
qko_ has quit [Ping timeout: 244 seconds]
<TorpedoSkyline> http://pastie.org/4361406
cantonic has quit [Quit: cantonic]
matti has joined #ruby
DarthGandalf has joined #ruby
xaq has quit [Ping timeout: 250 seconds]
<TorpedoSkyline> result = [], Hanmac
sirecote has joined #ruby
<TorpedoSkyline> Which I don't understand.
qko has joined #ruby
<Hanmac> result.class #=> Array
dhodgkin has joined #ruby
maletor has joined #ruby
<TorpedoSkyline> It's an empty array Hanmac
blast_hardcheese has joined #ruby
<Hanmac> yeah ... and where is the problem?
<TorpedoSkyline> Hanmac, I'm trying to get my head around it and lambdas.
thedonvaughn has joined #ruby
jstew has quit [Quit: leaving]
<Hanmac> imo the sample is a bit shity and could be coded better
bairui has joined #ruby
<TorpedoSkyline> I think I may understand the idiot array thing. We've got arrays within arrays going on and examining the arrays that are within the arrays. Meh.
<TorpedoSkyline> I think you're right Hanmac
ngoldman has quit [Remote host closed the connection]
cantonic has joined #ruby
capotej_ has joined #ruby
kvirani has quit [Remote host closed the connection]
<TorpedoSkyline> That is a really terrible example.
schickung has quit [Quit: schickung]
shashin has quit [Quit: shashin]
<Hanmac> http://pastie.org/4361437 << i would do something like this
ngoldman has joined #ruby
joast has joined #ruby
capotej has quit [Ping timeout: 246 seconds]
capotej_ has quit [Client Quit]
rovalent has joined #ruby
mascool has joined #ruby
xaq_ has quit [Read error: Connection reset by peer]
ryanf has quit [Quit: leaving]
ttilley_off is now known as ttilley
MarGarina has joined #ruby
xaq has joined #ruby
verto is now known as verto|off
jarjar_prime has joined #ruby
fralcon has joined #ruby
tiripamwe has joined #ruby
<TorpedoSkyline> ok thanks Hanmac. I'll study that.
<Mon_Ouie> yield(*pair) is the same as yield pair in fact
ngoldman has quit [Remote host closed the connection]
<Hanmac> ... yeah you may be right
<Mon_Ouie> The whole method is just that_array.map
burgestrand has quit [Quit: Leaving.]
d3vic3 has joined #ruby
savage- has quit [Ping timeout: 246 seconds]
Ste11a has joined #ruby
carlyle has joined #ruby
<Synthead> if I have a method defined like this: def this(that = true, those = false) ... end, how can I set the variable 'those' to something else without defining 'that'?
sernin has quit [Quit: ZNC - http://znc.in]
<Hanmac> Synthead use named parameters
Ethan has quit [Ping timeout: 272 seconds]
<Synthead> Hanmac: how?
<dereknelson> Can anyone give me some help w/ Rake and Rake Pipeline
carloslopes has quit [Quit: Leaving.]
cjlicata has quit [Ping timeout: 240 seconds]
<Synthead> Hanmac: use a hash, more or less?
<Hanmac> def this(opt={}) .... and then this(that: true,those: false)
qwerxy has joined #ruby
atmosx has joined #ruby
<Synthead> Hanmac: ooh
und3f has joined #ruby
carlyle has quit [Ping timeout: 260 seconds]
sdwrage has joined #ruby
fridim_ has quit [Ping timeout: 246 seconds]
beakerma_ has quit [Remote host closed the connection]
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
thone_ has joined #ruby
Criztian has joined #ruby
wvms has joined #ruby
nikeita has quit [Quit: sleep]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
rutkla has quit [Ping timeout: 264 seconds]
naz has joined #ruby
thone has quit [Ping timeout: 240 seconds]
asobrasil has left #ruby [#ruby]
htroyack has joined #ruby
sgronblo1 has quit [Ping timeout: 264 seconds]
TorpedoSkyline has quit [Quit: Computer has gone to sleep.]
brendan` has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
monkegjinni has joined #ruby
linoj has quit [Ping timeout: 246 seconds]
rutkla has joined #ruby
statarb3 has joined #ruby
statarb3 has quit [Changing host]
statarb3 has joined #ruby
ForSpareParts has quit [Disconnected by services]
newbie|2 has joined #ruby
ForSpareParts has joined #ruby
rovalent has quit [Quit: Linkinus - http://linkinus.com]
tomb_ has quit [Quit: Computer has gone to sleep.]
jonathanwallace has quit [Remote host closed the connection]
savage- has joined #ruby
jonathanwallace has joined #ruby
<lectrick> So I want someone to be able to include my module to add features to their class... but I also want them to be able to override a method... Is there a pattern for this?
<lectrick> (override a method in my module, I mean)
bbttxu has quit [Quit: bbttxu]
danielpunt has quit [Remote host closed the connection]
MarGarina has quit [Ping timeout: 252 seconds]
pskosinski 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]
schickung has joined #ruby
<lectrick> Can I just define the method again after I include the module?
jonathanwallace has quit [Ping timeout: 252 seconds]
<blazes816> you could try it, but I'm pretty sure that works
schickung has quit [Client Quit]
havenn has joined #ruby
pskosinski has joined #ruby
balki_ has joined #ruby
balki_ has quit [Read error: Connection reset by peer]
havenn_ has joined #ruby
balki has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
balki has joined #ruby
vlad_starkov has joined #ruby
<Hanmac> lectrick you could freeze the module if you want to prefent it
[Neurotic] has joined #ruby
d3c has joined #ruby
w400z has joined #ruby
stopbit has quit [Quit: Leaving]
ngoldman has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
ngoldman has quit [Remote host closed the connection]
abdulkarim has quit [Ping timeout: 260 seconds]
infinitiguy1 has quit [Read error: Operation timed out]
kiwnix has quit [Quit: Saliendo]
abdulkarim has joined #ruby
banseljaj is now known as imami|afk
MissionCritical has quit [Ping timeout: 244 seconds]
sevvie has joined #ruby
dagnachewa has joined #ruby
mneorr has quit [Quit: Leaving.]
qwerxy has quit [Quit: offski]
mneorr has joined #ruby
flip_digits has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Stalkr_ has joined #ruby
sdwrage_ has joined #ruby
jorge has quit [Remote host closed the connection]
sdwrage has quit [Ping timeout: 264 seconds]
sdwrage_ is now known as sdwrage
schickung has joined #ruby
MasterIdler_ has joined #ruby
adeponte has quit [Remote host closed the connection]
baphled has quit [Ping timeout: 252 seconds]
mneorr has quit [Ping timeout: 240 seconds]
adeponte has joined #ruby
MasterIdler has quit [Read error: Operation timed out]
MasterIdler_ is now known as MasterIdler
schickung has quit [Client Quit]
MasterIdler has quit [Client Quit]
jorge has joined #ruby
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
nicoulaj has quit [Ping timeout: 272 seconds]
<jwg2s> i have two arrays, i want to scan through one with each element in the other, and if the first two columns match, delete it from the first
<jwg2s> How can I do that?
sepp2k has quit [Remote host closed the connection]
alienaut has quit [Remote host closed the connection]
<jwg2s> [ [dog cat bog], [bird bill joe] ] and [ [dog cat jim] ], combine these but only keep [dog cat dog] instead of including [dog cat jim] as well.
<jwg2s> Sorry I'm having trouble explaining this...
w400z has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
w400z has joined #ruby
DrShoggoth has quit [Quit: Leaving]
darren_ has joined #ruby
chson has quit [Remote host closed the connection]
chson has joined #ruby
chson has quit [Remote host closed the connection]
mehlah has quit [Quit: Leaving...]
lupine_85 has quit [Excess Flood]
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
jorge has quit [Remote host closed the connection]
Hawklord has joined #ruby
SQLStud has quit [Read error: Connection reset by peer]
<jwg2s> I'll generalize… I want to take each element of one array and compare it against each element of another array. If a condition is met, delete it from the array that is being compared against.
sdwrage has quit [Quit: geekli.st/programmer]
lupine_85 has joined #ruby
mehlah has joined #ruby
sailias has joined #ruby
adeponte has quit [Remote host closed the connection]
cousine has joined #ruby
lupine_85 has quit [Client Quit]
<Synthead> is there a variable that will tell me the parent method of what called a certain method?
MissionCritical has joined #ruby
<ForSpareParts> Does anyone know of a Markdown solution that would be easy to extend to allow for a couple of custom app-specific tags?
niklasb has quit [Ping timeout: 260 seconds]
jorge has joined #ruby
lupine_85 has joined #ruby
<blazes816> ForSpareParts: perhaps http://kramdown.rubyforge.org/ ?
foudil has joined #ruby
adeponte has joined #ruby
SCommette_ has quit [Quit: SCommette_]
conor_ireland has joined #ruby
johnlcox has quit [Ping timeout: 252 seconds]
justsee has joined #ruby
MarGarina has joined #ruby
vvgomes has quit [Ping timeout: 252 seconds]
mpereira has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
ProLoser|Work has joined #ruby
jonathanwallace has joined #ruby
<ProLoser|Work> hallo
<ProLoser|Work> is this where i can get help with sass?
<ProLoser|Work> i want to create a mixin that appends something to each rule output but another mixin
bbttxu has joined #ruby
dv310p3r has quit [Ping timeout: 260 seconds]
tomb_ has joined #ruby
tomb_ has quit [Client Quit]
shashin has joined #ruby
<ForSpareParts> blazes816, Thanks! This is exactly what I needed. I must've been doing the wrong Google searches...
<blazes816> awesome!
jrist is now known as jrist-afk
jarred has quit [Quit: jarred]
jonathanwallace has quit [Ping timeout: 250 seconds]
verto|off is now known as verto
tewecske has quit [Quit: Leaving.]
jonathanwallace has joined #ruby
bbttxu has quit [Ping timeout: 240 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
iamjarvo has quit [Quit: Leaving...]
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
davidpk has quit [Quit: Computer has gone to sleep.]
foudil has left #ruby ["WeeChat 0.3.8"]
carlyle has joined #ruby
foudil has joined #ruby
snearch has joined #ruby
nari has joined #ruby
verto is now known as verto|off
kirun has quit [Quit: Client exiting]
theRoUS has quit [Ping timeout: 260 seconds]
beakerman has joined #ruby
Nick0010 has joined #ruby
vzhou has joined #ruby
<vzhou> hello
<vzhou> a quick question
<vzhou> i manage my gem with rvm
kpshek has quit []
awarner has quit [Remote host closed the connection]
justsee has quit [Ping timeout: 252 seconds]
<vzhou> no such file to load -- net/http/persistent (LoadError)
<vzhou> it shows this error
<vzhou> when requiring
carlyle has quit [Remote host closed the connection]
xaq has quit [Remote host closed the connection]
<vzhou> hello
<vzhou> is any one here?
Musok has quit [Read error: Connection reset by peer]
xaq has joined #ruby
sendoushi has joined #ruby
<vzhou> hello...
<vzhou> is any one here?
<vzhou> exit
vzhou has quit [Client Quit]
awarner has joined #ruby
<ccooke> ... impatient
Nick0010 has quit [Quit: Nick0010]
joshman_ has quit [Ping timeout: 252 seconds]
TheShadowFog has quit [Read error: Connection reset by peer]
sdwrage has joined #ruby
ngoldman has joined #ruby
awarner has quit [Remote host closed the connection]
cascalheira has joined #ruby
sendoushi has quit [Remote host closed the connection]
billiam has quit [Quit: Leaving]
<ged> Haha, awesome.
foudil has quit [Quit: WeeChat 0.3.8]
Synthead has quit [Quit: p33 ba115]
cousine has quit [Remote host closed the connection]
reuf has quit [Quit: Leaving]
andrewhl has quit [Remote host closed the connection]
wallerdev has quit [Quit: wallerdev]
w400z has quit [Quit: Computer has gone to sleep.]
<jrajav> That just made my day
wallerdev has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
jeff_sebring has quit [Quit: Leaving]
stkowski has quit [Quit: stkowski]
Criztian has quit [Remote host closed the connection]
havenn_ has quit [Remote host closed the connection]
uris has quit [Quit: leaving]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
chrisbolton has quit [Quit: chrisbolton]
centipedefarmer has joined #ruby
MarGarina has quit [Read error: Operation timed out]
ph^ has quit [Remote host closed the connection]
MarGarina has joined #ruby
emsilva has joined #ruby
Rezwan has joined #ruby
znouza_ has joined #ruby
burgestrand has joined #ruby
reuf has joined #ruby
xaq has quit [Ping timeout: 260 seconds]
znouza_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
bbttxu has joined #ruby
d3vic3 has quit [Quit: leaving]
EstanislaoStan has joined #ruby
<EstanislaoStan> Is there a string method like =~, but that returns the position of all matches, not just the first one?
jjbohn has joined #ruby
snearch has quit [Quit: Verlassend]
SphericalCow has quit [Quit: Leaving]
Transformer has joined #ruby
<shevy> hmm
<otters> don't believe so
<shevy> EstanislaoStan, you can use capture groups to work around it
<otters> I've just been sitting here for three minutes trying to find one
<shevy> or .scan for all matches
stephenjudkins has joined #ruby
<shevy> =~ /(\d+)(\d+)(\d+)(\d+)(\d+)(\d+)(\d+)(\d+)(\d+)(\d+)/
<shevy> then $1 $2 $3 etc...
adeponte has quit [Remote host closed the connection]
<shevy> but to return the positions itself... hmmmmm
beakerman has quit [Remote host closed the connection]
Transformer has quit [Excess Flood]
<otters> it's a bitch ain't it
pskosinski has quit [Ping timeout: 248 seconds]
<shevy> haha
<shevy> otter you are cute when you curse
nari has quit [Ping timeout: 250 seconds]
<otters> my github logo is already an otter head
<otters> I don't know what else you want
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
<shevy> oh?
havenn has joined #ruby
<otters> yeah
<otters> hang on a sec
<shevy> !!!
<shevy> empty!!!!!
<shevy> that is confusing
<otters> some loser already took the username "otters"
<shevy> hehe
<otters> so I had to settle for the singular
<otters> I'll just wait for him to die out
<otters> you can claim github usernames when the original owner hasn't had any activity in six months
<shevy> really?
<otters> yeah
<otters> but it's only been 5
<shevy> hmm
<otters> as you can see
<otters> there's a bunch of like chinese and stuff in otterses files
<otters> but yeah, I'm just sitting here like a vulture waiting
statarb3 has quit [Quit: Leaving]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<EstanislaoStan> I guess I could make my own method that runs =~, then overwrites the string with only the text after that point, runs the method again, and does this until nil is returned. It'll put all positions into an array that it'll return. Does that sound plausible?
bbttxu has quit [Quit: bbttxu]
lunitikcalm has joined #ruby
<otters> that sounds like your best bet
<otters> that's what I was gonna do, all in one line, but Ruby's no Haskell
lunitikcalm has quit [Remote host closed the connection]
virunga has quit [Quit: Sto andando via]
adeponte has joined #ruby
pskosinski has joined #ruby
gavilan2 has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
bradhe_ has quit [Remote host closed the connection]
<otters> let indexesOf' s c [x] = if c == x then [s] else []; indexesOf' s c (x:xs) = if c == x then s:indexesOf' (succ s) c xs else indexesOf' (succ s) c xs; indexesOf = indexesOf' 0
lunitik has joined #ruby
rmc3 has joined #ruby
lunitik has quit [Client Quit]
lunitikcalm has joined #ruby
yugui is now known as yugui_zzz
fearoffish has quit [Quit: Computer has gone to sleep.]
rd1 has left #ruby [#ruby]
Chryson has joined #ruby
MarGarina has quit [Ping timeout: 246 seconds]
x77686d has quit [Read error: Operation timed out]
dagnachewa has quit [Quit: Leaving]
nari has joined #ruby
<EstanislaoStan> Is that Haskell?
blazes816 has quit [Quit: Leaving]
<EstanislaoStan> Ooh, and I do have a tiny bit of a problem doing this. I don't know how to make methods that don't follow the .method format.
mikepack has quit [Remote host closed the connection]
troyack has joined #ruby
chson has joined #ruby
<burgestrand> EstanislaoStan: you just def them. def =~(thingy); end
vvgomes has joined #ruby
Speed has joined #ruby
chson has quit [Remote host closed the connection]
centipedefarmer has joined #ruby
htroyack has quit [Ping timeout: 244 seconds]
anderse_ has quit [Quit: anderse_]
htroyack has joined #ruby
bbttxu has joined #ruby
macer1 has joined #ruby
<macer1> hey
troyack has quit [Ping timeout: 240 seconds]
<macer1> I have a module Protocol, there is class Packet{1,2,3} etc.
<macer1> and these have packet_id's in them
<macer1> and I want to check every class in protocol if responds_to packet_id
MasterIdler_ has joined #ruby
<macer1> So I know PacketLogin have i.e. id 5
cbuxton has quit [Quit: Leaving.]
<burgestrand> macer1: you read it with Protocol::PacketLogin.packet_id?
<macer1> well I think it will work that way
<burgestrand> macer1: because when you said PacketX had packet_id in it, I expected just a regular attribute on every instance.
bluenemo has quit [Remote host closed the connection]
<burgestrand> macer1: so how do you want the results?
yugui_zzz is now known as yugui
<burgestrand> macer1: you can iterate through Protocol.constants and get the actual values with Protocol.const_get(constant_name)
<EstanislaoStan> burgestrand: I'm getting a t_match error. It thinks I'm using the method, not defining it.
<macer1> hmm
<macer1> My final goal is that I have a binary string with data. Then I check the first byte from this, the id. and then I convert it to instance of packet which is owning that id
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<macer1> I am using bindata
<burgestrand> macer1: I take it you don’t want to just make a hash: { packet_id_1 => Protocol::PacketLogin, packet_id_2 => Protocol::PacketDisconnect }?
<macer1> if posibble no :)
centipedefarmer has quit [Quit: This computer has gone to sleep]
robert- has joined #ruby
<burgestrand> Because that’d be simpler and probably looks better :)
kenichi has quit [Remote host closed the connection]
<macer1> here is some early code: https://github.com/macer1/mcp-ruby
und3f has quit [Read error: Operation timed out]
znouza_ has joined #ruby
bosent has joined #ruby
<macer1> ok I have locally the part that I get only id from packet
<macer1> 1,2,3,4,5 whatever
<macer1> now I need to make the instance of proper packet :)
frogstarr78 has joined #ruby
und3f has joined #ruby
revans has quit [Ping timeout: 260 seconds]
<burgestrand> macer1: http://ideone.com/Cn6hT
S2kx has joined #ruby
<macer1> eh that page is loading forever
<macer1> can't load
<burgestrand> :o
<macer1> ok loaded using some crappy proxy
<burgestrand> macer1: new one: http://ideone.com/9a71o
cascalheira has quit [Remote host closed the connection]
<burgestrand> macer1: as for how you get the packet_id with bindata I have no idea, but that’s all other things you need to do
x77686d has joined #ruby
S1kx has quit [Ping timeout: 255 seconds]
<macer1> hmm
bricker88 has joined #ruby
pen has joined #ruby
<macer1> oo
<macer1> that looks good
pen has quit [Remote host closed the connection]
<macer1> the new one
<burgestrand> :)
pen has joined #ruby
<macer1> mapping[myreadedid] I got the class
<burgestrand> Yep
iamjarvo has joined #ruby
<macer1> class = mapping[myreadedid], class.read(hexstring)
<macer1> like that :P?
MasterIdler_ has quit [Quit: MasterIdler_]
<burgestrand> macer1: yes, but use klass = mapping[myreadid], class is reserved for ruby :p
<macer1> ok :P
<bricker88> Where would you look if you were getting no method errors for `y`, if to_yaml was working? Ruby 1.9.2
<macer1> bricker88: maybe try to update to latest ruby first
<burgestrand> Probably google. Not much to go on there.
x77686d has quit [Ping timeout: 240 seconds]