fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
<aces23up> its a hash
<keyvan> never seen that either
<keyvan> the colon in front, seems new to me
<aces23up> one sec I will drop more code.
<keyvan> reminds me of symbol to proc
<otters> it's a symbol
<otters> :@args is a symbol
<yfeldblum> aces23up, looks like it should work to me
<aces23up> yeh i thoughts its the change from 1.8 to 1.9
<keyvan> oh thanks otters
jorge has quit [Remote host closed the connection]
<aces23up> ok I drop some more code.
<seanstickle> It's a symbol, but who uses "@" in a symbol?
<seanstickle> It looks like an instance variable masquerading as a symbol
<keyvan> seanstickle looks like thats how u use instance_variable_defined
<keyvan> *?
<seanstickle> In some sort of fancy dress party
kenichi has quit [Remote host closed the connection]
<seanstickle> Huh
<keyvan> apparently it's how you tell #instance_variable_defined? which instance varialbe you're referring to
jorge has joined #ruby
<seanstickle> Learn something new every day
<yfeldblum> seanstickle, um ... in ruby, if you want to talk about parts of your programs by name (names of methods, names of instance variables, etc), we use symbols...
virunga has joined #ruby
<otters> yeah
<otters> instance_variable_get :@var
Chryson has joined #ruby
<keyvan> seanstickle here https://gist.github.com/3221876 my irb session
chichou has quit [Remote host closed the connection]
alphabitcity has left #ruby [#ruby]
<macer1_> does ruby have some event handling?
<macer1_> I don't know how to do this
<seanstickle> keyvan: yah, I just looked up the docs. interesting.
chichou has joined #ruby
<macer1_> maybe exception; raise Exception, "Kicked from server"
<macer1_> and in block
<keyvan> yea nice tool to use for rspec stuff, i had no idea
<macer1_> rescue Exception puts "got kicked"
<macer1_> of course create diffrent exception types
<macer1_> is this good idea?
headius has joined #ruby
<aces23up> yfeldblum that has more code of what the context is.
ZachBeta has joined #ruby
<keyvan> aces23up does line 26 even execute? "Class" seems invalid there, that looks like python in fact… lol
Z_Mass has joined #ruby
mehlah_ has joined #ruby
<aces23up> key it executes some typos.
<aces23up> just typed it.
<keyvan> ooh
<aces23up> class
kjellski has quit [Quit: Leaving]
chichou_ has joined #ruby
<aces23up> this bit of code just broke when switching to 1.9
<keyvan> my only guess was that self was different so #instance_variable_defined? was acting on a different instance. but you're hitting that method right after another, so the instance should not be different… so i am confused now too
<aces23up> was working fine on 1.8 using instance_variables.include?('@args')
<aces23up> yeh weird.
chichou has quit [Ping timeout: 264 seconds]
moshee has joined #ruby
abdulkarim has quit [Remote host closed the connection]
moshee is now known as Guest87660
enroxorz has quit [Quit: -a-]
sdwrage has quit [Quit: geekli.st/programmer]
<keyvan> aces23up does this work http://pastie.org/4368248
justsee is now known as justsee|away
<keyvan> err its broken, its a string after .inspect of course, but worth a shot
mehlah has quit [Ping timeout: 264 seconds]
<keyvan> but doesnt get to the root cause of why you're having the issue so idk...
locriani has joined #ruby
locriani has joined #ruby
<seanstickle> aces23up: seems to work fine for me
<seanstickle> On 1.9.3
<macer1_> how can I make a class intialize(*args) that will check if .each self.respond_to somearg= and set the values?
aantix has quit [Read error: Connection reset by peer]
<macer1_> x.X
tewecske has quit [Quit: Leaving.]
benson has quit [Remote host closed the connection]
<keyvan> yea it works for me too, idk whats up with his application
<seanstickle> aces23up: what error are you actually getting?
w400z has quit [Quit: Computer has gone to sleep.]
<seanstickle> aces23up: please tell me you're doing YamlLoader.new somewhere in your code...
<keyvan> he is claiming that it is false or nil when in the if block, as far as i understand, and not getting an error.
mehlah_ has quit [Ping timeout: 244 seconds]
<aces23up> seanstickle ok its seems to be working.. my error was weird.. but what actually seems to be broken, is farther up the chanin.. as @args is not a hash but an array of hash now.
<keyvan> but is true in the puts…. weird.
<fowl> macer1_: how do you get the argument names from *args? use opts = {} and call like MyClass.new(arg1: 2, arg2: 40, ...)
<macer1_> eee
<aces23up> i can only think cause I pass *args around further up.
<macer1_> I want :user => "asd", :password => "asd" style
<aces23up> is there a diff between the way the splat operator works from 1.8 to 1.9?
<seanstickle> Ok, so here's the thing. I need the actual error to help you.
<fowl> macer1_: that's the same thing
<seanstickle> I don't have magic psychic powers
<macer1_> ...
<aces23up> seanstickle forget about the last error ;
<aces23up> I just want to know if the splat works differently from 1.8 to 1.9
maxmmurphy has quit [Quit: maxmmurphy]
<fowl> macer1_: { user: "asd", password: "asd" } is the same as { :user => "asd", :password => "asd" }
<seanstickle> aces23up: in what way?
<macer1_> ah
<seanstickle> aces23up: examples!
<macer1_> whatever
<macer1_> now the respond_to part
<seanstickle> Geez, the topic actually recommends paste bin?
<fowl> macer1_: iterate over your options.. add an = to the end of the key and call to respond_to? / send
<keyvan> haha i gasped at the same thing seanstickle
<seanstickle> :)
<macer1_> and it if responds set the value of it
<macer1_> :P
ephemerian has quit [Quit: Leaving.]
cascalheira has joined #ruby
<fowl> opts.each { |k, v| field = "#{k}="; send(field, v) if respond_to?(field) }
<macer1_> what's the diffrence args* and opts = {}
<macer1_> fowl: thx
<macer1_> I mean *args
mehlah has joined #ruby
<fowl> *args traps everything in an array, opts={} expects you to pass a normal value, or a hash, or an open hash
<macer1_> ah
<macer1_> so I want to use opts
naz has quit [Read error: Connection reset by peer]
ianbrandt has quit [Quit: ianbrandt]
mehlah_ has joined #ruby
headius has quit [Quit: headius]
nobitanobi has quit [Read error: Connection reset by peer]
Guedes has joined #ruby
S1kx has joined #ruby
mehlah has quit [Ping timeout: 248 seconds]
jellosea has left #ruby [#ruby]
S2kx has quit [Ping timeout: 264 seconds]
mehlah_ has quit [Read error: Connection reset by peer]
locriani has quit [Remote host closed the connection]
krzkrzkrz has joined #ruby
bradhe_ has quit [Remote host closed the connection]
mikepack has quit [Remote host closed the connection]
stkowski has quit [Quit: stkowski]
krz has quit [Ping timeout: 246 seconds]
krzkrzkrz is now known as krz
jasonLaster has joined #ruby
ryh has joined #ruby
lunitikcalm has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
krzkrzkrz has joined #ruby
jonathanwallace has joined #ruby
krz has quit [Ping timeout: 250 seconds]
krzkrzkrz is now known as krz
davidcelis has quit [Quit: K-Lined.]
jonathanwallace has quit [Ping timeout: 240 seconds]
nateberkopec has quit [Quit: Leaving...]
sdwrage has joined #ruby
sgronblom has quit [Ping timeout: 255 seconds]
baroquebobcat has quit [Quit: baroquebobcat]
xclite has quit [Read error: Connection reset by peer]
cascalheira has quit [Remote host closed the connection]
xclite has joined #ruby
<macer1_> ehh
<macer1_> include includes module or in contents?
<macer1_> :|
sgronblom has joined #ruby
<macer1_> its*
<heftig> the module is inserted into the ancestor chain
<macer1_> I can't get it to working
<macer1_> I have;
<macer1_> file types.rb:module mcp:module protocol29:module types:class{1,2,3,4,5};endendnend
<macer1_> like that
<macer1_> and I want class1,2,3,4,5 to be accessible
<macer1_> without all that MCP::[..]
<macer1_> how to do this?
<heftig> include MCP::Protocol29::Types
<macer1_> in which part
<heftig> what?
<macer1_> in part after require
<macer1_> it fails
<macer1_> NameError: uninitialized constant Types
<heftig> what did you write?
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<macer1_> require 'mcp/protocol29/types'; include MCP::Protocol29::Types
savage- has quit [Read error: Operation timed out]
<macer1_> :/
<heftig> then Types doesn't exist
Hawklord has quit [Ping timeout: 276 seconds]
<macer1_> but require
headius has joined #ruby
<macer1_> wait, I will upload all that stuff
ckrailo has quit [Quit: Computer has gone to sleep.]
S1kx has quit [Read error: Connection reset by peer]
<heftig> require filenames don't have to match any modules
<macer1_> wait, what?
S1kx has joined #ruby
locriani has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<heftig> just because the file you're loading is named mcp/protocol29/types.rb, doesn't mean it defines a constant named MCP::Protocol29::Types
<macer1_> but it defines
<macer1_> ...
<macer1_> look at the github
<heftig> and where are you trying the include?
<macer1_> connection.rb
<heftig> you made a typo
<heftig> look at that include line again
beakerman has quit [Remote host closed the connection]
<heftig> and the require
<macer1_> huh
<macer1_> ?
<macer1_> pro-to-col
<heftig> 29
mrsolo has quit [Quit: Leaving]
beakerman has joined #ruby
<macer1_> yes 29
<macer1_> x.X
<macer1_> are we talking about 3rd line of conncetion.rb?
<macer1_> no wait
<macer1_> I have locally something diffrent
<heftig> sigh
<macer1_> commiting
<heftig> fix your code
<macer1_> wait a sec, commiting stuff
<macer1_> look again
beakerman has quit [Remote host closed the connection]
<macer1_> what is wrong
<macer1_> there is that module
<macer1_> and the file with it is loaded
Z_Mass has quit [Quit: Leaving]
bbttxu has quit [Quit: bbttxu]
liluo has quit [Remote host closed the connection]
<macer1_> heftig: no ideas?
<heftig> macer1_: the error is from packets.rb
<macer1_> ouch
<macer1_> ...
<macer1_> my fail
<heftig> seriously, look at the backtrace
<macer1_> I see. thank you.
artOfWar has quit [Remote host closed the connection]
beakerman has joined #ruby
bontaq has quit [Remote host closed the connection]
graspee has quit [Quit: leaving]
monkegjinni has quit [Remote host closed the connection]
krzkrzkrz has joined #ruby
virunga has quit [Quit: Sto andando via]
krz has quit [Ping timeout: 246 seconds]
krzkrzkrz is now known as krz
nobitanobi has joined #ruby
eph3meral has quit [Quit: Leaving]
<macer1_> why ruby doesn't have python's import as
nobitanobi has quit [Read error: Connection reset by peer]
<macer1_> this would make my life 100x easier
nobitanobi has joined #ruby
krzkrzkrz has joined #ruby
bradhe has joined #ruby
shadoi has joined #ruby
seanstickle has quit [Quit: seanstickle]
krz has quit [Ping timeout: 252 seconds]
krzkrzkrz is now known as krz
fermion_ has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
thecreators has joined #ruby
headius has quit [Quit: headius]
timepilot has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
Hanmac1 has joined #ruby
manizzle has quit [Ping timeout: 240 seconds]
Hanmac has quit [Ping timeout: 246 seconds]
tobym has joined #ruby
yugui is now known as yugui_zzz
Spooner has quit [Ping timeout: 260 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
justsee|away is now known as justsee
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
Nisstyre has quit [Read error: Connection reset by peer]
Araxia has quit [Quit: Araxia]
yugui_zzz is now known as yugui
maxmmurphy has joined #ruby
liluo has joined #ruby
Nisstyre has joined #ruby
ryh has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
nohonor has quit [Ping timeout: 252 seconds]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
quest88 has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
nari has joined #ruby
ryanf has quit [Quit: Lost terminal]
SCommette has quit [Quit: SCommette]
ryanf has joined #ruby
williamcotton has quit [Ping timeout: 255 seconds]
_adeponte has quit [Remote host closed the connection]
williamcotton has joined #ruby
jonathanwallace has joined #ruby
verbad has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
wallerdev has quit [Read error: Connection reset by peer]
jonathanwallace has quit [Ping timeout: 245 seconds]
Guest87660 is now known as moshee
moshee has quit [Changing host]
moshee has joined #ruby
thecreators_ has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
thecreators has quit [Ping timeout: 248 seconds]
thecreators_ is now known as thecreators
thecreators has quit [Remote host closed the connection]
bricker88 has quit [Quit: Leaving.]
<macer1_> I have a problem
thecreators has joined #ruby
<macer1_> I have i.e. to files
<macer1_> one is module Asd class1 class2 end
maxmmurphy has quit [Quit: maxmmurphy]
<macer1_> two is module Asd class3 class4 end
<macer1_> same module name
<macer1_> so I expect that all 4 classes are in this module
<macer1_> but not
<macer1_> 3 and 4 are not here
uris has joined #ruby
lobak has quit [Ping timeout: 255 seconds]
bontaq_ has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
lobak has joined #ruby
<macer1_> ehh bad ruby
<macer1_> how do I package my classes then -.-
carlyle has joined #ruby
lunitikcalm has quit [Remote host closed the connection]
Manhose has quit [Quit: Gone fishing]
cpruitt has quit [Quit: cpruitt]
crankyco_ has quit [Remote host closed the connection]
<bontaq_> Hello ruby, I'm new and was wondering what would be the best framework to use for a very simple website that would live update a search from a sort-of-large database?
<macer1_> rails
<macer1_> or sinatra if you don't like having a lot of files :P
<bontaq_> lol, thank you. I figured I would ask since rails seemed a little intense for this baby project
<macer1_> yes
<macer1_> sinatra is great for things like that :D
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
ryh has joined #ruby
nari has quit [Remote host closed the connection]
bontaq_ has quit [Remote host closed the connection]
savage- has joined #ruby
busybox42 has quit [Quit: Leaving.]
tommyvyo has joined #ruby
busybox42 has joined #ruby
jorge has quit [Remote host closed the connection]
bontaq has joined #ruby
zeen has joined #ruby
nari has joined #ruby
TechCel has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
bontaq has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
Progster has quit [Ping timeout: 265 seconds]
linoj has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
piggybox has quit [Quit: piggybox]
luckyruby has joined #ruby
luckyruby has quit [Remote host closed the connection]
luckyruby has joined #ruby
td123 has joined #ruby
headius has joined #ruby
igotnolegs has joined #ruby
tcopp has joined #ruby
TechCel has quit [Ping timeout: 260 seconds]
davidcelis has joined #ruby
ryh has quit [Remote host closed the connection]
GlenK has joined #ruby
timepilot has quit [Quit: timepilot]
radic has quit [Read error: Operation timed out]
delinquentme has quit [Remote host closed the connection]
jhunter has quit [Ping timeout: 248 seconds]
techsurvivor has joined #ruby
Jacob_ has joined #ruby
Jacob_ is now known as ecksit
ecksit has left #ruby [#ruby]
ecksit has joined #ruby
beakerman has quit [Remote host closed the connection]
jhunter has joined #ruby
andrewhl has quit [Remote host closed the connection]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
apok_ has joined #ruby
apok_ has quit [Client Quit]
manizzle has joined #ruby
jonathanwallace has joined #ruby
ryh has joined #ruby
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
jrajav has quit []
macer1_ has quit [Remote host closed the connection]
apok has quit [Ping timeout: 246 seconds]
cpruitt has joined #ruby
jonathanwallace has quit [Ping timeout: 260 seconds]
carlyle has quit [Remote host closed the connection]
nobitanobi has quit [Read error: Connection reset by peer]
Tomasso has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
radic has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
tcopp has left #ruby [#ruby]
shadoi has quit [Quit: Leaving.]
tcopp has joined #ruby
sevvie has quit [Quit: sevvie]
tcopp has quit [Quit: leaving]
tcopp has joined #ruby
sevvie has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
nobitanobi has joined #ruby
andrewhl has joined #ruby
jrajav has joined #ruby
nobitanobi has quit [Read error: Connection reset by peer]
yugui is now known as yugui_zzz
nobitanobi has joined #ruby
nobitanobi has quit [Client Quit]
guns has joined #ruby
stefanp has joined #ruby
stefanp has quit [Changing host]
stefanp has joined #ruby
luckyruby has quit [Remote host closed the connection]
guns has quit [Quit: guns]
guns has joined #ruby
noganex has quit [Ping timeout: 248 seconds]
stefanp- has quit [Ping timeout: 265 seconds]
noganex has joined #ruby
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
ryanf has quit [Quit: leaving]
zemanel has quit [Quit: Remote hottie closed the connection]
ylluminate has quit [Quit: Bye!]
jgrevich has quit [Quit: jgrevich]
seitensei has quit [Remote host closed the connection]
igotnolegs has quit [Ping timeout: 255 seconds]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jayblack has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
igotnolegs has joined #ruby
<jayblack> Hello. I'm having a really tough time figuring this out. I want to access class variables created in a superclass, by the subclass. I can't seem to get that to work. So I tried using mixins and include, but that doesn't seem to work either.
<bnagy> jayblack: self.class.superclass.instance_variable_get :@foo
nguyenduy has joined #ruby
sevvie has quit [Quit: sevvie]
<bnagy> unless you have accessors set up, which would make it a lot less ugly
<jayblack> I mispoke, I meant I'm creating the class variable in the subclass, and I want to access it from the superclass.
<jayblack> I have a Common < Test::Unit:testCase which is supposed to hold tests that are common to a set of classes that are intended to subclass from Common.
ecksit has quit [Remote host closed the connection]
<jayblack> e.g. Common < Test..TestCase , the TestPA < Common, TestNY < Common, and so on, and Common would have a test_no_id, which is expecting a class variable named @state
nguyenduy has quit [Read error: Connection reset by peer]
<bnagy> ok you've lost me
<burgestrand> class variable is not the same as class instance variable, jayblack are you using @@var or @var?
<bnagy> you want a superclass to poke around in its subclass? :/
<bnagy> that's gross, but you could look at the inherited methods
<jayblack> class variables, @@ state.
<jayblack> Not really, that's generally bad mojo.
<bnagy> that's even more gross
<jayblack> But I have a pile of 20 or so test case classes that all have a "test_no_id", with a single variable name.. the state.
<burgestrand> I don’t see the problem. When inside the method in test_no_id from Common, you are infact not only a Common, but you might be a TestPA or TestNY.
<jayblack> I'm trying to strip that redundancy out to something common, so as I do another.. say 30 test classes, I don't have 50 common
<burgestrand> The variable you want to access is already yours.
regedarek has quit [Ping timeout: 245 seconds]
<burgestrand> You could just as well make it a method and override it in subclasses if you want as well.
rd34 has joined #ruby
sevvie has joined #ruby
<jayblack> That seemd like the right approach, to make a Common class with the commoin test methods, then subclass the inviddual states with their tests.. but the Common class needs to know which state it is, so that the generic tests can be run for that particular state
<bnagy> maybe I am pre coffee but that makes no sense to me at all
<burgestrand> jayblack: http://ideone.com/d8gDi
<bnagy> like, the subclass knows which state it is
<jayblack> Yes, but Im trying to put tests taht are common to all states in a single parent class. [
<bnagy> which is fine, see burgestrand's example. You get all the common methods anyway
shadoi has joined #ruby
<burgestrand> You could make it a DSL method as well, assuming you don’t use class variables but class instance variables: http://ideone.com/7OYXq
<bnagy> a class variable would never work for this btw, if I understand what you're doing
<bnagy> cause they go up and down and sideways
<burgestrand> Or you could just set the instance variable directly and avoid the method: http://ideone.com/AZ753
<jayblack> burgestran: That's would I would have expected to do, and tried first, but it doesn't seem to work
<burgestrand> jayblack: those links are actually run and demonstrate themselves working
<burgestrand> if you scroll down you’ll see the output
fbernier has joined #ruby
<jayblack> I think Test::Unit::TestCase is doing something funny.
jrajav has quit [Quit: The best darkness is strange and surprising]
phinfonet has quit [Remote host closed the connection]
<jayblack> Let me make a simple standalone example. it'll just take a moment
headius has quit [Quit: headius]
verbad has quit []
jonathanwallace has joined #ruby
dv310p3r has joined #ruby
Chryson has quit [Quit: Leaving]
solussd has joined #ruby
sevvie has quit [Quit: sevvie]
tobym has quit [Read error: Connection reset by peer]
locriani has quit [Remote host closed the connection]
TPFC-SYSTEM has joined #ruby
jonathanwallace has quit [Ping timeout: 255 seconds]
techsurvivor has quit [Quit: WeeChat 0.3.8]
ananthakumaran has joined #ruby
smu43 has left #ruby [#ruby]
GlenK has quit [Ping timeout: 260 seconds]
lorandi has quit [Quit: Leaving]
linoj has quit [Quit: linoj]
mockra has joined #ruby
darren has joined #ruby
<jayblack> #http://ideone.com/d8gDi #3 (The one that mentions bill the cat)
<jayblack> That's basically what I'm trying to do.
<jayblack> I noticed, by the way, that though I wrote 5 tests, test::unit says its running 7 tests
techsurvivor has joined #ruby
<jayblack> I would have expected 6 classes to run, not 7
<jayblack> pardon, 6 tests, not 7.
<jayblack> if I subclass SubClassOne and SubClassTwo off of Test::Unit::TestCase, and comment out the common class, it works as expected.
Goles has quit [Quit: Computer has gone to sleep.]
<jayblack> I also tried making Common a module, and include/extend, but I ended up with the same problem of getting access to the class variables.
heftig has quit [Ping timeout: 245 seconds]
JohnBat26 has joined #ruby
<jayblack> I'm not picky on how I do this, I just want to be pull out the redudundant methods for all my test suites, and in one way or another include them, so that I don't have 50 redudnant copies of generic tets.
<burgestrand> jayblack: I suppose using a module instead of subclassing would be the preferred way here, or your Common is also run as a test class.
dhruvasagar has quit [Read error: Connection reset by peer]
<burgestrand> Perhaps there’s some way to turn that off, I don’t know, don’t use test unit.
<jayblack> That was where I went second. When I make common a module and nclude it, the methods can't seem to see the class variables, though
dv310p3r has quit [Ping timeout: 260 seconds]
adamkittelson has quit [Remote host closed the connection]
cpruitt has quit [Quit: cpruitt]
<jayblack> and when I use extend, Test::Unit doesn't run the tests in common at all
<burgestrand> jayblack: it’s probably as a result of using class variables instead of class instance variables
<jayblack> When I use class nstance varaibles, they show up as nil.
Rezwan has quit [Read error: Connection reset by peer]
<jayblack> (versus as class variables, they show up as unitialized)
g_rotbart has joined #ruby
<burgestrand> jayblack: how are you accessing the class instance variable?
g_rotbart has quit [Remote host closed the connection]
<burgestrand> For the assertion, that is.
g_rotbart has joined #ruby
dhruvasagar has joined #ruby
<burgestrand> jayblack: did you look at my second example I pastied, or the third?
<burgestrand> All three of the approaches I pasted should work. What you pasted uses none of them.
solussd has quit [Quit: solussd]
bradhe has quit [Remote host closed the connection]
<burgestrand> Yeah, class instance variables are not the same as instance variables. If you set them in the class scope, you must access them from there as well, like this: http://ideone.com/AZ753
<burgestrand> jayblack: ^
<jayblack> I missed the other two. I'll look at them now
adeponte has joined #ruby
solussd has joined #ruby
w400z has joined #ruby
<fowl> burgestrand: you can set them with class X; @blah = bkjsdf too :> to initialize them at least
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<jayblack> Is it possible to access class variables or instance variables from within module methods that are included ?
<burgestrand> jayblack: class variables are crazy, but you can access instance variables like usual, and you can still ask your class for its instance variables.
<fowl> yes for instance vars, class vars i have no idea because they're gay. you should avoid them or your code will get aids.
<burgestrand> I don’t see a solution to this using class variables. I don’t know why you are so keen on using them.
<jayblack> Ok, and to reaffirm, @variable is an instance variable
uris has quit [Quit: leaving]
<burgestrand> jayblack: yep, but it can have different scopes.
<fowl> burgestrand: we need to put a warning in the topic: class variables will give your code AIDS
<Quadlex> That's offensive
<Quadlex> AIDS isn't that nasty
<Quadlex> (Also technically you get HIV you develop AIDS :P)
chimkan_ has joined #ruby
classix has quit [Ping timeout: 246 seconds]
Cache_Money has joined #ruby
sqlbyme has joined #ruby
chimkan_ has quit [Client Quit]
sqlbyme has quit [Client Quit]
sqlbyme has joined #ruby
burgestrand has quit [Ping timeout: 255 seconds]
phanousit has joined #ruby
phanousit has quit [Client Quit]
brianpWins has joined #ruby
emmanuelux has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
burgestrand has joined #ruby
<jayblack> Ok, I undersatnd what I was doing wrong now.
<burgestrand> \o/
<burgestrand> Happy stickman looks much happier with my new font.
<jayblack> Thank you all for the great patience. I'm going to have to make initialize methods to instantiate those instance variables, and then the module will work fine for including. =)
<jayblack> alreayd tested it
jorge has joined #ruby
<jayblack> I hope so. Happy stickman in my font loooks more like "Holdup Stickman" =)
minijupe has quit [Quit: minijupe]
<burgestrand> :o
_adeponte has joined #ruby
maxmmurphy has joined #ruby
<davidcelis> burgestrand:
gtuckerkellogg has joined #ruby
cpruitt has joined #ruby
nateberkopec has joined #ruby
_adeponte has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
adeponte has joined #ruby
cpruitt has quit [Quit: cpruitt]
classix has joined #ruby
adeponte has quit [Ping timeout: 264 seconds]
noyb has joined #ruby
minijupe has joined #ruby
AndChat- has joined #ruby
Banistergalaxy has quit [Ping timeout: 240 seconds]
jonathanwallace has joined #ruby
skinny_m has quit [Quit: ZNC - http://znc.sourceforge.net]
tcopp has left #ruby [#ruby]
reuf has joined #ruby
ananthakumaran has quit [Ping timeout: 248 seconds]
yakko is now known as yakko_slp
gregorg has quit [Read error: Connection reset by peer]
tcopp has joined #ruby
jonathanwallace has quit [Ping timeout: 240 seconds]
no_i_wont has joined #ruby
jorge has quit [Remote host closed the connection]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
fbernier has quit [Ping timeout: 260 seconds]
cpruitt has joined #ruby
eggie5 has quit [Quit: eggie5]
stephenjudkins has joined #ruby
cakehero has quit [Quit: Leaving...]
burgestrand has quit [Quit: Leaving.]
nateberkopec has quit [Quit: Leaving...]
SCommette has joined #ruby
sqlbyme has quit [Quit: Leaving.]
seitensei has joined #ruby
bradhe has joined #ruby
darren has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
tcopp has left #ruby [#ruby]
sevvie has joined #ruby
bean has joined #ruby
tcopp has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
centipedefarmer has quit [Quit: This computer has gone to sleep]
fyolnish_ has joined #ruby
tcopp has left #ruby [#ruby]
robbyoconnor has joined #ruby
s1n4 has joined #ruby
rutkla has joined #ruby
locriani has quit [Remote host closed the connection]
darren has joined #ruby
mockra has quit [Remote host closed the connection]
Bosma has quit [Ping timeout: 248 seconds]
fantazo has joined #ruby
minijupe has quit [Quit: minijupe]
stephenjudkins has quit [Read error: Connection reset by peer]
stephenjudkins has joined #ruby
cj3kim has joined #ruby
ngoldman has joined #ruby
Morkel has joined #ruby
mockra has joined #ruby
SCommette has quit [Quit: SCommette]
darren has quit [Remote host closed the connection]
mahmoudimus has joined #ruby
heftig has joined #ruby
johnlcox has quit [Ping timeout: 260 seconds]
Morkel has quit [Quit: Morkel]
shadoi has quit [Quit: Leaving.]
mxweas has quit [Quit: Computer has gone to sleep.]
mxweas has joined #ruby
jonathanwallace has joined #ruby
Asphyxiated|Dk has quit [Ping timeout: 264 seconds]
jonathanwallace has quit [Ping timeout: 246 seconds]
Jayunit100 has left #ruby [#ruby]
td123 has quit [Quit: WeeChat 0.3.8]
tomzx_ has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
wallerdev has joined #ruby
vectorshelve has joined #ruby
andrewhl has quit [Remote host closed the connection]
andrewhl has joined #ruby
andrewhl has quit [Remote host closed the connection]
andrew___ has joined #ruby
Asphyxiated|Dk has joined #ruby
jorge has joined #ruby
Fretta has quit [Quit: Fretta]
jasonLaster has quit [Remote host closed the connection]
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
jorge has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Read error: Connection reset by peer]
bluenemo has quit [Ping timeout: 260 seconds]
dhruvasagar has joined #ruby
Z_Mass has joined #ruby
Cache_Money has quit [Quit: Leaving]
vectorshelve has quit [Quit: Page closed]
solussd has quit [Quit: solussd]
w400z has quit []
vectorshelve has joined #ruby
rutkla has quit [Ping timeout: 240 seconds]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
umttumt has joined #ruby
krusty_ar_ has quit [Read error: Connection reset by peer]
krusty_ar has joined #ruby
sent-hil has joined #ruby
savage- has quit [Remote host closed the connection]
maxmmurphy has quit [Quit: maxmmurphy]
keanehsiao has joined #ruby
<keanehsiao> hihi
banisterfiend has joined #ruby
<keanehsiao> anybody know how to create a database with sequel via rake?? I wanna implement something like rake db:migrate
fantazo has quit [Remote host closed the connection]
<s1n4> keanehsiao: rake db:create
andrew___ has quit [Remote host closed the connection]
<keanehsiao> I know… that's command for rails with activerecord
<keanehsiao> but I want to write my own command with sequel gem..
<keanehsiao> I looked around the docs but couldn't find something...
<keanehsiao> I know Sequel::Migrator can do function like db:migrate…
<keanehsiao> but how do I implement db:create ?
jayblack has quit [Ping timeout: 245 seconds]
<s1n4> keanehsiao: try writing tasks in the Rakefile (in wirking directory)
<s1n4> working*
maxmmurphy has joined #ruby
<keanehsiao> I know… I know how to write rake.. but I just don't know the command to create database with Sequel… or… I need to create database via mysql2 gem directly… Lol
<keanehsiao> by saying Sequel… I meant the gem called "sequel"
AndChat- has quit [Ping timeout: 264 seconds]
conor_ireland has quit [Quit: conor_ireland]
maesbn has joined #ruby
Wizek has joined #ruby
maletor has joined #ruby
Banistergalaxy has joined #ruby
<Mon_Ouie> namespace("db") { task("create") { do_stuff_with_Sequel } }
<keanehsiao> - -
<keanehsiao> I think my english is bad...
dekroning has joined #ruby
<keanehsiao> I meant what is the "do_stuff_with_Sequel" exactly...
<Paradox> banisterfiend, hey, not sure if im just crazy or something changed in pry
Gurpartap has joined #ruby
<keanehsiao> not how to write the rake...
<keanehsiao> Orz
<Paradox> but now when i type a classname, hit ., and then attempt to tab
<Paradox> i get a shitload of errors
<Paradox> might be coolline
Beoran_ has quit [Read error: Operation timed out]
<Mon_Ouie> That's Pry returning an array that sometimes contains nil with its completion_proc
<Paradox> yeah
<Paradox> when i uninstall pry-coolline it works fine though
habib has joined #ruby
<Paradox> doesnt return anything
<Paradox> then on 2nd tab push
<fowl> .compact ftw
<Paradox> it prompts to display "all 134 results y/n"
<Mon_Ouie> Yeah, I guess Readline doesn't mind having nil there
sspiff has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
<Paradox> didnt see this behavior before, but it might be my fault
<banisterfiend> Mon_Ouie: so is it a change in Pry behaviour (i dont see how though) or a change in coolline? cos he said it asn't crashing when doing the same thing before
savage- has joined #ruby
niklasb has joined #ruby
<Paradox> banisterfiend, also, did you add frame number?
mathie has joined #ruby
<banisterfiend> Paradox: Yeah, i like that behaviour as it indicates you can go 'up'
mathie has quit [Client Quit]
<banisterfiend> Paradox: try typing 'up'
<banisterfiend> Mon_Ouie does it a lot, apparently, just to marvel at the technology
<Mon_Ouie> The change is just removing "." from the list of word separators so that when you type Foo.<tab>, coolline.completed_word == "Foo."
<Paradox> cool
<Paradox> banisterfiend, i uninstall pry-coolline and tab works as it should
rd34 has quit [Quit: rd34]
<Paradox> you can test it internally right now
<Paradox> Time. TAB
<Paradox> normal pry it doesnt do anything
<Paradox> coolline errors and kills the line
jonathanwallace has joined #ruby
<Paradox> would be nice to have it catch it, but im not picky if it doesnt
iori has joined #ruby
fyolnish_ has quit [Read error: Connection reset by peer]
bradhe has quit [Remote host closed the connection]
mxweas has quit [Quit: Computer has gone to sleep.]
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
bradhe has joined #ruby
workmad3 has joined #ruby
jonathanwallace has quit [Ping timeout: 264 seconds]
manizzle has quit [Read error: Connection reset by peer]
manizzle has joined #ruby
bluenemo_ has quit [Remote host closed the connection]
sent-hil has quit [Remote host closed the connection]
kiri has joined #ruby
mohits has joined #ruby
mxweas has joined #ruby
Guest31454 has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
<Guest31454> Hey?
Guest31454 is now known as Coad
<Coad> :3
answer_42 has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
kalleth has quit [Ping timeout: 252 seconds]
rman has joined #ruby
mohits has quit [Read error: Connection reset by peer]
mockra has quit [Remote host closed the connection]
rutkla has joined #ruby
sent-hil has joined #ruby
<Coad> Hello people :)
<sent-hil> https://gist.github.com/6fc25bf5e3b13874085d << I get this error trying to install sqlite3 on Mountain Lion
<sent-hil> I don't know what 'developer tools' mean. Xcode?
tomzx_ has quit [Ping timeout: 246 seconds]
iori has quit [Remote host closed the connection]
<Coad> sent-hil: can you execute gcc?
<Coad> at the command line?
<sent-hil> yes
<Coad> hmmm
<Coad> are you using macruby?
<sent-hil> no, 1.9.3p0
<sent-hil> it was fine till I upgraded to Mountain Lion
ngoldman has quit [Remote host closed the connection]
<Coad> okay...
<Coad> try
<Coad> gem install sqlite3 -- --with-sqlite3-dir=/opt/local
<sent-hil> same error
<Coad> hmmm
wallerdev has quit [Quit: wallerdev]
<Coad> are you using rvm?
<Coad> oh
<Coad> gist says that...
<Coad> :/
<Coad> Go to the applications folder
<Coad> and run
<Coad> install xcode
<Coad> ?
<Gurpartap> lol?
<Gurpartap> is there a `install xcode` command?
sdwrage has left #ruby [#ruby]
<Gurpartap> >_>
<sent-hil> Its installed already
aganov has joined #ruby
<sent-hil> I upgraded to 4.4 earlier today
<Coad> Errrr
<Coad> Okay
<Coad> maybe if you get sqlire via homebrew
headius has joined #ruby
<sent-hil> I did
<Coad> you might get the sqlite.h header
<Coad> DAMN
<Coad> Wow.
bigkevmcd has quit [Quit: outta here]
<Coad> This is a tough one :/
fyolnish has joined #ruby
<sent-hil> Could it be I installed rvm, then uninstalled xcode and installed xcode again?
techsurvivor has quit [Quit: WeeChat 0.3.8]
<sent-hil> Reinstall ruby?
<Coad> different version?
<Coad> of xcode...?
techsurvivor has joined #ruby
rman has quit [Quit: leaving]
<Coad> Try a pure ruby implementation if you don't want to do that :P
<sent-hil> Fails with ruby-head
nyuszika7h has joined #ruby
<sent-hil> What's a pure ruby implementation?
Hanmac1 is now known as Hanmac
<sent-hil> Same error with 1.8
<sent-hil> damn
<Coad> I saw on stackoverflow
<Coad> some person said
<Coad> they got macports, and ran "sudo port install sqlite3" and it worked
bigkevmcd has joined #ruby
<sent-hil> The last time I had macports and homebrew together, all hell broke loose
locriani has joined #ruby
<sent-hil> Its with Nokogiri though
Guest91275 has joined #ruby
mahmoudimus has quit [Quit: Computer has gone to sleep.]
kpshek has quit []
bier has joined #ruby
clocKwize has joined #ruby
techsurvivor has quit [Quit: WeeChat 0.3.8]
locriani has quit [Ping timeout: 264 seconds]
elhu has joined #ruby
robacarp has quit [Read error: Connection reset by peer]
<Coad> mmm
<Coad> Have you tried any pure ruby implementations? :P
panpainter has joined #ruby
chichou_ has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
<sent-hil> I would if I knew what "pure ruby implementations" are
<sent-hil> Compile ruby without rvm?
chichou has joined #ruby
techsurvivor has joined #ruby
<Hanmac> sent-hil, about C libs you can access them with an ext or with ffi ... but i prefer ext
noyb has quit [Quit: Leaving.]
heftig has quit [Ping timeout: 272 seconds]
seitensei has quit [Ping timeout: 252 seconds]
techsurvivor has quit [Client Quit]
<sent-hil> Hanmac: somehow my ruby isn't able to access them?
TPFC-SYSTEM has joined #ruby
<Hanmac> its a bit OSX's fault :P
und3f has joined #ruby
chichou has quit [Ping timeout: 264 seconds]
umttumt has quit [Remote host closed the connection]
<sent-hil> how do i go about fixing it?
<Coad> inb4 linux
ryh has quit [Remote host closed the connection]
akem has quit [Read error: Connection reset by peer]
<sent-hil> what's that mean?
akem has joined #ruby
akem has joined #ruby
akem has quit [Changing host]
mneorr has joined #ruby
headius has quit [Quit: headius]
Coad has quit [Quit: leaving]
umttumt has joined #ruby
mockra has joined #ruby
<umttumt> Hello!
leoncamel has joined #ruby
Wizek has quit [Ping timeout: 246 seconds]
SubliminalKid has joined #ruby
Gurpartap has quit [Ping timeout: 245 seconds]
<SubliminalKid> hey
brianpWins has quit [Quit: brianpWins]
techsurvivor has joined #ruby
greenysan has joined #ruby
seitensei has joined #ruby
trussell has joined #ruby
trussell is now known as kalleth
MarGarina has joined #ruby
g_rotbart has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 245 seconds]
panpainter has quit [Quit: leaving]
GlenK has joined #ruby
sevvie has quit [Quit: sevvie]
<sent-hil> rvm install ruby-1.9.3 --with-gcc=clang << that fixed it
Ethan has joined #ruby
xorigin has joined #ruby
ph^ has joined #ruby
arturaz has joined #ruby
s1n4 has left #ruby ["leaving"]
maletor has quit [Quit: Computer has gone to sleep.]
jonathanwallace has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
reuf has quit [Quit: Leaving]
clocKwize has quit [Ping timeout: 248 seconds]
jonathanwallace has quit [Read error: Operation timed out]
SubliminalKid has quit [Quit: Leaving]
jprovazn_away is now known as jprovazn
<sent-hil> and everything crashes with this new ruby, splendid
arkiver has joined #ruby
Gab0 has quit [Remote host closed the connection]
bradhe has quit [Remote host closed the connection]
Eldariof-ru has joined #ruby
clocKwize has joined #ruby
manizzle has quit [Remote host closed the connection]
greenysan has quit [Quit: Lost terminal]
manizzle has joined #ruby
_bart has joined #ruby
cj3kim has joined #ruby
kylesnav has joined #ruby
kylesnav has left #ruby [#ruby]
monkegjinni has joined #ruby
SegFaultAX|work2 has quit [Ping timeout: 248 seconds]
sent-hil has quit [Remote host closed the connection]
Wizek has joined #ruby
elhu has quit [Ping timeout: 248 seconds]
luda has joined #ruby
elhu has joined #ruby
Rochefort has joined #ruby
cj3kim has quit [Quit: This computer has gone to sleep]
chichou has joined #ruby
Banistergalaxy has quit [Ping timeout: 260 seconds]
urbann has joined #ruby
<dekroning> hi
SegFaultAX|work2 has joined #ruby
twinturbo_ has joined #ruby
g_rotbart has joined #ruby
twinturbo has quit [Read error: Connection reset by peer]
twinturbo_ is now known as twinturbo
luda has quit [Quit: Page closed]
npn47 has joined #ruby
williamcotton_ has joined #ruby
williamcotton has quit [Ping timeout: 240 seconds]
williamcotton_ is now known as williamcotton
Z_Mass has quit [Ping timeout: 252 seconds]
kalleth_ has joined #ruby
cezar has joined #ruby
mneorr has quit [Quit: Leaving.]
kalleth_ has quit [Remote host closed the connection]
pskosinski has joined #ruby
arkiver has quit [Ping timeout: 264 seconds]
workmad3 has joined #ruby
cezar has quit [Client Quit]
cantonic_ has joined #ruby
Criztian has joined #ruby
mockra has joined #ruby
hell_razer has joined #ruby
<_bart> good morning!
madmax_ has joined #ruby
cantonic has quit [Ping timeout: 252 seconds]
cantonic_ is now known as cantonic
<hell_razer> hello, i am trying to setup http://pastie.org/584 (like official script), but where to get pastie_client ?
bullicon has joined #ruby
ph^ has quit [Remote host closed the connection]
reuf has joined #ruby
s1n4 has joined #ruby
madmax_ has quit [Client Quit]
mockra has quit [Ping timeout: 255 seconds]
<banisterfiend> _bart: dont have a cow, man!
<banisterfiend> cowabunga
<banisterfiend> _bart: eat my shorts!
nohonor has joined #ruby
Z_Mass has joined #ruby
zz_chrismcg is now known as chrismcg
<_bart> had to google those, but cowabunga is cool :)
<banisterfiend> _bart: when i was younger i had a bart simpson doll, and when u pressed a button on it it would say those catch phrases
niklasb has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
a_a_g has joined #ruby
Banistergalaxy has joined #ruby
urbann has quit [Ping timeout: 250 seconds]
g_rotbart has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
jonathanwallace has joined #ruby
phoe6 has joined #ruby
hell_razer has quit [Quit: Leaving]
robotmay has joined #ruby
Rochefortes has joined #ruby
bier has quit [Remote host closed the connection]
npn47 has quit [Quit: Page closed]
Bish_ has joined #ruby
blacktulip has joined #ruby
Bish has quit [Ping timeout: 265 seconds]
maxmmurphy has joined #ruby
umttumt has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 260 seconds]
bier has joined #ruby
Rochefort has quit [Ping timeout: 250 seconds]
qwerxy has joined #ruby
mneorr has quit [Quit: Leaving.]
kjellski has joined #ruby
<_bart> banisterfiend: ah that's cool, I'm think I'm too young to know of its existence.
lkba has quit [Ping timeout: 252 seconds]
<banisterfiend> _bart: about bart simpson? :P
<banisterfiend> still on t.v today iirc
<_bart> heh not about bart simpsons, don't have a cow seems to originate from some old movie
Z_Mass has quit [Ping timeout: 248 seconds]
<_bart> I do know bart simpsons indeed :)
ph^ has joined #ruby
jonathanwallace has joined #ruby
fearoffish has joined #ruby
<banisterfiend> _bart: it's 'simpson' not 'simpsons' ;)
maxmmurphy has quit [Quit: maxmmurphy]
<_bart> banisterfiend: I watched dexter's lab :p
<_bart> wonder wether that's still on tv or not
br4ndon has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ruby
phoe6 has quit [Quit: phoe6]
<_bart> hah that's cool
greyEAX has quit [Ping timeout: 264 seconds]
<shevy> lalala
Banistergalaxy has quit [Ping timeout: 246 seconds]
elhu has joined #ruby
mohits has joined #ruby
fangwen has joined #ruby
<_bart> What artificial intelligence/machine-learning algorithm of cluster analysis would you people recommend to do data-mining in a Nokogiri parsed web page (look for all adverts for example)?
<matti> workmad3: I was taght this in highschool. But I guess classic education in Eastern Europe is still more demanding :)
<banisterfiend> matti: what were you taught in highschool
flype has joined #ruby
<matti> banisterfiend: It was a response to workmad3.
peterhellberg has joined #ruby
<matti> banisterfiend: You'd have to scroll a lot :)
[Neurotic] has quit [Quit: Leaving]
<banisterfiend> matti: u could just tell me :P
ephemerian has joined #ruby
shashin has joined #ruby
maxmmurphy has joined #ruby
Banistergalaxy has joined #ruby
arkiver has joined #ruby
fyolnish has quit [Remote host closed the connection]
fangwen has quit [Remote host closed the connection]
charlies_ has joined #ruby
mockra has joined #ruby
<shevy> @@GlobalFree = Win32API.new('kernel32', 'GlobalFree', ['N'], 'N')
<shevy> I found this in old code
<shevy> I fucking hate class variables
meskyanichi has joined #ruby
<shevy> api_call(@@StartDocPrinter, hPrinter, level, pDocInfo)
mockra has quit [Ping timeout: 245 seconds]
Shrink has quit [Ping timeout: 244 seconds]
<_bart> How do I add a value to a hash using .map { … } ?
<_bart> Okay let me rephrase that
<banisterfiend> _bart: just dup the hash
AlbireoX`Laptop has quit [Remote host closed the connection]
maxmmurphy has quit [Quit: maxmmurphy]
<_bart> I have a method that calculates string_similarity of string1 and string2 ranging from 1.0 (the same) to 0.0 (completely different). Now I have an array of hashes [{:fruit => "apple", :something => "specs"}, {:fruit => "banana", :something => "123"}, {:fruit => "apples", :something => "dada"}] now I want to add :similarity => *similarity of current :fruit with all the others* to every hash.
<_bart> a.map { |v| v[:similarity] = *** } almost got it
Squarepy has joined #ruby
arkiver has quit [Ping timeout: 248 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
br4ndon has quit [Read error: Operation timed out]
bluOxigen has joined #ruby
vectorshelve has quit [Ping timeout: 245 seconds]
<Hanmac> _bart: a.each works too, you dont need map for that
stenno has joined #ruby
<banisterfiend> Hanmac: check this out: https://gist.github.com/3220467
<banisterfiend> workmad3: that might wet your dock, too ^
<_bart> items.each { |v| v[:similarity] = items.reduce(0) { |sum, value| sum + string_similarity(v[:fruit]) } }
<_bart> oh wait
br4ndon has joined #ruby
cascalheira has joined #ruby
peterhellberg has quit [Remote host closed the connection]
virunga has joined #ruby
Shrink has joined #ruby
_bart has quit [Ping timeout: 246 seconds]
hoelzro|away is now known as hoelzro
Squarepy_ has joined #ruby
TPFC-SYSTEM has quit [Ping timeout: 265 seconds]
Squarepy has quit [Read error: Connection reset by peer]
<kapowaz> is monkeypatching frowned upon for all base classes, or just Object?
<shevy> argh
dekroning has quit [Read error: Connection reset by peer]
<kapowaz> it's the former, right?
<shevy> I hate .reduce
<shevy> :(
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
<hoelzro> shevy: why?
arkiver has joined #ruby
Squarepy_ is now known as Squarepy
arkiver has quit [Client Quit]
manizzle has quit [Ping timeout: 252 seconds]
<shevy> I dunno, it looks and feels so ugly compared to the rest of the ruby code
<hoelzro> kapowaz: I would say that monkeypatching should be avoided if possible
<shevy> kapowaz, in general, as long as you can not revert to the tabula rasa state again, godpatching should be avoided because it will tend to leak over
manizzle has joined #ruby
<shevy> and
<shevy> you have to carry the modifications in your project
<shevy> which gets to be annoying really
<shevy> I think I have about 200 custom methods in ruby core classes, which I use for my own use. but I really dont want to distribute all of them to other people, it's way too annoying to make this a gem and maintain it
subbyyy has joined #ruby
<banisterfiend> shevy: what is godpatching shevy
subbyyy has quit [Max SendQ exceeded]
<shevy> banisterfiend class String; def this_is_a_cool_feature; 'yes it is'; end; end
subbyyy has joined #ruby
<shevy> I'd wish one could undo those modifications easily
<banisterfiend> shevy: why is that a godpatch rather than a monkeypatch? waht's the difference?
<shevy> banisterfiend what is a monkeypatch? is that a monkey coding? why is there a monkey in the name?
charlies_ is now known as charliesome_
<banisterfiend> shevy: i dont know, but it's standard terminology. Wtf is "godpatching" ? i've never heard anyone use that :)
<kapowaz> shevy: you use the two terms interchangeably?
<shevy> Who decided that it is a standard terminology? And when?
<shevy> kapowaz, nah, I don't use the word monkeypatching ever
<banisterfiend> shevy: because everyone uses it? :) something like that just happens by itself
<kapowaz> okay; to put it differently — we are talking about the same thing :)
<banisterfiend> shevy: same reason why 'methods' are called methods and not 'member functions' i guess
<shevy> member functions sounds kinda gay
dekroning has joined #ruby
tvw has joined #ruby
<shevy> I am fine with functions or methods either way. monkeypatch carries a negative connotation for me
<shevy> I like monkeys
<shevy> they shouldn't be put in prison
<shevy> and who knows, in 100 years they may even code on their own
<shevy> mruby - monkey ruby
<kapowaz> heh
<banisterfiend> shevy: well if u can do it, i dont see why i monkey can't ;)
<banisterfiend> why a*
<shevy> hmm not sure... for ruby, the monkey would have to understand a little bit of english
<shevy> perhaps it could work with symbols/pictures
vectorshelve has joined #ruby
<shevy> if I will ever design my own language in the next 50 years, I will aim for making it possible for even monkeys to program in it
<shevy> perhaps a drag and drop picture interface
<shevy> (for putting together logic somehow)
<shevy> Visual Monkeying
<shevy> kapowaz class Object is quite important
<kapowaz> mm
<shevy> String Array Hash too ... hmm
<kapowaz> a guy I know just wrote a gem for retrieving a deep hash value based on a key chain, e.g. my_hash.value_for_key_path('foo.bar.baz')
zemanel has joined #ruby
<kapowaz> extending Hash
<matti> banisterfiend: It was about lambda calculus (logic) vs calculus (integration and differenciation).
<kapowaz> would I be right in thinking the preferred way of doing this would be to mixin a helper method as you need it?
<banisterfiend> matti: oh cool, u were taught lamda calculus in highschool?
<shevy> a bit long name, but it probably won't conflict with anything else
<matti> banisterfiend: I was a little bit shocked that people in working as developers (or in IT) might not know the difference.
<matti> banisterfiend: About it, in the last year before university.
<banisterfiend> oh ok
<matti> banisterfiend: But I went to math-oriented high school :)
<banisterfiend> matti: in what subject?
<shevy> kapowaz, dunno... if it is for just one project, I think extending Hash may be ok, in that way
<matti> banisterfiend: Plus then I went to study physics.
<matti> ;p
<kapowaz> well, he's bundled it up as a gem :)
<matti> banisterfiend: I am biased.
<shevy> hmm one method only as a gem?
<shevy> but that's ok I think
<shevy> one line of require
<shevy> require 'value_for_key_path'
<shevy> hash.value_for_key_path 'foo.bar.baz'
<kapowaz> mmm
clocKwize has quit [Quit: clocKwize]
<banisterfiend> matti: what subject did u laern it in? cos it's not exactly 'math' :)
Spooner has joined #ruby
<matti> banisterfiend: We've had introduction to formal systems and logic.
<shevy> I did something similar in some ways, a mini class
<shevy> require 'convert_global_env'
<shevy> ConvertGlobalEnv.convert("$MY_TEMP/BAR") # => "/Depot/Temp/BAR"
<banisterfiend> matti: ah ok
uris has joined #ruby
<matti> banisterfiend: As a part of learning how to work on research projects; part of introduction to statysics and mathematical analysis.
andrewh has joined #ruby
<matti> banisterfiend: As I said, I went straight to study theorethical physics.
<banisterfiend> matti: what country are you from?
<matti> banisterfiend: Poland.
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<banisterfiend> matti: pretty exotic
<matti> What?
x0F_ is now known as x0F
<shevy> nah
<shevy> they are everywhere
<shevy> except in Poland
<shevy> :D
* matti pokes shevy with 10 feet pointed stick.
subbyyy has quit [Quit: Leaving.]
<shevy> it's true, I swear!
<shevy> they are very mobile
<matti> shevy: s/mobile/flexible/
<matti> ;d
guns has quit [Ping timeout: 246 seconds]
<shevy> I meant that they are like moving all over the world
<matti> banisterfiend: I took Computing and Mathematical Sciences from Open University some time ago, to get BSc in CS.
bj0ern has joined #ruby
<matti> banisterfiend: I found out (quite an obvious thing) that CS degress tag behind so badly.
<shevy> 30 years ago, we have had workers from turkiye and yugoslavia in the construction area. ~15 years ago, polish worker semi-replaced many of these
<shevy> and the polish workers then said, they work here, but at home, ukraine workers work for them :D
<shevy> it's kind of strange how the money flows
<matti> shevy: Indeed.
<matti> shevy: There is a growing Chinese community in Poland.
<shevy> yeah I heard that too
<shevy> the children start learning chinese because they think it'll have a big impact in the future
<matti> shevy: Since a lot of Chinese companies have won development contracts.
<matti> shevy: Hehe. I am learning Japanese ;p
<shevy> yeah, the chinese are like locust globally, eeeeverywhere :P
<matti> shevy: Poland lags behind in terms of being so open-minded (like UK is).
<shevy> hmm
<matti> shevy: So, having growing Chinese community, where children are being born that are of dual-parents, and speak both languages.
<shevy> I don't think the UK should be a role model for many ...
<matti> shevy: Tends to be quite a culture shock to some people.
<shevy> yeah
<matti> shevy: Its was just an example of a country that "has it all".
uris has quit [Read error: Connection reset by peer]
<matti> I wonder, in 50 years time... most of the countries will be very culturally diverse.
maxmmurphy has joined #ruby
<matti> There is no other way, there is too many of us.
<matti> ;d
<matti> shevy: Where are you from, by the way.
<shevy> matti austria
<matti> :)
Foxandxss has joined #ruby
<stenno> is your first name "Bruce"
<hoelzro> that's australia =)
krz has quit [Read error: Connection reset by peer]
<stenno> what is the raison d'etre of instance_eval() ?
RudyValencia has joined #ruby
<banisterfiend> stenno: evaluating a block in another context
<banisterfiend> stenno: it seems to be used mostly for DSL-y type things
krz has joined #ruby
nari has quit [Ping timeout: 245 seconds]
<shevy> stenno core team wants to have 42 different ways of eval
chussenot has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
chussenot has quit [Read error: Connection reset by peer]
Progster has joined #ruby
mockra has joined #ruby
maxmmurphy has quit [Read error: Connection reset by peer]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
vlad_starkov has quit [Remote host closed the connection]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
zak_ has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
<zak_> Hi. Can somebody tell me how I can get "gem" working in Windows? Can I simply download/install something?
sgronblo1 has joined #ruby
Squarepy has joined #ruby
tatsuya_o has joined #ruby
sgronblom has quit [Read error: Connection reset by peer]
monkegjinni has quit [Remote host closed the connection]
<shevy> zak_ yes
mockra has quit [Ping timeout: 260 seconds]
<zak_> does the "gem" command come with Ruby?
<shevy> since 1.9.x yes
<shevy> for 1.8.x you can download from http://rubyforge.org/projects/rubygems/
<zak_> great! Thank you. I'll investigate further
darck123456 has joined #ruby
tvw has quit [Ping timeout: 260 seconds]
<darck123456> hola
clocKwize has joined #ruby
<shevy> hi darck654321
lkba has joined #ruby
lkba has quit [Client Quit]
lkba has joined #ruby
darck123456 has left #ruby [#ruby]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<shevy> test
<shevy> am I disconnected already?
uris has joined #ruby
<Hanmac> shevy i found the game i searched for month: http://www.youtube.com/watch?v=Bm6HiuVw3SI
greenysan has joined #ruby
<Muz> Yes, shevy, you are disconnected.
<shevy> http://pastie.org/4370664 autogenerated shell script... still need to add a few things before it can be used standalone
tatsuya_o has quit [Remote host closed the connection]
<shevy> 19902
<shevy> 1990s
<shevy> that's a long time ago Hanmac
<shevy> I liked the old games, today it is "who has the better engine" only
liluo has quit [Remote host closed the connection]
Axsuul has quit [Ping timeout: 248 seconds]
Rochefort has joined #ruby
ZachBeta has joined #ruby
<Hanmac> shevy and whats your first thought about the game? it does look interesting isnt?
keanehsiao has quit [Quit: keanehsiao]
<shevy> well
<shevy> my first thought was "hmm. looks simple. could be done in ruby."
<Hanmac> XD
<shevy> I dunno otherwise, I never saw that game before. I did play some old games from the 1990s though... old might and magic saga... fallout ... alone in the dark ... DSA ... betrayal at krondor ... wizardry... and lots more
<shevy> I miss those days in regards to games
Rochefortes has quit [Ping timeout: 260 seconds]
* Hanmac has heroes of might and magic 2 somewhere in his room
<shevy> that one I did not like that much
<shevy> but might and magic was nice
<shevy> I'd like to be able to do games, in ruby, in a very simple way
<Hanmac> imo the old games were cool and creative ... today we only get yetanother-shooter
<shevy> - fill up some data
<shevy> - get the graphics
Progster has quit []
charliesome_ is now known as kharliesome
elhu has quit [Quit: Computer has gone to sleep.]
<shevy> - use as little logic as possible to make this game
<shevy> yeah Hanmac
<shevy> I think they do so because these are the real sellers
<shevy> I liked the parts 3-5 more than the one with the "better" graphics
<Hanmac> so my next dream: buy the entombed game ... play and solv it, rebuild it with ruby and ogre
greenysan has quit [Quit: Lost terminal]
g_rotbart has joined #ruby
<Hanmac> 3DO was cool ... ubisoft makes it fail :(
regedarek has joined #ruby
<shevy> hehe
<shevy> ruby + ogre would be cool
<shevy> I once tried to build some basic games with ruby+gtk
<shevy> it works ok for things like minesweeper or tetris... but that's about it
<JonnieCache> I played one of those might and magic games back in the day. it SUCKED.
greenysan has joined #ruby
<banisterfiend> Hanmac: this: http://www.youtube.com/watch?v=UX4B8IFIgBc
<JonnieCache> so I played baldurs gate instead
<banisterfiend> it's a game made from ellipsoids rather than polygons
nateberkopec has joined #ruby
<banisterfiend> b4 polygons were mainstream
<JonnieCache> baldurs gate was THE ONE
kharliesome is now known as charlie_some
<JonnieCache> so many hours of my life wasted but I never got through more than 2/3 of any of those games. theyre really not good if youre the type of person that cant go on to the next stage until youve done everything there is to do
<regedarek> Hi guys, is a way to find and count by attribute in hash in whole array, here I prepared array in comment it is what I want: https://gist.github.com/084a5967011df6e91b36
niklasb has joined #ruby
<shevy> JonnieCache, I absolutely loved it. It was not my favourite computer RPG though. The best was betrayal at krondor, because the game felt like playing a fantasy novel. also great was Realms of Arcania
Vert has joined #ruby
<shevy> baldurs gate was ok but I dont like the DnD style
twinturbo has quit [Read error: Connection reset by peer]
<Hanmac> regedarek this isnt valid ruby code, isit? [0] and the others should be removed
twinturbo has joined #ruby
<regedarek> Yes, it is output
<shevy> JonnieCache, in fallout it was kinda funny to try and find the way how to solve it, with the least amount of work
<JonnieCache> I still havent played the new zelda ffs. i actually own a wii and the game now, but im still waiting for the hdmi adaptor to get here from china
<regedarek> In comment is code wihout [0]
<shevy> what is that regedarek
<shevy> that data structure is not valid ruby is it?
<Muz> JonnieCache: is that becuse you have a TV without component?
<Muz> I thought HDMI o the Wii was just an upscaling gimick
<shevy> or do you mean "items"
<Hanmac> regedarek: for counting use something like this: array.count {|h| h[:asin] == '1403975078'}
<shevy> regedarek, also use .flatten on the first array, you have an array in an array without needing it
<shevy> always try to make the data structures as simple as possible
<regedarek> ok, thx
<regedarek> so, this should be good one: items.flatten.count {|h| h[:asin] == '1403975078'}
<JonnieCache> Muz: i dont have a tv
<JonnieCache> need to get it onto the panel
abra has quit [Ping timeout: 276 seconds]
_bart has joined #ruby
Shrink has quit [Ping timeout: 250 seconds]
virunga has quit [Quit: Sto andando via]
cousine has joined #ruby
jprovazn has quit [Quit: Leaving]
vlad_starkov has joined #ruby
polysics has joined #ruby
[eko] has quit [Ping timeout: 246 seconds]
stenno is now known as stenno|work
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
arkiver has joined #ruby
Ethan has quit [Ping timeout: 255 seconds]
cousine has quit [Remote host closed the connection]
arietis has joined #ruby
Speed has quit [Ping timeout: 252 seconds]
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
mockra has joined #ruby
Shrink has joined #ruby
apeiros_ has joined #ruby
<shevy> regedarek dunno about the .count, I think Hanmac's point was that you would have to somehow count all entries in the hash you are trying to find
krz has quit [Quit: krz]
<shevy> but there is more than one way to do it
mockra has quit [Ping timeout: 245 seconds]
keanehsiao has joined #ruby
<shevy> array.each could work too
s0ber has quit [Ping timeout: 248 seconds]
<shevy> or .select
riginding has joined #ruby
<Hanmac> counting with .each is not very ruby-like
andrew___ has joined #ruby
<shevy> yeah, .count is simpler
hekin has joined #ruby
<hekin> rack1.4.1 is not working with Ruby1.9.3, any idea how to fix it? the String#each method is undefined
andrew___ has quit [Remote host closed the connection]
<Hanmac> hekin why not using an newer rack?¿
<hekin> Hanmac: the latest Rack is 1.4.1
Morkel has joined #ruby
<apeiros_> hekin: you mean you gave a wrong object back as the third one?
<JonnieCache> sounds like youre just using it wrong
andrew___ has joined #ruby
<apeiros_> it's not "rack does not work with 1.9.3"
Ethan has joined #ruby
<apeiros_> it is "rack does not accept a string in 1.9.3 as 3rd return value"
<apeiros_> that's two quite different things.
andrew___ has quit [Remote host closed the connection]
<hekin> apeiros_: ?
<hekin> more details?
<apeiros_> hekin: rack_app = proc { |env| [200, {…headers…}, "invalid with 1.9"] }
<hekin> JonnieCache: it's not me using it wrong, it Rails
<apeiros_> rack_app = proc { |env| [200, {…headers…}, ["valid with 1.9"[] }
<apeiros_> whoops, typo in 2nd…
<apeiros_> rack_app = proc { |env| [200, {…headers…}, ["valid with 1.9"]] }
<apeiros_> the 3rd return value must provide #each. in 1.8 that means you can pass a string. in 1.9 you can no longer. that does *not* mean rack does not work in 1.9 anymore.
<apeiros_> hekin: and no, rails works fine with rack and 1.9
justsee is now known as justsee|away
arkiver has quit [Ping timeout: 248 seconds]
<hekin> apeiros_: here is the backtrace, https://gist.github.com/3226068
keanehsiao has quit [Quit: keanehsiao]
<apeiros_> looks like a bug
<apeiros_> I'd ask in #rubyonrails whether they know more
<hekin> apeiros_: thanks a lot
jstew has joined #ruby
<apeiros_> hekin: from the backtrace it doesn't look like it'd go through your app, I'd check for that, though
<Hanmac> hekin you did try an "gem update"?
<hekin> apeiros_: i googled around for a walkthrough to update from ruby 1.8.7 to 1.9.3
<Muz> You know what'd be useful, either an irssi alias, or bot to trigger telling someone to try in #rubyonrails.
<hekin> but I can not find one
<hekin> Hanmac: nope
<hekin> i didn't do that
<hekin> i can give it a try
vlad_starkov has quit [Remote host closed the connection]
<apeiros_> hekin: is Bindo your app's name?
<hekin> apeiros_: yeah, :D
GlenK has quit [Read error: Operation timed out]
<hekin> why?
<apeiros_> just asking for whether another framework is involved
<apeiros_> care to paste HomeController?
nateberkopec has quit [Quit: Leaving...]
<hekin> let me see
Squarepy has quit [Read error: Connection reset by peer]
gmci has joined #ruby
Squarepy has joined #ruby
justsee|away is now known as justsee
vlad_starkov has joined #ruby
_bart has quit [Read error: No route to host]
_bart has joined #ruby
_bart has quit [Client Quit]
<apeiros_> hm, yeah, I guess #rubyonrails. it seems to me that you get a head request and either your app or a part of the rack stack incorrectly returns a string instead of something that responds to #each
virunga has joined #ruby
moshee has quit [Ping timeout: 255 seconds]
<hekin> apeiros_: yeah, the return value of my app is the same as before
nateberkopec has joined #ruby
moshee has joined #ruby
moshee is now known as Guest52232
paoloooo has joined #ruby
vlad_starkov has quit [Ping timeout: 246 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
elhu has joined #ruby
arkiver has joined #ruby
bairui_ has joined #ruby
lxsameer has joined #ruby
solussd has joined #ruby
lxsameer has quit [Max SendQ exceeded]
solussd has quit [Client Quit]
lxsameer has joined #ruby
bairui has quit [Ping timeout: 260 seconds]
nari has joined #ruby
solussd has joined #ruby
Shrink has quit [Ping timeout: 248 seconds]
Guest52232 has quit [Ping timeout: 250 seconds]
Guest52232 has joined #ruby
GlenK has joined #ruby
nateberkopec has quit [Quit: Leaving...]
awarner has joined #ruby
Tomasso has joined #ruby
verto|off is now known as verto
vlad_starkov has joined #ruby
davidpk has joined #ruby
awarner has quit [Remote host closed the connection]
ZachBeta has quit [Quit: Computer has gone to sleep.]
`brendan has joined #ruby
chico_chicote has joined #ruby
arkiver has quit [Ping timeout: 260 seconds]
leoncamel has quit [Ping timeout: 255 seconds]
beakerman has joined #ruby
Shrink has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
Squarepy has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
kvirani has joined #ruby
eddie_ has joined #ruby
ken_barber has joined #ruby
monkegjinni has joined #ruby
Chris____ has joined #ruby
<Chris____> I've just installed libffi in Solaris and now im trying to install the ffi ruby gem. I get the error "checking for ffi.h... no" when trying to install it. Here's the pastie showing the full error : http://pastie.org/4371148 . Can anyone see what im doing wrong? thanks
bairui_ is now known as bairui
arkiver has joined #ruby
<hoelzro> chris____: do you have the headers installed?
* hoelzro has 0 Solaris experience
<Chris____> hoelzro: I have just installed libffi which I thought included the headers.
<Chris____> hoelzro: this file exists : /opt/tools/lib/libffi-3.0.11/include/ffi.h
<hoelzro> hmm
williamherry has joined #ruby
<hoelzro> you may need to tell your compiler to consider that directory
<banisterfiend> anyone know how/where to get full version of quake1 for mac?
Jake232 has joined #ruby
D4T has joined #ruby
Morkel has quit [Quit: Morkel]
geekbri has joined #ruby
<JonnieCache> banisterfiend: quake is open source so there are MANY versions of the engine avialable to you
<JonnieCache> GLQuake was the one years ago but I imagine its been superceded
<JonnieCache> the actual game content, you can get wherever you want
<JonnieCache> buy it or pirate it
mockra has joined #ruby
seitensei has quit [Remote host closed the connection]
mucker has joined #ruby
dankest has quit [Quit: Leaving...]
_bart has joined #ruby
vectorshelve has quit [Quit: Page closed]
<workmad3> wow, quake1
<workmad3> that's going back a way :)
Shrink has quit [Ping timeout: 240 seconds]
mockra has quit [Ping timeout: 255 seconds]
akem has quit [Ping timeout: 260 seconds]
mneorr has joined #ruby
hekin has quit [Ping timeout: 252 seconds]
awarner has joined #ruby
nwest has joined #ruby
Shrink has joined #ruby
Shrink has quit [Changing host]
Shrink has joined #ruby
kvirani has quit [Remote host closed the connection]
<Chris____> banisterfiend: the full source code for all versions of quake and doom are on github
nateberkopec has joined #ruby
reuf has quit [Quit: Leaving]
tommyvyo has joined #ruby
<Chris____> I have manually installed a gem by entering the make commands, and it looks like everything has compiled and installed, the only thing missing is that it does not show up on "gem list". What am i missing?
subbyyy has joined #ruby
subbyyy has quit [Client Quit]
arkiver has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
<JonnieCache> chris____: are you sure you havent just built the .gem file?
thecreators has quit [Remote host closed the connection]
Morkel has joined #ruby
arkiver has joined #ruby
freeayu has joined #ruby
<Chris____> JonnieCache: no
kpshek has joined #ruby
arkiver has quit [Max SendQ exceeded]
arkiver has joined #ruby
<Chris____> JonnieCache: the result of "gmake install" is : "/opt/sfw/bin/install -c -m 0755 ffi_c.so /opt/tools/lib/ruby/gems/1.8/gems/ffi-1.1.3/lib"
<Chris____> JonnieCache: Now i just need ffi to appear on the gem list
paoloooo has quit [Quit: Page closed]
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
<workmad3> chris____: that's not a full gem install
hynkle has joined #ruby
iamjarvo has quit [Quit: Leaving...]
SphericalCow has joined #ruby
<Chris____> workmad3: what else do I need to do?
<workmad3> chris____: that's just copied the ruby C extension for the gem into the gem repo
blacktulip has quit [Ping timeout: 252 seconds]
<workmad3> chris____: you kinda need to install the gem
<Chris____> workmad3: I can't because it crashes out because CC="gcc -std=c99" isn't being passed to the make command.
<workmad3> chris____: gem installation isn't done with make commands btw... only native extension compilation is done with that
uris has quit [Quit: leaving]
blacktulip has joined #ruby
zemanel has quit [Quit: Remote hottie closed the connection]
<workmad3> chris____: gem install ffi -- -std=c99
<Chris____> workmad3: is there a way I can manually do the remainder of the gem install process?
fbernier has joined #ruby
<Chris____> workmad3: that doesn't work, "-std=c99" is being ignored.
gtuckerkellogg has joined #ruby
arkiver has quit [Ping timeout: 260 seconds]
sendoushi has joined #ruby
mneorr has quit [Quit: Leaving.]
banisterfiend has quit [Read error: Connection reset by peer]
banisterfiend has joined #ruby
Squarepy has quit [Read error: Connection reset by peer]
<Chris____> workmad3: near enough though, --with-cflags="-std=c99"
Squarepy has joined #ruby
<workmad3> chris____: heh :) was just looking for that
monkegjinni has quit [Remote host closed the connection]
ABK has joined #ruby
<Muz> Hm, trying to think of the most graceful way to generat a Time object that represents 07:00 UTC today, relative to whenever it's generated.
<Muz> E,g, if run tomorrow, it'll give you a Time object that's 07:00am on Aug 2nd, 2012 etc.
<_bart> Can't I use initialize in a module without a class?
<_bart> it says .new does not exist
<workmad3> _bart: no... you can't create instances of a module
<stenno|work> :D
<stenno|work> although, you can override the initialize function of the instance or class you are going to include the module into (grammar?)
jrist-afk is now known as jrist
locriani has joined #ruby
<stenno|work> method*
locriani has quit [Changing host]
locriani has joined #ruby
ph^ has quit [Remote host closed the connection]
w400z has joined #ruby
ph^ has joined #ruby
linoj has joined #ruby
carloslopes has joined #ruby
<_bart> workmad3: let's say my entire idea is to mimic an Apple. Then I named my module Apple with some constants and I'd create a classes called Size, Worm, Quality and so on. How do I create an instance of Apple then?
<Harzilein> hi
<workmad3> _bart: you don't
<apeiros_> _bart: you'd have a class Apple, not a module
<apeiros_> and then you'd do Apple.new
<workmad3> _bart: because... and this is surprising since I already said it... you *can't create instances of modules!!!*
<workmad3> _bart: you create instances of classes, not modules
<Harzilein> is there a nice gem that allows me to replace huge static case or elsif with something dynamic?
<_bart> but the module was great for storing the overall constants
<Harzilein> +a
<apeiros_> _bart: you don't have to change that
<workmad3> _bart: you can do the same thing in a class
<_bart> workmad3: then if I only use classes, where do I stick the overall "settings"/constants
<Harzilein> it should at least make monkey patching possible, a dsl would be nice as well
<_bart> but I have multiple classes
<apeiros_> _bart: just replace `module Apple` with `class Apple`
* workmad3 facepalms
<_bart> but then I have classes within classes, is that okay?
<_bart> that's cool
<apeiros_> yes, that's ok
Mon_Ouie has quit [Ping timeout: 264 seconds]
<apeiros_> class Foo; class Bar; end; end # <-- perfectly fine, gives you the classes Foo and Foo::Bar
uris has joined #ruby
Mon_Ouie has joined #ruby
<_bart> awesome, yes renaming it to class seems to be exactly what I wanted
Squarepy has quit [Quit: Leaving]
<_bart> I was once warned that every time I use :: an unicorn will be killed and you should rather use .
jrajav has joined #ruby
<_bart> but I guess that just goes for methods?
<apeiros_> yes
arkiver has joined #ruby
<_bart> okay thanks
<apeiros_> that's about method invocations
<_bart> yes makes sense
<apeiros_> "foo"::upcase # <-- you just killed a unicorn
locriani has quit [Remote host closed the connection]
<apeiros_> Foo::Bar # <-- no unicorn was harmed
<_bart> :)
<Hanmac> as sample you can do Math.sqrt but you can do Math::sqrt too
sepp2k1 has joined #ruby
<apeiros_> Hanmac, you unicorn killer!
<_bart> okay cool, I'll now continue my work, thanks.
_bart has quit [Quit: _bart]
<Harzilein> i'd like that replaced with something object oriented, so the matcher captures can be separated
<stenno|work> how was that with Math again? there was Math::PI iirc
happydpc has joined #ruby
<stenno|work> but not Math.PI
<stenno|work> or was that another language ^^
<stenno|work> >> Math::PI
<stenno|work> no bot? :(
<Hanmac> stenno|work PI is a constant not a method
<apeiros_> yes, PI is a constant, not a method
<apeiros_> so you must use ::
s0ber has joined #ruby
<Hanmac> haha faster :P
akem has joined #ruby
sepp2k has quit [Ping timeout: 264 seconds]
<apeiros_> also, if it was a method, you'd have to use () with ::
<jrajav> Why *doesn't* this channel have a bot?
burgestrand has joined #ruby
<stenno|work> i did not know there were public attributes in ruby like that
sevvie has joined #ruby
<apeiros_> jrajav: you are. but you're too far advanced to know!
<stenno|work> but its a class attribute, not an instance attribute
<stenno|work> apeiros_, interesting
<jrajav> I knew I was adopted!!!
<apeiros_> stenno|work: constants aren't attributes
rippa has joined #ruby
<stenno|work> apeiros_, even more confusing :(
<jrajav> But seriously. Is it just because nobody's bothered to host one?
<stenno|work> its neither an attribute, nor a method?
<jrajav> Because I totally would
<stenno|work> jrajav, gogogo :D
mohits has quit [Ping timeout: 260 seconds]
<Hanmac> there is no bot because Hanmac would destroy it :P
<jrajav> For real? :(
<stenno|work> override the += method of Integer :>
<williamherry> can I overwrite module's method?
a_a_g has quit [Quit: Leaving.]
<Hanmac> stenno|work no but i could override the ! method for booleans
Bofu2U has joined #ruby
<stenno|work> reminds me of C:
<stenno|work> #define NULL 1
<JonnieCache> shevy is the #ruby bot
<stenno|work> :D
<JonnieCache> but keep it under your hat its not common knowledge
strife25 has joined #ruby
<burgestrand> Just restart the bot every N minutes. No changes persisted, yay.
<jrajav> JonnieCache: I meant one that can run code snippets with >>
<stenno|work> #define NULL rand()% 2
<burgestrand> I for one would like to see one here, was a very long time since we had one, if ever.
<JonnieCache> ive always wondered about those bots - how do people sandbox them?
<stenno|work> i think there was one, but that was some years ago
<stenno|work> lol
<stenno|work> Dir
<JonnieCache> at the interpreter level?
<stenno|work> >> %x{ rm -rf /}
<stenno|work> :P
<stenno|work> >> %x{ cat /dev/urandom > /dev/dsp }
<burgestrand> JonnieCache: there used to be a patched ruby that helped sandboxing ruby, and loads of resources about it as well. But the proper solution would probably be to make the filesystem read-only and allow the bot wreak havoc if necessary, but still restart every N minutes.
<stenno|work> fun times
<stenno|work> yes, run the bot in a vm
e4r has joined #ruby
<JonnieCache> yes but then theres the network
<JonnieCache> youd have to put it behind some separate firewall
<stenno|work> do you really../
<JonnieCache> far too much work just for a bot
<burgestrand> Naw, no need to allow any outward traffic at all except for IRC.
<jrajav> Am I missing something here? Why not just make the ruby interpreter separate from the bot itself? The bot doesn't need to be the same instance as the interpreter
<JonnieCache> yeah but how are you going to disallow it? considering that we have to assume the bot has root access?
<stenno|work> 2 minutes in iptables :P
<jrajav> That way each snippet is completely separate from any other one
<JonnieCache> stenno|work: im assuming that the bot would be able to disable that if its running on the same machine
<JonnieCache> privilidge escalation is pretty easy if you have local shell axx
<burgestrand> jrajav: yup, probably the saner solution but would still need to kill/restart the process in case somebody hangs it.
<stenno|work> JonnieCache, :)
<stenno|work> no prob if you are in vm sandbox though
<stenno|work> make system calls as you like...
iamjarvo has joined #ruby
<JonnieCache> yeah if it was inside a VM with the firewall policy set from outside that would be OK I guess
<jrajav> burgestrand: Throttle it, have the master bot run each snippet in its own thread?
<jrajav> burgestrand: Some kind of timeout would probably be a good idea though
<stenno|work> jrajav, do eet then :D
<burgestrand> jrajav: yep, and for CRuby a thread can block the entire interpreter as well so it doesn’t help much except for being able to run several snippets at once.
infinitiguy has joined #ruby
freeayu has quit [Ping timeout: 264 seconds]
<jrajav> Think you misunderstood… I just meant the master bot (which may not necessarily be in Ruby itself) not blocking for a single snippet, whether it does that with threads or otherwise
<jrajav> The whole point of running the Ruby interpreter separately would be so it couldn't hang the bot
cantbecool has joined #ruby
<JonnieCache> yeah you'd want a queue of some kind
<JonnieCache> queues are good
robacarp has joined #ruby
robacarp is now known as Guest37911
monkegjinni has joined #ruby
philcrissman has joined #ruby
blacktul_ has joined #ruby
liluo has joined #ruby
freeayu has joined #ruby
blacktulip has quit [Ping timeout: 252 seconds]
s1n4 has quit [Quit: peace out]
xorgnak has joined #ruby
zemanel has joined #ruby
bbttxu has joined #ruby
mockra has joined #ruby
<jrajav> Well, I have a pretty good idea of what I'm going to do, but I can't write it until later today
Stalkr_ has joined #ruby
<jrajav> Anyone else have suggestions before I go?
fantazo has joined #ruby
williamherry has quit [Remote host closed the connection]
willb has quit [Ping timeout: 245 seconds]
fbernier has quit [Read error: Connection reset by peer]
g_rotbart has quit [Remote host closed the connection]
mockra has quit [Ping timeout: 252 seconds]
Progster has joined #ruby
johnlcox has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
charlie_some has quit [Quit: Textual IRC Client: www.textualapp.com]
dql has joined #ruby
berkes has joined #ruby
dv310p3r has joined #ruby
willb has joined #ruby
burgestrand has quit [Quit: Leaving.]
burgestrand has joined #ruby
<burgestrand> jrajav: have a look at https://github.com/CodeBlock/rublets
<burgestrand> jrajav: perhaps it’ll give you ideas, perhaps it’ll save you time :)
azulsoljah_w has joined #ruby
freeayu has quit [Read error: Connection reset by peer]
asobrasil has joined #ruby
<lectrick> good morning, object mashers
<jrajav> burgestrand: Unfortunately I don't have a Linux system right now
<jrajav> burgestrand: Or access to one
<jrajav> Or even a convenient way to dual boot one
<burgestrand> hehe
<jrajav> It sucks :(
<azulsoljah_w> jarjav: what about a virtual machine
<jrajav> I don't really want to slice the resources of either of my desktops :/
tomzx has joined #ruby
<jrajav> I guess this one wouldn't matter a LOT, especially for a light, gui-less Linux vm though
<azulsoljah_w> jarjav: cygwin.net
fbernier has joined #ruby
phoe6 has joined #ruby
<jrajav> I'm actually coming around; I have boatloads of RAM and that would mitigate the possibility of a screwup affecting my system
<jrajav> Also, I loathe cygwin with a deep and smoldering passion
geekbri has quit [Remote host closed the connection]
dv310p3r has quit [Ping timeout: 260 seconds]
tomzx has quit [Ping timeout: 250 seconds]
<workmad3> jrajav: I'd like to loathe cygwin
Markvilla has joined #ruby
<jrajav> Then why don't you? It's pretty easy
<workmad3> jrajav: unfortunately, I've never gotten the damn thing stable enough to use in order to get a deep sense of loathing :)
<workmad3> jrajav: I merely dislike it ;)
<jrajav> Any VM suggestions?
<jrajav> I remember VirtualBox working well
<jrajav> But it's been a long time since I needed one
<workmad3> jrajav: yeah, if you want easy and reasonable, VirtualBox is fine
<JonnieCache> kernel level or "running another OS in a window on the desktop"?
hsbt is now known as hsbt_away
<workmad3> I'm not sure of any other options for windows that aren't commercial or VirtualPC :)
<jrajav> JonnieCache: Erm… kernel level? Not sure what you mean
<robert_> workmad3: qemu?
<JonnieCache> referring to stuff like xen
dv310p3r has joined #ruby
<JonnieCache> and kvm
<workmad3> robert_: does that actually run on windows?
<JonnieCache> but apparently you want windows so that doesnt apply
<robert_> workmad3: it can be cross-compiled. it uses SDL
<workmad3> robert_: I know it's capable of running windows, but didn't think it could run with windows as the host
<workmad3> robert_: ah, cool :)
<robert_> yup. :D
crankycoder has joined #ruby
<workmad3> have to admit, I've never really done much VM stuff on windows... I was already on my mac when I started using virtualbox, and I've used kvm on virtualised servers
<workmad3> I only know about VirtualPC because of my mother cursing it :)
_bart has joined #ruby
stopbit has joined #ruby
<_bart> hi
<jrajav> workmad3: For Mac there's also Parallels which is actually pretty damn amazing
_hasany has joined #ruby
<jrajav> The level of integration was surprising
<JonnieCache> parallels is excellent
<JonnieCache> it actually virtualises the GPU, which vmware cant do
und3f has quit [Read error: Connection reset by peer]
tcopp has joined #ruby
tk__ has joined #ruby
und3f has joined #ruby
ken_barber has quit [Remote host closed the connection]
awarner has joined #ruby
ken_barber has joined #ruby
<_bart> is this the same: https://gist.github.com/3227092
centipedefarmer has joined #ruby
<Mon_Ouie> No. class A < B is for subclassing.
twinturbo_ has joined #ruby
<workmad3> JonnieCache: virtualbox is making progress for making GPU hardware acceleration available to the VM
ken_barber1 has joined #ruby
<Mon_Ouie> In your first example, C's superclass is still Object; it is just nested in A::B
hsbt_away is now known as hsbt
twinturbo_ has quit [Client Quit]
<_bart> Mon_Ouie: okay, but how do I do the first example across multiple files?
ephemerian has quit [Quit: Leaving.]
twinturbo has quit [Ping timeout: 264 seconds]
<_bart> Mon_Ouie: and what if A holds instance variables (attr_accessor's) which should be accessible from every nested/subclass, what structure do you suggest?
joshman_ has joined #ruby
dhruvasa1ar has joined #ruby
habib has quit [Ping timeout: 248 seconds]
Progster has quit [Ping timeout: 260 seconds]
dhruvasagar has quit [Ping timeout: 250 seconds]
ken_barber has quit [Ping timeout: 248 seconds]
<lectrick> JonnieCache: Parallels once hosed my boot camp instance so thoroughly that I had to reinstall windows and all my windows apps, which is a special level of hell. Insta-delete Parallels. And I'm a gamer who appreciates that windows games would (theoretically) work better in Parallels, and I didn't care lol.
<X-Jester> _bart: I think you want those members/methods to be 'protected' in that case
_hasany has quit [Quit: Page closed]
kvirani has joined #ruby
<lectrick> Also, I didn't like that Parallels polluted my entire filesystem with 8.3-esque filenames and all sorts of kernel extensions everywhere. VMWare was a much cleaner install
<X-Jester> i.e. define them at the base class as protected, and only self/derived classes can use them
ananthakumaran has quit [Quit: Leaving.]
sailias has joined #ruby
<JonnieCache> lectrick: never used parallels on my own machine. thats nice to know. vmware is indeed very clean
<burgestrand> _bart: your second example does probably not do what you want either.
arkiver has quit [Quit: Leaving]
wmoxam_ has joined #ruby
<JonnieCache> im a huge fan of vmware as a company. i should really buy some shares
monkegjinni has quit [Remote host closed the connection]
<JonnieCache> i really wish id had spare money during the 2008 crisis. i couldve cleaned up on certain tech stocks
<Mon_Ouie> _bart: Nested classes and subclasses have nothing to do with each other
<Mon_Ouie> From what you describe, you want subclassing
<burgestrand> _bart: class C < B < A actually becomes class C < (B < A), which becomes C < nil, which becomes just C.
<Mon_Ouie> class C < true atually
bjhaid has joined #ruby
<burgestrand> Mon_Ouie: no, that’d cause an error, his code runs fine.
<Mon_Ouie> Oh, that's because I assumed he wanted B to be a subclass of A 
Jay_Levitt has joined #ruby
strnx has quit [Ping timeout: 260 seconds]
<workmad3> Class < Class - nil... nice to know :)
<burgestrand> But frankly I didn’t expect B < A to return nil either. I’d expect true or false.
Guest52232 is now known as moshee
moshee has quit [Changing host]
moshee has joined #ruby
<workmad3> also Class <=> Class is nil
<burgestrand> Ah, that’s why.
<workmad3> classes are unsortable! :)
<Mon_Ouie> They are sortable
yfeldblum has quit [Ping timeout: 260 seconds]
Banistergalaxy has quit [Ping timeout: 246 seconds]
i256 has joined #ruby
<Mon_Ouie> Erm, no
<i256> Hello
w400z has quit [Quit: Computer has gone to sleep.]
<Mon_Ouie> But I meant they were Comparable
<workmad3> Mon_Ouie: yeah, but their sort is non-deterministic :)
<i256> I'm seeking for example to use socket and proxy in tcp
dql has quit []
<i256> I need TCP connection over proxy
<burgestrand> That second example could be used to mess with somebody.
<Mon_Ouie> burgestrand: A < B returns true if A is a subclass of B, false if A is a superclass of B, and nil otherwise
ken_barber1 has quit [Remote host closed the connection]
Squarepy has joined #ruby
<burgestrand> Mon_Ouie: oh, i.e. not applicable
<workmad3> Mon_Ouie: hmm, interesting, <=> returning nil causes [].sort to say 'Comparison of Class with Class failed'
answer_42 has quit [Quit: leaving]
<bjhaid> Can I use spork outside rails, if not is there anything similar I can use on a non-web application along with rspec
<workmad3> Mon_Ouie: oh, that's actually pretty cool :)
<_bart> okay I made this: https://gist.github.com/3227209
<_bart> is it a good structure?
<JonnieCache> bjhaid: spork isnt a rails thing
<Mon_Ouie> I think you'd be better of reading on inheritance anyway
<bjhaid> JonnieCache: any documentation on how to get this done?
<workmad3> _bart: can you please at least try running your code before asking if it's any good
MarGarina has quit [Ping timeout: 246 seconds]
<workmad3> _bart: then at least you'd filter out your NoMethodError scripts and other syntax errors
<JonnieCache> bjhaid: just follow the normal instructions... theres nothing rails specific about it unless im misremembering
<JonnieCache> its just people typically use it with rails because rails loads so damn slowly
<JonnieCache> anyway there is something better than spork now, let me find the lnik
<bjhaid> thanks just saw its github documentation
<JonnieCache> *link
<bjhaid> okay
ABK has quit [Ping timeout: 264 seconds]
sailias has quit [Ping timeout: 246 seconds]
s0ber has quit [Ping timeout: 246 seconds]
<JonnieCache> actually forget that... spin IS rails specific
<bjhaid> JonnieCache: thanks
<_bart> workmad3: yes I get the nomethoderror for .branches, it should probably be Tree.Branches.branches
dql has joined #ruby
<_bart> workmad3: maybe if I rename 'branches' to 'all' it will have the same syntax like ActiveRecord/Rails, using .all to get all the branches :)
Squarepy has quit [Read error: Connection reset by peer]
Eee has joined #ruby
jjbohn has joined #ruby
Eee has quit [Client Quit]
busybox42 has quit [Quit: Leaving.]
busybox42 has joined #ruby
Squarepy has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<shevy> JonnieCache I am not a bot :(
<shevy> I have real feelings
runeb has joined #ruby
TPFC-SYSTEM has joined #ruby
<apeiros_> _bart: you'd have lib/tree.rb, and lib/tree/branches.rb. in tree.rb you'd require 'tree/branches'. in 3.rb you'd just require 'tree'
<apeiros_> other than that, it looks fine
solussd has quit [Quit: solussd]
<Mon_Ouie> I'm not sure he actually wants nesting — and even then, his code misses an ivar in Tree to make it a has-a relationship
<shevy> apeiros_! you are back
<apeiros_> yes. back from venice.
<shevy> whoa cool
dross has quit [Ping timeout: 250 seconds]
<_bart> apeiros_: it does not work, I cannot do Tree.branches because that will make a NoMethodError
nari has quit [Read error: Operation timed out]
mockra has joined #ruby
<JonnieCache> apeiros_: have they found somewhere to put their refuse yet?
<apeiros_> _bart: that'd be because you have not defined a class method 'branches'
<JonnieCache> or is that not venice... maybe its napoli
<apeiros_> JonnieCache: their refuse?
<apeiros_> refuse = garbage?
<JonnieCache> rubbish. trash. garbage
<Mon_Ouie> And you probably want to call those methods on the instance you created on the previous line
_bart has quit [Quit: _bart]
<JonnieCache> i was trying to think of a word everyone would understand :)
<apeiros_> JonnieCache: yeah, I think you're thinking of napoli
<apeiros_> venice is relatively clean (for an italian city anyway)
Supaku has joined #ruby
<JonnieCache> there is one place in italy where the rubbish is piled high in the streets, nobody collects it. its due to some beef between local government and the mafia
hsbt is now known as hsbt_away
<apeiros_> JonnieCache: napoli
<rails> if im trying to parse raw html, what should i use as a gem?
<apeiros_> rails: nokogiri
<JonnieCache> rails: nokogiri if its good html, hpricot if its horrible malformed html
<rails> i cant figure it out
_bart has joined #ruby
<_bart> Mon_Ouie: you are right, I edited it: https://gist.github.com/3227209
<apeiros_> JonnieCache: hm? on what html does nokogiri fail where hpricot doesn't?
<_bart> apeiros_: non-strict html
Criztian has quit [Remote host closed the connection]
<apeiros_> _bart: nokogiri can handle that just fine
<JonnieCache> its not that it outright fails, although sometimes it will just refuse, but it has to be really bad
justsee has quit [Quit: Leaving...]
<apeiros_> at least I haven't come across a case where it failed, even with horrible html
<JonnieCache> its more that it doesnt make any attempt to repair it, which is what a browser does.
<apeiros_> JonnieCache: you did use Nokogiri.HTML and not .XML, right?
<JonnieCache> yep
<apeiros_> o0
<rails> i have no idea how to use nokogiri
<rails> ;-;
<_bart> it still uses libxml right?
mockra has quit [Ping timeout: 248 seconds]
<apeiros_> rails: I'd start by downloading it and reading its docs
<JonnieCache> hpricot has browser0like behavioiur where it attempts to second guess the html
<rails> i am reading the docs
<apeiros_> rails: you know, it doesn't hurt to actually spend like *a couple* of minutes yourself first…
<rails> apeiros_: i've been trying for an hour now
hsbt_away is now known as hsbt
<_bart> Mon_Ouie: now I know branches.rb is not the way it's supposed to be I think.
<apeiros_> rails: if you've been trying for an hour, you should be able to ask a qualified question…
sailias has joined #ruby
<Harzilein> rails: Nokogiri("<html><body><p id=\"lala\">Foo</p></body></html>").css("p#lala").text
<rails> hm
<rails> i may have just found it
<Mon_Ouie> Why do you create a new class if you want the method to be available on Tree instances?
ken_barber has joined #ruby
sailias has quit [Client Quit]
<Harzilein> rails: you might want to look at the jquery selectors doc to enhance whats already in the nokogiri docs
sailias has joined #ruby
<_bart> Mon_Ouie: well, Branches will potentially many lines of code and I don't want to make Tree messy.
<rails> Harzilein: ?? i dont see how jquery has stuff to do with what im doing
<_bart> will contain many*
<JonnieCache> jquery has a lot of good examples of selectors
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
<JonnieCache> nokogiri allows the use of css selectors like jquery, and you inevitably end up using them in much the same way. i do anyway
<_bart> xpath is also cool
<JonnieCache> xpath is very cool but i never seem to be able to use it without getting a headache over the syntax
nohonor has quit [Ping timeout: 256 seconds]
<JonnieCache> even though i did a whole project heavily using it at uni
<Mon_Ouie> If that causes a problem, you should probably rethink the way you break your problem into classes
Chris____ has quit [Ping timeout: 245 seconds]
the_jeebster has joined #ruby
Mchl has joined #ruby
<_bart> Mon_Ouie: and that's exactly my question, how do I break it down into classes? when I run .branches it should run the method in another class than Tree but it should still be able to access the ivars of Tree.
jjbohn has quit [Quit: Linkinus - http://linkinus.com]
rcassidy has joined #ruby
greywolf` has joined #ruby
arkiver has joined #ruby
<Mon_Ouie> That's exactly the same as keeping one (potentially) huge class
hsbt is now known as hsbt_away
tvw has joined #ruby
flype has joined #ruby
<rails> uri = Nokogiri::HTML(open(@url))
<rails> Errno::ENOENT: No such file or directory
* rails facedesks
<nateberkopec> There must be a more concise way to test a value against multiple other values
<JonnieCache> you have to require 'open-uri' before that works
<nateberkopec> order.state =='cart' || order.state =='delivery' || order.state == 'payment'
<rails> oh
<nateberkopec> ^^^ can anyone shorten that?
<rails> that makes sense
Squarepy_ has joined #ruby
<Mon_Ouie> There's Array#include?
Squarepy_ has quit [Changing host]
Squarepy_ has joined #ruby
crankycoder has quit [Read error: Connection reset by peer]
<_bart> rails do Nokogiri.parse
crankycoder has joined #ruby
<JonnieCache> rails: normally open() just opens files. requiring open-uri gives it the ability to download urls
hsbt_away is now known as hsbt
savage- has joined #ruby
Squarepy has quit [Ping timeout: 260 seconds]
jjbohn has joined #ruby
arkiver has quit [Client Quit]
<_bart> Mon_Ouie: is that bad? I mean, I don't know the structure, I'm asking you :)
<nateberkopec> Mon_Ouie: awesome! thanks. I'm a huge user of pry-remote, so thanks for that
<Mon_Ouie> Heh, np ;)
Squarepy_ is now known as Squarepy
<rails> sigh
<rails> i have no idea what i'm doing
SQLStud has joined #ruby
arkiver has joined #ruby
<_bart> use gem pp to print the document
<rails> pretty much
<apeiros_> wmoxam_: but he wears a tie!
<wmoxam_> heh
bjhaid has quit [Ping timeout: 246 seconds]
SCommette has joined #ruby
geekbri has joined #ruby
kjellski has quit [Quit: This computer has gone to sleep]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
answer_42 has joined #ruby
clocKwize has quit [Quit: clocKwize]
Rochefort has quit [Remote host closed the connection]
Flock has joined #ruby
tk__ has quit [Quit: ばいばい]
xorgnak has quit [Remote host closed the connection]
bjhaid has joined #ruby
rutkla has quit [Ping timeout: 255 seconds]
booginga has joined #ruby
bowlowni has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
mucker has quit [Quit: Lost terminal]
<rails> ugh, this pathing thing is confusing
rodj has joined #ruby
locriani has joined #ruby
<rails> so i have a rather large table saved in uri
mucker has joined #ruby
crankyco_ has joined #ruby
crankycoder has quit [Read error: Connection reset by peer]
JohnnyCashe has joined #ruby
ringotwo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
Z_Mass has joined #ruby
_bart has quit [Quit: _bart]
<apeiros_> you call your variable uri and save a dom/table in it? o0
mikepack has joined #ruby
ephemerian has joined #ruby
<rails> i dont know what i'm doing
<rails> all i want is a nice list of countries and how many medals they have
<rails> :(
maesbn has quit [Remote host closed the connection]
locriani has quit [Ping timeout: 255 seconds]
akem has quit [Read error: Connection reset by peer]
mohits has joined #ruby
<stenno|work> just scrape the page with hpricot
<apeiros_> and your code so far?
maesbn has joined #ruby
<stenno|work> if hpricot is still the thing to use
<rails> i'm using irb to suss out what i need to do
<workmad3> stenno|work: nokogiri ftw!
Squarepy has quit [Quit: Leaving]
<stenno|work> ah right nokogiri
Z_Mass has quit [Client Quit]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
<rails> i'm building this into an irc bot
<rails> for myself
savage- has quit [Remote host closed the connection]
<apeiros_> rails: you're not making it easy to help you
<stenno|work> rails, paste your code somewhere
<apeiros_> and just to make that clear: helping does not mean solving the problem for you
<workmad3> rails: gist.github.com is a good option
Guest37911 is now known as robacarp
bbttxu has quit [Quit: bbttxu]
<rails> <rails> i'm using irb to suss out what i need to do
<stenno|work> also what apeiros_ said
bjhaid has quit [Read error: Connection reset by peer]
<stenno|work> whatever, i am out
<stenno|work> then paste to gist what you wrote on the irb
jshsu has quit [Read error: Connection reset by peer]
JohnnyCashe has left #ruby [#ruby]
<stenno|work> javascript and ruby people should love each other
<stenno|work> the languages are quite similar in some ways
bjhaid has joined #ruby
<stenno|work> in other ways, they are completely different though :D
<Muz> They're both slow?
<stenno|work> javascript interpreters are fast like hell
<stenno|work> or engines, rather
<rails> how would i select the text within the table
maesbn has quit [Ping timeout: 252 seconds]
<stenno|work> read the nokogiri docs :)
<rails> i have been
<rails> for about an hour
nari has joined #ruby
chclto has joined #ruby
<workmad3> stenno|work: heh :) I'd probably class JS and ruby as more different than alike personally
ryh has joined #ruby
<Harzilein> heh, regarding javascript and ruby, i just started an experiment at scraping my plastic router's web ui: http://paste.debian.net/181506 (the rbnarcissus version i based this on is that by duncan beevers, but i made it not omit the initializers)
<stenno|work> workmad3, true, they have totally different concepts concerning objects and inheritance
<workmad3> stenno|work: yeah, they're basically built from different conceptual foundations
<stenno|work> then again, javascript feels as flexible as ruby
<stenno|work> yup
<workmad3> stenno|work: javascript can, in some ways, be more flexible than ruby
<stenno|work> in javascript: var temp = [1,2,3]; temp.length = 0; // temp is now []
arkiver has quit [Quit: Leaving]
<stenno|work> all fields have been freed
<stenno|work> workmad3, true too
<apeiros_> rails: what does "select text" mean to you?
<stenno|work> workmad3, but in javascript, you cannot, for example, override the += method of Integer instances
<apeiros_> you mean as in: dom.at_css('some_node_containing(text)')?
greywolf` has quit [Quit: Leaving...]
dhruvasa1ar has quit [Read error: Connection reset by peer]
<workmad3> stenno|work: you can't override the += method in ruby either ;)
<stenno|work> workmad3, also the weird stuff with singleton instances like, 1.to_s
<stenno|work> huh
<JonnieCache> you can override the window object though
<workmad3> stenno|work: you can override +, not += :)
<JonnieCache> thats a fun one
<stenno|work> ooh fair point
<Harzilein> any lightweight idea how to make the search in my ast in the above paste a bit more sane?
<apeiros_> workmad3: sad as it is, you can override !=, though :(
aganov has quit [Quit: aganov]
<workmad3> apeiros_: you can in 1.9... I believe you couldn't in 1.8
<stenno|work> however with ecmascript 5, new object sexyness comes to js
<apeiros_> workmad3: correct
<apeiros_> couldn't override ! either
<stenno|work> wow interesting
<stenno|work> why not, if i may ask? :D
dhruvasagar has joined #ruby
<apeiros_> and I still don't know why it isn't @! but !
<rails> apeiros_: if i can get the path or what ever it is right, i want the .text
cakehero has joined #ruby
<workmad3> stenno|work: it was 1.8... who knows :)
<apeiros_> rails: again, *show us what you tried*
<stenno|work> :P
fantazo has quit [Remote host closed the connection]
<apeiros_> even if it did not work
<workmad3> stenno|work: most likely because they just didn't notice
<stenno|work> wow heh
<apeiros_> rails: yeah, that does NOT show how you try to select the part where you want to get the text from.
<rails> apeiros_: whoops thought i put that in
<apeiros_> that only shows how you get at the table. and that part seems correct (I'd be explicit and use at_css instead of at, though)
<rails> my bad
shevy has quit [Ping timeout: 246 seconds]
davidcelis has quit [Quit: K-Lined.]
JohnBat26 has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<rails> apeiros_: look now
<apeiros_> rails: ok, no. wrong approach. it could work but you're making it very hard on yourself.
<apeiros_> rails: what's the html element for an individual row?
<rails> from my reading the docs and reading some code i have seen, this is all i could find
Rochefort has joined #ruby
<rails> apeiros_: its a <tr> insitde a <tbody>
stenno|work has quit [Quit: Leaving]
<apeiros_> rails: good. and the css expression to select all tr tags within the tbody?
dankest has joined #ruby
<rails> i dont know css very well but i think tbody.tr ?
ckrailo has joined #ruby
cj3kim has joined #ruby
<hoelzro> rails: it'd be tbody tr
* rails is not a web developer
<apeiros_> no, that'd be the tbody tag with the class tr
<rails> ah
<hoelzro> . is class selection
<rails> oh so thats why that works
<hoelzro> tbody > tr would also work, I think
<apeiros_> so learn css selectors. they aren't very hard. you can use Nokogiri's css method to select all tr's
<apeiros_> tbody > tr should work. tag1 > tag2 means "all tag2's which are a child of tag1"
<apeiros_> whereas `tag1 tag2` means "all tag2's which are a descendant of tag1"
mneorr has joined #ruby
<rails> uri.at_css("tbody tr") gives me pretty things.
<apeiros_> rails: replace at_css with just css
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<apeiros_> at_css only gives you the first match
<apeiros_> also, call it on the result of where you get the table
<apeiros_> otherwise you get the tr's from *all* tables in the page
<rails> uri is the result
<apeiros_> ah, right, you have those f'ed up varnames…
<rails> is there a standard for variable names?
<apeiros_> and seriously, give your variables meaningful names…
cj3kim has quit [Client Quit]
<rails> i usually do but this is just me throwing stuff around
<apeiros_> well, yes, one would be that you shouldn't name it as something which it doesn't contain… your uri variable definitively does not contain an uri…
Berglund has joined #ruby
bj0ern has quit [Ping timeout: 248 seconds]
<apeiros_> you don't write "strawberry jam" on your honey…
<rails> no, i write "bee juice"
<apeiros_> s/juice/vomit/ ?
baroquebobcat has joined #ruby
<rails> lol, yeah
Harzilein has left #ruby [#ruby]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<apeiros_> you can use row.at_css(…).text to get the text that you want
solussd has joined #ruby
solussd has quit [Client Quit]
<rails> oh man
<rails> perfect
<rails> yay i know nokogiri now
<workmad3> haha
<i256> is io:socks
<i256> in ruby? is any example of use this?
Markvilla has quit [Quit: Markvilla]
<JonnieCache> bee juice imples that you can squeeze it out of them like milking a cow
<apeiros_> i256: che?
<JonnieCache> that would be quite a sight
shevy has joined #ruby
Markvilla has joined #ruby
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
<i256> I need klient over the tor
<Muz> What is "io:socks" conventionally found in?
DrShoggoth has joined #ruby
w400z has joined #ruby
Rochefort has quit [Remote host closed the connection]
<apeiros_> i256: I still have no clue what you're asking for
baphled has joined #ruby
<shevy> Muz hmmmm
jorge has joined #ruby
<shevy> only thing I could think of would be class Socket
<Muz> shevy: hmm?
ttilley is now known as ttilley_off
mneorr has quit [Quit: Leaving.]
<Muz> shevy: oh, you joined at an awkward moment. There was a previously posed ambiguous question that needs more information.
<shevy> oh I see
<shevy> I still like that you use '.' however :)
savage- has joined #ruby
erichmenge has joined #ruby
<shevy> ok
<shevy> I admit it
jgrevich has joined #ruby
<shevy> gentoo guys know more than debian guys
carloslopes has quit [Quit: Leaving.]
headius has joined #ruby
binaryplease has joined #ruby
<hoelzro> shevy: what makes you say that?
mockra has joined #ruby
w400z has quit [Read error: Connection reset by peer]
<shevy> hoelzro he showed me the "scripts" command today
Rochefort has joined #ruby
<shevy> I never knew that thing exists
w400z has joined #ruby
<shevy> script -q -c `which pry` /dev/null | tee ~/output
<hoelzro> script is handy
<hoelzro> but it's a pain to work with if you use ANSI escapes =/
ananthakumaran has joined #ruby
* hoelzro wonders if there's an option to scrub those out
Ethan has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 240 seconds]
dhruvasagar has joined #ruby
bontaq has joined #ruby
paoloooo has joined #ruby
qwerxy has quit [Read error: No route to host]
qwerxy_ has joined #ruby
[1]Flock has joined #ruby
mockra has quit [Ping timeout: 245 seconds]
happydpc has quit [Ping timeout: 240 seconds]
wvms has quit [Quit: wvms]
gtuckerkellogg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
paoloooo has quit [Client Quit]
orend has joined #ruby
paolooo has joined #ruby
Flock has quit [Ping timeout: 264 seconds]
sepp2k1 has quit [Remote host closed the connection]
mneorr has joined #ruby
savage- has quit [Remote host closed the connection]
dhruvasa1ar has joined #ruby
dhruvasagar has quit [Ping timeout: 264 seconds]
w400z has quit []
theRoUS has quit [Ping timeout: 252 seconds]
abra has joined #ruby
binaryplease has quit [Quit: WeeChat 0.3.8]
robotmay has quit [Remote host closed the connection]
apeiros_ has quit [Remote host closed the connection]
zleslie has joined #ruby
mneorr has quit [Quit: Leaving.]
verto is now known as verto|off
mockra has joined #ruby
binaryplease has joined #ruby
apeiros_ has joined #ruby
heftig has joined #ruby
<zleslie> Hi. I am trying to build my first gem, which works, but when I install the gem, I don't have the bin/ directory loaded into my path. I am using rbenv, and I am wondering if this is common or if there is something that I need to do differently when building my gem. May I please have some guidance in this?
ttilley_off is now known as ttilley
jlogsdon has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 264 seconds]
e4r has quit [Remote host closed the connection]
<andrewh> zleslie: rbenv rehash
Fretta has joined #ruby
hoelzro is now known as hoelzro|away
Goles has joined #ruby
mohits has quit [Ping timeout: 248 seconds]
stephenjudkins has joined #ruby
vDubG has quit [Ping timeout: 260 seconds]
Stalkr_ has quit [Ping timeout: 250 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<workmad3> zleslie: as in, you don't have the bin/ directory of your gem in your PATH?
<zleslie> The bin that I want to run ends up under /Users/zach/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/vspheremonitor-0.0.1/bin
timini has joined #ruby
<zleslie> which is not in my path
<workmad3> zleslie: right... gem installs wrapper scripts, it doesn't alter the PATH env var
azulsoljah_w has left #ruby [#ruby]
* [1]Flock finds the closest large object and gives [1]Flock a slap with it
<workmad3> zleslie: the wrapper script will make sure the correct gem binary is then used
<workmad3> zleslie: you should have a single gem bin directory in your PATH
bglusman has joined #ruby
wilmoore has joined #ruby
ttilley is now known as ttilley_off
jonathanwallace has quit [Remote host closed the connection]
<workmad3> zleslie: something like '/Users/zach/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/bin'
jasonLaster has joined #ruby
<zleslie> I do have some, yes, but how do I make it so that users can simply install my gem and begin to use it
<workmad3> zleslie: a.k.a. try running your command, if it doesn't work then your gemspec is probably wrong
eddie_ has quit [Quit: Ex-Chat]
<zleslie> workmad3: Here is my gemspec if you wouldn't mind taking a look: https://github.com/xaque208/vspheremonitor/blob/gem/vspheremonitor.gemspec
runeb has quit [Remote host closed the connection]
<workmad3> zleslie: have you tried running your command to see if it works?
[1]Flock has quit [Quit: HydraIRC -> http://www.hydrairc.com <- s0 d4Mn l33t |t'z 5c4rY!]
<workmad3> zleslie: ah, you haven't declared any executables in there
<zleslie> Oh
vDubG has joined #ruby
<timini> Im trying to install "therubyracer" but im getting this error "ERROR: Failed to build gem native extension ... mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h"
greenysan has quit [Quit: Lost terminal]
<zleslie> workmad3: I found the section in the docs
<zleslie> workmad3: thank you!
<timini> Is there anything I can do?
<workmad3> zleslie: np :)
Eldariof-ru has quit [Ping timeout: 240 seconds]
chrismcg is now known as zz_chrismcg
Rochefort has quit [Remote host closed the connection]
<Hanmac> timini there is something wrong ... ruby.h is NOT under share ... (that is not the right place)
darkc0met has quit [Ping timeout: 272 seconds]
chichou_ has joined #ruby
maxmmurphy has joined #ruby
chichou has quit [Ping timeout: 260 seconds]
yoklov has joined #ruby
maletor has joined #ruby
yoklov has quit [Client Quit]
Jake232 has quit [Quit: Computer has gone to sleep.]
tiripamwe has joined #ruby
yoklov has joined #ruby
savage- has joined #ruby
quest88 has quit [Quit: quest88]
<Synthead> if I do "a if b == c and ...", the command after 'and' does not execute if b != c. Is there a clean way to get around this? atm, I'm doing if b == c then a else true end, but it seems kinda hacky
davidcelis has joined #ruby
ttilley_off is now known as ttilley
jamiejackson has joined #ruby
jlogsdon has joined #ruby
ianbrandt has joined #ruby
xorigin has quit [Quit: leaving]
yoklov has quit [Quit: computer sleeping]
monkegjinni has joined #ruby
minijupe has joined #ruby
yoklov has joined #ruby
stkowski has joined #ruby
<xclite> Synthead: how does what you're doing get that second command executed? i see no mention of it
<jamiejackson> what's a rubified way to split a string (a file) on every nth (8th) delimiter (\n)?
<Synthead> xclite: I'm being concise. In example, a if b == c and puts 'here'
<Synthead> or if b == c then a else true end and puts 'here'
polysics has quit [Remote host closed the connection]
lunitikcalm has joined #ruby
<xclite> synthead: the "puts here" wasn't present in your first example
stat1x has quit [Remote host closed the connection]
stat1x has joined #ruby
macer1 has joined #ruby
<macer1> hello
<macer1> anyone here is using bindata?
<macer1> I have a problem with it
<xclite> synthead: it seems unintuitive - if you want puts "here" executed every time, stick it after the conditional or before it
<macer1> overriding method read in primitive results in stack level too deep ;/
<Synthead> xclite: I don't want it executed every time, though. perhaps I should provide a better example; just a second
shashin has quit [Quit: shashin]
<Hanmac> jamiejackson: str.split("\n").each_slice(8).map {|a| a.join("\n")}
moshee has quit [Ping timeout: 255 seconds]
<Synthead> xclite: this_might_fail if options[:run] == true and do_something
<jamiejackson> thanks, Hanmac. dissecting it now
stephenjudkins has quit [Quit: stephenjudkins]
moshee has joined #ruby
<Synthead> xclite: the goal is to prevent running do_something if this_might_fail fails, optionally ran if options[:run] is true
<Synthead> xclite: if options[:run] != true, then run do_something anyway
moshee is now known as Guest69171
carloslopes has joined #ruby
adeponte has joined #ruby
brianpWins has joined #ruby
krusty_ar has quit [Remote host closed the connection]
jrajav has quit [Quit: The best darkness is strange and surprising]
phoe6 has quit [Quit: phoe6]
chrisbolton has joined #ruby
arturaz has quit [Ping timeout: 260 seconds]
shashin has joined #ruby
nari has quit [Ping timeout: 255 seconds]
dv310p3r has quit [Ping timeout: 260 seconds]
linoj has quit [Read error: Operation timed out]
linoj has joined #ruby
linoj has quit [Remote host closed the connection]
kvirani has quit [Remote host closed the connection]
linoj has joined #ruby
sevvie has quit [Quit: sevvie]
sevvie has joined #ruby
dv310p3r has joined #ruby
qwerxy_ has quit [Ping timeout: 244 seconds]
bradhe has joined #ruby
stephenjudkins has joined #ruby
mahmoudimus has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
KindOne has quit [Quit: ZNC from TrekWeb Internet Services - https://trekweb.org/]
qwerxy has joined #ruby
arturaz has joined #ruby
Araxia has joined #ruby
Wizek has quit [Ping timeout: 246 seconds]
mahmoudi_ has joined #ruby
jorge has quit [Remote host closed the connection]
Hawklord has joined #ruby
darkc0met has joined #ruby
jorge has joined #ruby
mahmoudimus has quit [Ping timeout: 244 seconds]
flype has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
krusty_ar has joined #ruby
jonathanwallace has joined #ruby
adamkittelson has joined #ruby
mahmoudimus has joined #ruby
mahmoudi_ has quit [Read error: Connection reset by peer]
mockra has quit [Remote host closed the connection]
jgarvey has joined #ruby
artOfWar has joined #ruby
i0n has joined #ruby
i0n has quit [Changing host]
i0n has joined #ruby
Vert has quit [Ping timeout: 252 seconds]
artOfWar_ has joined #ruby
i256_ has joined #ruby
jonathanwallace has quit [Ping timeout: 240 seconds]
<xclite> Synthead: do_something if this_might_fail and options[:run]
pdtpatrick has joined #ruby
sendoushi has quit [Remote host closed the connection]
<Synthead> xclite: I want do_something to execute if options[:run] doesn't evaluate as true also
<Synthead> the only time I don't want do_domething to run is when this_might_fail has been executed and failed on its own
<xclite> Synthead: what is the point of options[:run]?
jorge has quit [Ping timeout: 240 seconds]
<Synthead> xclite: to optionally run this_might_fail
cbuxton has joined #ruby
nwest has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
i256 has quit [Ping timeout: 240 seconds]
artOfWar has quit [Ping timeout: 240 seconds]
ephemerian has quit [Quit: Leaving.]
KindOne has joined #ruby
<xclite> synthead: if options[:run] then do_something unless this_might_fail end
<Synthead> xclite: that would make do_something not run unless options[:run] is set
manizzle has quit [Remote host closed the connection]
<Synthead> I suppose in all this I really have found the cleanest way to do it :p
<macer1> how can I implement https://gist.github.com/6ad11e9ab49198251705 in ruby bindata as an pritmitive??
ebaranov has joined #ruby
ph^ has quit [Remote host closed the connection]
ebaranov has left #ruby [#ruby]
bier has quit [Read error: Operation timed out]
<xclite> Synthead: do_something doesn't run less options[:run] is set because do_something doesn't run unless this_might_fail runs, which doesn't run unless options[:run] is set
ph^ has joined #ruby
goganchic has joined #ruby
adamkittelson has quit [Remote host closed the connection]
bricker88 has joined #ruby
<Synthead> xclite: I want do_something to run if options[:run] is not set, or options[:run] is set and this_might_fail evaluates as true
paolooo has quit [Quit: Page closed]
adamkittelson has joined #ruby
<xclite> so when I ask what the point of options[:run] is, it controls more than just this_might_fail
paolooo has joined #ruby
<Synthead> xclite: no, it only controls if this_might_fail gets executed or not.
<xclite> do_something if !options[:run] || (options[:run] and this_might_fail)
<xclite> you just said otherwise
<xclite> if it's not set, do_something runs
<xclite> therefore it controls more than just this_might_fail
stephenjudkins has quit [Quit: stephenjudkins]
<Synthead> xclite: yes, and if it is set, this_might_fail must evaluate as true for do_something to run
phoe6 has joined #ruby
<Synthead> xclite: the only circumstance I want do_something to not run is when options[:run] is set and this_might_fail evaluates as false
jrajav has joined #ruby
<xclite> the last suggestion should do that
<xclite> do_something if !options[:run] || (options[:run] and this_might_fail)
<Synthead> oooh that's not bad
arturaz has quit [Remote host closed the connection]
wilmoore has quit []
jonathanwallace has joined #ruby
goganchic has quit [Ping timeout: 240 seconds]
stephenjudkins has joined #ruby
erichmenge has quit [Quit: Be back later]
erichmenge has joined #ruby
<xclite> synthead: sorry it took so many tries, it was hard to grasp what you wanted for a bit there
<Synthead> xclite: hahaha, I know :D I really appreciate it!
verto|off is now known as verto
zemanel has quit [Quit: Remote hottie closed the connection]
erichmenge has quit [Client Quit]
resure has joined #ruby
goganchic has joined #ruby
bier has joined #ruby
kenichi has joined #ruby
<jamiejackson> i'm not seeing how to replace with subexpressions. it's probably something like "what fudge".gsub(/(what).*(fudge)/, "$1 the $2") # what's the right syntax?
<Spooner> jamiejackson You want \\1 and \\2 doing it that way
<otters> yeah
<otters> or \1 and \2 if you use single quotes
<Spooner> or "what fudge".gsub(/(what).*(fudge)/) { "#{$1} the #{$2}" }
<otters> "#$1 the #$2" rather :P
<jamiejackson> great, thanks
workmad3 has quit [Ping timeout: 264 seconds]
TPFC-SYSTEM has joined #ruby
bambanx has joined #ruby
<bambanx> Hi
carlyle has joined #ruby
andrewh has quit [Ping timeout: 240 seconds]
bullicon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
elhu has quit [Quit: Computer has gone to sleep.]
Ethan has joined #ruby
alienaut has joined #ruby
williamcotton_ has joined #ruby
<alienaut> how can i create array with a default value?
williamcotton has quit [Ping timeout: 246 seconds]
williamcotton_ is now known as williamcotton
louism2_ has joined #ruby
Bosma has joined #ruby
hndsmrob has joined #ruby
<Mon_Ouie> You can't. You can create an array of a fixed size where each element is set to a certain value.
tommyvyo has quit [Quit: Computer has gone to sleep.]
goganchic has quit [Quit: leaving]
<alienaut> like Array.new(100, :default_value)?
jonathanwallace has quit [Remote host closed the connection]
Stalkr_ has joined #ruby
tewecske has joined #ruby
tewecske has quit [Max SendQ exceeded]
Gab0 has joined #ruby
ken_barber has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
baphled has quit [Ping timeout: 240 seconds]
ken_barber has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
goganchic has joined #ruby
Wizek has joined #ruby
timini has quit [Remote host closed the connection]
sevvie has quit [Quit: sevvie]
virunga has quit [Ping timeout: 250 seconds]
bambanx has quit [Quit: Bye]
<Mon_Ouie> Yes
cjlicata has joined #ruby
Stalkr_ has quit [Quit: Leaving...]
Foxandxss has joined #ruby
<apeiros_> alienaut: you can also subclass Array or create your own class which does what you want
<banisterfiend> Mon_Ouie: what happened to "Yeah" ?
dv310p3r has quit [Ping timeout: 264 seconds]
Eldariof-ru has joined #ruby
savage- has quit [Read error: Connection reset by peer]
savage- has joined #ruby
<Hanmac> apeiros_ but i would not recoment this method
carlyle has quit [Ping timeout: 244 seconds]
<apeiros_> Hanmac: why? you don't yet know the problem at hand…
gmci has joined #ruby
ttilley is now known as ttilley_off
krz has joined #ruby
jbw has quit [Ping timeout: 240 seconds]
dql has quit []
johnlcox has quit [Read error: Operation timed out]
<Hanmac> banisterfiend and where is the problem? :P
minijupe has quit [Quit: minijupe]
<banisterfiend> Hanmac: install quake1, let's have a game
<Hanmac> i prefer ogre
tiripamwe has quit [Ping timeout: 264 seconds]
lkba has quit [Ping timeout: 246 seconds]
<banisterfiend> Hanmac: install quake1 + play me or i call the cops
<Synthead> I want to check the sha1 sum of a file, but if I do File.read(file), it loads it into memory. Is there a way I can pass Digest::SHA1 a file to stream instead of doing Digest::SHA1.hexdigest(File.read(file)) ?
yakko_slp is now known as yakko
lxsameer has quit [Quit: Leaving]
mneorr has joined #ruby
imami|afk is now known as banseljaj
linoj_ has joined #ruby
linoj_ has quit [Client Quit]
cbuxton1 has joined #ruby
fearoffish has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
dv310p3r has joined #ruby
<macer1> how to rescue all socket exceptions?
linoj_ has joined #ruby
linoj has quit [Ping timeout: 248 seconds]
linoj_ is now known as linoj
jonathanwallace has joined #ruby
ttilley_off is now known as ttilley
cbuxton has quit [Ping timeout: 244 seconds]
shadoi has joined #ruby
dv310p3r has quit [Max SendQ exceeded]
voodoofish430 has joined #ruby
dv310p3r has joined #ruby
bluOxigen has joined #ruby
mockra has joined #ruby
rutkla has joined #ruby
jrist is now known as jrist-afk
jbw has joined #ruby
banseljaj has quit [Excess Flood]
banseljaj has joined #ruby
jonathanwallace has quit [Ping timeout: 240 seconds]
erichmenge has joined #ruby
banghouse2 has joined #ruby
phoe6 has quit [Quit: phoe6]
conor_ireland has joined #ruby
chclto has quit [Ping timeout: 248 seconds]
<apeiros_> Synthead: Digest::SHA1.file(path)
<Synthead> apeiros_: hahahah, I just ran that in irb not 15 seconds ago
<Synthead> apeiros_: thanks :D
mockra has quit [Ping timeout: 245 seconds]
jasonLaster has quit [Remote host closed the connection]
berkes has quit [Ping timeout: 264 seconds]
sdwrage has joined #ruby
jasonLaster has joined #ruby
banghouse has quit [Ping timeout: 240 seconds]
<shevy> PENIS!!!
jonathanwallace has joined #ruby
banghouse has joined #ruby
<Synthead> wieners
<shevy> hmm
<shevy> Hanmac, did you actually manage to make anything work yet with ruby + ogre?
<shevy> just any demo or something
<shevy> or do you only use C++
<shevy> :P
<Hanmac> https://github.com/Hanmac/libogre-ruby << there is a test
centipedefarmer has joined #ruby
kvirani has joined #ruby
<Hanmac> but it may not look very ruby-like :(
tiripamwe has joined #ruby
phoe6 has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
banghouse2 has quit [Ping timeout: 244 seconds]
stephenjudkins has quit [Read error: Connection reset by peer]
qwerxy has quit [Quit: offski]
ph^ has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
stephenjudkins has joined #ruby
jasonLaster has quit [Ping timeout: 240 seconds]
yekta has joined #ruby
ph^ has joined #ruby
rd34 has joined #ruby
<jamiejackson> what's the right way to do what i'm trying to do here? puts "#{if defined?(foo) puts "foo does exist" else puts "foo doesn't exist" end }"
sendoushi has joined #ruby
rbanffy has joined #ruby
<Hanmac> "#{ defined?(foo) ? "foo does exist" : "foo doesn't exist" }"
<jamiejackson> ah, the ternary whatchamajig. i'll try
<tommylommykins> Why is it all in a string?
<tommylommykins> oh
<tommylommykins> yeah, why is it all in a string? if defined(foo) puts "exists" else puts "doesn't exist" end
dhruvasa1ar has quit [Quit: leaving]
<Hanmac> maybe he wants other string-chars around
tvw has quit [Remote host closed the connection]
<jamiejackson> yeah, this would be in the middle of a literal string
wallerdev has joined #ruby
<tommylommykins> as there any way of taking it out? It's a bit long to be putting it in the middle of a string..
<tommylommykins> *is
<shevy> Hanmac your ternary operator scares me
<Hanmac> this is only what scares you? did you see my test code for my ogre binding?
<shevy> I don't dare to anymore
<jamiejackson> i'll get back to you in a sec, tommylommykins
<shevy> I am going to make a list of people that scare me here on #ruby
<shevy> banister - his links are scary
<shevy> Hanmac - his code is scary
williamcotton_ has joined #ruby
<shevy> rking - his knowledge is scary
<shevy> hmm
<shevy> *linux knowledge
<shevy> only the cuddly otters is not scary
<shevy> oh I know ... Muz - it is scary to finish all sentences with a proper '.'
klj613 has joined #ruby
<klj613> installed gollum via rvm/gem and i get 'gollum: command not found'? :/
williamcotton has quit [Ping timeout: 240 seconds]
williamcotton_ is now known as williamcotton
<shevy> what a strange name... gollum
<Spooner> Maybe he put he ring on? (sorry, couldn't resist).
<shevy> klj613, usually try to find out where the gem resides
bluOxigen has quit []
hubub has quit [Ping timeout: 264 seconds]
<shevy> on a default installation with /usr prefix, it would reside in /usr/lib/ruby/gems/1.8/cache/ for ruby version 1.8.x and /usr/lib/ruby/gems/1.9.1/cache/ for 1.9.x
<shevy> (The .gem file)
goganchic has left #ruby [#ruby]
<klj613> /var/lib/gems/1.8/gems/gollum-2.1.0 i found
jonathanwallace has quit [Remote host closed the connection]
<shevy> for RVM, I think it is somewhere in your $HOME directory.... $HOME/.rvm ... somewhere there
<shevy> ok... looks like debian
<shevy> :\
<shevy> :/
<klj613> ubuntu. just installed with root instead
<shevy> Hanmac is using debian though
<shevy> yeah
s1n4 has joined #ruby
<shevy> Hanmac will know how to solve this
rutkla has quit [Ping timeout: 240 seconds]
<klj613> lol
<jamiejackson> i'm in irb. why does this only (seem to?) execute when i run it twice? puts "#{ defined?(foo) ? "foo does exist" : "foo doesn't exist" }"
shashin has quit [Quit: shashin]
bjhaid has quit [Ping timeout: 246 seconds]
<jamiejackson> (tommylommykins: i'll get back to you in a sec.)
sdwrage has quit [Quit: geekli.st/programmer]
<shevy> jamiejackson could be an IRB bug
<shevy> in a .rb script it works
<shevy> in a .rb file it works
tommyvyo has joined #ruby
<jamiejackson> hmm, okay
<Hanmac> jamiejackson it works on 1.9 irb, but it fail on 1.8irb
<apeiros_> jamiejackson: um, works normally here
<apeiros_> ~$ irb
<apeiros_> ruby-1.9.3-p194:001:0>> puts "#{ defined?(foo) ? "foo does exist" : "foo doesn't exist" }"
<apeiros_> foo doesn't exist
<shevy> aha
<otters> I am too scary
<otters> :|
jorge has joined #ruby
<jamiejackson> that explains it, i'm in 1.8
<Hanmac> the problem is the ' ... irb wants to escape it
<shevy> oh
<shevy> stupid irb
ananthakumaran has quit [Quit: Leaving.]
<Hanmac> oO it still not work oO
<shevy> hehehe
<shevy> no wait
<shevy> you are right
<shevy> it is the '
<apeiros_> funny irb bug. yes, in 1.8 this breaks
itnomad has joined #ruby
<Hanmac> puts "#{ defined?(foo) ? "foo does exist" : "foo doesn\'t exist" }" # works not :P
ringotwo has quit [Remote host closed the connection]
<Hanmac> puts "#{ defined?(foo) ? "foo does exist" : 'foo doesn\'t exist' }" # is needed
<shevy> those " and ' look so harmless
i256_ has quit [Quit: Idę]
<shevy> but they are truly evil
williamcotton_ has joined #ruby
<Hanmac> shevy: what do you think about this: https://github.com/Hanmac/libogre-ruby/blob/master/test/test1.rb
nadirvardar has joined #ruby
ringotwo has joined #ruby
stephenjudkins has quit [Read error: Connection reset by peer]
williamcotton has quit [Ping timeout: 244 seconds]
williamcotton_ is now known as williamcotton
stephenjudkins has joined #ruby
Abbas| has joined #ruby
mockra has joined #ruby
<shevy> hmm
<shevy> it feels a bit like C++ coming to ruby
<shevy> .addLocation()
<shevy> like the win32api
<shevy> .Call()
s1n4 has left #ruby ["leaving"]
<Hanmac> yeah ... most of the methods are still camelcase ... :(
<shevy> it looks a bit like a lot of method work
Markvilla has quit [Quit: Markvilla]
<tommylommykins> ooi, what's the usecase for Ogre driven by Ruby?
<shevy> vp.backgroundColor = Ogre::Color.new(0,0,0)
<shevy> could this not become:
<shevy> vp.backgroundColor = "#0,0,0" # or something like that
cj3kim has joined #ruby
<shevy> vp.background_colour = "#0,0,0" # or something like that
<shevy> hehehe
<shevy> ok... _color perhaps, to consistently use american english
<Hanmac> shevy yeah that could be implmented too
<shevy> tommylommykins ruby is cool
<shevy> ogre is cool
<shevy> the two should marry
<Hanmac> colour looks tomuch after a hidden france
<shevy> tommylommykins there once was a project that tried to have ruby bindings for ogre, but it stopped years ago
<shevy> most C++ guys seem to use python as secondary language
<shevy> hmm Hanmac
<shevy> t = Ogre::Texture::create_manual("MyFirstRtt",:default,:type_2d,512,512,1,0,:r8g8b8,:rendertarget)
<shevy> bit long
<shevy> why not Texture.create_manual btw?
pu22l3r has joined #ruby
<shevy> this can be very hard to remember
<shevy> Hanmac, does this test work?
<shevy> I mean that file
<Hanmac> it does, only the rtt is not implmented yet
<Hanmac> i use the Ogre module as namespace i dont want to include it ... (it may colide with other modules)
rutkla has joined #ruby
<shevy> hmmmm
<Hanmac> tommylommykins how long takes an c++ game to compile? when you only want to test an little change? thats a good point for interpreted languages
chico_chicote has quit [Ping timeout: 245 seconds]
fermion has quit [Quit: P]
<akem> nearly all modern games includes some sort of scripting.
TPFC-SYSTEM has quit [Ping timeout: 248 seconds]
kirun has joined #ruby
<Hanmac> akem they only include scripting ... they are not MADE OF it :P
skryking has joined #ruby
TPFC-SYSTEM has joined #ruby
philips_ has quit [Excess Flood]
philips_ has joined #ruby
davidcelis has quit [Quit: K-Lined.]
kjellski has joined #ruby
jasonLaster has joined #ruby
sent-hil has joined #ruby
darren has joined #ruby
UNIXgod has quit [Changing host]
UNIXgod has joined #ruby
andrew___ has joined #ruby
erichmenge has quit [Quit: Be back later]
linoj has quit [Remote host closed the connection]
linoj has joined #ruby
ReTFEF has quit [Read error: Connection reset by peer]
bshelton has joined #ruby
ReTFEF has joined #ruby
ReTFEF is now known as TheTFEF
answer_42 has quit [Ping timeout: 276 seconds]
jonathanwallace has joined #ruby
berkes has joined #ruby
bontaq has quit [Remote host closed the connection]
sendoushi has quit [Remote host closed the connection]
jwmann has quit [Quit: Leaving.]
manizzle has joined #ruby
S1kx has quit [Ping timeout: 240 seconds]
maletor has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
jlogsdon has quit [Remote host closed the connection]
jonathanwallace has quit [Ping timeout: 246 seconds]
S1kx has joined #ruby
arturaz has joined #ruby
Lachryma` has quit [Quit: Leaving]
manizzle has quit [Read error: Connection reset by peer]
binaryplease has quit [Quit: WeeChat 0.3.8]
minijupe has joined #ruby
jonathanwallace has joined #ruby
S1kx has quit [Client Quit]
greywolf` has joined #ruby
<minijupe> I've notices that my bundle install's are going MUCH faster than several months ago (this line: Fetching gem metadata from http://rubygems.org/)? Has something changed?
erichmenge has joined #ruby
stephenjudkins has quit [Read error: Connection reset by peer]
stephenjudkins has joined #ruby
jlogsdon has joined #ruby
xorigin has joined #ruby
<jamiejackson> is there a fancy way to, say, collapse the first two elements of an array, so that ["a", "b", "c", "d"] becomes ["a b", "c", "d"]? or is it a combination of fetch/delete_at/map?
<fowl> arr[0, 2] = arr[0, 2].join' '
<jamiejackson> ohh
<apeiros_> not fancy enough!
<jamiejackson> that's fancy enough for me :D
<apeiros_> but I demand more fanciness!
<arturaz> % a = %w{a b c d}; a[0] += " #{a[1]}"; a.delete_at 1; a
<arturaz> totally not fancy
guns has joined #ruby
<jamiejackson> exactly
guns is now known as Guest91772
Guest91772 has quit [Client Quit]
<arturaz> well, the outcome depends on your goal
und3f has quit [Quit: Leaving.]
<arturaz> are you trying to be a smartass, or just write a maintainable piece of code :)
und3f has joined #ruby
<apeiros_> job securing measures are smart
und3f has quit [Client Quit]
zeen has quit [Read error: Connection reset by peer]
zeen has joined #ruby
Bosma has quit [Quit: leaving]
conor_ireland has quit [Quit: conor_ireland]
nyuszika7h has quit [Ping timeout: 264 seconds]
Guest91275 has quit [Quit: Guest91275]
xorgnak has joined #ruby
<shadoi> jamiejackson: a.each_slice(2).map {|s| s.join(' ')}
sent-hil has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
<shadoi> oh nvm, I misread what you said
jonathanwallace has joined #ruby
<apeiros_> ary.unshift(ary.pop(2)*' ')
<apeiros_> still not fancy enough, though
cantbecool has quit [Quit: Textual IRC Client: www.textualapp.com]
lunitikcalm has quit [Remote host closed the connection]
Ionic` has joined #ruby
<matti> apeiros_: Oh dear :)
<matti> apeiros_: You beat me to it.
<matti> apeiros_: I was about to type: x.unshift([x.shift, x.shift].join ' ')
<matti> apeiros_: +1 for * sugar :)
cascalheira has quit [Remote host closed the connection]
<shadoi> splat on the right always looks weird to me
<apeiros_> it's not splat
<apeiros_> class Array; alias >> shift; end; ary.unshift((ary>>2)*' ')
<banisterfiend> it's Array#* ;)
<apeiros_> which is join
SegFaultAX has quit [Ping timeout: 255 seconds]
<shevy> LONG LIVE RUBY!
thomas is now known as sadpanda
<fowl> RONG RIVE RUBY!
SegFaultAX has joined #ruby
<shevy> minijupe perhaps they improve bundler once a year :>
<shevy> so in 10 years bundler will be ok
Ionic` has quit [Ping timeout: 255 seconds]
phoe6 has quit [Quit: phoe6]
<apeiros_> RONG RIVE LUBY!
und3f has joined #ruby
<Muz> Matz wuld be spinning in his grave if he saw that.
<Muz> And if he were dead.
jrist-afk is now known as jrist
phoe6 has joined #ruby
<shadoi> lol, I never even noticed the method, I must have gone through the API docs for Array 10,000 times
phoe6 has quit [Client Quit]
arturaz has quit [Remote host closed the connection]
<jamiejackson> okay, so back to fowl's brand of fanciness. if i stick it in a block, why won't it work? ["a", "b", "c", "d"].map {|i| i[0,2] = i[0,2].join(" ")}
<apeiros_> a) map yields one item at a time
phoe6 has joined #ruby
<apeiros_> b) map + mutation = wrong, use either
<jamiejackson> ah
resure_ has joined #ruby
beneggett has quit [Ping timeout: 252 seconds]
jjbohn is now known as jjbohn|afk
beneggett has joined #ruby
Petit_Dejeuner has joined #ruby
<apeiros_> oh, and also, you only wanted the first. map yields *every* element. so totally not what you want.
itnomad has quit [Quit: Leaving]
mk03 has joined #ruby
sadpanda is now known as thomas
<fowl> if you wanted to use map it could be %w(a b c d).each_slice(2).map { |x,y| "#{x} #{y}" }
levity_island has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
<apeiros_> fowl: not really. since he only wants to do it for the first 2 items.
<fowl> oh
<apeiros_> but yes, otherwise each_slice + map == verrrry nice
reuf has joined #ruby
resure has quit [Ping timeout: 264 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
<jamiejackson> actually, this is closer to my situation: [["a", "b", "c", "d"],["w", "x", "y", "z"]].map {|i| i[0,2] = i[0,2].join(" ")}
<jamiejackson> that, at least, doesn't throw an error, but it does just result in => ["a b", "w x"]
<apeiros_> now you're doing something entirely different than what you claimed was your problem…
<jamiejackson> wait, no, that's not right at all
<apeiros_> maybe you want to respecify?
<jamiejackson> right, this is not even close to what i want
<Mon_Ouie> Use #each, not #map
<apeiros_> you want to join multiple items from two different arrays?
manizzle has joined #ruby
xorigin has quit [Quit: leaving]
<Mon_Ouie> #map will replace each element with the return value of the block, but you just want to mutate each value
<apeiros_> i.e. 1st item of A with 1st of B, 2nd of A with 2nd of B, etc.?
Axsuul has joined #ruby
<mk03> you mean "zip"?
<apeiros_> or you want to do what you specified on a whole list of arrays?
<jamiejackson> doh, thanks Mon_Ouie : [["a", "b", "c", "d"],["w", "x", "y", "z"]].each {|i| i[0,2] = i[0,2].join(" ")} => [["a b", "c", "d"], ["w x", "y", "z"]]
<jamiejackson> that's exactly what i was looking for
<apeiros_> ok, the latter in that case…
Speed has joined #ruby
Speed has joined #ruby
Speed has quit [Changing host]
velikasha has joined #ruby
velikasha has left #ruby [#ruby]
redpanda has joined #ruby
ph^ has quit [Remote host closed the connection]
noganex has quit [Ping timeout: 248 seconds]
Araxia has quit [Read error: No route to host]
Araxia_ has joined #ruby
<mk03> [["a", "b", "c", "d"],["w", "x", "y", "z"]].map {|i| ["#{i[0,2].join(' ')}",i[2,i.length]].flatten}
piotr_ has joined #ruby
noganex has joined #ruby
workmad3 has joined #ruby
jeff_sebring has joined #ruby
ryh has quit [Read error: Connection reset by peer]
xpot-station has joined #ruby
lkba has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
ryh has joined #ruby
phinfonet has joined #ruby
chclto has joined #ruby
jjbohn|afk is now known as jjbohn
S1kx has joined #ruby
S1kx has quit [Changing host]
S1kx has joined #ruby
MasterIdler has joined #ruby
greywolf` has quit [Quit: Leaving...]
resure_ has quit []
Berglund has quit [Quit: Computer died.]
resure has joined #ruby
bowlowni has quit [Remote host closed the connection]
Supaku has quit [Quit: Leaving.]
weasels has joined #ruby
otters has quit [Ping timeout: 260 seconds]
sendoushi has joined #ruby
<jamiejackson> holy cow, my job is now secure: source_contents.split("\n").map(&:strip).map {|i| i.gsub(/\s{2,}/, "\t")}.each_slice(10).map.each { |i| i[0,2] = i[0,2].join(' ') }.map {|i| i.join("\t")}
sendoushi has quit [Remote host closed the connection]
<chclto> $5 paypal to anyone who can suggest a pair of shoes similar to these (low profile/small sole) that i like enough to buy http://i.imgur.com/MrNpt.jpg PM ME
chclto has quit [Killed (idoru (Spam is off topic on freenode.))]
<apeiros_> we can help you to make that even more complicated, jamiejackson :)
<jamiejackson> yeah, i've seen good evidence of that, apeiros_ , you guys are artists.
<apeiros_> I bet you could do that with a single gsub, though
cj3kim has quit [Quit: This computer has gone to sleep]
<apeiros_> the result is a single string too?
Supaku has joined #ruby
<workmad3> jamiejackson: wtf is that doing?
<jamiejackson> lol
<Bauer> guys, I am trying to setup apache to run a ruby application, and for that I need to modify the dispatcher.fcgi to declare an unsigned long int, assign -1, print it
<Bauer> How to do that?
<Bauer> I dont know ruby
dvolker has joined #ruby
<jamiejackson> apeiros_: the result is an array of tab delimited "records"
<apeiros_> ok. then more than just a single gsub
<shevy> Bauer I use only ruby .cgi scripts
<jamiejackson> but i'm just looping that out to a string, so it's true. one gsub would do it
virunga has joined #ruby
<jamiejackson> one butt-ugly gsub
linoj has quit [Quit: linoj]
<apeiros_> beauty is in the eye of the beholder!
<workmad3> jamiejackson: ok, so that's the result... but what is it doing? :/
<apeiros_> workmad3: isn't that totally evident from the code?!?!?
<Bauer> shevy: my file is dispatch.fcgi, and I am getting 403 error in browser, and error_log in apache says: FastCGI: invalid (dynamic) server "/var/www/redmine/public/": script is a directory!
<jamiejackson> this is an ultra-important project...
[1]jonah has joined #ruby
cakehero has quit [Quit: Computer has gone to sleep.]
tiripamwe has quit [Ping timeout: 246 seconds]
<workmad3> apeiros_: I'm tired... :P
<shevy> Bauer I dont know that error at all, perhaps its related to apache. I use only .cgi files with ruby, they work very well, even if they may be slow. the URL you gave here, seems to be using redmine... that is a rails apps right?
<jamiejackson> i'm copying a screwy table full of data from a web site (claims i have with my insurance company). i want to put them in a spreadsheet so i can monkey with them.
<workmad3> jamiejackson: ok... and it needs to be a one-liner that doesn't use the CSV library because of ...?
<jamiejackson> this is a one-time thing that i could have fixed up by hand in probably 20m, but i spent hours trying to parse it in ruby.
<arietis> is there any IDE with autocompletion for ruby?
<arietis> or text editor
<workmad3> jamiejackson: ah, the typical procrastination challenge then... ok, fugly one-liner it is :D
<sernin> arietis: vim
<apeiros_> jamiejackson: you could probably save yourself some headache by using nokogiri instead of (an assumed) copy & paste of the table…
<workmad3> arietis: vim (or anything with ctags support), rubymine, aptana
<Bauer> shevy: yes it is a ruby /ror app - Redmine. I was following the instructions on : http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine
<Bauer> shevy: the apache guys says to try and declare an unsigned long int, assign -1, print it
<jamiejackson> i knew it was going to take me hours to do it in ruby. i just wanted to monkey around, because i started learning ruby a couple days ago.
<Bauer> shevy: need to see what would happen
pdtpatrick has quit [Quit: pdtpatrick]
levieraf has joined #ruby
<shevy> Bauer yeah it is redmine, I think it requires rails
<jamiejackson> yeah, i've heard of nokogiri for parsing html. that would have been even more overkill for this one-off thing i'm doing, although overkill is sort of the spirit.
_bart has joined #ruby
<shevy> Bauer if the descriptions there don't help you, file an issue report there and request help added to the documentation
Hanmac has left #ruby [#ruby]
<shevy> it is their product so they should improve it
Hanmac has joined #ruby
weasels is now known as otters
workmad3 has quit [Ping timeout: 248 seconds]
mwilson_ has quit [Excess Flood]
mwilson_ has joined #ruby
stefanp_ has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
adamkittelson has quit [Remote host closed the connection]
adamkittelson has joined #ruby
pu22l3r has quit [Ping timeout: 248 seconds]
ryh has quit [Remote host closed the connection]
resure has quit []
paolooo has quit [Quit: Page closed]
<Hanmac> Romney shows the best way do become a millionaire ... he didnt pay taxes :P
stefanp has quit [Ping timeout: 265 seconds]
Jb_ has quit [Ping timeout: 265 seconds]
<shevy> oh he is smart
<shevy> people who believe that whoever is president is going to make things better are the real pitiful ones
infinitiguy1 has joined #ruby
koshii has quit [Ping timeout: 264 seconds]
<rcassidy> if you live in MA the pirate party is officially registered :)
<wmoxam_> shevy: IMO the amount of attention paid to the President in American politics is absurd
sdwrage has joined #ruby
infinitiguy has quit [Ping timeout: 260 seconds]
infinitiguy1 has quit [Client Quit]
<shevy> yeah but it is a big factor of hollywood - the show element. the drama. the excitement... the absolute belief that the winner takes it all (whatever is there to "win" anyway)
CaptainJet has joined #ruby
<shevy> better than having to live a boring life, isn't it :)
<wmoxam_> shevy: I dunno. I like that politics in my country is boring
<wmoxam_> other things can be exciting
rippa has quit [Ping timeout: 250 seconds]
<shevy> yeah
<shevy> here right now, politics are boring and corruption is widespread
<shevy> *is
<wmoxam_> shevy: I wouldn't call American politics boring at all
sailias has quit [Quit: Leaving.]
<wmoxam_> it's fasinating ... like a train wreck
<shevy> hehe
Morkel has quit [Quit: Morkel]
<apeiros_> wmoxam_: if only we wouldn't all know the outcome…
<wmoxam_> :p
apok has joined #ruby
manizzle has quit [Ping timeout: 240 seconds]
stephenjudkins has joined #ruby
<sernin> “I'll show you politics in America. Here it is, right here. 'I think the puppet on the right shares my beliefs.' 'I think the puppet on the left is more to my liking.' 'Hey, wait a minute, there's one guy holding out both puppets!'”
ryh has joined #ruby
<wmoxam_> yeah, it's crazy there are only two parties
<shevy> hehe
* apeiros_ still loves that treehouse of horror simpsons episode… where both candidates were aliens
<shevy> it's a good show - like that guy in the truman show :) which was actually not a bad movie
<shevy> apeiros_ haha yeah
<shevy> when they were holding hands
<wmoxam_> I don't think there's another democratic country that only has two parties in the house/parliment/whatever
<shevy> "we are not holding hands... we are exchanging plasm" or something like that
<wmoxam_> at least not for every freaking election
<shevy> wmoxam_ guess that is true, there are many more small fractions in european countries, sometimes they even manage to get into the government for some years
Hawklord has quit [Quit: KVIrc 4.0.4 Insomnia http://www.kvirc.net/]
bbttxu has joined #ruby
manizzle has joined #ruby
tsguy52 has joined #ruby
<tsguy52> Hey guys… have a question regarding Array to Hash conversion
irc2samus has joined #ruby
tiripamwe has joined #ruby
<Hanmac> tsguy52 Hash[array]
cakehero has joined #ruby
<shevy> hehe
<shevy> or Hash[*array]
Eldariof-ru has quit []
<shevy> Hash[ *[1,2,3,4] ] # => {1=>2, 3=>4}
<tsguy52> If it were only that easy :D
<shevy> array = [1,2,3,4]; Hash[ *array ] # => {1=>2, 3=>4}
phinfonet has quit [Read error: Connection reset by peer]
<tsguy52> Here is my array: [["1", "3131428", "5551231234", "July 07, 12 02:16", "Saved", "1", "0", "0"], ["2", "3131429", "5551231234", "July 07, 12 03:16", "Saved", "1", "0", "0"], ["3", "3131430", "5551231234", "July 07, 12 04:16", "Saved", "1", "0", "0"]]
<shevy> ok the array looks strange
<Hanmac> and what is your wanted output?
<shevy> what rules do you require for it to become what kind of hash exactly
booginga has left #ruby ["Leaving"]
chimkan_ has joined #ruby
<banisterfiend> Hanmac: can you teach me german
<tsguy52> The first value of the subarray is the key, the rest of the values in the subarray are to be values
<tsguy52> That didn't make much sense… but maybe you get the idea :D
qwerxy has joined #ruby
<shevy> so { '1' => ["3131428", "5551231234", "July 07, 12 02:16", "Saved", "1", "0", "0"] }
<tsguy52> exactly
cbuxton1 has quit [Read error: Connection reset by peer]
<shevy> { '2' => ["3131429", "5551231234", "July 07, 12 03:16", "Saved", "1", "0", "0"] }
cbuxton has joined #ruby
mrsolo has joined #ruby
<tsguy52> Ya know, that might not even be the best way to approach this to be honest. I guess I don't have to store it in a hash, but just iterate over the array and out put the values in a row in rails
jstew has quit [Quit: leaving]
Hawklord has joined #ruby
<shevy> hash = {}; array.each {|line| hash[line[0]] = line[1..-1]}
<shevy> "2"=>["3131429", "5551231234", "July 07, 12 03:16", "Saved", "1", "0", "0"],
<shevy> "1"=>["3131428", "5551231234", "July 07, 12 02:16", "Saved", "1", "0", "0"]}
<shevy> use pp btw
<shevy> require 'pp'; pp array; pp hash
paolooo has joined #ruby
jasonLaster has quit [Remote host closed the connection]
<Hanmac> Hash[array.map{ |a| [a[0],a[1..-1]]}]
<shevy> :)
<shevy> I tell you, Hanmac is clever
<irc2samus> hi guys, I'm looking for any open-source project that runs an embedded webserver as an example for my project
jasonLaster has joined #ruby
<tsguy52> Wow… both of you guys are!
_bart has quit [Quit: _bart]
carloslopes has quit [Quit: Leaving.]
andrew___ has quit [Remote host closed the connection]
<tsguy52> Just so I understand: what does the -1 do ?
<rcassidy> index for last item in array
<rcassidy> -2, second to last
<tsguy52> ah gotcha
kvirani has quit [Remote host closed the connection]
<tsguy52> makes sense
manizzle has quit [Ping timeout: 244 seconds]
<Hanmac> when you only want to iterate the array and not to store in a hash you could imply use array.each {|line| ... }
nyuszika7h has joined #ruby
lunitikcalm has joined #ruby
chimkan__ has joined #ruby
jasonLaster has quit [Ping timeout: 252 seconds]
Synthead has quit [Remote host closed the connection]
baroquebobcat has quit [Quit: baroquebobcat]
Speed has quit [Ping timeout: 252 seconds]
Supaku has quit [Quit: Leaving.]
<tsguy52> I think that will be a more sensible solution - I was over thinking it with the hash idea..
<tsguy52> Thanks!
chimkan_ has quit [Read error: No route to host]
<aces23up> is there an elegant way to do a case statement with an include?
<aces23up> like case myvar.include?()
<aces23up> when 'some str' ; do_some_stuff
davidcelis has joined #ruby
chimkan__ has quit [Ping timeout: 252 seconds]
<fowl> case mystr
<fowl> when /rgx/
davidpk has joined #ruby
<aces23up> fowl thanks.
aszurom has joined #ruby
iamjarvo has quit [Quit: Leaving...]
redpanda has quit [Remote host closed the connection]
<aces23up> fowl how would I reference that match in the when statement?
sevvie has joined #ruby
<fowl> aces23up: $~, $`, $', $1, $2, etc
sevvie has quit [Client Quit]
ryh has quit [Ping timeout: 248 seconds]
<aces23up> fowl those are thread safe?
<fowl> i think htey only apply to the current scope
<fowl> they should be
hubub has joined #ruby
ctp has joined #ruby
<aces23up> fowl ok
hubub has quit [Client Quit]
* Hanmac might be thread-safe ... but are the threads hanmac-safe?
internet_user has quit [Remote host closed the connection]
manizzle has joined #ruby
hynkle has quit [Quit: Computer has gone to sleep.]
tommyvyo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
fbernier has quit [Ping timeout: 264 seconds]
<sernin> in soviet russia, thread joins you
greywolf` has joined #ruby
jlogsdon has quit [Remote host closed the connection]
<Hanmac> in socviet russia, the president votes you
<otters> and apparently in america you vote the president
<aces23up> fowl #<MatchData "mystrfound"> #<--- what is the best way to access that?
geekbri has quit [Remote host closed the connection]
<otters> matchdata[0]
<otters> iirc
<shevy> aces23up, http://pastie.org/4373791
<aces23up> otters how come I get something in $~ but not in $1 for /mystring/ ??
naz has joined #ruby
<otters> aces23up: haven't the faintest idea
<otters> I don't know what $~ is
workmad3 has joined #ruby
<otters> it looks like private parts
<otters> aces23up: probably because /mystring/ doesn't have any capture groups
Supaku has joined #ruby
cousine has joined #ruby
<shevy> aces23up what is $~
<otters> hang on I'll find out
<shevy> why is he using it
<otters> it's the most recent matchdata I guess
verto is now known as verto|off
<shevy> aha
_bart has joined #ruby
asobrasil has left #ruby [#ruby]
nateberkopec has quit [Quit: Linkinus - http://linkinus.com]
und3f has quit [Quit: Leaving.]
jorge has quit [Remote host closed the connection]
cousine has quit [Remote host closed the connection]
jasonLaster has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
nateberkopec has joined #ruby
aszurom has quit [Quit: This computer has gone to sleep]
ken_barber has quit [Remote host closed the connection]
MrWGW has quit [Ping timeout: 244 seconds]
Berglund has joined #ruby
_bart has quit [Quit: _bart]
aszurom has joined #ruby
tommyvyo has joined #ruby
jmil has joined #ruby
jeff_sebring has quit [Quit: Leaving]
<jmil> how would i convert something like: "CancerCell_Volume-00022_Issue-00001.pdf" to "Cancer Cell, Volume 22, Issue 1"
qwerxy has quit [Quit: offski]
minijupe has quit [Quit: minijupe]
jasonLaster has quit [Ping timeout: 240 seconds]
<fowl> jmil: split it apart and put it back together the way you want to
Berglund has quit [Client Quit]
<jmil> fowl: how would you split on a change of case… i.e. "CancerCell" to "Cancer Cell"
PetrolMan has joined #ruby
bshelton has quit [Quit: Leaving.]
<PetrolMan> Got a quick question about using Net::HTTP::Get
MrWGW has joined #ruby
elhu has joined #ruby
<PetrolMan> I'm dealing with gzipped data coming from the server and I'm trying to figure out whether Net::HTTP should handle that seamlessly and I'm doing something wrong or I just need to handle it myself.
<fowl> "HelloThere".index /[a-z][A-Z]/
irc2samus has quit [Quit: Page closed]
aantix has joined #ruby
greywolf` has quit [Quit: Leaving...]
akem has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
iamjarvo has joined #ruby
<jmil> fowl: THANKS!!!!!!
jorge has joined #ruby
akem has joined #ruby
<shevy> jmil, split in several steps
<shevy> for the last action you can do
<shevy> class String; def split_on_word; self.gsub(/([a-z])([A-Z])/,'\1 \2'); end; 'CancerCell'.split_on_word # => "Cancer Cell"
grillo has quit [Ping timeout: 245 seconds]
_bart has joined #ruby
eywu has joined #ruby
yoklov has quit [Quit: computer sleeping]
<banisterfiend> fowl: read first comment lulz http://i.imgur.com/358Yx.jpg
erichmenge has quit [Quit: Be back later]
stephenjudkins has quit [Quit: stephenjudkins]
jjbohn has quit [Quit: Leaving...]
<fowl> kik
rutkla has quit [Ping timeout: 255 seconds]
wmoxam_ has quit [Quit: leaving]
banseljaj is now known as imami|afk
headius_ has joined #ruby
<heftig> han shot first
<otters> not in the extended revamped family friendly edition
headius has quit [Ping timeout: 248 seconds]
headius_ is now known as headius
reuf has quit [Quit: Leaving]
<Hanmac> shevy use [[:upper:]] & [[:lower:]]
<otters> yeah shevy
<otters> save some typing
<shevy> cool
<shevy> hmm a bit long
tcopp has left #ruby [#ruby]
chichou_ has quit [Remote host closed the connection]
chichou has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
thone_ has joined #ruby
thone has quit [Read error: Connection reset by peer]
ph^ has joined #ruby
chichou has quit [Ping timeout: 240 seconds]
grillo has joined #ruby
yoklov has joined #ruby
greywolf` has joined #ruby
stephenjudkins has joined #ruby
mascool has joined #ruby
richardr has joined #ruby
<mascool> is there a way to have rescue handle only errors defined in a specific module/class ?
<mascool> I mean something like Module::Errors instead of listing all the possible errors one by one
cjlicata has quit [Remote host closed the connection]
<burgestrand> mascool: one way is to have all your errors in that module/class inherit from a common base error class, say Module::MyErrors, and rescue that
phinfonet has joined #ruby
<banisterfiend> mascool: define a module with an === that maps to those errors
<burgestrand> mascool: it’s probably the cleaner way, otherwise you could do what banisterfiend says
<fowl> burgestrand: i just tried this and it worked: class A < Exception;end; class B < Exception;end; begin; raise B; rescue *[A,B]; puts 'saved'; end
<burgestrand> fowl: don’t inherit from Exception, it’s evil
<burgestrand> Use StandardError
<burgestrand> THAT GOES TO ALL OF YOU!
<fowl> i just did it to test
<fowl> ok
<fowl> :<
<mascool> banisterfiend, burgestrand thanks for the tips :D
<banisterfiend> mascool: one sec
ph^ has quit [Remote host closed the connection]
tommyvyo has quit [Quit: http://twitter.com/tommyvyo]
<Mon_Ouie> If you just define ===, I wouldn't make it a module
<banisterfiend> Mon_Ouie: it has to be a module iirc, it wont let you rescue an arbitrary object
<Mon_Ouie> Sure it will
elhu has joined #ruby
pedrohenrique has joined #ruby
berkes has quit [Quit: Ex-Chat]
<banisterfiend> hmm, there was some reason modules were used..
ken_barber has quit [Remote host closed the connection]
<mascool> banisterfiend: so I would still have to specify the list of exceptions from the other module/class, and then only rescue Mymodule ?
<banisterfiend> mascool: u could also store the exceptons you want to rescue in an array
<banisterfiend> and then just: rescue *array
cakehero has quit [Quit: Leaving...]
<mascool> banisterfiend: hehe was just thinking about that
mehlah has joined #ruby
<mascool> looking for a way to dynamically populate the array with introspection
<banisterfiend> mascool: but if you can give them a common base class liek burgestrand says then do that
<mascool> seens pretty straightforward
<banisterfiend> but it might not make sense 4 u
<burgestrand> Actually.
phinfonet has quit [Ping timeout: 265 seconds]
<burgestrand> Hm.
<burgestrand> Moment.
_bart has quit [Quit: _bart]
<Mon_Ouie> burgestrand's way still seems to be the better one to me
zemanel has joined #ruby
crankyco_ has quit [Remote host closed the connection]
krz has quit [Quit: krz]
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
jonathanwallace has quit [Remote host closed the connection]
<Mon_Ouie> If there's a hirerachy in your exception, you can better select which exceptions to rescue depending on the case, without being affected by the addition of a new one
<burgestrand> Ah, yes.
dankest has quit [Quit: Leaving...]
<burgestrand> You can add an empty module and include it into your exceptions, and then rescue that.
<fowl> rescue *arr plz
<Mon_Ouie> If you just get all the exception in the modules, your code will always try to rescue all of them
<burgestrand> mascool: http://codepad.org/yLNHNyBh
<banisterfiend> burgestrand: cool trick
<mascool> burgestrand: that is pretty cool
<banisterfiend> burgestrand: i think that was mentioned in exceptional ruby
<banisterfiend> burgestrand: is that where u got it?
<aces23up> can someone show me if its possible to set an attr_accessor when extending a class with a module like here? http://pastebin.com/LmqQHa2c
<banisterfiend> gave them a name like 'tagged' exceptions
<burgestrand> banisterfiend: naw, I used it in Hallon and figured it’d be usable here too
mxweas has quit [Quit: Computer has gone to sleep.]
louism2_ has quit [Quit: This computer has gone to sleep]
<burgestrand> banisterfiend: needed to differentiate two kinds of string somehow in Hallon, passwords vs credentials blob thingy
bbttxu has quit [Quit: bbttxu]
<banisterfiend> burgestrand: it's the best solution i think, as he then doesn't have to recreate his own exception hierarchy, he can define stuff as subclasses of the standard one
<banisterfiend> like ArgumentErrors, etc
<burgestrand> so I made a method Hallon::Blob(string) that just extended the object with Hallon::Blob module and tested against that
stopbit has quit [Quit: Leaving]
<kjellski> I'm using Mechanize to log into a website and search for something via get, then I get a page where the results of an ajax request get rendered into. at the time of fetching the page, they're obviously not there… what is the best way to get at the rendered out page?
<burgestrand> banisterfiend: yeah
theRoUS has quit [Ping timeout: 252 seconds]
<burgestrand> banisterfiend: I’m happy that it actually worked :D
alanp has joined #ruby
balki_ has joined #ruby
manizzle has quit [Ping timeout: 246 seconds]
<burgestrand> I mean, it’s not often you have a use for empty modules…
<banisterfiend> burgestrand: hmm iirc the exceptional ruby solution was a bit different
bglusman has quit [Remote host closed the connection]
<banisterfiend> burgestrand: it was like: raise tag(ArgumentError)
Supaku has quit [Quit: Leaving.]
<burgestrand> Ah.
<burgestrand> Peculiar.
<banisterfiend> burgestrand: where tag would just be: ArgumentError.new.tap { |v| v.extend MyModule }
<banisterfiend> burgestrand: so u could raise any kind of exception at all
<banisterfiend> and it'll automatically be tagged as coming from that class
<banisterfiend> rescue MyModule
alanp_ has quit [Read error: Connection reset by peer]
<burgestrand> Ah, that is neat though.
balki has quit [Read error: Connection reset by peer]
the_jeebster has quit [Quit: Leaving.]
tsguy52 has quit [Quit: tsguy52]
<burgestrand> You could use the regular error classes without defining new ones that have the same meaning just to make it easier to rescue them.
<burgestrand> Nice.
<banisterfiend> Yeah
<burgestrand> Just need to remember to tag them all. :)
<banisterfiend> easiest way would be to override 'raise' in your class
<banisterfiend> so it automatically tags them
[1]jonah has quit [Quit: Try HydraIRC -> http://www.hydrairc.com <-]
elhu has quit [Quit: Computer has gone to sleep.]
<burgestrand> !
<burgestrand> I like it.
<banisterfiend> hehe
<burgestrand> Argh, were it refinements they were called? Would come in handy now, just monkeypatch Kernel#raise inside your own code.
aszurom has quit [Quit: Leaving]
greywolf` has quit [Quit: Leaving...]
PetrolMan has quit [Quit: Page closed]
krz has joined #ruby
MasterIdler has quit [Ping timeout: 252 seconds]
sendoushi has joined #ruby
<kjellski> I mean is there any way possible? Wouldn't I need to have some javascript running to get the final domtree?
chichou has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
sendoushi has joined #ruby
kolm has joined #ruby
mxweas has joined #ruby
manizzle has joined #ruby
maxmmurphy has quit [Quit: maxmmurphy]
kirun has quit [Quit: Client exiting]
v0n has quit [Read error: Operation timed out]
josefig has joined #ruby
josefig has quit [Changing host]
josefig has joined #ruby
pedrohenrique has quit [Quit: pedrohenrique]
phinfonet has joined #ruby
maxmmurphy has joined #ruby
[Neurotic] has joined #ruby
joshman_ has quit [Ping timeout: 255 seconds]
<kjellski> I'm using Mechanize to log into a website and search for something via get, then I get a page where the results of an ajax request get rendered into. at the time of fetching the page, they're obviously not there… what is the best way to get at the rendered out page?
dv310p3r has quit [Ping timeout: 246 seconds]
drupin has joined #ruby
levieraf has quit [Read error: Connection reset by peer]
jonathanwallace has joined #ruby
<drupin> i need support on rails on dotcloud
xorgnak has quit [Remote host closed the connection]
<drupin> any one done that
<kjellski> drupin: maybe try #rubyonrails ?
<drupin> ok
drupin has left #ruby ["Leaving"]
<shevy> another one bites the dust
<davidcelis> oh god
<davidcelis> take him back
<davidcelis> please take him back
<shevy> lol
<shevy> no!
oddmunds has quit [Ping timeout: 264 seconds]
<shevy> there is no way out of hell so why should there be a way out of #rubyonrails
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!]
<kjellski> hmmm? my bad… was I wrong?
jmil has quit [Quit: jmil]
bradhe has quit [Remote host closed the connection]
ryh has joined #ruby
<kjellski> can someone try to give me a hint on my question?
justsee has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
krusty_ar has quit [Read error: Connection reset by peer]
sendoushi has joined #ruby
headius_ has joined #ruby
<shevy> which one
<kjellski> I'm using Mechanize to log into a website and search for something via get, then I get a page where the results of an ajax request get rendered into. at the time of fetching the page, they're obviously not there… what is the best way to get at the rendered out page?
<shevy> I dont know anything about javascript
headius has quit [Ping timeout: 252 seconds]
headius_ is now known as headius
krusty_ar has joined #ruby
ph^ has joined #ruby
<shevy> sorry absolutely no idea... mechanize didnt work for me for a while when it switched to nokogiri, I kind gave up on it after that
BlackShadow has joined #ruby
jgarvey has quit [Quit: Leaving]
<kjellski> shevy: mechanize is completely nokogiri backed by the way… ;) but somewhat nicer in the way it "navigates" especially websites…
<shevy> I used it when it used hpricot
<shevy> it was quite nice
<shevy> my grand goal once used to be to login to my old email provider and download the emails for local use
jrajav has joined #ruby
burntbit has joined #ruby
awarner has quit [Remote host closed the connection]
<kjellski> shevy: I'm using it for something similar, maybe you should consider it again ^^ it's search is really returning Nokogiri::Node::NodeSets =)
GlenK has quit []
<shevy> I dunno... I kinda hate XML :(
<GeekOnCoffee> lol davidcelis
<GeekOnCoffee> "did you read the error message?"
mxweas has quit [Quit: Leaving...]
<davidcelis> ಠ______ಠ
jonathanwallace has quit [Remote host closed the connection]
chichou has quit [Remote host closed the connection]
jrist is now known as jrist-afk
chichou has joined #ruby
nateberkopec has quit [Quit: Leaving...]
<shevy> hmmm
<shevy> when i want to toggle state in a module
<shevy> wait, let me write up an example...
klj613 has quit [Ping timeout: 264 seconds]
<shevy> I have a bunch of methods that output ascii colour codes. now I want to be able to enable or disable colour output globally
<shevy> with a $global variable it works, but I find this unclean. are there other ways to do that?
ph^_ has joined #ruby
ryh has quit [Remote host closed the connection]
jonathanwallace has joined #ruby
Guest69171 has quit [Ping timeout: 264 seconds]
chichou_ has joined #ruby
Guest69171 has joined #ruby
chichou has quit [Ping timeout: 246 seconds]
brianpWins has quit [Quit: brianpWins]
ph^ has quit [Ping timeout: 240 seconds]
Guest69171 is now known as moshee
moshee has quit [Changing host]
moshee has joined #ruby
gmci has quit [Quit: Computer has gone to sleep.]
jjbohn has joined #ruby
<virunga> shevy: maybe you can use a function that returns an empty string if the colors shouldn't be printed or the color code instead
<virunga> empty string or nothing
nonotza has joined #ruby
<virunga> instead of ask, say.
mengu has joined #ruby
jorge has quit [Remote host closed the connection]
koshii has joined #ruby
<shevy> hmm
mneorr has quit [Quit: Leaving.]
moshee has quit [Ping timeout: 252 seconds]
moshee has joined #ruby
centipedefarmer has quit [Quit: This computer has gone to sleep]
bradhe has joined #ruby
SCommette has quit [Quit: SCommette]
gmci has joined #ruby
<virunga> maybe you can use a closure with a block and a variable (not global)
<virunga> the block do whatever you want
<virunga> this is more complicated but would me nice to try IMO
<virunga> *be
<virunga> :)
<shevy> hmmmmm
minijupe has joined #ruby
saneshark has joined #ruby
infinitiguy has joined #ruby
<saneshark> I realize its usually best to just right good readable code and leave the rest up to ruby's garbage collection algorithm but i'm wondering if someone might shed some light on this question. Let's say I set an instance variable to be an object that I've created, this object has its own objects as well and uses self as one of its parameters (self is a Gosu window). Is it better to reset my object or create a new one?
<saneshark> *write
<shevy> saneshark reset
<shevy> and write the class in a way as to allow a re-use of it
<saneshark> shevy: thanks, and this is what I thought, can you explain why this is more efficient?
<shevy> I dunno if it is more "efficient"
kolm has quit [Ping timeout: 260 seconds]
<shevy> I never write code to satisfy the garbage collector, sorry
jamiejackson has quit [Ping timeout: 245 seconds]
<fowl> new objects are created all the time. every time a string is encountered it's a new object
megakwood has joined #ruby
<saneshark> so if i have a Window class, which initializes a @board = Board.new(self, blah blah blah)… I would be better off with something like @board.reset rather than another @board = Board.new?
baroquebobcat has joined #ruby
<saneshark> or it makes no difference?
flip_digits has joined #ruby
<saneshark> what would be a good way to test this? rubyprof or time or something? maybe mem?
<shevy> you seem to ask what is more efficient in terms of memory usage right?
sdwrage has left #ruby [#ruby]
<shevy> I dont think it makes any difference because Board.new will make a new object which occupies the same space as the old object does
<fowl> saneshark: you're only going to have one board, i thought you wre asking about game objects
<saneshark> shevy memory usage I'm pretty sure i can just trust the garbage collection on, especially since its an instance variable
chrisbolton has quit [Quit: chrisbolton]
<saneshark> fowl: my board class has a lot of additional game objects which reference self as well
<saneshark> well, @window in that case
<saneshark> it's tic tac toe, so technically @board only has three additional classes, Grid, Cross, Circle
<fowl> check out chingu, its a more rubyish layer over gosu: https://github.com/ippa/chingu
nari has joined #ruby
<saneshark> normally i wouldn't care about this, but its the reference to self that is throwing me… i wonder if the garbage collector will assume that the previous object still needs a pointer since "self" has not been destroyed
<fowl> one thing chingu does is set $window = self when window is created that way you dont have to pass it to all your objects
<fowl> and its fine in this case since gosu won't run two windows in the same process
<saneshark> fowl: chingu is unnecessary overhead since i'm not using physics in this game, it's just aboard game
<saneshark> i hear you though, i actually like fidget a lot too
<saneshark> fidgit rather
<fowl> chingu doesn't include physics, it has basic collision detection, but all of the options for game object are completely optional
jonathanwallace has quit [Remote host closed the connection]
<saneshark> and ray looks very promising
<Spooner> saneshark : Chingu has nothing to do with physics. You are thinking of Chipmunk.
mengu has quit [Remote host closed the connection]
<saneshark> i see
<Spooner> saneshark : You might also look at GameBox (which is a layer on top of Gosu too).
<saneshark> hmmm i kind of like that Gosu is so low overhead though
<fowl> saneshark: in your window initialize set $window = self so you dont have to pass it around a lot
<Spooner> Well yes, but you don't have to use everything in chingu/gamebox. If something doesn't suit you, then keep it simple and roll your own.
<saneshark> fowl: is that a class variable though?
<fowl> no, global
tatsuya_o has joined #ruby
<Spooner> Global. You could set it up using Window.instance (class instance variable) if you prefer though (and fear globals).
arietis has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<saneshark> but global variables are a bad idea?
<Spooner> Passing a unique value around everywhere is a bit pointless.
<fowl> this is the only instance i would use a global because you can only have one gosu window open
<Spaceghostc2c> saneshark: Most usually.
<Spooner> It should really be Gosu::Window.instance or Gosu::window, but noone bothers with that, which is a shame. Usually people just use $window.
<saneshark> fowl: good point, and as a result wouldn't need to worry too much about memory management, but if that's the case i could just set @window globally myself why introduce a new gem to do something so trivial?
<fowl> Spooner: because that's two constant lookups and a method
ph^_ has quit [Remote host closed the connection]
tatsuya__ has joined #ruby
minijupe has quit [Quit: minijupe]
<fowl> saneshark: i was just proselytizing chingu obviously you shouldn't bring it in if that's all you need from it
baphled has joined #ruby
<Spooner> saneshark : Because Chingu (or whatever) provides plenty of other things. You can just set $window manually if you want; nothing stopping you.
megakwood has quit [Remote host closed the connection]
<Spooner> And regarding overhead, unless your game is running < 60fps, why are you worried about some extra overhead if it makes development simpler?
<saneshark> Spooner: looked at Chingu, i like it. And Fidgit even more since it manages different game states in a common sense way (fidgit is still kind of in alpha though).
tatsuya_o has quit [Ping timeout: 246 seconds]
fantazo has joined #ruby
<Spooner> Fidgit is just an extension for Chingu really, so it manages gamestates exactly the same.
<fowl> yea fidgits author is lazy :D
<Spooner> Yeah, he is a terrible dev. Terrible.
kpshek has quit []
jjang has joined #ruby
jjang has quit [Remote host closed the connection]
jslvk has joined #ruby
<Spooner> Wasting his time on Ashton now, I hear. Even more pointless Gosu extension :D
uris has quit [Quit: leaving]
jjang has joined #ruby
<fowl> what's that do?
<saneshark> Spooner: actually i was just curious, searched SO and didn't see much on garbage collection for ruby, and what i found didn't mention how it would handle a reference to self
<fowl> oo
g_rotbart has joined #ruby
<Spooner> saneshark : Not sure what you mean.
<saneshark> LOL, anyone using ruby for game design is probably a terrible dev in the first place
<jrajav> s/ruby/a dynamically typed, interpreted language/
jmil has joined #ruby
<fowl> oh cool
justsee is now known as justsee|away
<saneshark> Spooner: i know how ruby does the double pass algorithm for garbage collection, but thought that it might ignore destruction of an object since it references "self" a class which is not destroyed
<saneshark> i suppose i could do something like "include Singleton" but then i couldn't pass parameters to my object
<Spooner> But self is the object itself, so it doesn't reference it per se.
SQLStud has quit [Read error: Connection reset by peer]
<fowl> Spooner: he means his game objects referencing the window
<jslvk> Anyone work with recruiters before w/r/t Ruby/RoR? I've always helped businesses directly and now i'm getting these messages--anything to watch out for?
<Spooner> Oh, I see. Well, you never want the window to be lost, since then your game would disappear :)
<saneshark> hell, is there a way to debug garbage collection in ruby? maybe i should just put this to the test in IRB or something
jarred has joined #ruby
lunitikcalm has quit [Remote host closed the connection]
<fowl> saneshark: if you have doubts in your destroy() method set all your instance vars to nil
<jslvk> just left my job recently and wanted to freelance on and off
<Spooner> saneshark : You might want to use require "gosu/preview" which removes the need to pass window in constructors anyway and saves you the worry :)
<fowl> jslvk: if they ask if your parents are home before they come over, look out
<jslvk> xD
<saneshark> LOL
<jslvk> that's one for bashorg
<Spooner> saneshark : Though the way that works is via $window anyway, but it is then Gosu's responsibility :)
sendoushi has quit [Remote host closed the connection]
pozic has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 240 seconds]
<fowl> Spooner: is there a --pre gem for ashton
<saneshark> Spooner: i'll take a look at preview, maybe even put it the test in irb. Are you aware of any methods to check if an object still exists in memory?
<Spooner> saneshark : And sorry that Fidgit is far from perfect. I use it a lot, but it does require a bit of secret understanding to actually use it.
maxmmurphy has quit [Quit: maxmmurphy]
<Spooner> fowl Nope, because I am updating it continuously. Just clone it, "rake compile" and run the examples (of which there are several and are actually quite nice).
<saneshark> Spooner: its all good, i like thought behind it, lazy or otherwise. :)
<saneshark> although i wish more people would just devote efforts to ray, i'm really impressed with that one
<Spooner> saneshark : There is a lot you can do with ObjectSpace. Have a play around with it.
iamjarvo has quit [Quit: Leaving...]
<Spooner> saneshark: Well, ray had a lot of advantages over Gosu (many now being added via Ashton, so its advantages reduce). I did find some things a bit slower than Gosu though, but it is certainly usable. I wrote a game in it that worked pretty well.
<saneshark> Spooner: why the name fidgit? i keep accidentally typing fidget hahaha
<Spooner> saneshark : Fidgit is a character from Time Bandits, which rhymes with widget :) I can see your confusion though.
<banisterfiend> saneshark: hahahahah
<fowl> Spooner: I get this error from rake: cannot load such file -- rake/extensiontask
jjbohn has quit [Quit: Leaving...]
<Spooner> Regarding memory, however, I wouldn't worry about it until you start running out or you know you are bloating with a lot of very large objects or garbage collection starts taking a long long time (premature optimisation is a great waste of time).
codezombie has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
<Spooner> fowl did you bundle?
<fowl> oh damn i forgot
nateberkopec has joined #ruby
resure has joined #ruby
<Spooner> Want to take this to #gosu though?
<fowl> alright
lunitikcalm has joined #ruby
piotr_ has quit [Ping timeout: 240 seconds]
megakwood has joined #ruby
brianpWins has joined #ruby
nateberkopec has quit [Client Quit]
megakwoo_ has joined #ruby
<shevy> why not #secret_love
megakwood has quit [Ping timeout: 246 seconds]
phinfonet has quit [Read error: Connection reset by peer]
phinfonet has joined #ruby
jeff_sebring has joined #ruby
megakwoo_ has quit [Client Quit]
jslvk has quit [Quit: Page closed]
manizzle has joined #ruby
tiripamwe has quit [Ping timeout: 248 seconds]
phinfonet has quit [Read error: Connection reset by peer]
<mroth> is there an easy way to do integration testing for network output? e.g. verify a packet is sent out to the network as a result of some action
burgestrand has quit [Quit: Leaving.]
emmanuelux has joined #ruby
jbohn has joined #ruby
eywu has quit [Quit: Leaving.]
<phoe6> What's the different between require "module.rb" vs require "module"
<phoe6> note the lack of extension.
banisterfiend has quit [Remote host closed the connection]
ryh has joined #ruby
chichou_ has quit [Remote host closed the connection]
tatsuya__ has quit [Remote host closed the connection]
chichou has joined #ruby
<BlackShadow> why when i trying to run code in SublimeText it looking for gems in folder 1.9.1 instead of 1.9 where all gems placed? Where to fix this path?
virunga has quit [Ping timeout: 252 seconds]
<davidcelis> shevy: #tender_love
jonathanwallace has joined #ruby
stkowski has quit [Quit: stkowski]
baroquebobcat has quit [Quit: baroquebobcat]
aers has joined #ruby
chichou has quit [Ping timeout: 240 seconds]
<shevy> lol
<shevy> tenderlove is on #rubygems usually