fflush changed the topic of #ruby to: Ruby 1.9.3-p194: http://ruby-lang.org || Paste > 3 lines of text on pastebin.com
Criztian_ has quit [Remote host closed the connection]
Criztian has joined #ruby
<elico> ruby is the first language a actually wrote code longer then 1000 lines
<elico> with a lot of one liners..
matty5000 has quit [Ping timeout: 260 seconds]
fridim_ has quit [Ping timeout: 246 seconds]
apok_ has joined #ruby
maletor has joined #ruby
<elico> shevy: so what about the trees?
pabloh has joined #ruby
<shevy> every day some water then your trees will prosper
lukekhamilton has joined #ruby
<elico> i have two small plant in pots here near the room.. very nice.. quiet
<shevy> I think my largest project in ruby has about 12k lines of code
<shevy> and I am trying to reduce that number
<elico> what to?
<elico> 12 K lines? what did you wrote?
banisterfiend has quit [Remote host closed the connection]
<adeponte> Axsuul: hey, just letting you know. After putting that gem to heavy use toady I have found some issues and have been rewritting it to resolve all of those issue
<lukekhamilton> question, is it possible to add two ranges? something like this: x = (1..10) + ("a"..z")?
<shevy> it's some kind of build system where you can compile or install software elico
apok has quit [Ping timeout: 260 seconds]
apok_ is now known as apok
banisterfiend has joined #ruby
Criztian has quit [Ping timeout: 264 seconds]
<shevy> "ry perl" will compile perl from source for instance
<lukekhamilton> I am trying to create an array of valid characters.
matty5000 has joined #ruby
arubin has joined #ruby
<shevy> lukekhamilton so what should your end result be
tomsthumb_ has quit [Quit: Leaving.]
<elico> shevy: and i must ask how are you with orginizing data?(i'm bad at it)
havenn has joined #ruby
<shevy> elico, I only use yaml files so far. at a later time, I'll generate a sqlite3 database from the dataset I have (I have 2400 separate yaml files right now, one file for every program)
<lukekhamilton> shevy: [,1,2,3,4,5,6,7,8,9,0,"a",b",c",etc….]
<elico> yes you told me...
dinkytoy has joined #ruby
<elico> i needed a reminder
banisterfiend has quit [Ping timeout: 245 seconds]
<shevy> even when I'll have a database, I won't have too much data
nari has quit [Ping timeout: 244 seconds]
<shevy> 2400 yaml files, average 8 lines per file... about 20.000 lines of data
<shevy> lukekhamilton, x = (1..10).to_a + ('a'..'z').to_a # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
apok has quit [Remote host closed the connection]
<macer1> >> (1..10).to_a + ('a'..'z').to_a
<al2o3cr> (Array) [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
jorge has quit [Remote host closed the connection]
apok has joined #ruby
<lukekhamilton> shevy: ok cool
<lukekhamilton> I wasn't too sure if that was they easy/Ruby way or not
mahmoudimus has quit [Quit: Computer has gone to sleep.]
jorge has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
mrdodo has joined #ruby
<shevy> well we just make them arrays, then concat them
<shevy> the range objects
<shevy> Range does not seem to like + method
butblack has joined #ruby
<shevy> (1..200) + (300..500) NoMethodError: undefined method `+' for 1..200:Range
<shevy> dunno why
<shevy> perhaps because it could be ambigous
jorge_ has joined #ruby
lolzie has joined #ruby
<shevy> hmm
<shevy> or perhaps it would change the Range object into something else
jorge has quit [Read error: Connection reset by peer]
<lukekhamilton> yeah ok. Thanks heaps
pelangi has joined #ruby
<butblack> I was reading about OO programming and read this line "Most OO languages require a class to be defined before we can have a new kind of object, but ruby does not" … I don't understand how ruby does not?
<shevy> I guess they dont like changing objects via methods
moted has quit [Remote host closed the connection]
<shevy> except for replace() method in class String
<butblack> anytime I instantiate a class I have already defined that class no?
<butblack> instantiate an object*
mrdodo has quit [Remote host closed the connection]
<shevy> butblack, you could create structs or anonymous classes too
<lolzie> Hi guys. I have this:- print (1..1000).select { |x| x % 3 == 0 or x % 5 == 0 }.inject { |x, y| x + y }
cantonic has quit [Quit: cantonic]
<shevy> or autogenerate them somehow via metaprogramming
<lolzie> How can I remove the duplication of x % 3 == 0 or x % 5 == 0 ?
codeFiend has joined #ruby
<lolzie> I'd like to do something like [3, 5].something { |y| }
<shevy> butblack, for 99% of what I see though, people first write a class, then instantiate that
matty5000 has quit [Ping timeout: 246 seconds]
<butblack> shevy: i don't understand the importance of writing out that line..
<lolzie> The intention being to sum all numbers divisible by 3 or 5 between 1 and 1000
<shevy> the line you typed here?
<butblack> shevy: I can live with that, and yeah
insecurlex has quit [Remote host closed the connection]
<shevy> no idea either, ask the authors. perhaps they want to sound important :)
t71526 has quit [Remote host closed the connection]
<shevy> ruby is quite close to the prototypic OOP model
t54616 has joined #ruby
<shevy> once I thought I could use only structs to write a MUD in ruby
<butblack> shevy: it was written by matz
<lolzie> shevy: how does it differ from the prototyping OO model?
ephemerian has left #ruby [#ruby]
<shevy> butblack, aha. well I hope he explained it then
<lolzie> prototypic*
cantonic has joined #ruby
Speed has quit [Remote host closed the connection]
<shevy> lolzie, well you can instantiate from a prototype, and then remodel that prototype, then re-instantiate from that clone, or?
maletor has joined #ruby
<butblack> shevy: haha, I'll post the paragraph it came from.. I apologize in advance for the excessive amount of text
<butblack> We commonly take one step of abstraction above this, because it turns out to be as easy to build a factory that makes machines as it is to make an individual machine. We aren't likely to build a single tripmeter directly; rather, we arrange for any number of tripmeters to be built from a single pattern. The pattern (or if you like, the tripmeter factory) corresponds to what we call a class, and an individual tripmet
<butblack> generated from the pattern (or made by the factory) corresponds to an object. Most OO languages require a class to be defined before we can have a new kind of object, but ruby does not.
<shevy> hmm
<shevy> I think he meant java
Z_Mass has joined #ruby
<butblack> shevy: that's pretty much what i read
<butblack> and it has the same parahraph
<butblack> paragraph, same line
<shevy> are you sure matz wrote that?
<butblack> second last paragraph
<butblack> file://localhost/Volumes/Untitled/rg/about.html
<butblack> whoop[s
<butblack> hahaha
<shevy> aha
<shevy> japanese original, translated by GOTO
bricker881 has quit [Quit: Leaving.]
moted has joined #ruby
<butblack> yeah
<butblack> i was typing something may have been lost in translation
<shevy> hehe
<shevy> did you read the interview from matz in 2003?
<butblack> no
<butblack> link me?
havenn has quit [Remote host closed the connection]
<shevy> he gives sound reasons for his answers there
<butblack> shevy: cool, thanks
<shevy> so I was surprised to read something like that you said he wrote
<butblack> shevy: it didn't make much sense to me either
bradhe has quit [Remote host closed the connection]
<shevy> because I am not entirely sure what he would mean with "Most OO languages require a class to be defined before we can have a new kind of object, but ruby does not."
<shevy> because really... 99% of the ruby examples, do make use of a newly written class, before its instantiated
<butblack> because that's all oo is lol, create a class instantiate an object
<butblack> exactly
<shevy> kinda. with structs you are more flexible in some ways
<jrajav> >> x = 7; [3, 5].map { |y| x.modulo(y) }
<al2o3cr> (Array) [1, 2]
SubliminalKid has joined #ruby
<jrajav> lolzie: ^
<shevy> Sword = Struct.new(:length, :weight)
<shevy> sword = Sword.new(120, 4.5) # => #<struct Sword length=120, weight=4.5>
ComradeBlack has joined #ruby
<shevy> I dunno why I never continued with this idea for the MUD :(
abahkaiyisah has quit [Ping timeout: 245 seconds]
<ComradeBlack> shevy: MUDs?
<butblack> from what i understand struct is just a more flexible class definition
<shevy> just one engine ComradeBlack :P
<ComradeBlack> I love MUDs :D
<shevy> ged here once created faerieMUD
<SubliminalKid> shevy, your writing a MUD?
<SubliminalKid> :o
<SubliminalKid> I love MUDing
<shevy> SubliminalKid dunno... it takes so much effort and time ...
<SubliminalKid> shevy, I am really tempted to write a game using curses and ruby.
<jrajav> I like mud wrestling
<jrajav> Does that count?
<lolzie> jrajav: the x % 3 == 0 or x % 5 == 0 part needs to return true or false
<SubliminalKid> ever play Liberal Crime Squad?
<shevy> SubliminalKid, but I kind of want to see "what if it were possible"
bradhe has joined #ruby
<shevy> and if you know LPC, ruby could easily replace it
maletor has quit [Ping timeout: 260 seconds]
<lolzie> jrajav: substituting it by your code didn't produce the correct answer so I think it's not quite an analog
<jrajav> lolzie: Oh. I'm sorry I answered your question instead of doing all the integration work :P
<SubliminalKid> le
pskosinski has quit [Ping timeout: 245 seconds]
<jrajav> Well, let's see, given the array returned by my example, you want at least one element == 0, right?
<lolzie> Hmm, yeah
ComradeBlack has left #ruby [#ruby]
<shevy> SubliminalKid one nice idea ged had was to make the MUD story-centric
<SubliminalKid> shevy, just make a one player game
<SubliminalKid> using curses
<SubliminalKid> :p
<shevy> I hate curses
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<shevy> whoever designed that API should be slowly tortured
Foxandxss has joined #ruby
graspee has quit [Quit: leaving]
maletor has joined #ruby
<SubliminalKid> shevy, is curses and ruby bad?
mrdodo has joined #ruby
Foxandxss has quit [Client Quit]
<elico> shevy: if you find him pick me up on the way to kill!
luxurymode has quit [Quit: Computer has gone to sleep.]
jonathanwallace has joined #ruby
<shevy> SubliminalKid I just find curses unusable really
dross_ has joined #ruby
<SubliminalKid> :(
<SubliminalKid> shevy, i want to make something in the style of LCS though
<shevy> what is LCS?
tiripamwe has quit [Ping timeout: 252 seconds]
butblack_ has joined #ruby
havenn has joined #ruby
butblack has quit [Ping timeout: 248 seconds]
dross has quit [Ping timeout: 248 seconds]
Bauer1 has quit [Ping timeout: 248 seconds]
butblack_ is now known as butblack
andrewpthorp has quit [Quit: Linkinus - http://linkinus.com]
banisterfiend has joined #ruby
<lolzie> jrajav: cheers for the help. I didn't understand the relevance of it even being integrable til you clarified with the hint
Guest8778 has quit [Read error: Connection reset by peer]
<jrajav> ;)
ichilton has quit [Ping timeout: 248 seconds]
koivula_ has quit [Ping timeout: 248 seconds]
oz has quit [Ping timeout: 248 seconds]
soulcake has quit [Ping timeout: 248 seconds]
Takehiro has joined #ruby
<shevy> jrajav is an old ruby expert
mrsolo has quit [Quit: Leaving]
<jrajav> Hahahahahaha
<jrajav> hahaha
ichilton has joined #ruby
<shevy> he wrote an undestroyable, unbreakable bot in ruby
koivula has joined #ruby
Bauer1 has joined #ruby
cantonic has left #ruby [#ruby]
<jrajav> It can be destroyed by Freenode :P
<shevy> and Hanmac :D
oz has joined #ruby
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
grenierm has joined #ruby
soulcake has joined #ruby
<elico> shevy: undestroyable ??
Mchl has joined #ruby
<elico> but what this bot allows?
Banistergalaxy has quit [Ping timeout: 260 seconds]
Gm4n has quit [Quit: ZNC - http://znc.sourceforge.net]
<jrajav> A lot more than a normal sandbox
<elico> how can access it?
<jrajav> >> p 'heya'
<al2o3cr> (String) "heya", Console: "heya"
<jrajav> >> 1 + 2
<al2o3cr> (Fixnum) 3
alindeman has joined #ruby
<shevy> elico the question is not how we can access it
<shevy> the question is:
<shevy> How can we break it?
<elico> what i ment was... how can i get hold of the source?
<shevy> >> sleep while 5 > 4
<shevy> elico, I think it is on github somewhere
<shevy> in some dark corners of github
<shevy> the abyss...
mxbtty has quit [Quit: Leaving.]
<elico> NICE
<jrajav> elico: github.com/jrajav
<jrajav> /al2o3cr
Takehiro has quit [Remote host closed the connection]
<elico> thanks
<shevy> is al2o3cr a gem too?
<shevy> gem install al2o3cr
<jrajav> Newp
<jrajav> Lol is it really that special
<jrajav> A <40 SLOC Cinch bot?
<jrajav> :P
<elico> !panic ?
<al2o3cr> AAAAAAAH
<al2o3cr> Still alive~
<elico> nice!!!
<elico> !dammit
<al2o3cr> SAVE YOURSELF
<al2o3cr> Crisis averted
beneggett has joined #ruby
Synthead has quit [Remote host closed the connection]
<shevy> jrajav more than anyone else did here before
<elico> ho it's for a one liner..
recycle has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
LouisGB has joined #ruby
<jrajav> shevy: Welp, those lines of code (and the dead predecessors) represent a few significant hours of work
v0n has quit [Ping timeout: 246 seconds]
<jrajav> shevy: Like many <40 SLOC apps that Just Work(™), I'll bet
<shevy> 40 SLOC
<elico> jrajav: i must say that this is the first irc bot code that i have ever understood how it works and make sense to me!
<shevy> hmmm
<shevy> that's not much
<shevy> my irc-client has 200 LOC
<jrajav> Did you use a framework?
artOfWar has quit [Remote host closed the connection]
<elico> LOC ?
_keith has joined #ruby
erichmenge has joined #ruby
artOfWar has joined #ruby
<jrajav> Lines Of Code
<jrajav> And SLOC = Significant Lines Of Code
macmartine has joined #ruby
<SubliminalKid> shevy, liberal crime squad
<SubliminalKid> LCS
<shevy> what is that
<shevy> jrajav, hmm no. it's a standalone class
<SubliminalKid> shevy, http://lcs.wikidot.com/
<jrajav> Well, there's the difference. Most of my workhorse code is in Cinch
<shevy> _ = TalkInIrcChannel.new(ARGV,false); _.set_channel_name :ruby
<shevy> select( [$stdin], nil, nil, 1.1 ) <--- this part was the most difficult to understand
tiripamwe has joined #ruby
<bperry> IRC is a super easy protocol, very lightweight
<elico> i will try it
ibash has joined #ruby
<shevy> IRC is quite easy yeah
<SubliminalKid> yea
<SubliminalKid> i love it as a protocol
<shevy> I'd wish I'd know how to use ssl
<shevy> from ruby
artOfWar has quit [Read error: Operation timed out]
<shevy> oh
<shevy> does cinch allow ssl connections?
<elico> shevy: ssl for what?
<jrajav> I don't know
andrewpthorp has joined #ruby
<SubliminalKid> and shevy that link, not the game itself
<SubliminalKid> but the style
<SubliminalKid> i cant think any way to do that but with curses
<shevy> lib/cinch/irc.rb: ssl_context.key = OpenSSL::PKey::RSA.new(File.read(@bot.config.ssl.client_cert))
khakimov has joined #ruby
<shevy> seems it does
<shevy> I am going to study that, perhaps I have an insight
havenn has quit [Remote host closed the connection]
orf__ has joined #ruby
iori has joined #ruby
adamkittelson has quit [Remote host closed the connection]
orf_ has quit [Ping timeout: 276 seconds]
_keith has quit [Quit: _keith]
GoGoGarrett has joined #ruby
liluo has quit [Remote host closed the connection]
sterex has quit [Quit: sterex]
maletor has quit [Quit: Computer has gone to sleep.]
mwmnj has joined #ruby
pelangi has quit []
mrdodo has quit [Remote host closed the connection]
<mwmnj> any heroku vets around?
dpk has quit [Ping timeout: 240 seconds]
t54616 has quit [Remote host closed the connection]
t67590 has joined #ruby
erichmenge has quit [Quit: Be back later]
chimkan_ has joined #ruby
<jrajav> I wish I was a heroku vet :/
<jrajav> I'm thinking of getting an app onto it sometime soon
<jrajav> And I also want to know how it works for blogging
<jrajav> And static serving
<jrajav> And serving static blogs :P
<shevy> you sound very enthusiastic
<jrajav> Haha
gtuckerkellogg has joined #ruby
dpk has joined #ruby
Tomasso has quit [Ping timeout: 256 seconds]
<jrajav> My main problem with blogging is that I'm never satisfied with anything I write
<jrajav> So I never end up writing anything
<banisterfiend> good
<jrajav> And that app is in the works; I spent 4 hours on it today alone
<banisterfiend> :P
<banisterfiend> there's a lot of crap blog posts in the ruby community :)
<banisterfiend> i blog maybe once-twice a year for a similar reason
<shevy> hehe
<shevy> 4 hours!
<jrajav> That's aside from my fulltime job :P
ilyam has joined #ruby
macmartine has quit [Quit: Computer has gone to sleep.]
<banisterfiend> jrajav: what does your app do?
<jrajav> Note taking
<jrajav> + Cloud syncing
<jrajav> For Android
<jrajav> Modeled very closely on Notational Velocity for the mac
banghouse has quit [Remote host closed the connection]
<banisterfiend> like vernote
SeanLazer has quit [Quit: SeanLazer]
<banisterfiend> ?
<jrajav> Yeah but just text only
<banisterfiend> evernote
<jrajav> Maybe Markdown support at some point
<jrajav> I also want to explore dropbox and maybe git syncing options
<jrajav> But just SImplenote to start with
locriani has quit [Remote host closed the connection]
codeFiend has quit [Ping timeout: 246 seconds]
<banisterfiend> you have a lot of competition there
<banisterfiend> there's a tonne of apps for that :P
<banisterfiend> (if i understand u correctly)
<jrajav> Well, I'm not trying to monetize it at all
<jrajav> It's mainly for myself to be honest
kvirani has joined #ruby
<banisterfiend> even free apps i mean
<jrajav> I'm not satisfied with any of the options for Simplenote note taking on Android right now
<jrajav> So I honestly don't care if that many people use it
<banisterfiend> np
jgrevich has joined #ruby
jgrevich has quit [Client Quit]
haxrbyte has quit [Remote host closed the connection]
<jrajav> I am thinking of an HTML5 app that does the same thing with a Heroku proxy though
<jrajav> And I *would* try to monetize that
andrewpthorp has quit [Quit: Leaving...]
<jrajav> Mainly for the reason that I couldn't scale it otherwise, if tons of people started using it
kenichi has quit [Remote host closed the connection]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
savage- has quit [Read error: Operation timed out]
<banisterfiend> would it be a webview thingy or just run in a website?
<banisterfiend> in the brwoser i mean
<jrajav> A website, but with localStorage
<jrajav> So a true HTML5 "app" in the sense that it can work offline
<jrajav> And sync once you go back online
erichmenge has joined #ruby
<jrajav> I might try a prototype with a webview though, because that wouldn't require a proxy. The proxy is needed for a served website due to cross-domain
_keith has joined #ruby
<banisterfiend> i would do webview
<banisterfiend> browser apps on android (in my experience) feel kind of crappy
<banisterfiend> and the browsers are all pretty buggy
sevenseacat has joined #ruby
<banisterfiend> with weird UI
reactormonk has quit [Ping timeout: 246 seconds]
<jrajav> Oh, I meant this mainly for desktop actually
<banisterfiend> oh ok
<banisterfiend> so android is just for reading them?
<jrajav> HTML5 and phonegap are still pretty bad on both android and iphone
<jrajav> No?
chimkan_ has quit [Quit: chimkan_]
randomautomator has quit [Remote host closed the connection]
<banisterfiend> you mentioned android
<jrajav> The app I'm writing right *now* is just a native Android app in Java
<banisterfiend> :))
jgrevich has joined #ruby
cbley has joined #ruby
<banisterfiend> confused..
lolzie has quit [Quit: Page closed]
<banisterfiend> so the notetaking app on android is a native java app
<jrajav> Yes
<jrajav> Separate things
dpk has quit [Quit: Asleep at the keyboard.]
<elico> ok.. i want to write a DB of domains in a tree form but wamt to work with storage files that will hold the data/
uris has joined #ruby
<banisterfiend> jrajav: but the same project? just two ways of leaving notes?
<banisterfiend> or two different projects?
<jrajav> Two projects to provide the same solution
graft has quit [Ping timeout: 245 seconds]
<jrajav> The Android one is a lot more relevant to me and I would use it every day
<jrajav> So yeah
_keith has quit [Quit: _keith]
<banisterfiend> cool
aantix_ has joined #ruby
<banisterfiend> jrajav: my own way of doing that is just saving text files that i create to dropbox :P
<jrajav> This would basically do that :P
michael52025 has joined #ruby
Takehiro has joined #ruby
chimkan_ has joined #ruby
michael52025 has left #ruby [#ruby]
<banisterfiend> jrajav: what do u think of the android api? is it as horrible as people say?
<banisterfiend> esp. cmpare to ios which people seem to like
aantix_ has quit [Client Quit]
aantix has quit [Ping timeout: 240 seconds]
tomsthumb_ has joined #ruby
havenn has joined #ruby
adeponte has quit [Remote host closed the connection]
codeFiend has joined #ruby
liluo has joined #ruby
locriani has quit [Remote host closed the connection]
grenierm has quit [Quit: grenierm]
alvaro_o_ has joined #ruby
reactormonk has joined #ruby
CoverSlide has quit [Ping timeout: 240 seconds]
<jrajav> ? I haven't experienced that
xyxxy has quit [Quit: Page closed]
yasushi has joined #ruby
jgrevich has quit [Quit: jgrevich]
yasushi has quit [Remote host closed the connection]
alvaro_o has quit [Ping timeout: 240 seconds]
mwmnj has quit [Quit: Page closed]
havenn has quit [Remote host closed the connection]
<jrajav> That's pretty vague, anyway
<banisterfiend> jrajav: hmm, i guess it's only people who first programmed ios apps and then did some android who feel so strongly :)
t67590 has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
<banisterfiend> cocoa is a really nice framework
t13852 has joined #ruby
tommyvYo has quit [Quit: Computer has gone to sleep.]
_keith has joined #ruby
seich has quit [Ping timeout: 260 seconds]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
jgrevich has joined #ruby
_keith has quit [Client Quit]
ianbrandt has quit [Quit: ianbrandt]
bbttxu has quit [Quit: bbttxu]
fmcgeough has quit [Quit: fmcgeough]
mahmoudimus has joined #ruby
_keith has joined #ruby
Hanmac1 has joined #ruby
LouisGB has quit [Ping timeout: 244 seconds]
havenn has joined #ruby
emmanuel__ has quit [Ping timeout: 244 seconds]
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
mrdodo has joined #ruby
mahmoudimus has quit [Client Quit]
coyo has quit [Quit: Heaven is not a place, it's being with people who love you.]
Hanmac has quit [Ping timeout: 245 seconds]
92AABFASL has quit [Ping timeout: 260 seconds]
Takehiro has quit [Remote host closed the connection]
zodiak has quit [Remote host closed the connection]
gfontenot has quit []
Takehiro has joined #ruby
cableray has joined #ruby
mahmoudimus has joined #ruby
TheLZA has joined #ruby
sazboom has quit [Quit: EPIC5-1.1.4[1667] - amnesiac : Press [ESC] to detonate or any other key to explode]
sevenseacat has left #ruby [#ruby]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
mmitchell has joined #ruby
mmitchell has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 246 seconds]
apok has quit [Ping timeout: 276 seconds]
Takehiro has quit [Remote host closed the connection]
bbttxu has joined #ruby
jgrevich has quit [Quit: jgrevich]
chare has quit [Quit: Leaving]
Takehiro has joined #ruby
Z_Mass has quit [Ping timeout: 252 seconds]
eywu has quit [Quit: Leaving.]
jgrevich has joined #ruby
krz has quit [Quit: krz]
_keith has quit [Quit: _keith]
Z_Mass has joined #ruby
adamkittelson has joined #ruby
_keith has joined #ruby
mrdodo has quit [Remote host closed the connection]
orf__ has quit [Quit: Leaving]
riley526 has joined #ruby
sterex has joined #ruby
Takehiro has quit [Remote host closed the connection]
andrewhl has joined #ruby
bawigga has joined #ruby
<bawigga> in the ruby versions, ex: ruby-1.9.3-p194, what does the 'p' stand for in p194
jenrzzz has quit [Quit: GOING HOME]
beneggett has quit [Quit: Computer has gone to sleep.]
arvidkahl has quit [Quit: arvidkahl]
opus has quit [Quit:]
beneggett has joined #ruby
_keith has quit [Quit: _keith]
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
nari has joined #ruby
linoj has joined #ruby
moshee has quit [Ping timeout: 250 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
olrrai has joined #ruby
mrdodo has joined #ruby
olrrai has quit [Client Quit]
mmitchell has joined #ruby
jonathanwallace has joined #ruby
bradhe has quit [Remote host closed the connection]
td123 has joined #ruby
freeayu has joined #ruby
seich- has joined #ruby
<RubyPanther> revision
<bawigga> p stands for revision?
<RubyPanther> sorry patchlevel
<bawigga> oh cool
<bawigga> thanks!
w400z has joined #ruby
savage- has joined #ruby
sepp2k has joined #ruby
igotnolegs has joined #ruby
ringotwo has quit [Remote host closed the connection]
Z_Mass has quit [Ping timeout: 246 seconds]
BadQuanta has quit [Quit: Leaving]
seanstickle has quit [Quit: seanstickle]
Takehiro has joined #ruby
bawigga has quit [Quit: Linkinus - http://linkinus.com]
BadQuanta has joined #ruby
wvms has quit [Quit: wvms]
sepp2k has quit [Ping timeout: 246 seconds]
linoj has quit [Quit: linoj]
zelrik has quit [Quit: Konversation terminated!]
t13852 has quit [Remote host closed the connection]
t80757 has joined #ruby
Takehiro has quit [Remote host closed the connection]
jorge_ has quit [Remote host closed the connection]
freeayu has quit [Read error: Connection reset by peer]
linoj has joined #ruby
freeayu has joined #ruby
zeknox has joined #ruby
headius has quit [Quit: headius]
machty has joined #ruby
Takehiro has joined #ruby
freeayu__ has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
freeayu has quit [Ping timeout: 240 seconds]
ndngvr has quit [Ping timeout: 240 seconds]
<zeknox> hey whats my best way to get the value out of a block variable, outside of the block code? I essentially am trying to say, if the string READ/WRITE is found, then display "you have admin" ---> http://pastie.org/4571919
rump has joined #ruby
rump has left #ruby [#ruby]
radic has quit [Read error: Connection reset by peer]
Banistergalaxy has joined #ruby
jorge has joined #ruby
radic has joined #ruby
codeFiend has quit [Quit: codeFiend]
arvidkahl has joined #ruby
jearvondharrie has joined #ruby
cableray has quit [Quit: See you 'round like a donut.]
banisterfiend has quit [Ping timeout: 240 seconds]
xclite has joined #ruby
sepp2k has joined #ruby
SubliminalKid has quit [Quit: Leaving]
mrdodo has quit [Remote host closed the connection]
jenrzzz has joined #ruby
bradhe has joined #ruby
luckyruby has quit [Remote host closed the connection]
coyo has joined #ruby
coyo has quit [Changing host]
coyo has joined #ruby
verto is now known as verto|off
sdwrage has joined #ruby
headius has joined #ruby
khakimov has joined #ruby
locriani has quit [Remote host closed the connection]
headius has quit [Client Quit]
Z_Mass has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
pabloh has quit [Read error: Connection reset by peer]
havenn has quit [Remote host closed the connection]
maletor has joined #ruby
davejacobs has joined #ruby
seth-- has joined #ruby
adeponte has joined #ruby
codeFiend has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
Juul has quit [Quit: GOING!]
Takehiro has quit [Remote host closed the connection]
tomsthumb_ has quit [Quit: Leaving.]
shadoi has quit [Quit: Leaving.]
beneggett has joined #ruby
tiripamwe has quit [Quit: Leaving]
n_blownapart has joined #ruby
poop_ has joined #ruby
<elico> anyone?
<poop_> Anyone know if there is a chanel specifically for Sinatra here?
locriani has quit [Ping timeout: 245 seconds]
ndngvr has joined #ruby
<poop_> Derp. #sinatra
Takehiro has joined #ruby
hadees has quit [Quit: hadees]
<elico> i want to initialize a leaf node but from unknown reason on initialize the object became nil
linoj has quit [Quit: linoj]
<xclite> elico, code sample?
<elico> class Domain
<elico> include Enumerable
<elico> @domain
<elico>
<elico> @subdomains = []
<elico> def initialize(par)
<elico> puts par.class
<elico> puts @paren.class
<elico> setparent(par)
<elico> setdom(dom)
<elico> end
banisterfiend has joined #ruby
Z_Mass has quit [Quit: Leaving]
<elico> there are other methods but this is the idea
<xclite> elico, generally you want to use pastebin.com for snippets like taht
<elico> yee a sec
<bnagy> not generally
<bnagy> ALWAYS
<xclite> bnagy, +1
TheLZA has quit [Quit: Bye]
tomsthumb_ has joined #ruby
<xclite> elico, further we want to see you use the code where it's becoming nil
<elico> yes yes a sec
<elico> all coming
havenn has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<elico> a domain tree for a sorted tree
reactormonk has quit [Ping timeout: 246 seconds]
<xclite> elico, there's a lot... generally wrong. First, your indentation is a mess, second, your to_s should return a string, not output it
Takehiro has quit [Remote host closed the connection]
<elico> missing t at: est2 = Domain.new(test1)
<n_blownapart> hi could someone give me a clear (quick?) explanation of enumerator in this case ... the books explanation is worthless aside from mentioning precedence. thanks: http://pastie.org/4572016
<bnagy> @paren.class is always going to be NilCLass cause you don't initialize it anywhere
Banistergalaxy has quit [Ping timeout: 244 seconds]
<elico> but ... @parent  = parent in the "setparent(parent)"
<elico> also if i use directky the setparent(parent) it works
<elico> just not in the initialize
<elico> i have tried to initialize that before with the same result
<bnagy> elico: a) @paren != @parent and b) when you use it in initialize, you haven't initialized it yet
<bnagy> and c) if you're going to fricking argue when you're wrong, you can go whistle
pingfloyd has joined #ruby
<elico> i will give you the code same way...
<elico> i just changed dont be picky on what's not relevent
<bnagy> forget it, I only do homework for people who listen
tomsthumb_ has quit [Quit: Leaving.]
<bnagy> n_blownapart: yeah (array.map) will be an Enumerator
<bnagy> in your first example you enclose the block in parens as well, in the second you don't, that's why the behaviour is different, not do end vs {}
<elico> well it seems like works now after cleanup of a line that wasnt suppose to be there
<n_blownapart> thanks bnagy ...is enumerator always the same thing? does it always mean the same thing as output.?
_br_ has quit [Excess Flood]
ssspiff has joined #ruby
ssspiff has quit [Changing host]
ssspiff has joined #ruby
t80757 has quit [Remote host closed the connection]
<n_blownapart> bnagy: I'm not too clear on what it is...
t96150 has joined #ruby
<elico> thanks bnagy the problem was that i forgot to remve a line...
<bnagy> no an Enumerator is a special kind of object when you have used something that would normally feed a block, but you didn't give it one yet
banisterfiend has quit [Remote host closed the connection]
<bnagy> or you did, and asked for it to be turned into an enum :)
sspiff has quit [Ping timeout: 276 seconds]
banisterfiend has joined #ruby
_br_ has joined #ruby
<n_blownapart> bnagy: so it bypasses the block here, given what the interpreted assumes is happening.
<n_blownapart> bnagy: poorly phrased. ^
Takehiro has joined #ruby
beneggett has quit [Ping timeout: 248 seconds]
<bnagy> elico: normally we wouldn't define getters and setters like that. there's a construct called attr_accessor :domain, :parent
jorge has quit [Remote host closed the connection]
<elico> yes indees there are attr_accessor...
<bnagy> and if we did then they would looke like def parent;@parent;end def parent=(other);@parent=other;end
<elico> i am lowleveling for couple hours..
ananthakumaran has joined #ruby
<poop_> Anyone happen to know how Sinatra calculates the hmac for rack.session cookies?
_br_ has quit [Excess Flood]
_br_ has joined #ruby
<n_blownapart> bnagy: what purpose does the enum serve as output, or as a newly created "special" object?
<bnagy> cause then the final code will be more expressive - this_domain.parent == that_domain etc
_br_ has quit [Excess Flood]
xyxxy_ has joined #ruby
Takehiro has quit [Remote host closed the connection]
<xyxxy_> def csrf_tag Rack::Csrf.csrf_tag(env) end <-- what algorithm is used to generate this csrf token?
_br_ has joined #ruby
<bnagy> n_blownapart: it's an Enumerator, it does Enumerator stuffs. Read the docs ?
banisterfiend has quit [Ping timeout: 260 seconds]
beneggett has joined #ruby
<poop_> xyxxy_: Are you testing a Sinatra app too? :p
<bnagy> it's for when you have contonuation style code and want to control iterations by hand
reactormonk has joined #ruby
t-mart has quit [Ping timeout: 246 seconds]
<xyxxy_> poop_: lol.
xyxxy_ is now known as xyxxy
<n_blownapart> bnagy: thanks I'll check it out. owe you plenty o' tea.
<xyxxy> What level are you on?
<poop_> 4
<poop_> You?
<xyxxy> I'm on 6.
voodoofish430 has quit [Quit: Leaving.]
<poop_> poo
binaryplease has quit [Quit: WeeChat 0.3.8]
<poop_> I can't figure out how this app is calculating the hmac
<bnagy> hmacs are standard, there are only a few
<bnagy> hopefully it's hmac-sha1 or better, but I bet it's md5 :>
<bnagy> can't you just read the src?
<xyxxy> poop_ notice how that when you send someone some karma your password is reflected on their default page.
<poop_> FUQ
<poop_> I just realized
<poop_> sorry for the language
36DABY0WQ has quit [Quit: Computer has gone to sleep.]
cakehero has quit [Quit: Computer has gone to sleep.]
matty5000 has joined #ruby
GoGoGarrett has quit [Remote host closed the connection]
Banistergalaxy has joined #ruby
ngoldman has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
mmitchell has quit [Remote host closed the connection]
freeayu has joined #ruby
shadoi has joined #ruby
ssspiff has quit [Ping timeout: 246 seconds]
butblack has quit [Quit: butblack]
cbley has quit []
freeayu__ has quit [Ping timeout: 265 seconds]
<elico> is there a method to dfine in order to indentify object in array?
Cascador has quit [Quit: Leaving]
xclite has quit [Remote host closed the connection]
jonathanwallace has quit [Remote host closed the connection]
chimkan___ has joined #ruby
chimkan___ has quit [Remote host closed the connection]
chimkan__ has joined #ruby
sailias has joined #ruby
chimkan__ has quit [Read error: Connection reset by peer]
chimkan_ has quit [Read error: Connection reset by peer]
chimkan__ has joined #ruby
elico has left #ruby [#ruby]
<machty> if i have an array and I want to quickly generate a Hash of some property of the object in that array as the key pointing to the object as the value, what's the best way to do that?
richardcreme has quit [Ping timeout: 244 seconds]
<machty> right now i do array.each{ |v| hash[v.prop] = v }
<machty> that's fine, but i do this a lot and wanted to know if there's some idiom i'm overlooking
Cache_Money has joined #ruby
richardcreme has joined #ruby
banisterfiend has joined #ruby
<banisterfiend> bnagy: hey nag
<bnagy> mornin
arvidkahl has left #ruby [#ruby]
<bnagy> machty: group_by would do it I guess
<bnagy> but it's not much more elegant
Banistergalaxy has quit [Ping timeout: 272 seconds]
<bnagy> id_hah=coll.group_by {|e| e.id}
<bnagy> *hsh :P
<bnagy> coffee still not kicked in yet
<machty> or group_by(&:id), but still the values would be arrays
<bnagy> with the bonus that wouldn't overwrite dups, which may or may not be handy
<machty> which would be cool in some cases but ids are unique so that's kind of a waaste
a_a_g has joined #ruby
r0bby has joined #ruby
chimkan___ has joined #ruby
<bnagy> if you need to do this a lot it could be an indicator of some datastructure issues though - this is like a cache for when you're about to do lots of id lookups, for example yeah?
hadees has joined #ruby
<machty> yeah, sort of, i've got to serialize a user object and all the things he's voted for
<Cache_Money> Spooner: What's the strategy against the Yellow pixel in Level 4 of Alpha Channel
<Cache_Money> ?
<machty> and be able to quickly look up if a certain thing's been voted for on the client side
<bnagy> normally I'd ask a db to handle that kind of stuff :)
robbyoconnor has quit [Ping timeout: 260 seconds]
chimkan__ has quit [Ping timeout: 246 seconds]
<machty> the db gives me a nice big array of vote objects. i just at some point need to turn it into this more locally queriable structure
fyolnish has joined #ruby
fyolnish has quit [Read error: Connection reset by peer]
banisterfiend has quit [Remote host closed the connection]
<bnagy> one of these new fangled hash dbs are built for this kind of thing, aren't they?
<bnagy> it's not really my domain though
banisterfiend has joined #ruby
matty5000 has quit [Ping timeout: 246 seconds]
ngoldman has quit [Remote host closed the connection]
freeayu has quit [Read error: Connection reset by peer]
banisterfiend has quit [Read error: Connection reset by peer]
jarred has joined #ruby
freeayu has joined #ruby
banisterfiend has joined #ruby
<Spooner> Cache_Money : Yellow is just stronger than red I think. The later ones are a bit more tricky... While since I've played it myself :)
dinkytoy has quit []
moshee has quit [Ping timeout: 240 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
chare has joined #ruby
ngoldman has joined #ruby
<Spooner> Cache_Money : Just keep throwing red ones at it and you'll get it. Can't just kill it against the green ones, which you can do with reds in the first few levels.
davejacobs has quit [Quit: leaving]
sebicas has quit [Quit: sebicas]
<Spooner> Cache_Money : Glad to see someone is playing it :)
<chare> why does rails have db migrate, intsead of something like "just sync everything about the database schema to the right value"
<Spooner> chare : I think because, for one, it is a reversable action.
insecurlex has joined #ruby
rtj has quit [Quit: rtj]
tomsthumb_ has joined #ruby
<chare> whats the point of reversable?
<Spooner> chare : And there you have learned about 50% of what I know about Rails, so it is time for me to shut up :)
<n_blownapart> hi still some questions on enumerator if you have time. so apparently gsub is very flexible and outputs an enumerator in the case where there is no second (replacement) argument. So this special variable stores the results of a regex until it is needed later. noob question, but where is the enumerator stored? what is its scope? sorry no better way to ask the question. thanks : http://pastie.org/4572202
<Spooner> It is always good to be able to roll-back changes.
ndngvr has quit [Read error: Connection reset by peer]
freeayu__ has joined #ruby
jarred has quit [Quit: jarred]
ndngvr has joined #ruby
freeayu has quit [Ping timeout: 244 seconds]
<bnagy> n_blownapart: you need to start working this stuff out yourself
<TTilus> n_blownapart: it is returned
<bnagy> you know enough now to use irb - you can work out these things
<bnagy> define a local var, then make the enum, then see if the local var is visible when you do you each_woth_index
<banisterfiend> n_blownapart: bnagx0r is right, u can figure out a lot of your questions on #ruby yourself :P you have the skills now i think
sepp2k1 has joined #ruby
sepp2k has quit [Read error: Connection reset by peer]
<TTilus> chare: thats very valid question, it is really a matter of choise to ask for conversions and maintain schema state automatically (the rails way)
macmartine has joined #ruby
Takehiro has joined #ruby
<TTilus> chare: or to ask for schema def and determine migration automatically
randomau_ has joined #ruby
xyxxy has quit [Quit: Page closed]
w400z has quit []
<TTilus> chare: the former allows you to combine schema and data conversions
ngoldman has quit [Remote host closed the connection]
burgestrand has quit [Quit: Leaving.]
uris has quit [Quit: leaving]
<TTilus> chare: the later mandates the separation of them
azm has joined #ruby
azm has joined #ruby
azm has quit [Changing host]
c0rn_ has joined #ruby
<TTilus> chare: and ive never seen any point in "down" migration, it is always snapshot/dump (rails provides schema dump and seed.rb) which you roll back with, not a down migration
<n_blownapart> banisterfiend: bnagy I'm not lazy, I just get very little out of web searches. the answers get mired down in context I don't yet understand. I can follow some of it...crestfallen.
Kichael has quit [Ping timeout: 245 seconds]
<banisterfiend> n_blownapart: websearches != irb/pry :P
<banisterfiend> you can answer questions by asking ruby itself ;)
<bnagy> hypothesis, experiment, result!
fearoffish has quit [Quit: Computer has gone to sleep.]
t96150 has quit [Remote host closed the connection]
yasushi has joined #ruby
apeschel has quit []
t31143 has joined #ruby
xnm has joined #ruby
<bnagy> I actually honestly wonder sometimes if the expectation that all answers are instantly available on google is changing the way we learn
Takehiro has quit [Remote host closed the connection]
<banisterfiend> bnagy: how long do you wonder about it b4 u start thinking about sth more interesting
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<bnagy> a while - it's pretty relevant in my field
<n_blownapart> banisterfiend: banisterfiend well I prefer people that's part of the reason I'm asking. However horrible they are, I need to pose questions until I can comprehend.
jorge has joined #ruby
<bnagy> n_blownapart: that's how 3 year olds learn
<banisterfiend> n_blownapart: the knowledge will be more firmly cemented if you acquire it yourself, the hard way :) srsly, once u get used to using irb/pry to answer questions u probably wont go back, its' really effective way 2 learn
<bnagy> 'why?'
<n_blownapart> banisterfiend: but the output is just the output, it doesn't explain itself.
<banisterfiend> n_blownapart: ruby (combined with irb/pry) can answer any question you ask it nearly any level of detail u want
machty_ has joined #ruby
<bnagy> you just have to ask the right questions
fyolnish_ has joined #ruby
<banisterfiend> it tells u why, u can view the source code, view the documentation, try things out, see the result, and so on
Takehiro has joined #ruby
machty has quit [Read error: Connection reset by peer]
machty_ is now known as machty
wallerdev has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
thecreators has joined #ruby
<bnagy> try mentally rephrasing all your 'how does...' 'where is...' questions as 'does it work like this?' 'is it here?'
<bnagy> then you can test that
jorge has quit [Ping timeout: 240 seconds]
<bnagy> good questions can be verified, negated, quantified
r0bby_ has joined #ruby
yoklov has quit [Quit: computer sleeping]
yasushi has quit [Remote host closed the connection]
curious_develope has joined #ruby
don1 has joined #ruby
don1 has quit [Client Quit]
Spooner has quit [Ping timeout: 246 seconds]
sepp2k1 has quit [Ping timeout: 246 seconds]
insecurlex has quit [Remote host closed the connection]
techsurvivor has quit [Ping timeout: 246 seconds]
r0bby has quit [Ping timeout: 246 seconds]
tommyvYo has quit [Quit: Computer has gone to sleep.]
sepp2k has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
yoklov has joined #ruby
<curious_develope> hi all, iam trying to figure out what exactly private and protected means. it seems that private methods cannot take a receiver (can never be called outside class hierarchy). Protected is you can use a receiver and as long as the receiver is the same type where the protected method lives
jasonLaster has joined #ruby
ozzloy has quit [Ping timeout: 246 seconds]
jasonLas_ has quit [Ping timeout: 246 seconds]
<banisterfiend> curious_develope: sounds right
<curious_develope> banisterfiend: anything you would add or change?
mmitchell has joined #ruby
<banisterfiend> curious_develope: well there's an edge case in the case of foo= methods
<banisterfiend> where self.foo= is valid, even if foo= is private
locriani has quit [Remote host closed the connection]
mike4_ has quit [Quit: bbl]
<banisterfiend> but that's about it
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
zamn has joined #ruby
ozzloy has joined #ruby
ozzloy has quit [Changing host]
ozzloy has joined #ruby
yoklov has quit [Client Quit]
<zamn> hey how would i go about editing images in ruby
maletor has joined #ruby
techsurvivor has joined #ruby
jgrevich has quit [Quit: jgrevich]
<banisterfiend> zamn: believe in yourself, and u can do it
insecurlex has joined #ruby
<zamn> is there a library
Takehiro has quit [Remote host closed the connection]
jords has joined #ruby
<curious_develope> banisterfiend: what causes that edge case?
<jords> Hey, I'm debugging a weird issue with nokogiri behaving differently on my laptop and on heroku (it's correct on my laptop). I've isolated it to this: Digest::MD5.hexdigest(open("https://s3.amazonaws.com/projectxuploads/a").to_s)
<chare> oh fuck me how do i connect rails to multipl databases
<jords> on my laptop, that gives b2ae94516e5a5b28a789dda743bcaa66, on heroku it gives 7a4a63171833cd2300aab3dbe91c0d96
<banisterfiend> curious_develope: "v = x" always creates locals
<n_blownapart> banisterfiend. bnagy this is all really appreciated but just as a nearby example: I switched line 5, the block arguments from { |e,i| puts "#{i}: #{e}"} to { |i,e| puts "#{i}: #{e}"} . The output switched with the value "one" first and the index second. how could I discern why. The sequence of #{} didn't change.
<jords> what could cause that? the locales seem to match...
jonathanwallace has joined #ruby
<banisterfiend> curious_develope: if "self.foo= x" could be invoked as simply "foo = x" then it would be impossible to create a foo local
mmitchell has quit [Ping timeout: 276 seconds]
<jords> oh wait, that's totally dumb
maletor has quit [Client Quit]
<jords> I'll come back :)
<zamn> jords: what was wrong? llool
<banisterfiend> curious_develope: basically, if you *ever* wanna use a foo= method on the current self when u have to use self.foo=
<banisterfiend> curious_develope: cos without the explicit receiver, it'll always create a local
devdazed has quit [Ping timeout: 260 seconds]
yxhuvud has joined #ruby
randomau_ has quit [Read error: Connection reset by peer]
<jords> zamn: open("https://s3.amazonaws.com/projectxuploads/a").to_s => "#<File:0x00000004c75868>". It turns out the memory map on the server is'nt identical to the one on my laptop. There is a real problem here but it's not that :)
<zamn> teehee you silly goose
hemanth has joined #ruby
<curious_develope> banisterfiend: thanks
<banisterfiend> curious_develope: k00
grenierm_ has joined #ruby
azm has quit [Read error: Operation timed out]
sterex has quit [Quit: sterex]
jonathanwallace has quit [Ping timeout: 265 seconds]
Cache_Money has quit [Ping timeout: 252 seconds]
<jords> Ok, let's try this again. Digest::MD5.hexdigest(open("https://s3.amazonaws.com/projectxuploads/a").read) produces the same result on my computer and heroku, but Digest::MD5.hexdigest(Nokogiri::HTML( open("https://s3.amazonaws.com/projectxuploads/a")).to_s) produces different results. Both of them produce the same result every time, so it's repeatable. Both are running nokogiri 1.5.5 on linux_x64.
t31143 has quit [Remote host closed the connection]
t49206 has joined #ruby
<zamn> same ruby versions?
<jords> The output produced on my computer is correct, where as the one from heroku has a </body> </html> and <html> inserted in a few places throughout the output
<jords> both 1.9.3, not sure about the patch version
<jords> should be the same, I'm running 194 on my computer and heroku runs 194 as well iirc
taichou has joined #ruby
AMcP has joined #ruby
<bnagy> test with a different site, one that you know is only hosted in one physical location
<jords> bnagy, but the result from the md5 of the open command matches?
<jords> unless somebody is generating hash conflicts in order to f*** with my mind
<bnagy> I got no idea what's providing that open command :)
<jords> open-uri :)
<bnagy> anyway, forget the MD5 part until you work out why the html is different
<bnagy> it'll just hide things from you
yoklov has joined #ruby
<bnagy> and I still say test with a more controlled site
ananthakumaran has quit [Quit: Leaving.]
<jords> Well It seems that when I give the nokogiri on heroku and the nokogiri on my computer the same input, I get different results. I could give that a try I guess.
n_blownapart has quit [Remote host closed the connection]
zamn has left #ruby [#ruby]
curious_develope has quit [Quit: Page closed]
civilordergone has joined #ruby
<civilordergone> hey, i have an array with multiple key + values, i was wondering how to output when doing a for loop, a particular key?
mascool has joined #ruby
vectorshelve has joined #ruby
burgestrand has joined #ruby
<jords> Ok, I have it on my site now: Digest::MD5.hexdigest(Nokogiri::HTML( open("http://thoms.net.nz/a")).to_s)
<havenn> civilordergone: { key: 'value', aim: true, pie: 'better than cake' }.each_key { |k| puts k }
c0rn_ has quit [Quit: Computer has gone to sleep.]
<havenn> civilordergone: Neither Array, nor for loop, but...
<jords> So the actual problem I have is that Nokogiri::HTML( open("http://thoms.net.nz/a")).css("body > div").count is 9 on heroku, and 22 on my computer
recycle has joined #ruby
<civilordergone> havenn, is there a way to specify though on an each iteration a particular key?
sgmac has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
shadoi has quit [Quit: Leaving.]
<bnagy> jords: why do you keep testing not-the-real-problem ? :)
<havenn> civilordergone: I'd recommend checking out Hash class methods: http://www.ruby-doc.org/core-1.9.3/Hash.html
<bnagy> the real problem is 'what html does Nokogiri::HTML get from the page', no?
<jords> Well the problem is in the node tree nokogiri is generating
banisterfiend has quit [Remote host closed the connection]
<jords> but it's difficult to compare those since this is a 700kb html file
<bnagy> only if it's getting the same raw html
<jords> as it's input? they have the same md5 hash, so I think it's safe to assume it's the same
thecreators has quit [Quit: thecreators]
<jords> I'm just using the open command as an easy way to ensure I'm using the same input on different servers
maletor has joined #ruby
<bnagy> you need to look at nokogiri's idea of raw html, not open-uri's
arkiver has joined #ruby
<bnagy> or, better, pass html strings you know are identical to nokogiri
<bnagy> anyway, must hack, sry
banisterfiend` has joined #ruby
anoldhacker has joined #ruby
td123 has quit [Quit: WeeChat 0.3.8]
xnm has quit [Read error: No route to host]
tagrudev has joined #ruby
banisterfiend` has quit [Remote host closed the connection]
coyo has quit [Quit: Heaven is not a place, it's being with people who love you.]
poga has quit [Remote host closed the connection]
<jords> bnagy, np, thanks for your help
shiki has quit [Remote host closed the connection]
yoklov has quit [Ping timeout: 240 seconds]
macmartine has quit [Quit: Computer has gone to sleep.]
<poop_> I have a question. I'm printing out some (unknown) data and it usually looks somewhat like this: "\333\302\eJ\322&" (truncated) Do the slashes indicate binary data?
<poop_> or unprintable characters
grenierm_ has quit [Quit: grenierm_]
ringotwo has joined #ruby
mascool has quit [Ping timeout: 244 seconds]
Stalkr_ has joined #ruby
Banistergalaxy has joined #ruby
AMcP has quit [Remote host closed the connection]
zyphlar has joined #ruby
<zyphlar> heyo
<bnagy> poop_: that's octal
<vectorshelve> hemanth: good morning
devdazed has joined #ruby
<zyphlar> i'm trying to help someone understand how before_save callbacks are implemented in rails, but we're having trouble with self. and instance variables
nilg has joined #ruby
Bauer1 has quit [Ping timeout: 276 seconds]
<zyphlar> i.e. if Foo < Parent and Parent has def self.before_save(*args), we try to save @args = args but it doesn't persist anywhere we can find
Bauer1 has joined #ruby
banisterfiend has joined #ruby
civilordergone has quit [Quit: Leaving]
<poop_> bnagy: I thought octal was for integers only... in any case, how can I convert it to its hex representation?
sailias has quit [Quit: Leaving.]
<zyphlar> so: how do you call a parent method from within child class Foo, which saves an instance variable in a way we can later access?
<bnagy> "\333".each_byte.map {|b| "%.2X" % b} for example
<havenn> >> "\333".unpack 'H*'
<al2o3cr> (Array) ["db"]
devdazed has quit [Ping timeout: 246 seconds]
<poop_> Thanks
<poop_> I still need to get used to ruby's syntax
<anoldhacker> zyphlar: please take this to #rubyonrails
<zyphlar> anoldhacker: i would except this is pure ruby
<zyphlar> the naming of before_save is just coincidental to trying to understand how instance variables inherit
r0bby_ is now known as robbyoconnor
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
t49206 has quit [Remote host closed the connection]
t36340 has joined #ruby
slycog has quit [Ping timeout: 260 seconds]
<anoldhacker> zyphlar: You are talking about persisting data. Either you are really conflating your problem, or this is much, much more about what Rails is up to than not.
jearvondharrie has quit [Ping timeout: 276 seconds]
<zyphlar> yeah the problem is conflated when i describe it like that. here's a gist. https://gist.github.com/3432239
<zyphlar> basically if you change [:foo, :bar] on line 9 to @args, you get a nomethoderror because @args doesn't exist in that scope
ringotwo has quit [Read error: Connection reset by peer]
ringotwo has joined #ruby
<zyphlar> again, this isn't rails, this is just imitating their callback style for educational purposes
mxweas has joined #ruby
sdwrage has quit [Ping timeout: 252 seconds]
<bnagy> @args is a class ivar there, try p self.class.instance_variables in #save
tonini has joined #ruby
[|Ayax|] has joined #ruby
<anoldhacker> BTW, before_save is part of AM, and you're not inheriting from there...
hukl has joined #ruby
hukl has quit [Remote host closed the connection]
<zyphlar> thanks bnagy
<anoldhacker> And... Since @args is an ivar on PaulAR, you won't be able to see it from and instance of Foo via self.class.instance_variable, since self.class will yield Foo.
<zyphlar> anoldhacker: this isn't part of rails, it's just imitating it. before_save is in PaulAR
<zyphlar> right, so how do we save @args into Foo?
<anoldhacker> PaulAr.inherited.
<zyphlar> afaik the problem is in self.before_save being able to save stuff into Foo
[|Ayax|] has left #ruby [#ruby]
<zyphlar> ok
<anoldhacker> Ugly, but it works.
<anoldhacker> Or, you could define a method in Foo to read it out.
<anoldhacker> Or, if you want to live REALLY dangerously, use a class var on PaulAr.
dimday has joined #ruby
lightspeare has joined #ruby
<anoldhacker> I'm not a fan of those, though. At all.
lateau1 has joined #ruby
dimday has quit [Client Quit]
<zyphlar> yeah trying to avoid class vars
lightspeare has quit [Client Quit]
dimday has joined #ruby
<bnagy> you can pull your class ivars into normal ivars in init
<anoldhacker> Good for you.
<bnagy> same for your superclass ivars
slycog has joined #ruby
davorb has joined #ruby
ciopte7 has quit [Quit: ciopte7]
lurch_ has joined #ruby
<bnagy> but ime all of this metajiggerypokery ends up looking a bit ugly underneath the covers - esp with inheritance
<anoldhacker> Remember, though, that you can get an almost identical effect by defining attr accessors on your class, then defining parallel attr accessors in your instance to access the class accessors.
n_blownapart has joined #ruby
<anoldhacker> Those inherit, which solves your problem as well.
<zyphlar> hmm k
Araxia_ has joined #ruby
Araxia has quit [Read error: Connection reset by peer]
Araxia_ is now known as Araxia
senny has joined #ruby
<zyphlar> PaulAR.inherited is private?
heftig has quit [Ping timeout: 245 seconds]
<zyphlar> what i don't get is why before_save must be a static method when it's called from a child
circlicious has joined #ruby
<zyphlar> though i guess it's outside a method so it kinda makes sense
<circlicious> how can i replicate JS type of ifs? i mean i want if(0) to return false
<circlicious> i think i mean falsy values
<bnagy> you can't, thank bishnu
<bnagy> test .zero?
<anoldhacker> zyphlar: You're before save is NOTHING like AM's.
<circlicious> in ruby only if(false) will not execute the block, all other values will execute the block
<circlicious> bnagy: for me?
ttilley has joined #ruby
<banisterfiend> zyphlar: what do u want before_save to do exactly
ttilley has quit [Changing host]
ttilley has joined #ruby
<bnagy> circlicious: yes. actually nil is falsey as well
<circlicious> ya nil and false
<banisterfiend> nm
<circlicious> well
<circlicious> i want to execute a block if the variable is not '' nil and false, how do i do that?
<zyphlar> banisterfiend: just as coded, if it worked. just to figure out callbacks across inheritance
<circlicious> and 0
n_blownapart has quit [Remote host closed the connection]
<circlicious> do i make sense bnagy
<anoldhacker> zyphlar: You mentioned calling before_save from an instance. Yours does nothing for the instance.
<banisterfiend> zyphlar: couldn't you get before_save to decorate teh save method?
<havenn> >> 0.respond_to?(:empty?) ? empty? : !self
<al2o3cr> (FalseClass) false
<circlicious> if var != '' && var != 0 && !var - seems messy
<havenn> >> ''.respond_to?(:empty?) ? empty? : !self
<al2o3cr> -e:1:in `eval': undefined method `empty?' for main:Object (NoMethodError), from -e:1:in `eval', from -e:1:in `<main>'
<zyphlar> what's decorate?
<anoldhacker> AM before_save pushes a method name on the callback stack. The callbacks are in turn wrapped around the AM#base methods. When the base methods get called, the methods in the callback stack are invoked appropriately.
rohit has joined #ruby
<circlicious> how did you know i am using rails ? :P
<zyphlar> anoldhacker: that sounds conceptually like what i'm trying to do here, i guess i don't understand the difference well enough
<circlicious> buit that wont work for 0
<circlicious> ugh
<zyphlar> circlicious: you could override integer with a .falsy? method
<anoldhacker> zyphlar: You have to be a pretty good programmer to come up with something as messed up as rails.
elhu has joined #ruby
<zyphlar> anoldhacker: apparently so ;)
<bnagy> what's wrong with if @foo && not @foo.empty? && @foo.nonzero?
<circlicious> too lomng :D
<bnagy> you're testing threee things, why should someone reading your code not know that?
<rohit> What are ou trying to do?
<hemanth> vectorshelve, yo! long time
ananthakumaran has joined #ruby
<rohit> you*
<vectorshelve> hemanth: yes.. hope you are doing good..
<anoldhacker> Seriously, if you want AM behavior, use it. If you want something similar but not quite, dig in. Be prepared to feel like you've entered a house of mirrors.
weethawk has joined #ruby
chare has quit [Quit: Leaving]
<hemanth> vectorshelve, true
<weethawk> I'm not sure if this is the right channel to ask, but I'm just asking any channels in general. Does anyone know a possible way to find out the creator/owner of a Facebook Fan Page?
Bauer1 has quit [Ping timeout: 244 seconds]
<zyphlar> anoldhacker: so how would you implement something vaguely similar? i feel like i could do it in a language i'm more versed in like java/c# but ruby classes confuse me
Bauer1 has joined #ruby
<weethawk> tl;dr: fan page is harassing friends constantly, FB wont take it down, trying to find out who owns it
<zyphlar> weethawk: this is definitely not facebook support :)
<weethawk> Well thank you for the obvious :)
<rohit> weeb1e_, Can't your friend just block the fan page? :)
<banisterfiend> zyphlar: one sec.
<zyphlar> banisterfiend: thanks
<weethawk> FB has been having a gltich where blocking fan-pages won't work. Trust me, we've tried. having a fan-page dedicated to making fun of your friend who was killed gets annoying after a while
t36340 has quit [Remote host closed the connection]
<weethawk> hence my desperate attempt to find the owner
t59161 has joined #ruby
<zyphlar> bitch about FB on twitter? ;D
<bnagy> or somewhere other than here
<weethawk> you're not really being funny zyphlar
jords has quit [Ping timeout: 268 seconds]
<weethawk> i'm just asking if anyone had an answeer to my question
<banisterfiend> zyphlar: https://gist.github.com/3433238
<banisterfiend> zyphlar: assuming i understand what u're trying to do
<havenn> weethawk: What is the fan page?
<zyphlar> banisterfiend: looks like voodoo, which is probably what i need ;)
<banisterfiend> anoldhacker: is that right? https://gist.github.com/3433238
<banisterfiend> im not 100% what he's trying to achieve
<weethawk> page called "LOL jessicas finally dead. bitch."
rakunHo has joined #ruby
<bnagy> weethawk: seriously, this is not the forum for complaining about your facebook woes. If you're not here to talk about ruby, please go somewhere else
<weethawk> bnagy: i'm not complaining, I'm asking for help. Please don't be an asshole for no reason.
<bnagy> it's ironic that you're displaying bad netiquette because you're upset about someone's bad netiqeutte
<weethawk> ...
<bnagy> ask for help somewhere appropriate
<weethawk> there is litereally no appropriate place for a questiont his specfic
<anoldhacker> Well, your example looks more like "after_save" than "before_save" to me, and I'm not super-up on unbound methods, but yeah, that probably works. I'm still trying to understand the problem being addressed, though.
Eldariof-ru has joined #ruby
* anoldhacker assumes that weethawk is a troll.
<banisterfiend> anoldhacker: good point, he can just switch those 2 lines around though
kvirani has quit [Ping timeout: 244 seconds]
<weethawk> Anoldhacker: I'm just asking the top populated channels because this isn't something i can solve on my own and it's causing serious issues for family and friends
<weethawk> a simple "yes" or "no" to the basic question would have worked
andrewhl has quit [Ping timeout: 265 seconds]
M- has joined #ruby
<banisterfiend> zyphlar: switched, https://gist.github.com/3433238
adamkittelson has quit [Remote host closed the connection]
weethawk has left #ruby ["Leaving"]
<zyphlar> weethawk: we have no idea, try something facebook related
<zyphlar> aw
<bnagy> talk about #firstworldproblems >:(
<rohit> weethawk, Your best bet is getting in touch with Facebook directly. Sorry but folks are right that this is not the right channel to ask questions about Facebook. :)
<zyphlar> banisterfiend: thanks, it works on my machine and passes most of the tests i throw at it. the old_save.bind(self).call seems to be the voodoo that does it
<banisterfiend> zyphlar: yeah, it's called method decorationb
jenrzzz has joined #ruby
<zyphlar> to pop in to the right scope
<zyphlar> hmm i tried googling for decoration, i'll have to investigate more
<banisterfiend> basically i keep redefining the 'save' method, but calling the previous version after
<banisterfiend> i save state by using closures
sgmac has left #ruby [#ruby]
<banisterfiend> so you dont need any ivars
<rohit> It's a pattern, no? Try searching for method decoration pattern
<banisterfiend> i just close over the parameters
kvirani has joined #ruby
<banisterfiend> zyphlar: it's kind of like alias method chain, but less retarded
ryanf has joined #ruby
bradhe has quit [Remote host closed the connection]
jasonLaster has quit [Remote host closed the connection]
alanp_ has joined #ruby
jasonLaster has joined #ruby
<zyphlar> ah, damn closures. this article is right: they taught me OO and forgot about this functional wizardry
alanp has quit [Ping timeout: 245 seconds]
Stalkr_ has quit [Read error: Connection reset by peer]
Stalkr_ has joined #ruby
maesbn has joined #ruby
Stalkr_ has quit [Client Quit]
<banisterfiend> zyphlar: what article
jenrzzz has quit [Ping timeout: 248 seconds]
<anoldhacker> @banisterfiend: I have to disagree with you on your solution being better than amc.
<davidcelis> :%s/closure/clojure/
<zyphlar> clojure uses closures, no?
<davidcelis> closures use clojure
<zyphlar> anoldhacker: not looking for better, just roughly equivalent
<banisterfiend> araujo: why's that? alias_method_chain fills your object with a tonne of methods with ridiculous names
<anoldhacker> @banisterfiend: with amc, you can see the stack trace cleanly, even if the method names change. Furthermore, you can instert additional stuff after the fact.
venkatk_ has joined #ruby
<banisterfiend> anoldhacker:
jasonLaster has quit [Ping timeout: 246 seconds]
davorb has quit [Quit: Computer has gone to sleep.]
ilyam has quit [Quit: ilyam]
brianpWins has joined #ruby
<banisterfiend> anoldhacker: i dont think amc helps with the stacktrace, u see a bunch of similarly named with weird suffixes, also, im not sure how my one shows up in the stacktrace
<banisterfiend> ill check it now
<anoldhacker> @banisterfiend: I agree that there is a price to pay for keeping the chain open, but it made my life REALLY easy when I changed the UserStamp gem to wrap save_without_timestamps instead of save.
<banisterfiend> anoldhacker: what do u mean keeping the chain open? you can use the unbound method approach any time you would use teh amc approach instead, afaik
<banisterfiend> can you give an example where you can use amc but cant use the unbound method approach?
devdazed has joined #ruby
<anoldhacker> @banisterfiend: In the stack trace, you get the file name and line number of the calls. Very clean. With your solution, you can come back to the same line over & over, and it can become difficult to determine exactly which iteration you are on.
igotnole_ has joined #ruby
jwmann1 has joined #ruby
igotnolegs has quit [Ping timeout: 244 seconds]
jwmann1 has quit [Max SendQ exceeded]
<anoldhacker> @banisterfiend: Sure. The UserStamp gem originally wrapped AR#save to add a userstamp in a fashion which was parallel to timestamp.
jwmann1 has joined #ruby
<anoldhacker> @banisterfiend: When AR added the Dirty module, however, it had the effect of making lots of objects dirty that should not be.
djdb has joined #ruby
<anoldhacker> With AMC, I changed the call from alias_method_chain :save, :userstamp to alias_method_chain :save_without_timestamp, :userstamp.
<anoldhacker> Done.
devdazed has quit [Ping timeout: 246 seconds]
<circlicious> seriosuly is there a better way to do this
<circlicious> if a['td'] && a['td'] != 0 && a['td'] != '' ?
jwmann1 has quit [Client Quit]
<banisterfiend> anoldhacker: well there's tradeoffs either way, in amc you get a cluttered method table which makes it harder to see what's going on when interacting with objects in the REPL
<banisterfiend> anoldhacker: further, using unbound methods, u do get the filename/line number, its' just not labelled very nicely it's just called "block" as opposed to a named method
havenn has quit [Remote host closed the connection]
<zyphlar> circlicious: there are rails methods like .blank? .nil? .nonzero? you can use
<bnagy> circlicious: if a.has_key? td; unless a['td'].zero? || a['td'].empty?; ...
mahmoudimus has joined #ruby
<bnagy> nil? and nonzero? are ruby
<banisterfiend> anoldhacker: and i just interactively played with the backtrace in pry, using 'cat --ex' it was able to show me each of the different places the method was redefined (with unbound methods)
bradhe has joined #ruby
und3f has joined #ruby
<circlicious> zyphlar: i use nonzero, i think its ruby method, but nonzero on a string would cause error
<zyphlar> ah
<anoldhacker> @banisterfiend: Your solution is to create methods that get called but don't show up in instance_methods? I don't see much of a win there...
<banisterfiend> anoldhacker: i guess it depends on the tools you use, examining the stack trace using pry makes it easy, either way
<zyphlar> i use .blank? for most of my stuff which is rails
<circlicious> .blank? wont go werll with 0
<anoldhacker> @banisterfiend: I've never used pry. Sounds like I might need to learn it.
<circlicious> bnagy: almost similar, k
<banisterfiend> anoldhacker: the win is 1. you dont have a cluttered method table so it's easy to play with things in the repl 2. i agree that the method names dont show up in teh stacktrace, but with a decent debugging tool like pry it doesnt matter anyway
lewis1711 has joined #ruby
<lewis1711> http://pastebin.com/wV7yVwts is there a quick and dirty way to make sure each element of "address_to_binary" has length 8? ie, packed with leading 0s
<bnagy> lewis1711: printf specifier?
davorb has joined #ruby
<anoldhacker> lewis1711: Look up String#%
<lewis1711> anoldhacker: aha, that's the ticket, thanks
philips_ has quit [Excess Flood]
<banisterfiend> anoldhacker: https://gist.github.com/3433399
devdazed has joined #ruby
shiki has joined #ruby
jords has joined #ruby
timonv has joined #ruby
philips_ has joined #ruby
jprovazn_away is now known as jprovazn
Guest37999 has joined #ruby
ringotwo has quit [Remote host closed the connection]
havenn has joined #ruby
burgestrand has quit [Quit: Leaving.]
havenn has quit [Remote host closed the connection]
elhu has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby
rohit has quit [Quit: Leaving]
freeayu__ has quit [Read error: Connection reset by peer]
apeiros_ has joined #ruby
limeds has joined #ruby
freeayu has joined #ruby
machty has quit [Ping timeout: 240 seconds]
petrjanda has joined #ruby
elhu has joined #ruby
petrjanda has quit [Client Quit]
freeayu__ has joined #ruby
heftig has joined #ruby
Morkel has joined #ruby
cirwin has joined #ruby
anoldhacker has quit [Quit: KVIrc Insomnia 4.0.0, revision: 3900, sources date: 20100125, built on: 2011-03-15 15:32:03 UTC 3900 http://www.kvirc.net/]
<limeds> good morning, just cant figure out how to use .run so i can publish data from the udp server to the websocket, hope someone could help / show me how to -> http://pastebin.com/ZUvUz0pz
freeayu has quit [Ping timeout: 246 seconds]
elhu has quit [Client Quit]
savage- has quit [Remote host closed the connection]
<RubyPanther> when I shut down apache my my apache module (with an embedded Ruby 2.0) keeps spewing: mod_foo: warning: already initialized constant TMP_RUBY_PREFIX
pskosinski has joined #ruby
<lewis1711> ["11", "00"].inject(:&&) #err, I don't get this error
riley526 has quit [Remote host closed the connection]
<lewis1711> surely && is a method on strings? since it responds to it
freeayu3 has joined #ruby
Urtokk_ has quit [Quit: leaving]
lukekhamilton has quit [Quit: lukekhamilton]
answer_42 has joined #ruby
freeayu3 has quit [Read error: Connection reset by peer]
freeayu3 has joined #ruby
<lewis1711> meh I'll just do it the long way
<bnagy> >> [0b00,0b11].inject(&:&)
<al2o3cr> (Fixnum) 0
<bnagy> && is logical
<bnagy> and, afaik, an operator not a method
freeayu__ has quit [Ping timeout: 264 seconds]
nazty has joined #ruby
naz has quit [Ping timeout: 240 seconds]
lewis1711 has left #ruby [#ruby]
iflista has quit [Ping timeout: 265 seconds]
ryanf_ has joined #ruby
ph^_ has joined #ruby
qwerxy has joined #ruby
zommi has joined #ruby
nilg has quit [Ping timeout: 240 seconds]
mc0e has joined #ruby
naz has joined #ruby
nazty has quit [Ping timeout: 252 seconds]
situ has joined #ruby
t59161 has quit [Remote host closed the connection]
t55681 has joined #ruby
igotnole_ has quit [Quit: Computer has gone to sleep.]
Zespre_ has quit [Ping timeout: 245 seconds]
chimkan___ has quit [Quit: chimkan___]
Zespre has joined #ruby
fantazo has quit [Remote host closed the connection]
aganov has joined #ruby
Urtokk has joined #ruby
petrjanda has joined #ruby
kedare has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
Tomasso has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
daniel_hinojosa has joined #ruby
davorb has quit [Quit: Computer has gone to sleep.]
dhruvasagar has joined #ruby
elhu has joined #ruby
nazty has joined #ruby
xorigin has joined #ruby
naz has quit [Ping timeout: 246 seconds]
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
naz has joined #ruby
dekroning has joined #ruby
banisterfiend has joined #ruby
freeayu__ has joined #ruby
Mchl has joined #ruby
jasonLaster has joined #ruby
freeayu3 has quit [Ping timeout: 245 seconds]
chussenot has joined #ruby
nazty has quit [Ping timeout: 260 seconds]
gloomer has joined #ruby
robustus has joined #ruby
elhu has quit [Ping timeout: 240 seconds]
Mchl has quit [Ping timeout: 246 seconds]
freeayu3 has joined #ruby
Hanmac1 is now known as Hanmac
fabrice31 has joined #ruby
adeponte has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
lolmaus has joined #ruby
elhu has joined #ruby
t55681 has quit [Remote host closed the connection]
t6012 has joined #ruby
freeayu__ has quit [Ping timeout: 245 seconds]
silentbob_ has joined #ruby
dekroning has quit [Quit: leaving]
jasonLaster has quit [Ping timeout: 276 seconds]
silentbob_ has left #ruby [#ruby]
hoelzro|away is now known as hoelzro
<Mon_Ouie> >> ["11", "00"].all?
<al2o3cr> (TrueClass) true
<Mon_Ouie> ^ this will properly short-circuit
<Mon_Ouie> && could not be implemented as a method, otherwise "foo && foo.bar" would always need to evaluate foo.bar
arkiver has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
pingfloyd has quit [Quit: pingfloyd]
thone has joined #ruby
daniel_hinojosa has quit [Quit: Leaving.]
thone_ has quit [Ping timeout: 252 seconds]
freeayu3 has quit [Read error: Connection reset by peer]
freeayu3 has joined #ruby
daniel_hinojosa has joined #ruby
fastred has joined #ruby
wobr1 has joined #ruby
<banisterfiend> Mon_Ouie: hello
clocKwize has joined #ruby
chussenot has quit [Quit: chussenot]
maletor has quit [Quit: Computer has gone to sleep.]
devdazed has quit [Ping timeout: 240 seconds]
LouisGB has joined #ruby
Whoop has quit [Ping timeout: 245 seconds]
<Mon_Ouie> 'alut
<banisterfiend> Mon_Ouie: have you ever had someone go "wtf?" when you said "'alut" cos it's a bit of a stretch for some people to figure out what 'alut means ;)
<banisterfiend> Mon_Ouie: you were just lucky in my case because i'm a french speaker :P but i wonder what others think..
Whoop has joined #ruby
<hoelzro> I figured 'alut was Canadian French
<hoelzro> but I've never been to France, so that shows how much I know =)
<limeds> looks like missing a 's' pre and an 'e' post it
<Mon_Ouie> I don't know where I got it from, I guess I was just looking for a distinctive greeting message :p
<Mon_Ouie> (There's no "e" in French "salut")
insecurlex has quit [Remote host closed the connection]
haxrbyte has joined #ruby
<limeds> my fault, always had a 'F' in french class
Advocation has joined #ruby
devdazed has joined #ruby
no_i_wont_ has quit [Quit: ZNC - http://znc.sourceforge.net]
vlad_starkov has joined #ruby
<limeds> Mon_Ouie: may you can tell me how to get this script working? http://pastebin.com/jpwPJFSX atm its running the websocket, after ctrl+c the udp server but i need to push the data so the websocket....
TPFC-SYSTEM has joined #ruby
Criztian has joined #ruby
Drewch has joined #ruby
Drewch has quit [Excess Flood]
taichou has quit [Remote host closed the connection]
ryanf_ has quit [Ping timeout: 244 seconds]
Xeago has joined #ruby
Drewch has joined #ruby
randomautomator has joined #ruby
ryanf has quit [Quit: broken pipes |||]
mneorr has joined #ruby
d3vic3 has joined #ruby
randomau_ has joined #ruby
mxweas has quit [Quit: Leaving...]
situ has left #ruby [#ruby]
Mchl has joined #ruby
t6012 has quit [Remote host closed the connection]
t47236 has joined #ruby
DDAZZA has joined #ruby
randomautomator has quit [Ping timeout: 268 seconds]
DDAZZA has quit [Client Quit]
Markvilla has joined #ruby
Markvilla has quit [Client Quit]
devdazed has quit [Ping timeout: 240 seconds]
cantonic has joined #ruby
ibash has quit [Quit: ibash]
vlad_starkov has quit [Remote host closed the connection]
cezar has joined #ruby
Beoran__ has quit [Ping timeout: 245 seconds]
wmoxam has quit [Ping timeout: 244 seconds]
ksk_ has quit [Quit: leaving]
Banistergalaxy has quit [Ping timeout: 240 seconds]
ionte has joined #ruby
kedare has quit [Read error: Connection reset by peer]
cezar has quit [Quit: Leaving]
<vectorshelve> any good reference on setting up jruby and torquebox on rvm
kedare has joined #ruby
kedare is now known as Guest10697
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
mneorr has quit [Quit: Leaving.]
<ionte> hi. i need a hint. this is what i want to do: i have a string with a number embedded (let's say "#2382#") and i would like to do arithmetics on that number (say add 500 to it for example). how to do this most efficiently?
<ionte> i'm using a gsub and regex now, but the arithmetics part i don't know how to solve
Bauer1 has quit [Ping timeout: 246 seconds]
Bauer1 has joined #ruby
<eridani> gsub(/#(\d+)/) { |num| num.to_i + 500 }
gtuckerkellogg has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<ionte> eridani: thanks!
<eridani> i'm not sure that's completely accurate
<ionte> also find out i can use $1
petrjanda has quit [Quit: petrjanda]
<ionte> as in "#{$1.to_i + 1000}"
<ionte> love how asking a question on irc gives me an idea of what to google for :)
* Hanmac hates the $1-$9 variables
<ionte> Hanmac: why?
elaptics`away is now known as elaptics
ephemerian has joined #ruby
<Hanmac> its the scope ... in the next block these variables gets invalid (even they look like globals)
<Hanmac> and then the user wonders whats happening
BiHi has joined #ruby
<ionte> why do you think they look global?
Beoran__ has joined #ruby
M- has quit [Quit: This computer has gone to sleep]
<banisterfiend> Hanmac: so what do you use instead of globals?
<banisterfiend> Hanmac: Regexp.captures.first lulz?
<ionte> is there a ruby bot on this channel so that i can evaluate an expression?
<shevy> ionte all $foo variables denote global variables
<banisterfiend> ionte: Yeah
<banisterfiend> >> 1 + 1
<al2o3cr> (Fixnum) 2
lkba has quit [Quit: Bye]
<shevy> al2o3cr you stupid thing
<ionte> shevy: oh, i see
otters has quit [Ping timeout: 240 seconds]
<shevy> ionte, al2o3cr is a bot btw
<banisterfiend> >> "shevy shutup".split.reverse.join(" ") + "!"
<al2o3cr> (String) "shutup shevy!"
<shevy> grrrrr
<shevy> who controls it
<shevy> Hanmac is it you
<ionte> >> "#283".gsub(/#(\d+)/, "\1")
<al2o3cr> (String) "\x01"
<ionte> whyyyy?
<Hanmac> :P
<shevy> hmm
locriani has quit [Remote host closed the connection]
<shevy> "#283".gsub(/#(\d+)/, '\1') # => "283"
<shevy> "#283".delete '#' # => "283"
<Hanmac> or
<Hanmac> >> "#283".gsub(/#(\d+)/, "\\1")
<shevy> :P
<al2o3cr> (String) "283"
<Hanmac> but shevys line is better
<shevy> about optparse
<shevy> is there a way to colourize the output?
<shevy> right now I output different colours in my class
<Hanmac> shevy: i dont make the bot, and i dont control it ... only the bot thinks it is :P
<shevy> but optparse is white
<shevy> :(
<ionte> ah, of course! :)
xbayrockx has joined #ruby
<banisterfiend> >> { 3 => "an", 5 => "semi", 0 => "shevy", 4 => "epsilon", 1 => "is", 6 => "moron" }.sort_by(&:first).map(&:last).join " "
<al2o3cr> (String) "shevy is an epsilon semi moron"
robotmay has joined #ruby
<shevy> grrrr
<eridani> >> `id`
<al2o3cr> -e:1:in `eval': No such file or directory - id (Errno::ENOENT), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<shevy> this was not Hanmac
a_a_g has quit [Ping timeout: 252 seconds]
<eridani> that can't be good
<shevy> I think I know who it is, it's the horse porn lover
<shevy> eridani I am surprised that could even work
<shevy> what is the id binary doing?
zyphlar has left #ruby [#ruby]
<shevy> oh yes
<shevy> feedbacks the UID etc..
<shevy> >> `id jravav`
<al2o3cr> -e:1:in `eval': No such file or directory - id jravav (Errno::ENOENT), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<Hanmac> >> Dir["/usr/bin/*"]
randomau_ has quit [Read error: Connection reset by peer]
t47236 has quit [Remote host closed the connection]
<al2o3cr> (Array) ["/usr/bin/timeout", "/usr/bin/node", "/usr/bin/ruby", "/usr/bin/gem", "/usr/bin/sudo", "/usr/bin/pkill"]
<shevy> hmm probably sandboxed
Criztian has quit [Remote host closed the connection]
t64734 has joined #ruby
<Hanmac> there are only very few binaries
<shevy> hehehe
troessner has joined #ruby
<shevy> apparently
<shevy> a grand total of 6
Criztian has joined #ruby
<shevy> >> `pkill 1`
<al2o3cr> pkill: killing pid 63 failed: Operation not permitted, pkill: killing pid 26292 failed: Operation not permitted
<Hanmac> shevy its not sandboxed anymore, because an sandbox can be broken :P
<shevy> ???
<Hanmac> its running into an VM (or chroot?)
<eridani> i already find all the files
<eridani> there's very little
<shevy> pid 63? pid 26292? from where does it get that numbers
<shevy> lol Hanmac
<eridani> it's chrooted
Guest10697 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
Vert has joined #ruby
<eridani> who runs the bot?
<shevy> this time the sandbox seems safe
<Mon_Ouie> chroot; it just happens to be run in a VM, but that doesn't help the sandboxing
<Mon_Ouie> jrajav
<shevy> eridani, jravav should
Banistergalaxy has joined #ruby
<Hanmac> https://github.com/jrajav/al2o3cr/ << there is the repo of the bot (maybe outdated)
qwerxy has joined #ruby
<eridani> then i guess downloading the code directly from the bot is a waste
justinmcp has joined #ruby
virunga has joined #ruby
<shevy> hehe
Criztian has quit [Ping timeout: 256 seconds]
mneorr has joined #ruby
<Hanmac> shevy do you know this:
<Hanmac> !panic
<al2o3cr> SWEET ZOMBIE JESUS
<al2o3cr> Still alive~
ly_gs has joined #ruby
<shevy> doesn't seem too useful
jords has quit [Ping timeout: 248 seconds]
cirwin has quit [Ping timeout: 268 seconds]
whowantstolivefo has quit [Ping timeout: 260 seconds]
whowantstolivefo has joined #ruby
<banisterfiend> !reset
<al2o3cr> SWEET ZOMBIE JESUS
<al2o3cr> Still alive~
<banisterfiend> !kill hanmac
* Hanmac cant be killed with a bot
wmoxam has joined #ruby
* Hanmac is bot-proof, but the bots are not hanmac-proof
<shevy> Hanmac what do you use for giving ARGV to commandline ruby scripts? optionparser?
ly_gs has quit [Remote host closed the connection]
ly_gs has joined #ruby
<Hanmac> ... currently i never used ARGV ... or optionparser :(
t64734 has quit [Remote host closed the connection]
t46269 has joined #ruby
<shevy> ok then how do you set things like "ruby foo.rb --name bla"
vlad_starkov has joined #ruby
no_i_wont has joined #ruby
<limeds> cant you just use "ruby script bla" und in your ruby file name=ARGV[1]
dimday has quit [Read error: Connection reset by peer]
devdazed has joined #ruby
<shevy> limeds yeah but I also want to use -- settings
<shevy> ruby irc_client.rb --name jonny --channel_name ruby --port 5152
<limeds> i think optionparser would be good
<shevy> I am starting to hate OptionParser
<shevy> end.parse!
<shevy> things like this ^^^
<shevy> HATE :(
<limeds> but i dont use it, me hate it too
<shevy> limeds yeah I will use optionparser for now
<limeds> thats why i use ARGV
<shevy> order!(argv = default_argv, &nonopt)
<limeds> im still trapped in my websocket/udp server code -.- just cant figure out how to get that b**** running and sending..
<shevy> it even has a method called .order!
skattyadz has joined #ruby
wvms has joined #ruby
jeff_sebring has quit [Quit: Leaving]
fyolnish_ has quit [Remote host closed the connection]
chussenot has joined #ruby
<vectorshelve> been getting this error on and again for some time now
<vectorshelve> ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) bad response Forbidden 403 (http://bb-m.rubygems.org/gems/torquebox-server-2.1.0-java.gem)
<shevy> I don't like the foo! methods much
<shevy> vectorshelve HAH
<shevy> java gem!!!!!
<limeds> "`add_observer': observer needs to respond to `update' (NoMethodError)" cant figure out how to fix
<shevy> vectorshelve, I suppose it is unavailable. perhaps the link is down
<vectorshelve> shevy: trying to setup jruby + torquebox :)
<vectorshelve> shevy: :( this is a worry factor from rubygems and other gem hosters
<shevy> there are some elementary truths
<shevy> you can't rely on anything to work in the computer world
jjang has quit [Ping timeout: 240 seconds]
devdazed has quit [Ping timeout: 276 seconds]
devdazed has joined #ruby
<vectorshelve> shevy: any work around to get this completed.. :(
justinmcp has quit [Remote host closed the connection]
_bart has joined #ruby
<limeds> vectorshelve: tried downloading the gem via wget? dunno if you can install it from a local file ?
<shevy> dunno. you can try to download the gem locally?
<_bart> howdy
<shevy> _bart where is lisa
<_bart> it's been a while
<limeds> Homer: Lisa do I have my pants on?!
<shevy> _bart did you leave ruby for python :(
<shevy> limeds hahaha
<vectorshelve> shevy: the link is down :)
<shevy> limeds shame they somehow killed the simpsons :(
<_bart> I left Ruby for visiting Sziget Festival
<vectorshelve> shevy: and the gem giving issue is a dependant gem
<Hanmac> shevy an method name allows only one ! or one ? and only at the end ... "gem!!!!!" is not a valid method name ... okay it works with define_method but i dont trust this
<shevy> sziget... sounds hungarian
<_bart> that's correct
<shevy> :)
<shevy> köszenem sepem!
<shevy> fekede madcka (haha I dont even know how to spell it...)
<_bart> (I'm not hungarian though, got their by a 20-hour trip with a train)
<limeds> hmm shevy new simpsons episodes starting next week monday.. here at .DE
<shevy> was suppose to be "black cat"
<shevy> limeds I stopped watching years ago, they ruined it IMO... so many changes... the whole theme changed... :(
<Muz> Dental plan.
<Muz> Lisa needs braces.
<shevy> lol
<shevy> I remember that one
<_bart> but I'm back with an interesting question. Let's say I have selected a specific <td> element using Nokogiri, now how do I get the corresponding <th> or the first <td> (that most likely has the title/column-name)?
workmad3 has joined #ruby
<shevy> limeds are the last episodes worth watching at all?
<vectorshelve> shevy: I tried curl curl -L https://rubygems.org/downloads/torquebox-server-2.1.0-java.gem -O and seems to work.. 119mb in size :O
<Muz> _bart: how deterministic is the table HTML or is this a generic solution?
danheberden has quit [Ping timeout: 252 seconds]
<shevy> quite a huge gem vectorshelve
khakimov has joined #ruby
<limeds> shevy: dont know, new ones coming next week so i have to judge on monday :D
ickmund has joined #ruby
devdazed has quit [Ping timeout: 260 seconds]
<_bart> Muz: this is a generic solution, artificial intel you might say.
<_bart> :)
dross_ is now known as dross
<Muz> Using XPath, you can get the parent of the TD item, and then descend back to get the th
<matti> shevy: !
<shevy> limeds, and the last ~3 you watched? were they worth any minute spent seeing? :)
<shevy> matti: !!!
atmosx has joined #ruby
<_bart> and how about getting the first td when there is no TH?
<matti> Whoo, Zed has a major rant on HN.
<Muz> As for which position th you want, some maths on the number of preceeding and following td elements as siblings, and maths with the width attrbutes if any of your selected td
<_bart> that's easy too, heh thanks
<limeds> well yes.. always watch while havin dinner
<shevy> matti what is HN
<Muz> _bart: XPath has array offsetting for multiple matches, or the first() operator iirc.
<vectorshelve> shevy: yes they now have torquebox gem to help us get out of the long lengthy conventional way of install it otherwise :)
<Muz> Pull out the table, descend and either pull out the th if present, or fall back to the first td
danheberden has joined #ruby
<_bart> Muz: yes, thanks, I think I'll get this.
<limeds> ok lots o poeple here.. hopefully one can help me now > http://pastebin.com/Sh8FAT48 < when i connect to the websocket it gives me "observer.rb:126:in `add_observer': observer needs to respond to `update' (NoMethodError)"
<shevy> I could try! but I dont know observer.rb
IPGlider has joined #ruby
<Muz> _bart: if you're using Nokogiri, you could even pull the <tr> that your TD is in, and find the array offset of the <td> within that, and use the array key to select the correct item from the corresponding <th> or first <td> row.
<limeds> every help is welcome :)
<Muz> Taking into account width attributes or whatever they're called in the HTML for a <td> that may span several columns.
<_bart> Muz: yes, colspan.
<Muz> That'd be the badger.
chessguy has quit [Remote host closed the connection]
devdazed has joined #ruby
t46269 has quit [Remote host closed the connection]
t27878 has joined #ruby
<_bart> Do you guys use soft tabs or real tabs and how many?
<vectorshelve> Cork: You here too... jquery + ruby = Cork ? :)
workmad3 has quit [Ping timeout: 248 seconds]
<Cork> vectorshelve: javascript, jquery, ruby, RoR, go, python, perl, ...
<hoelzro> _bart: spaces
<Cork> i work in quite a bit of languages here
<Muz> _bart: 2 spaces.
Banistergalaxy has quit [Ping timeout: 246 seconds]
<Muz> Real tabs can die in a chemical fire.
<vectorshelve> Cork: cool man :) But I still insist you are the KING of Jquery
<shevy> _bart I use 2 spaces all the time, without exception
<_bart> yes me too, but a collegue uses real tabs.
<shevy> _bart reason was that I used to use tabs once, but I realized I am trying to align comments, and suddenly was mixing tabs with spaces
<_bart> and we have haml
<Muz> They could do with a liberal application of fire.
<shevy> Cork why perl!!!
<hoelzro> because Perl is awesome =)
<hoelzro> </2c>
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<Cork> shevy: cause we have programs that only accept perl scripts for automation
<Cork> its not for the web though
tonini has quit [Remote host closed the connection]
<shevy> leeeegacy!
<vectorshelve> shevy: :)
fixl has joined #ruby
nirix has quit [Quit: Computer has gone to s…zZzZz]
himsin has joined #ruby
DuoSRX has joined #ruby
<vectorshelve> shevy: as discussed before are the any great online dictionaries with open APIs available I can use for my gem ?
<shevy> hmm not sure
<shevy> I use leo usually for german-english
<shevy> and I collect words I don't know myself into a local yaml file too
<Xeago> thesaurus used to have a api
<Xeago> but that's before it got bought by dictionary.com
<atmosx> that would be a good service
<atmosx> dictionaries with online api, no more scraping shit
andrenkov has joined #ruby
<atmosx> I doubt anyone would offer this service for free though, if the dictionary is good enough...
freeayu3 has quit [Read error: Connection reset by peer]
<vectorshelve> atmosx: :)
<atmosx> vectorshelve: what langs are you looking to translate?
<atmosx> or by dictoinary you mean, thesaurus?
<vectorshelve> atmosx: yes
<atmosx> vectorshelve: we had the same conversation again right?
<vectorshelve> atmosx: yes I have documented your thoughts and links... waiting for the weekend :)
<atmosx> okay :-)
<atmosx> json API
<atmosx> anyone the iPad 2 has arrived, I'm gonna go check it and probably take it
sspiff has quit [Remote host closed the connection]
<vectorshelve> atmosx: for ?
Speed has joined #ruby
Speed has quit [Changing host]
Speed has joined #ruby
Takehiro has joined #ruby
<atmosx> my mother
<shevy> lol
<atmosx> it's the best way for her to use FaceTime and call me when I'm abroad
<atmosx> plus I think it's the last high-tech piece of hardware I'm gonna buy for the next couple of years
<shevy> sure sure sure
t27878 has quit [Remote host closed the connection]
<shevy> ;)
<vectorshelve> atmosx: :D I am looking to sought of get the results from a good site into array and give that out as the output of the gem method
limeds has quit [Read error: Connection reset by peer]
<atmosx> hahaha
<shevy> vectorshelve soon you will reach this point:
<shevy> "omg all those gems suck... I will write my own gem that works"
limes has joined #ruby
seitensei has quit [Quit: Computer has gone to sleep.]
<vectorshelve> atmosx: why you laughing ?
t45152 has joined #ruby
<atmosx> that would be a slow method, the book I'm reading dectates that you should pick a good name for that method!
<atmosx> vectorshelve: about shevy's 'sure sure sure' statement
cantonic has quit [Ping timeout: 246 seconds]
devdazed has quit [Ping timeout: 276 seconds]
<vectorshelve> shevy: what does that statement mean... itt;'s more like a wierd extrapolation which you aint sure yourself that it will turn true some day :D
seitensei has joined #ruby
<shevy> vectorshelve he said he wont buy any high tech afterwards for the next couple of years
<shevy> I am going to ask him again in 2015
<shevy> :P
locriani has quit [Remote host closed the connection]
<atmosx> apart from the iPhone 5
<atmosx> !!!
<atmosx> I wont!
<vectorshelve> shevy: I was talking about
<vectorshelve> [15:05] <shevy> vectorshelve soon you will reach this point: [15:05] <shevy> "omg all those gems suck... I will write my own gem that works"
<shevy> I swear the most active "users" on rubygems.org must be bots
<vectorshelve> shevy: swear ;D
<shevy> vectorshelve I mean you
<shevy> you are going to write ALL gems on your own eventually
<vectorshelve> shevy: which is a good thing for learners and ppl who wants to take all responsibility to themselves
devdazed has joined #ruby
<atmosx> I'm gonna get a shower
freeayu3 has joined #ruby
<atmosx> I need to study biophysics, fucking Fricks
<shevy> \o/
<atmosx> and his idiotic laws
<atmosx> shevy: all those people inventing all this shit, it's fine with me… Why do I care about diffusion concentration ratios? :-/
limes has quit [Client Quit]
<atmosx> it's a simple equation, I'll use my computer to memorize it!!!
<atmosx> anyway
cantonic has joined #ruby
<shevy> atmosx yeah I am often wondering about that too
<shevy> we aren't allowed to use computers for calculation
<Hanmac> atmosx i need to find some crazy bio/genetic/chemist ... i have crazy i ideas ... and an i dont acept an "this is not possible"
<shevy> but for work, we use computers ALL the time ...
<shevy> Hanmac what ideas :D
cantonic has quit [Client Quit]
<shevy> ideas are good
<shevy> the implementation is the problem
<atmosx> Hanmac: like, you saw the movie "Spiderman" recently?
<atmosx> shevy: when it comes to bio-whatever, some ideas are just idiotic imho.
<shevy> which one!
<shevy> I see only ideas that are hard to implement
<shevy> universal blood types for instance
<Hanmac> no ... better: animal & plant comined ... then you get an animal that feeds on sunlight, and an plant that can produce steak and milk
<atmosx> that makes sense to begin with
<shevy> Hanmac lol
bluefish_ has joined #ruby
<shevy> and you eat only 5% of that thing every day Hanmac? :D
tk__ has joined #ruby
<shevy> "mhhmmm my pseudo-cow also tastes like salad"
quazimodo has joined #ruby
<Hanmac> shevy: why not a salad that tastes like cow?
<shevy> Hanmac, I think moving physically takes a lot of energy
<shevy> a plant does not have to spend energy moving around
<shevy> Hanmac yeah
<shevy> natural cow-salad hehe
<quazimodo> shevy: pro tip bro
<Hanmac> or if humans has chloroplast inside the skin? then i have finialy a reason to go outside :P
<shevy> do you really wanna become a green human Hanmac
khakimov has quit [Quit: Computer has gone to sleep.]
<atmosx> finding a way-faster algorithm to decode DNA in desktop cpus would be a good project
resure has joined #ruby
<Hanmac> shevy i dont trust this info ... i have seen some animals before that eat plants to absorb the chloroplasts but cant make them itself
fastred has quit [Quit: fastred]
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
nari has quit [Ping timeout: 245 seconds]
<atmosx> I'm off
<Hanmac> shevy what is REALLY interesting: chlorophl and hemoglobin are sisters
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<shevy> Hanmac yeah but aphids are small, and it's also not the first time to have seen it. dinoflagellates also pick up other microorganisms to photosynthesize - http://en.wikipedia.org/wiki/Dinoflagellate "Approximately half of living dinoflagellate species are autotrophs possessing chloroplasts and half are non-photosynthesising heterotrophs"
<shevy> I have to leave here soon, will be back in ~2 hours
vlad_starkov has quit [Remote host closed the connection]
shiki has quit [Remote host closed the connection]
<vectorshelve> shevy: Hanmac please dont ruby room into bio-ruby room :P
Dreamer3 has quit [Quit: Leaving...]
dhruvasagar has quit [Remote host closed the connection]
<Hanmac> shevy: better green than this shitty avatar-snuff-blue :P
hoelzro is now known as hoelzro|away
hoelzro|away is now known as hoelzro
adambeynon has joined #ruby
Takehiro has quit [Read error: Connection reset by peer]
wallerdev has quit [Quit: wallerdev]
Takehiro has joined #ruby
Squarepy has joined #ruby
Banistergalaxy has joined #ruby
Araxia has quit [Quit: Araxia]
<Xeago> If anyone with padrino experience is here, is it possible to start thin from within padrino console (irb)?
cantonic has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
Squarepy has quit [Changing host]
Squarepy has joined #ruby
t45152 has quit [Remote host closed the connection]
t13505 has joined #ruby
<_bart> def alphanumeric?(s) s.to_s.match(/\*REGEXP HERE*/) == nil ? false : true end
dhruvasagar has joined #ruby
<_bart> What should the regexp be [a-z0-9]+ ?
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
jenrzzz has joined #ruby
workmad3 has joined #ruby
<Muz> _bart: you'll want a /i on that regex if that's what you use.
<Muz> Otherwise A-Z wouldn't be matched.
fyolnish_ has joined #ruby
<_bart> yes true, okay
<_bart> def is_alphanumeric?(s) s.to_s.match(/\[a-z0-9]+/i) == nil ? false : true end
<Muz> Alternatively [^\W]+
<Muz> Alternatively /[^\W]+/
<Muz> Actually, that would include underscores.
<Muz> /[a-z0-9]+/i
<_bart> it should match hashes, like SESSID's
<Muz> What's generating the session IDs?
<Muz> I can't think of any reason why your session ID couldn't contain a non-alphanumeric character.
<_bart> Muz: PHP's SESSID does not contain non-alphanumeric characters
chussenot has quit [Read error: No route to host]
<_bart> s.to_s.match(/[a-z0-9]+/i) == nil ? false : true , it also returns true for sdfsdf.ssfs_
<_bart> :/
<Muz> If you're the one creating and auditting the session IDs, you could probably tailor something more specific and secure to your usecase.
<Muz> Jus' saying.
taichou has joined #ruby
<Muz> /^[a-z0-9]+$/i
<_bart> thanks
lukekhamilton has joined #ruby
graspee has joined #ruby
<_bart> I know this seems weird to do but everything I do is an approach to check strings/structures with a certain uncertainty, and I know this is not secure. I also use a method that uses consonants to check for the "probability" that a string is gibberish. :)
<Hanmac> _bart:
<Hanmac> >>!!"AE34".match(/\A[[:alnum:]]+\z/)
<al2o3cr> (TrueClass) true
<Muz> Also I know it's bikeshedding, but there's also, s.to_s =~ /regex/ ? true : false; s.to_s.match(/regex/).nil? ? false : true;
<Muz> Or there's the option of not using a ternary at all, as they're just nasty-looking in general. :)
_JamieD_ has joined #ruby
<Hanmac> !!( s.to_s =~ /regex/) is maybe the best way
<Hanmac> >> !!("9" =~ /[[:digit:]]/)
<al2o3cr> (FalseClass) false
* Muz isn't a fan of !! personally.
<Muz> But yeah, golf anyone? What color do you want your bikeshed?
fyolnish_ has quit [Remote host closed the connection]
Morkel has quit [Quit: Morkel]
<JonnieCache> what kind of 9 is that
SeySayux has quit [Ping timeout: 244 seconds]
eighty4_ is now known as eighty4
eighty4 has quit [Changing host]
eighty4 has joined #ruby
<Hanmac> "Fullwidth forms, capitals"
<Hanmac> but for some reason the other 9 is not currect encoded ...
<Hanmac> >>"9".force_encoding("UTF-8").match(/[[:digit:]]/)
<al2o3cr> (MatchData) #<MatchData "\uFF19">
locriani has quit [Remote host closed the connection]
<JonnieCache> thats got to be useful for adwords
<JonnieCache> do they allow unicode in adwords?
lateau1 has quit [Quit: Leaving.]
wltsmrz has joined #ruby
jrajav has joined #ruby
<Guest37999> >> true
<al2o3cr> (TrueClass) true
<Guest37999> aweyeah
<Hanmac> JonnieCache: "whereas /[[:digit:]]/ matches any character in the Unicode Nd category." ... currently i trying to prof that
otters has joined #ruby
SeySayux has joined #ruby
fyolnish has joined #ruby
ciopte7 has joined #ruby
seitensei has quit [Remote host closed the connection]
vlad_starkov has joined #ruby
mneorr1 has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
justinmcp has joined #ruby
cantonic has quit [Quit: cantonic]
mneorr has quit [Ping timeout: 244 seconds]
tayy has joined #ruby
moshee has quit [Ping timeout: 276 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
shiki has joined #ruby
ciopte7 has quit [Quit: ciopte7]
A124 has joined #ruby
A124 has left #ruby [#ruby]
ananthakumaran has quit [Quit: Leaving.]
ananthakumaran has joined #ruby
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
Mchl has quit [Quit: ZNC - http://znc.sourceforge.net]
Mchl has joined #ruby
jakob_____ has joined #ruby
gloomer_1 has joined #ruby
jakob_____ has left #ruby [#ruby]
gloomer has quit [Read error: Connection reset by peer]
Eldariof-ru has quit []
BiHi has quit [Quit: Computer has gone to sleep]
freeayu3 has quit [Read error: Connection reset by peer]
workmad3 has quit [Ping timeout: 260 seconds]
liluo has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
jords has joined #ruby
matty5000 has joined #ruby
Criztian has joined #ruby
lschmidt is now known as Schmidt
freeayu3 has joined #ruby
mc0e has quit [Ping timeout: 268 seconds]
mc0e has joined #ruby
<_bart> how do I quickly count the number of numeric digits (0-9) in a string?
<banisterfiend> _bart: string.chars.count { |v| v =~ /\d/ }
<_bart> cool! thanks
<Mon_Ouie> string.count "0-9"
thunderstrike has joined #ruby
ph^_ has quit [Ping timeout: 240 seconds]
<banisterfiend> Mon_Ouie: k00
<Mon_Ouie> Is that "k00" a new thing? I've seen you use it like all the time lately, but never before.
<banisterfiend> Mon_Ouie: yes, i invented it recently. I'm trying to get it to catch on u, u should help me
<gloomer_1> k00
znake has joined #ruby
<banisterfiend> gloomer_1: thx
vlad_starkov has joined #ruby
circlicious has left #ruby [#ruby]
taichou has quit [Remote host closed the connection]
Taichouchou has joined #ruby
jrajav has quit []
rakunHo has quit [Remote host closed the connection]
znake has quit [Quit: znake]
<_bart> why doesn't this regexp match the file size: http://rubular.com/r/p87enYVgPx it looks correct
<_bart> k00
zommi has quit [Ping timeout: 265 seconds]
<hoelzro> _bart: case sensitivity
<hoelzro> oh, nvm
<hoelzro> didn't see the /i
dpk has joined #ruby
<hoelzro> hmm
<hoelzro> the first bit matches ok
<Mon_Ouie> Because those aren't spaces
<Mon_Ouie> They're non-breakable spaces
<Mon_Ouie> Also using regular expressions for that kind of stuff hurts eyes
Speed has quit [Quit: When two people dream the same dream, it ceases to be an illusion.]
fastred has joined #ruby
<_bart> how do I match non-breakable spaces?
ph^ has joined #ruby
<Mon_Ouie> You type it or you lookup its unicode code point
<banisterfiend> Mon_Ouie: do you think you'll say k00
<Mon_Ouie> No
<banisterfiend> Mon_Ouie: is there anything i can say/do to encourage you to say it
redgetan has joined #ruby
tayy has quit [Remote host closed the connection]
<Mon_Ouie> And that will work?
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<banisterfiend> Mon_Ouie: Yeah
<Mon_Ouie> Then no
bluenemo has quit [Remote host closed the connection]
<banisterfiend> Mon_Ouie: don't you think it's a bit unfair, i mean i emulate your "Yeah"
<_bart> okay changed it to ((\d+(?:[.,]\d+)?)\W?([ptgmk]?b))\b
<vectorshelve> I am not able to install gem paperclip in jruby rails app. whats the way around ?
<vectorshelve> Installing paperclip (3.1.4) Gem::InstallError: paperclip requires Ruby version >= 1.9.2. An error occured while installing paperclip (3.1.4), and Bundler cannot continue. Make sure that `gem install paperclip -v '3.1.4'` succeeds before bundling.
jearvondharrie has joined #ruby
Morkel has joined #ruby
Morkel has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
arkiver has joined #ruby
Morkel has joined #ruby
zommi has joined #ruby
<Hanmac> vectorshelve dont use jruby nor rails? :P
<virunga> Hi Mon_Ouie
resure has quit [Remote host closed the connection]
wltsmrz has quit [Quit: Lost terminal]
<virunga> Mon_Ouie: you're good with OpenGl, aren't you?
<vectorshelve> Hanmac: I wish if I had the choice... :)
<Hanmac> jruby is never a choice for me :D
<vectorshelve> Hanmac: some say its better in terms of performance since JVM
<Hanmac> i use c++-libs in ruby ... this does not work for jruby
<vectorshelve> Hanmac: how can I update my ruby env ? the command
<vectorshelve> Hanmac: gem update --system didnt do that part
Coolhand has joined #ruby
<Hanmac> install the ruby1.9.1-full package and then "update-alternatives --config ruby" (on debianoid)
liluo has joined #ruby
limes has joined #ruby
<lectrick> module A; class B; end; end; B #=> How do I get the 'full path' of class B without raising a NameError: uninitialized constant B ?
<vectorshelve> Hanmac: $ gem env gives me RubyGems Environment: - RUBYGEMS VERSION: 1.8.24 - RUBY VERSION: 1.8.7 (2012-02-22 patchlevel 357) [java]
<vectorshelve> Hanmac: I want to update it to 1.9.3
<Hanmac> install an better ruby ... the ruby1.9.1-full package
<vectorshelve> Hanmac: I am working on latest jruby 1.6,7 and it uses RUBYGEMS VERSION: 1.8.24 which I want to upgrade
thatRD has joined #ruby
<Hanmac> lectrick: "A::B".split("::").inject(Object,:const_get)
<Hanmac> or do you want the reverse?
<vectorshelve> Hanmac: I use rvm so I have all the other ruby versions as well.. including 1.9.3
<lectrick> Hanmac: Say I only know the name of B, but I don't know the name of A, and I want a constantized version of B
<vectorshelve> Hanmac: gave gem update instead of gem update --system since I am on rvm and not system ruby so now it seems working ;)
<Hanmac> lectrick you cant you need the full path or B as Class object
<lectrick> Hanmac: I can sort of look up the full path via ObjectSpace.each_object but I wanted something better :)
<lectrick> Hanmac: ObjectSpace.each_object{|o| puts o if o.class==Class && o.name =~ /::B/}
<Hanmac> vectorshelve question ... WHY dont you ask at #jruby?
<Hanmac> lectrick there are maybe better ways ... moment i try to find them
nilg has joined #ruby
<Mon_Ouie> Virunga: Haven't used it in a while, but I did use it. Why?
berserkr has joined #ruby
<vectorshelve> Hanmac: asked no response... inactive room
<lectrick> Hanmac: This is a little cleaner (but still as ugly as a polished turd) ObjectSpace.each_object.detect{|o| o.class==Class && o.name =~ /::B/}
<virunga> Mon_Ouie: i wanted to ask help to you :D
lukekhamilton has quit [Quit: lukekhamilton]
joephelius has quit [Quit: WeeChat 0.3.8]
<nohonor> how would i use a class method as associated code?
<nohonor> ruby -e "print %w(H A L).collect &String#succ"
geekbri has joined #ruby
<Hanmac> lectrick i dont think so that there are a better way ... imo you should know the full path or store the B class somewhere
t13505 has quit [Remote host closed the connection]
saispo has quit [Ping timeout: 260 seconds]
<nohonor> doesn't work
<lectrick> Hanmac: Yeah, I'm doing some fancy dynamic stuff and there might not be a way for me to do that
t50306 has joined #ruby
<Hanmac> >> print %w(H A L).collect &:succ
<al2o3cr> ["I", "B", "M"](NilClass) nil
<justinmcp> vectorshelve: WAG - are you running jruby in 1.9 mode; --1.9 or JRUBY_OPTS=--1.9 ?
<nohonor> Hanmac, thank you!
<Mon_Ouie> Having to specify the class of the receiver would break the point of OOP
<nohonor> Hanmac, and how would i qualify the owning class
<Hanmac> lectrick becaue there could be multible B classes ... as sample CEGUI and Ogre as both an Color class
<Hanmac> nohonor you dont need to
<nohonor> yes, but if i wanted to
<Mon_Ouie> You shouldn't want to
<Hanmac> >> print %w(H A L).collect &String.instance_method(:succ)
<al2o3cr> -e:1:in `eval': wrong argument type UnboundMethod (expected Proc) (TypeError), from -e:1:in `eval', from -e:1:in `<main>'
<lectrick> Hanmac: ah you're right. crap
<nohonor> what if i want to use Math.something
ndngvr has quit [Ping timeout: 252 seconds]
<Mon_Ouie> That's something completely different, the block argument isn't the receiver, but just a regular argument
<Mon_Ouie> And there's nothing wrong with { |o| Math.something(o) }
<nohonor> it's unnecessary typing
<Hanmac> >> print [1,2,3].map &Math.method(:sin)
<al2o3cr> [0.8414709848078965, 0.9092974268256817, 0.1411200080598672](NilClass) nil
<nohonor> Hanmac, nice
IPGlider has quit []
<nohonor> well, what is the function of the # separator then
quazimodo has quit [Remote host closed the connection]
<Mon_Ouie> It's for documentation only
<vectorshelve> justinmcp: look at line 6 and 7 http://pastie.org/4574018 I want to make it 1.9.3
<nohonor> ah, ok
saispo has joined #ruby
<nohonor> it means instance method?
<Mon_Ouie> Yes
erichmenge has joined #ruby
<Hanmac> in doc #succ is an instance method, and :: is an class method
mneorr1 has quit [Quit: Leaving.]
<nohonor> ok, thanks
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
<nohonor> it'd be nice if we could use the methods directly though
<nohonor> >> print [1,2,3].map :&Math::sin
<al2o3cr> -e:1:in `eval': (eval):1: syntax error, unexpected tCONSTANT, expecting $end (SyntaxError), print [1,2,3].map :&Math::sin, ^, from -e:1:in `<main>'
`brendan has joined #ruby
tommyvYo has quit [Client Quit]
<nohonor> in c# you can say new[]{1,2,3}.Select(Math.Sin)
<Mon_Ouie> That's not possible with Ruby's syntax because methods can still be called without parens and without arguments
<nohonor> blah
<nohonor> then it's another case where the optional invocation parens suck
virunga has quit [Remote host closed the connection]
<Mon_Ouie> What are the others in your opinion?
<justinmcp> vectorshelve: try; $ JRUBY_OPTS=--1.9 gem env
Taichouchou has quit [Remote host closed the connection]
zommi has quit [Ping timeout: 265 seconds]
<vectorshelve> justinmcp: export JRUBY_OPTS=--1.9 worked
zz_chrismcg is now known as chrismcg
<justinmcp> vectorshelve: sweet
hemanth has quit [Read error: Connection reset by peer]
<vectorshelve> justinmcp: sour error after that http://pastie.org/4574018
<nohonor> >> Math.log(64,4)
<al2o3cr> (Float) 3.0
<nohonor> >> Math.log (64,4)
<al2o3cr> -e:1:in `eval': (eval):1: syntax error, unexpected ',', expecting ')' (SyntaxError), Math.log (64,4), ^, from -e:1:in `<main>'
<nohonor> Mon_Ouie, how about this one?
hemanth has joined #ruby
Rochefort has joined #ruby
<Mon_Ouie> It makes sense to me that after a space it is interpreted as a grouped expression and not an argument list
<vectorshelve> justinmcp: hey but your command JRUBY_OPTS=--1.9 gem env instead of mine export JRUBY_OPTS=--1.9 seems to work
<banisterfiend> nohonor: it's a trade-off, but in general i think optional parentheses are a clear win.
<banisterfiend> nohonor: DSLs would look a lot uglier with mandatory parens, for example.
<nohonor> uglier but consistent
<justinmcp> vectorshelve: should be functionally the same, export just adds it to your shell env
Axsuul has quit [Ping timeout: 260 seconds]
<vectorshelve> justinmcp: yes but yours did the magic :)
<nohonor> this opens you to all sorts of bogus invocation trees
<banisterfiend> nohonor: well, they wouldn't look like a DSL
<nohonor> banisterfiend, well, there could be an interpreter switch
<banisterfiend> nohonor: similarly, what about the 'loop' method? that would have to be: loop() { puts "hi" }
bluefish_ has quit [Quit: Ex-Chat]
<banisterfiend> rather than the current, loop { puts "hi" }
<banisterfiend> and attr_accessor :x would become attr_accessor(:x)
<nohonor> oh, the horror
<justinmcp> vectorshelve: I dont know whats up with the bundle install error - looks like you are running a newer java than myself, thats about the only thing that immediately comes to mind
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
<banisterfiend> nohonor: yes, syntax is important.
<shevy> bundle has the tendency to error
darkfox83 has joined #ruby
<Mon_Ouie> ruby -e 'system "python", *ARGV' -- — there's the interpreter switch
<shevy> but people use all sorts of crazy combinations... debian system ruby combined with rvm and bundler
<banisterfiend> nohonor: loop() { } completely blows the idea of loop { } acting like a language construct.
<vectorshelve> justinmcp: could be but whats wierd is that ur alias command to mine worked fine :)
Taichouchou has joined #ruby
<limes> shevy did you find a fix ?
<limes> *solution
mneorr has joined #ruby
<justinmcp> vectorshelve: that is weird
<banisterfiend> nohonor: the advantage in optional parens + blocks is you can create methods that behave like built in syntax. As a result, ruby can implement many things are methods that in other languages are keywords
<shevy> limes only for me, I compile from source and avoid bundler rvm etc...
<banisterfiend> as methods*
<limes> damn
<vectorshelve> justinmcp: well I am trying to run my rails app into jruby... now done with bundle install.. need to configure the db now.. any idea ?
<limes> went from node via rabbitmq + node back node js and finaly im so close to my udp websocket -.-
<nohonor> banister, sounds obfuscatory to me
<Taichouchou> test
<nohonor> but i appreciate your input anyway
<shevy> Taichouchou test passed
<banisterfiend> nohonor: in fact, a tonne of things in ruby are in fact methods that you'd think are keywords, for example: loop, raise, attr_accessor, alias_method, and so on.
<Taichouchou> thanx shevy
<nohonor> yes, and that makes grokking that much harder
<banisterfiend> nohonor: even 'public' and 'private' (accessor 'keywords') are methods
TommyBotten has joined #ruby
<nohonor> ^ what i said above
<nohonor> implicit is evil
<nohonor> optional is evil
<shevy> explicit self in python really sucks
<nohonor> but i guess it's up to the language designer to make the tradeoff
<banisterfiend> nohonor: not really, it makes it easier IMO. Most thing are methods, and you know how methods behave already. It removes the barrier between applications and core language. Kind of like lisp, but not quite as intense
<justinmcp> vectorshelve: I had to use activerecord-jdbc-adapter, then bundle exec the rake tasks - don't recall doing much else
<banisterfiend> nohonor: i think it's an idea ruby got from smalltalk actually, where even 'if' is a method
<justinmcp> vectorshelve: I moved over to torquebox - which added bits and pieces
sepp2k has quit [Ping timeout: 246 seconds]
<nohonor> so i guess that's the 'ruby way'
<banisterfiend> nohonor: yeah, inspired by the 'smalltalk way' and the 'lisp way'
darkfox83 has quit [Remote host closed the connection]
<JonnieCache> if is a method?
anoldhacker has joined #ruby
<JonnieCache> thought it was a keyword
<hoelzro> in some smalltalks, yes
<banisterfiend> nohonor: and definitely contrasted with the 'java way' and the 'python way'
darkfox83 has joined #ruby
<hoelzro> true:ifTrue [ Transcript show: 'Hello'; cr. ]
<nohonor> let's see if i warm up to this approach as i progress further with the language
bluenemo_ has joined #ruby
bluenemo_ has quit [Changing host]
bluenemo_ has joined #ruby
<JonnieCache> oh you mean in smalltalk. in ruby it just behaves like a method wrt return values
<JonnieCache> correct?
* Hanmac is searching for a spell that turn my camel into snakes
sepp2k has joined #ruby
<hoelzro> well, if is a keyword in Ruby, but all Ruby expressions (afaik) are also statements
<hoelzro> er, vice versa
<nohonor> can't if be considered a lazy-evaluating method
<Mon_Ouie> It doesn't behave at all like a method. It's an expression unlike in C, that's all.
<hoelzro> that's why I can do greeting = if language == 'German' then 'Guten Tag' else 'Hello' end
DuoSRX has quit [Remote host closed the connection]
bluenemo_ has quit [Read error: Connection reset by peer]
BiHi has joined #ruby
<JonnieCache> i suppose function would be a better term than method, but yeah its just the expression thing really i guess
<nohonor> btw, what is the consensus way to achieve lazy evaluation of arguments
<shevy> hehe "consensus"
<JonnieCache> use lazy data structures?
<banisterfiend> nohonor: wrap it in a lambda i guess
<shevy> my data structures are hard workers
<shevy> the lazy ones get fired
<JonnieCache> or that heh
<nohonor> banisterfiend, i see
<nohonor> but that's not really it
<nohonor> you have to cache the value
Takehiro has quit [Ping timeout: 245 seconds]
<hoelzro> you could create a Lazy class that acts like the lazy value
<hoelzro> ex. value = Lazy { long_running_operation }
<nohonor> yeah, that's OOPish
<hoelzro> mhmm
joephelius has joined #ruby
paulovittor23 has joined #ruby
<JonnieCache> thats what i meant. classes that act like enumerables but have lazy logic inside them
<nohonor> what is the semantic difference between while(true) { } and loop { }
<hoelzro> none, I think
<shevy> loop {} is cleaner
<hoelzro> except
<JonnieCache> shevy: thats not semantic
<hoelzro> I think loop automatically catches StopIteration
Takehiro has joined #ruby
<hoelzro> but I'm not sure
<shevy> also while(true) { puts 'hi' } does not even work
<nohonor> http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-loop: StopIteration raised in the block breaks the loop.
<hoelzro> shevy: it doesn't?
<nohonor> i'm not sure what this means
<shevy> irb does not like it
<hoelzro> nohonor: StopIteration is raised by Enumerator#next
<nohonor> breaking out of a block raises and exception?
<hoelzro> when the end of an Enumerator is reached
<nohonor> i'm sorry, i don't follow
<Mon_Ouie> The break keyword doesn't raise an exception but you can raise on to break from a loop
inerdier has joined #ruby
<nohonor> ahhaa
<Mon_Ouie> And that's what Enumerator#next does when there are no more items
<nohonor> ok, and why would i want to do that in loop { }
<Mon_Ouie> loop { a = e.next; … } — break is automatically propagated here
<nohonor> break is propagated to a containing loop?
<Mon_Ouie> hoelzro: while doesn't accept a block, it just expects a condition, a body, and an end keyword (
inerdier has left #ruby [#ruby]
<banisterfiend> ruby stole this behaviour from python btw
<Mon_Ouie> (with an optional do after the condition)
<banisterfiend> StopIteration trick
<Mon_Ouie> nohonor: No, it propagates from Enumerator#next to the loop
<Hanmac> hm an while loop has one catchtype more then an loop-loop (while catch "break")
<hoelzro> Mon_Ouie: right
<nohonor> omg, while(true) { puts 'hi' } really doesn't work
<Mon_Ouie> While the regular break keyword has to be lexically scoped
BiHi has quit [Read error: Connection reset by peer]
<Mon_Ouie> while true; puts "hi"; end
t50306 has quit [Remote host closed the connection]
Taichouchou has quit [Remote host closed the connection]
<Mon_Ouie> puts "hi" while true
t96460 has joined #ruby
<hoelzro> while true do puts 'hi' end
<nohonor> but why?
<Mon_Ouie> Why not?
<nohonor> what's wrong with while(true) { puts 'hi' }
<hoelzro> it's not valid Ruby
<nohonor> why, because of the braces
<banisterfiend> nohonor: you will understand what blocks are soon and you'll know why that doenst work, i think
<Mon_Ouie> And there's no reason for Ruby to use that syntax, it has one already.
<hoelzro> which, considering that { ... } is a shortcut for do ... end in block syntax, seems kind of silly.
<nohonor> well, blah
<nohonor> { } is the same as do... end, except when it isn't
Monie has quit [Ping timeout: 244 seconds]
<Hanmac> Mon_Ouie & hoelzro: its interesting to see the difference between "while(true)\n end" and "loop do\n end" with puts RubyVM::InstructionSequence.compile(code).disasm
<Mon_Ouie> It is the same only for block syntax
erichmenge has quit [Quit: Be back later]
jdripper has joined #ruby
<nohonor> Mon_Ouie, ok, i get it. thanks
<Mon_Ouie> Well, loop gets compiled as a method call with a block while a while loop gets compiled as gotos and labels
chrismcg is now known as zz_chrismcg
<Hanmac> psst dont tell the noobs that they could activate goto inside ruby
BiHi has joined #ruby
* nohonor pretends he didn't notice
machty has joined #ruby
<nohonor> although i've actually had a good use for goto in production code
<nohonor> once
<Mon_Ouie> It doesn't have anything to do with the joke __goto__ keyword
<hoelzro> I think one can be responsible and use goto.
<nohonor> hoelzro, not at the same time
<Mon_Ouie> gotos are commonly used in the bytecode-languages that structured languages get compiled into
<banisterfiend> You can implement 'goto' using continuations, if you really want to :)
<nohonor> banisterfiend, lol
<hoelzro> hehe
<Mon_Ouie> banisterfiend: Except you can't jump to a point that hasn't been reached before
<nohonor> "you can implement if using zygomorphisms"
<banisterfiend> Mon_Ouie: Yeah
Takehiro has quit [Remote host closed the connection]
jrist has joined #ruby
virunga has joined #ruby
virunga has quit [Remote host closed the connection]
Takehiro has joined #ruby
<hoelzro> I think that using goto to clean up errors in C is about the only responsible use of it, though
Morkel has quit [Quit: Morkel]
andrewpthorp has joined #ruby
<nohonor> Mon_Ouie: so Enumerator#next raises an exception when there are no more items
<nohonor> why doesn't it just return
<Mon_Ouie> Return what?
<nohonor> and what does that have to do with loop { } if that's based on an infinite enumeration
<nohonor> hmm, maybe i'm thinking in c sharp
<hoelzro> you must unlearn
<hoelzro> what you have learned
<Mon_Ouie> loop is implemented like def loop; yield while true; rescue StopIteration; end
cantonic has joined #ruby
<nohonor> well, instead of calling yield
<hoelzro> =P
Spooner has joined #ruby
<nohonor> call return
<Mon_Ouie> Enumerator#next doesn't yield anything
<Mon_Ouie> yield passes a value to a block
<nohonor> i'm afraid the enumeration infrastructure in my ind is a bit fuzzy
<nohonor> you have an enumeration
<nohonor> an "iterator"
<nohonor> and you have a consumer
<nohonor> enumeration.iterator &consumer
<nohonor> where does "enumerator" come in or should i just research it myself and stop asking silly questions
andrewpthorp has quit [Ping timeout: 246 seconds]
nanderoo has joined #ruby
jorge_ has joined #ruby
<Hanmac> thanks of enumerator your "iterator" is chainable: enumeration.iterator.iterator.iterator (&consumer)
<Mon_Ouie> in that example, nowhere
<nohonor> Mon_Ouie, in loop { if (frob()) blah; if(quux) break } ?
erichmenge has joined #ruby
andrewpthorp has joined #ruby
<Xeago> why is there an enumerator for a loop construct?
andrewpthorp has quit [Client Quit]
<Mon_Ouie> Nowhere either (and that's not valid Ruby either)
<Xeago> wha twould the collection for the enumerator be, e.g. what is the enumerable?
chussenot has joined #ruby
<Mon_Ouie> fibo = Enumerator.new { |y| a, b = 0, 1; loop { y << a << b; a, b = b, a + b }
* nohonor inserts "end" keywords
<Mon_Ouie> Yeah
<banisterfiend> Yeah
jearvondharrie has quit [Ping timeout: 240 seconds]
<nohonor> unmatched braces are unmatched ...
<banisterfiend> >> fibo = Enumerator.new { |y| a, b = 0, 1; loop { y << a << b; a, b = b, a + b } }; [fibo.next, fibo.next, fibo.next]
<al2o3cr> (Array) [0, 1, 1]
<Mon_Ouie> It's way too hard to remember how many of them I opened :p
<banisterfiend> >> fibo = Enumerator.new { |y| a, b = 0, 1; loop { y << a << b; a, b = b, a + b } }; [fibo.next, fibo.next, fibo.next, fibo.next, fibo.next]
<al2o3cr> (Array) [0, 1, 1, 1, 1]
<banisterfiend> ghey
<Mon_Ouie> fibo.take 10
<banisterfiend> >> fibo = Enumerator.new { |y| a, b = 0, 1; loop { y << a << b; a, b = b, a + b } }; fibo.take(10)
<al2o3cr> (Array) [0, 1, 1, 1, 1, 2, 2, 3, 3, 5]
<Mon_Ouie> Oh, I probably meant yield << a only
<Xeago> how to print stacktrace in ruby?
<nohonor> what's the << operator do?
<Mon_Ouie> It calls the #<< method
<hoelzro> appends, or writes to stream
<Mon_Ouie> Xeago: puts caller
* hoelzro finds it hideous
<Mon_Ouie> What it does still completely depends on the receiver
<hoelzro> unless used for actual bit shifting
t96460 has quit [Remote host closed the connection]
<fowl> hoelzro << :aids
t80427 has joined #ruby
<nohonor> strange to see c++ in ruby
<fowl> thats how you give hoelzro aids
<Mon_Ouie> In this case it adds a value to the Enumerator
<Hanmac> fowl: hoelro >> :aids
<Hanmac> and so you can remove the aids later :D
<vectorshelve> I am trying to convert my ror app to jruby on rails. my backend is postgresql and I installed jruby -J-Xmx1024m -S gem install jdbc-postgres . now when I try to do rake db:setup I get this error http://pastie.org/4574202
<Mon_Ouie> IIRC Matz was a C++ programmer before writing Ruby
* Hanmac thinks it is a little bad that ruby is not writen in C++ :(
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
<Mon_Ouie> Why?
nwest has joined #ruby
<Hanmac> i dont know ... i thought it would be more fun
jonathanwallace has joined #ruby
<Xeago> what is ruby written in?
<Hanmac> plain C
<Mon_Ouie> C
<hoelzro> C
<Xeago> what's wrong with that?
<Xeago> I still write c daily?
<hoelzro> nothing
<Xeago> what's bad with it hanmac?
<Mon_Ouie> There are other implementations in Java or C++ and Ruby
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
<Hanmac> Xeago it feels a bit odd when you write c++ gems
darkfox83 has quit [Quit: Ex-Chat]
<nohonor> a ruby written in windows batch
<nohonor> that i'd like to see
<ly_gs> :D
<Xeago> I doubt it'd be possible
<Hanmac> vectorshelve go and anoy other channels ... like #rubyonrails or #jruby ... when this channels are not responding it is not our failure
<vectorshelve> Hanmac: ok boss :)
<TommyBotten> Can anyone shed some light on Ruby/IOCTL on http://stackoverflow.com/questions/11949538/pointers-to-buffer-in-ioctl-call ?
<hoelzro> Hanmac: you could always write a C++ wrapper for the C API =)
<nohonor> anyway, thanks for the help everyone
<nohonor> i learned a lot in 30 minutes
<hoelzro> IRC is a great place to learn =)
<Xeago> the only reason I have it open
<Hanmac> hoelzro i have seen something like Rice but it does not feel right
<hoelzro> that's the experience I've seen with every C++ binding to the Lua API =)
freeayu3 has quit [Read error: Connection reset by peer]
apok has joined #ruby
<Xeago> it is possible to write multithreaded ruby right?
<Mon_Ouie> TommyBotten: Just generate a string from your structure
<Xeago> using just plain 'ol ruby
<Xeago> ?
<Mon_Ouie> That BinStruct library probably provides you with a pack method or something similar
fixl has quit [Quit: KVIrc 4.1.3 Equilibrium http://www.kvirc.net/]
<anoldhacker> When debugging a C extension, is there an easy way to get printf output? Or do I need to invoke puts somehow?
<TommyBotten> Mon_Ouie: That I get, but the struct for ifconf contains a union which in turn contains structs.
<TommyBotten> Mon_Ouie: Which I haven't gotten my head around ... yet.
thecreators has joined #ruby
<hoelzro> anoldhacker: printf should do you fine
verto|off is now known as verto
<anoldhacker> hoelzro: Lovely. I wonder what my problem is.
yasushi has joined #ruby
<Hanmac> anoldhacker: i often use rb_warn for debuging ...
<banisterfiend> rb_p too
resure has joined #ruby
_keith has joined #ruby
freeayu3 has joined #ruby
jrajav has joined #ruby
<anoldhacker> k thanks.
bluebie has joined #ruby
fforbeck has joined #ruby
thecreators has quit [Remote host closed the connection]
<bluebie> ohai
d3vic3 has quit [Ping timeout: 265 seconds]
shiki has quit [Remote host closed the connection]
sspiff has quit [Ping timeout: 246 seconds]
jorge_ has quit [Remote host closed the connection]
d3vic3 has joined #ruby
Spooner has quit [Quit: Spooner]
bbttxu has quit [Quit: bbttxu]
Spooner has joined #ruby
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
zommi has joined #ruby
thatRD has quit [Ping timeout: 276 seconds]
CreativeEmbassy has joined #ruby
<zeknox> i have a logic flaw in the way im parsing xml, line 17 loops through every element in the xml, when I only want it to view the current tag that ties to the ip address tag, would appreciate any assistance ---> http://pastie.org/4574305
limes has quit [Quit: limes]
meskyanichi has quit [Quit: Linkinus - http://linkinus.com]
<bluebie> zeknox: presumably e1 is an element with a similar 'elements inside me' kind of method you could use instead of querying xmldoc.elements
virunga has joined #ruby
<bluebie> it maybe fixed simply by replacing 'xmldoc' with e1 on line 17
<bluebie> but then, I don't use rexml, and don't care to learn it :S
shiki has joined #ruby
<bluebie> or... oh I think I get what you want
<CodeFriar> How do I tell rspec that I expect method X to call method Y
bluenemo has quit [Quit: Verlassend]
<hoelzro> CodeFriar: why does it matter what methods method X calls?
<CodeFriar> just trying to be complete. new to testing.
<Spooner> CodeFriar : You can't directly check if X itself is calling Y, but you do @subject.should_receive(:Y); @subject.X
<bluebie> I'm sure you could do something horrible with the backtraces :)
<bluebie> but dont
miho has joined #ruby
<bluebie> please
<hoelzro> CodeFriar: well, the problem then is that your tests depend on the fact that X calls Y
<CodeFriar> Spooner: thats what I'm doing but it's not working
<CodeFriar> hoelzro: thats the behaviour I want...
yoklov has joined #ruby
<Spooner> hoelzro : It matters if you want to do true unit testing and not test Y at that point, for example if Y is accessing a database or something else slow.
<hoelzro> so if you want to change that, you need to change your tests and your code
GoGoGarrett has joined #ruby
Eldariof-ru has joined #ruby
<zeknox> bluebie: I changed line 17 like you mentioned, it runs, but doesn't display anything now
<bluebie> mmm yeah sorry zeknox I misunderstood your problem :/
<bluebie> looking for better solution now
<bluebie> rexml :S
<zeknox> bluebie: yeah, its hard to explain
<banisterfiend> bluebie: sup bluebs
<bluebie> I get it now
<bluebie> hey banisterfiend - don't suppose you know rexml?
<banisterfiend> bluebie: nope
<banisterfiend> sry
<zeknox> what do you guys prefer I use to parse xml in the future? xpath?
<bluebie> zeknox: nokogiri is great
<Spooner> zeknox : What bluebie is trying to say is, if you use nokogiri or another commonly used XML thing in this day and age, then you'd get more wisdom here :)
itcharlie has joined #ruby
<bluebie> xpath is a query syntax, nokogiri is a parsing library (which can do xpath, as can rexml)
<bluebie> I personally prefer css selectors
Takehiro has quit [Remote host closed the connection]
Takehiro has joined #ruby
<zeknox> bluebie: Spooner: I understand guys, just started googling last night and working away at it
kpshek has joined #ruby
<itcharlie> Where can I read more information about mod ruby?
<Hanmac> itcharile you mean like in apache mods?
<fowl> itcharlie: modruby hasnt been updated since 2008 iirc
workmad3 has joined #ruby
<itcharlie> yes. Actually I found the url. http://modruby.net/en/ seems like modruby.net/ needs a landing page instead of "It works"
<bluebie> itcharlie: You'll be wanting passenger these days
<Spooner> zeknox : You can probably get away with something like xmldoc.elements["address"].each
<itcharlie> bluebie, say what?
<zeknox> Spooner: you thinking of doing that on line 17?
<bluebie> itcharlie: Fusion's Passenger is an apache/nginx module for serving ruby webapps
theRoUS has joined #ruby
<bluebie> it works a bit like mod_php, loading up apps, shutting them down when they're not in use anymore
<Spooner> zeknox : both 16 and 17 - I don't know though, since I don't know the nmap.xml structure. I was being lazy (if you just want all the address tags from the doc, that will do fine).
<bluebie> pretty good for hosting some little apps for your personal site or whatever. There's better app server style stuff for if you're going to be the next github or tumblr
<itcharlie> I see thanks bluebie
<bluebie> zeknox: does a <host> only ever contain at most one address and one <hostscript><script>?
<Spooner> zeknox : Or use xpath, which people probably know better than rexml's API (disclaimer, I avoid XML like the plague, so I rarely have to worry and only learn the minimum I need in the circumstance when I can't).
<zeknox> bluebie: Spooner I'll post some sample xml
resure_ has joined #ruby
<bluebie> zeknox: If this is your first dealing with xml in ruby, and you're not terribly invested in rexml, I'd switch to nokogiri. Let me know if you're keen on doing that and I'll post some example code for you
nateberkopec has joined #ruby
workmad3 has quit [Ping timeout: 252 seconds]
fridim_ has joined #ruby
ananthakumaran has quit [Quit: Leaving.]
<zeknox> bluebie: yeah im considering changing to nokogirl because I know that it is big now that you mention it, I'm only about 4 hours vested into REXML
<bluebie> alright post that example xml and I'll have a go at it for you :)
redgetan has quit [Quit: Leaving]
infinitiguy has joined #ruby
<zeknox> bluebie: working on it :)
waxjar has joined #ruby
t80427 has quit [Remote host closed the connection]
t58605 has joined #ruby
rubious has joined #ruby
<zeknox> bluebie: cool if I pm it over?
sepp2k has quit [Ping timeout: 246 seconds]
<bluebie> if it's more than a few lines, paste it somewhere
<bluebie> my irc client will start ignoring you if you dump a lot of lines at me
<zeknox> im doing pastie, but want to keep it private
<bluebie> sure thing :)
Taichouchou has joined #ruby
sepp2k has joined #ruby
tagrudev has quit [Remote host closed the connection]
enroxorz-work has joined #ruby
enroxorz-work has quit [Changing host]
enroxorz-work has joined #ruby
znake has joined #ruby
resure has quit [Remote host closed the connection]
resure_ is now known as resure
csmrfx has joined #ruby
bbttxu has joined #ruby
niklasb has joined #ruby
ph^ has quit [Ping timeout: 252 seconds]
asteve has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
Guest68848 has quit []
Taichouchou has quit [Ping timeout: 240 seconds]
<csmrfx> Is there a ruby project template? github or...
cezar has joined #ruby
apok has quit [Quit: apok]
thatRD has joined #ruby
cezar has quit [Client Quit]
thatRD has quit [Quit: thatRD]
uris has joined #ruby
paolooo has joined #ruby
<bluebie> csmrfx: blank text file works fine
<bluebie> what sort of project are you hoping to make?
znake has quit [Client Quit]
znake has joined #ruby
denysonique has joined #ruby
<bluebie> rails has some 'generators' which are kind of like smart (or dumb depending who you ask) dynamic templates for big complex businessy webapp things
locriani has quit [Remote host closed the connection]
johnlcox has joined #ruby
<philcrissman> csmrfx: not a template, but there was a recent article about good patterns for ruby gems: http://rubysource.com/polish-your-gems/
axl_ has quit [Read error: Connection reset by peer]
axl_ has joined #ruby
Eldariof59-ru has joined #ruby
<zeknox> bluebie: thanks for the help, you da man!
<csmrfx> More like just have a nice simple directory structure and a .rb file with the correct encoding header, why not also have a var that points to where the filepath is
niklasb has quit [Ping timeout: 240 seconds]
* csmrfx is not much of a gem person
<csmrfx> ie. "ruby boilerplate"
<csmrfx> maybe have stuff for bundler / gem packagers etc ready in the project template too
sspiff has quit [Ping timeout: 246 seconds]
mneorr has quit [Quit: Leaving.]
<bluebie> :)
<Spooner> csmrfx : bundle gem my_gem
<Spooner> Does some manner of template generation, but I havent' used it myself.
<bluebie> csmrfx: ruby doesn't need anything like that. Just make a file - you don't need any special stuff to get started
<bluebie> csmrfx: it's not like C or Java or whatever where you need some standard boring stuff to wrap the interesting bits
<csmrfx> Ruby doesn't need, *I* *want*
Eldariof-ru has quit [Ping timeout: 264 seconds]
<Spooner> bluebie : There is a lot of boilerplate you need to create a gem though though, which does take time to copy-and-paste from other projects.
sspiff has joined #ruby
sspiff has quit [Changing host]
sspiff has joined #ruby
* csmrfx is not a ruby noob
lolmaus has quit []
jlogsdon has joined #ruby
<csmrfx> HTML5 doesn't *need* the broilerplate, either
<csmrfx> but it is still *great*
<csmrfx> saves time, etc
yoklov has quit [Quit: computer sleeping]
<Spooner> Anyway, just use bundler if you want, and don't if you don't :)
<bluebie> csmrfx: there's no boilerplate
<bluebie> I guess gems have a little bit :S
<bluebie> it's like a lib directory and a five line file
<bluebie> but whatever floats your boat I suppose
<fowl> csmrfx: say more things like *this*
<Spooner> Bit more than that, bluebie, and certainly a lot less than other languages.
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<bluebie> ruby is pretty much *the* language where if there were boilerplate, they built it in to the language already and got rid of it, IMO. #canuseasteriskstoo #andhashtags
<csmrfx> well I guess I will have to make a boilerplate
<fowl> most people these days have a stove, but whatever
jearvondharrie has joined #ruby
<Spooner> If you followed that link I pasted, it shows you. Gemfile, Rakefile, .gitignore, gemspec, main file in lib, version file.
<Spooner> I'd also suggest that bin/mygem is a pretty standard 100% boilerplate file.
<Mon_Ouie> Not all gems need a binary
<bluebie> yeah most don't
<bluebie> it'd be annoying for gems to polute my path with random crap messing up my autocomplete if they don't have a binary functionality
<Spooner> No, but many do. Just saying that there is plenty of repetition in every gem.
<bluebie> seems like a lot of opt-in repitition to me
t58605 has quit [Remote host closed the connection]
<Xeago> anyone good with english? unread notifications count, or unread notification count
t77004 has joined #ruby
<bluebie> Xeago: "unread notification count"
<philcrissman> Xeago: bluebie +1, unread notification count.
<csmrfx> I used to banter HTML5 boilerplate project. But then had to start alot from the scratch. And suddenly realized there are dozens of small "10-minute" things that are "easy as hell" even to the smallest of project. Boilerplate saved me time. Doesn't matter if it's 10 minuter, or the more likely 60 minutes
<fowl> >> $0
<al2o3cr> (String) "-e"
fantazo has joined #ruby
<fowl> >> DATA
<al2o3cr> -e:1:in `eval': uninitialized constant DATA (NameError), from -e:1:in `eval', from -e:1:in `<main>'
<rcassidy> >> ARGV
<al2o3cr> (Array) []
<bluebie> csmrfx: html isn't ruby
iori has quit [Remote host closed the connection]
<csmrfx> really?
<fowl> >> ENV
<al2o3cr> (Object) {"TERM"=>"linux", "PATH"=>"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/core_perl", "LANG"=>"C", "SHELL"=>"/bin/bash", "LOGNAME"=>"jrajav", "USER"=>"jrajav", "USERNAME"=>"jrajav", "MAIL"=>"/var/mail/jrajav", "HOME"=>"/home/jrajav", "SUDO_COMMAND"=>"/usr/bin/ruby -E binary:binary -e result = eval(STDIN.read); puts \"(\#{result.class}) \#{result.inspect}\"", "SUDO_USER"=>"root", "SUDO_UID"=>"0", "SUDO_GID"=>"0"}
<csmrfx> well I never..
<bluebie> now that's an interesting output
carloslopes has joined #ruby
<rcassidy> >> Dir.glob "*:
<al2o3cr> -e:1:in `eval': (eval):1: unterminated string meets end of file (SyntaxError), from -e:1:in `<main>'
<rcassidy> >> Dir.glob "*"
<al2o3cr> (Array) ["usr", "bot.err", "log", "bot.rb", "bot.out", "sys", "root", "proc", "node_modules", "bin", "lib", "etc", "lost+found"]
<fowl> no use
sailias has joined #ruby
<bluebie> java aye
<fowl> >> Dir.glob ?*
<al2o3cr> (Array) ["usr", "bot.err", "log", "bot.rb", "bot.out", "sys", "root", "proc", "node_modules", "bin", "lib", "etc", "lost+found"]
<fowl> be leet
mneorr1 has joined #ruby
<jrajav> Oh dear
<bluebie> lol single character strings
<fowl> >> ?f<<?a<<?t<<?t<<?y
<al2o3cr> (String) "fatty"
<bluebie> silly people
<shevy> rewrites are so tedious...
<jrajav> All my privatey privates
<shevy> be lucky that you have only 40 lines of code jrajav
awarner has joined #ruby
<bluebie> >> open('bot.rb').read
<al2o3cr> (String) "require 'cinch'\nrequire 'open3'\nrequire 'timeout'\n\ndef smush(text, length)\n array_len = (length / 3).ceil\n lines = text.lines.to_a.each { |l| l.chomp! }\n last = lines[-1]\n smushed = (lines.length < array_len ? lines.to_a[0..-2] : lines.to_a[0..(array_len-2)]).join(\", \")\n if smushed.length < length\n return last, smushed\n else\n return last, smushed[0..length] + \"...\"\n end\nend\n\n# Scriptlet ...
<al2o3cr> ... \"-u\", \"jrajav\", \"ruby\", \"-E\", \"binary:binary\", \"-e\", runner_script, resource_limits) do |i, o, e, t|\n i.print query\n i.close\n stdout = o.read\n stderr = e.read\n if not stderr.empty?\n result, error = smush(stderr, 400)\n m.reply \"\#{error}, \#{result}\"\n else\n result, output = smush(stdout, 400)\n m.reply ...
<al2o3cr> ... configuration\nrunner_script = 'result = eval(STDIN.read); puts \"(\#{result.class}) \#{result.inspect}\"'\nresource_limits = { :rlimit_cpu => 1, :rlimit_nproc => 4, :rlimit_fsize => 50000 }\n\nCinch::Bot.new do\n configure do |c|\n c.server = \"irc.freenode.net\"\n c.nick = \"al2o3cr\"\n c.channels = [\"#ruby\"]\n end\n\n on :message, /^>>(.+)/ do |m, query|\n Open3.popen3(\"timeout\", \"2\", \"sudo\", ...
<al2o3cr> ... jrajav\"\n m.reply phew.sample\n end\nend.start\n"
<al2o3cr> ... output.empty? ? result : \"\#{result}, Console: \#{output}\"\n end\n end\n end\n\n on :message, /^!(panic|zomg|dammit|apocalypse|reset)/ do |m, query|\n panic = [\"AAAAAAAH\", \"PANIC\", \"HOLY HELL\", \"AAAAUUUUGH\", \"SWEET ZOMBIE JESUS\", \"NOOOOOOO\", \"SAVE YOURSELF\"]\n phew = [\"All better\", \"Phew!\", \"Crisis averted\", \"Still alive~\"]\n m.reply panic.sample\n Process.spawn \"pkill -u ...
<jrajav> Holy god
<jrajav> lol
<bluebie> hey neat source code
<fowl> what
<rcassidy> whaaaa
<shevy> I still have to port about 4000 lines of old ruby code
<fowl> Hahaha
<shevy> ack
<shevy> SPAM!
graspee has quit [Quit: leaving]
<jrajav> How did that manage to get around the flooding controls
<carloslopes> lol
<shevy> lol
<jrajav> I truncate all string at 400 chars
<bluebie> well I'm having fun
<Spooner> bluebie : Lots of gems don't need Rakefile or Gemfile? Yeah, you don't strictly need it, but the point of boilerplate generators is to create a lot of standard stuff that will mostly be useful. Doesn't mean you can't either use it and then edit it or just not use it, but it sets a nice standard if you want to save 10 minutes of rote creation on a new project.
<rcassidy> >> File.new("rcassidy.txt", "w").puts "I doubt this will work."
<al2o3cr> -e:1:in `eval': Permission denied - rcassidy.txt (Errno::EACCES), from (eval):1:in `new', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<bluebie> IDK you probably need the gemfile
<jrajav> rcassidy: Odd.. that actually *should*
cakehero has joined #ruby
<rcassidy> jrajav: i was able to do it before you patched it some
<jrajav> rcassidy: I guess you can't create a new file if the directory's not executable?
<Spooner> And whoever is spamming the bot on irrelevant stuff, rather than using PM, is close to getting a /ignore on the bot :/
<rcassidy> jrajav: i think you blocked it more than you thought - can't do this either
<Mon_Ouie> mkdir -p gem/lib; cp gem.rb gem/lib/gem.rb; add gemspec
<bluebie> >> File.new('/tmp/bluebie.txt','w').puts "we cool bro?"
<al2o3cr> -e:1:in `eval': No such file or directory - /tmp/bluebie.txt (Errno::ENOENT), from (eval):1:in `new', from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<Mon_Ouie> That's pretty much all I *always* need
<bluebie> aw
<rcassidy> >> File.open("log").gets
<al2o3cr> (NilClass) nil
<bluebie> what kind of a crazy linux doesn't have /tmp
<Mon_Ouie> And come on, stop spamming this channel with the bot
<Muz> If you're going to dick about with the bot, do it in a PM.
<Muz> If you've actually something interesting, or not done before, post it to the channel.
<Muz> *actually done
<fowl> lol @ the amount of times "the bot" was just said
<bluebie> kk :)
twigmorewelsh has joined #ruby
<banisterfiend> Mon_Ouie is about to use the banhammer
emmanuel__ has joined #ruby
<fowl> there are 666 ppl in here
<jrajav> I'll see if I can fix the fact that you can't write files
<jrajav> But not today
<jrajav> I've hacked around with the bot way too much lately >_>
<Spooner> Mon_Ouie : so that is all the boilerplate you need. Fine. Not sure why that stops other people using a generator to create more files if they aren't forcing you to do it too.
<jrajav> I'm a lot more likely to add aliasing first
<jrajav> If I add anything to the bot
<shevy> bluebie the bot is in a chrooted sandbox
znake has quit [Quit: znake]
<bluebie> is the chroot the only sandboxing? <_<
<shevy> it wants to break out of it
<Mon_Ouie> Nothing, I was just stating a fact
<shevy> dunno... there are only 6 files in /usr/bin or something like that
<jrajav> bluebie: Other than what you see in the source, yup
adac has joined #ruby
<jrajav> bluebie: The scripts are also run in a separate process with various resource limits
<Spooner> bluebie : It is in a VM too, so it isn't going anywhere.
<shevy> FAMOUS LAST WORDS!!!
<jrajav> And yeah the whole linux box is just a vm
<bluebie> lol
<jrajav> And the bot is the only thing on it
<banisterfiend> when building C extensions there can be more boilerplate
<bluebie> oh right
<banisterfiend> i like to use templates for that
<banisterfiend> and also for specific kinds of gems, like pry plugins, i have gem templates for that too :)
<bluebie> I kind of want to /part just so I don't have to read 'boilerplate' again tonight
<jrajav> bluebie: More easily readable source: github.com/jrajav/al2o3cr
fbernier has joined #ruby
cantonic has quit [Quit: cantonic]
justinmcp has quit [Remote host closed the connection]
<banisterfiend> bluebie: let's call them pot boilers
<bluebie> jrajav: Neat! ^_^
joephelius has quit [Ping timeout: 268 seconds]
<jrajav> Yo dawg I heard you like boilerplate
<adac> Currently I'm dowonlaoding a file via mechanize like this: "agent.get(URL).save PATHTOFILE" Now thsi does not simply overwrite the file if it already exists, but saves the file again numbered. How can I tell "save" to overwrite it? Any ideas?
<bluebie> you could rm the file before downloading it <_<
* csmrfx infinite lazyness
<chiel> hmm
<chiel> has any of you ever written a restart script for unicorn?
<chiel> I guess it's not too hard
<chiel> Process.kill('USR2') or something
<csmrfx> ie. a daemon that restarts if fail
<bluebie> unicorn doesn't come with something like that in the form of an rc.d script?
<shevy> adac one work around - FileUtils.rm PATHTOFILE if File.exist? PATHTOFILE
<chiel> don't think so, you need to script it into the config, so it knows what to do on forking and stuff
<chiel> and then you send it to USR2 to gracefully shut down the current master and bring up a new one
t77004 has quit [Remote host closed the connection]
<bluebie> shevy: Or even ask forgiveness! FileUtils.rm PATHTOFILE rescue nil
<chiel> the first worker on the new master will then send a QUIT to the old master
* bluebie is a bad person
t33265 has joined #ruby
<shevy> ewww
<adac> bluebie, yes I could but that would be one "if" more ;)
<chiel> just need to dig into it, I guess :D
<shevy> I hate rescue nil expressions
<adac> shevy, ^^
<shevy> ada2358, but save is a method
<shevy> what arguments does it accept?
freeayu__ has joined #ruby
<shevy> because if it does accept only one argument, I dont see how you can tell it to overwrite or remove the file directly
<shevy> sorry
<shevy> I meant adac
jorge_ has joined #ruby
<Spooner> Or just FileUtils.rm "blob.fish", force: true
andrewhl has joined #ruby
<Spooner> or rm_f, of course.
<adac> shevy, I think it is this: http://mechanize.rubyforge.org/Mechanize/Download.html#method-i-save I found the mechanize doku some kind of difficult to handle
freeayu3 has quit [Ping timeout: 265 seconds]
<anoldhacker> I'm wanting to check which of two valid symbols my method has been passed (in C). The README.EXT led me to believe that String ValueCStr would work, but it only wants real Strings.. Help?
<adac> Spooner, yes that sounds good
jarek has joined #ruby
<Spooner> andrenkov : You can do SYM2ID(symbol) == rb_intern("frog"), which saves messing with strings.
thatRD has joined #ruby
joshman_ has joined #ruby
<anoldhacker> Spooner: was that answer for me?
<Spooner> anoldhacker : Sorry, autocomplete hates me.
jorge_ has quit [Ping timeout: 276 seconds]
* anoldhacker think that autocomplete hates EVERYONE...
gfontenot has joined #ruby
<Hanmac> PS: first you could check with SYMBOL_P(sym) if an VALUE is realy an symbol
<Spooner> We just need to make #ruby less popular, so there aren't multiples of people with the same first 2-3 characters. Right, where was that spam-bot again. I'm going to boilerplate it to death.
<shevy> haha autocomplete
<shevy> ada2358 vs adac
<anoldhacker> Hanmac: Already did that. ;)
<shevy> xchat prefers ada2358
<shevy> :(
<bluebie> autocomplete loves me
atmosx has joined #ruby
uris has quit [Ping timeout: 252 seconds]
<Mon_Ouie> I configured my client to only autocomplete up to the last unambiguous character
<Hanmac> why is the most evil spamer one of the Channel ops?
<Mon_Ouie> Saves some mistakes :p
<adac> shevy, yes xchat does weird things with the autocomplete. Its really annoying
axl_ has quit [Read error: Connection reset by peer]
<fowl> Hanmac: his Programs are extra Meta; in other words he has been deemed Enlightened enough to lead us
<shevy> Hanmac so he can ego-control #ruby like zenspider does on #ruby-lang
<Mon_Ouie> Hm; maybe because he lives where people walk upside down, so he's there when everyone's asleep? :p
<banisterfiend> Mon_Ouie: hmm, then u have no excuse for referring to me as 'baby:' in #pry
axl_ has joined #ruby
<bluebie> now as I understand it, #ruby-lang is not a fun happy go lucky place
<bluebie> Why once told me to never go in there
uris has joined #ruby
<bluebie> is that still the case?
<shevy> dunno, it depends
<Muz> They're less tolerant of idiots.
<shevy> some people on #ruby-lang are never here on #ruby
<Muz> I guess the question is, are you an idiot?
<banisterfiend> bluebie: it's pretty much dead these days
<fowl> bluebie: go in there and ask obvious ruby questions
<bluebie> Muz: yes
mahmoudimus has joined #ruby
<Spooner> Muz I'll stay here then :)
<Muz> :p
freeayu3 has joined #ruby
<shevy> my biggest problem with it is that you must be registered now in order to speak on #ruby-lang
gift has joined #ruby
<bluebie> elitist ruby
<bluebie> okay
<shevy> yeah but also some smart folks
gloomer_1 has quit [Ping timeout: 252 seconds]
<bluebie> meh who needs 'em!
<Hanmac> bluebie some of the users there are banned on #ruby-lang :P
<shevy> hehe
<shevy> RubyPanther is still banned? :D
<bluebie> what we lack in quality we make up for in quantity!
<fowl> bluebie: its lead by a group called seattlerb, and we all know what seattle is made of... hipsters.
jrajav has quit [Quit: The best darkness is strange and surprising]
freeayu__ has quit [Ping timeout: 268 seconds]
<Hanmac> shevy do i need you to remember at Tintin? XD
<bluebie> doubtless they were in to ruby before it was cool
<shevy> hmm tintin... which tintin... not the MUD client or?
carrythezero has quit [Read error: Connection reset by peer]
<fowl> ha
<shevy> bluebie even matz used to be on #ruby-lang
<Hanmac> no i mean the user that anoy us all
<shevy> Hanmac or do you mean that comic?
<shevy> aha
<bluebie> shevy: neat
stopbit has joined #ruby
ananthakumaran has joined #ruby
<Mon_Ouie> s0phie is probably the weirdest I've seen
<shevy> bluebie, yeah, but he left one day. I think he said that IRC takes too much time and distracts too much
<Mon_Ouie> (After banisterfiend, that is)
axl_ has quit [Read error: Connection reset by peer]
<bluebie> that's true!
<shevy> is that the man-girl?
<bluebie> I'm glad matz left
<banisterfiend> Mon_Ouie: bluebie is a real girl
<banisterfiend> probably the first in #ruby
nirix has joined #ruby
<bluebie> because ruby 1.9 is really nice
<fowl> lol i should get blimlimb up and running and put on a show for #ruby-lang
<shevy> bluebie, matz hacks on mruby these days -> https://github.com/mruby/mruby last commit by him one day ago
<bluebie> banisterfiend: oh sure we're going to make this in to a thing?
axl_ has joined #ruby
<Mon_Ouie> shevy: Yeah (or at least one of them :p)
<bluebie> do I need to change my 'realname' to something ambigious?
ph^ has joined #ruby
<csmrfx> What is this Off-Topicsies on hier?!=!
t33265 has quit [Remote host closed the connection]
<banisterfiend> bluebie: no...i dont think anyone cares that you're a girl
<shevy> it's ruby in the real world!
t95974 has joined #ruby
<bluebie> good
<csmrfx> How diff is it to get vim to jump to the error line after :!ruby codez.rb errors?
<fowl> csmrfx: our programs be Meta, thus we scoff Indignantly
<bluebie> bad memories of freenode ten years ago when people cared a lot :S
<Mon_Ouie> bluebie: Glad matz left what?
uris has quit [Quit: leaving]
carrythezero has joined #ruby
<shevy> #ruby-lang :D
<bluebie> Mon_Ouie: IRC to be more productive!
<lectrick> How do I pass an implicit block along to another method? Do I have to accept it explicitly?
<Mon_Ouie> Oh
Guest__ has joined #ruby
<bluebie> I like the stuff Matz makes :)
<banisterfiend> lectrick: &Proc.new
<shevy> yugui_zzz is here but she seems to sleep always
<banisterfiend> lectrick: def my_each; (1..10).each(&Proc.new); end
Guest__ has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
cantonic has joined #ruby
<Hanmac> shevy tintin was the guy how wants that "class A < B" is replaces with "class A extends B" ... as sample
<Mon_Ouie> There are couple of core commiters on #ruby-lang, though only drbrain is active on IRC
<banisterfiend> >> def my_each; (1..10).map(&Proc.new); end; my_each { |v| v * 2 }
<al2o3cr> (Array) [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
<lectrick> banisterfiend: wait, wait. I have a method that took an implicit block via &block. I want to call method_two(&block), but method_two isn't seeing it.
<banisterfiend> lectrick: that's an EXPLICIT block :)
Spooner has quit [Ping timeout: 252 seconds]
simao has quit [Changing host]
simao has joined #ruby
<lectrick> banisterfiend: but it's got the & magic. Isn't an explicit block taking it as an arg?
<bluebie> I wonder if mruby would run on tiny 8-bit computers
<banisterfiend> lectrick: no
<bluebie> that could be cool
<banisterfiend> lectrick: watch
<banisterfiend> explicit:
<banisterfiend> >> def hello(&block); block.call; end hello { "hi" }
<al2o3cr> -e:1:in `eval': (eval):1: syntax error, unexpected tIDENTIFIER, expecting $end (SyntaxError), def hello(&block); block.call; end hello { "hi" }, ^, from -e:1:in `<main>'
<Hanmac> i wonderd why there is an output from al2o3cr without >> .... and then i remember that one user there is blocked
<banisterfiend> >> def hello(&block); block.call; end; hello { "hi" }
<al2o3cr> (String) "hi"
<banisterfiend> lectrick: implicit
bbttxu has quit [Ping timeout: 245 seconds]
<lectrick> ok so I call the method from my method with method_two(&Proc.new) ?
<banisterfiend> >> def hello; yield; end; hello { "hi" }
<al2o3cr> (String) "hi"
cezar has joined #ruby
<Mon_Ouie> If you use regular arguments, it's not even a block that gets passed
<lectrick> Yeah, you're right, it's just an argument variable
rippa has joined #ruby
jorge_ has joined #ruby
SCommette has joined #ruby
mohits has quit [Ping timeout: 246 seconds]
<shevy> Hanmac haha good point. he kept on spamming me in PRIVMSG with useless crap so I had to ban him too
cezar has quit [Client Quit]
w400z has joined #ruby
axl_ has quit [Read error: Connection reset by peer]
chussenot_ has joined #ruby
<lectrick> ah shit i had the arg in the wrong place, I got it to work
axl_ has joined #ruby
<lectrick> you just pass it along to the next method with &block
chussenot has quit [Read error: No route to host]
chussenot_ is now known as chussenot
axl_ has quit [Remote host closed the connection]
mahmoudimus has quit [Quit: Computer has gone to sleep.]
<shevy> http://mechanize.rubyforge.org/Mechanize/Page/Base.html how does mechanize use .html pages? are these yard generated or something?
<shevy> the documentation part
axl_ has joined #ruby
bluebie has quit [Quit: Linkinus - http://linkinus.com]
v0n has joined #ruby
internet_user has joined #ruby
pdelgallego has joined #ruby
fearoffish has joined #ruby
choffstein has joined #ruby
<Muz> shevy: bottom left, it mentions what was used to generate the pages.
<shevy> cool
venkatk_ has quit [Quit: This computer has gone to sleep]
uris has joined #ruby
<shevy> darkfish rdoc
headius has joined #ruby
fmcgeough has joined #ruby
jjbohn has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
yasushi has quit [Remote host closed the connection]
glistle has joined #ruby
sebicas has joined #ruby
sendoushi has joined #ruby
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
Takehiro has quit [Remote host closed the connection]
axl__ has joined #ruby
nopolitica has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
<csmrfx> ruby regexp patterns: how to return a match a or be (";" or escaped double-quote)?
codeFiend has quit [Quit: codeFiend]
zodiak has joined #ruby
<csmrfx> hm, is the method String.scan...
<Hanmac> shevy did you see the new microsoft logo?
Takehiro has joined #ruby
axl_ has quit [Ping timeout: 260 seconds]
axl__ is now known as axl_
<shevy> Hanmac nope. dont use MS much these days
und3f has quit [Quit: Leaving.]
<csmrfx> What do you call it when you want the match between pattern a and pattern b? (for example, between 'param=' and ';')
<Hanmac> you mean like this? /param=\w*;/
axl__ has joined #ruby
<csmrfx> hm, lets see
tiripamwe has joined #ruby
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<rcassidy> >> /param=\w*;/.match('param=grapefruit;')
<al2o3cr> (MatchData) #<MatchData "param=grapefruit;">
<csmrfx> Hanmac: almost
<csmrfx> the key word being *between*
axl__ has quit [Read error: Connection reset by peer]
<csmrfx> ie. exclude the 'pattern delimters' param= and ;
<Hanmac> >> /param=(\w*);/.match('param=grapefruit;')[1]
<al2o3cr> (String) "grapefruit"
<rcassidy> >> /param=\w*;/.match('param=grapefruit;')[0]
<al2o3cr> (String) "param=grapefruit;"
Guest__ has joined #ruby
<rcassidy> i seeeee
<csmrfx> aha
bbttxu has joined #ruby
<csmrfx> hm, so what you call that?
axl__ has joined #ruby
<rcassidy> >> /param=\w*;/.match('param=grapefruit;')[2]
<al2o3cr> (NilClass) nil
jords has quit [Ping timeout: 245 seconds]
<Hanmac> but i would use some ini parsing lib
Guest__ has quit [Client Quit]
Stalkr_ has joined #ruby
axl_ has quit [Ping timeout: 265 seconds]
axl__ is now known as axl_
<csmrfx> hm, how do you know it is 'grapefruit' btw
Guest__ has joined #ruby
<Hanmac> it was an sample
jearvondharrie has quit [Read error: Connection reset by peer]
jorge_ has quit [Remote host closed the connection]
freeayu has joined #ruby
Guest__ is now known as wo66le
josemota has joined #ruby
<csmrfx> Heh, I am thick, I do not grok how to combine scan, match and result group [1]
tayy has joined #ruby
<josemota> hi everyone, i'm running `time rspec` and the time shows up instantly before running the specs. what gives? has anyone had this happening?
<csmrfx> hm, mebbe in block
tomsthumb_ has quit [Quit: Leaving.]
<josemota> am i missing something?
freeayu3 has quit [Ping timeout: 246 seconds]
tayy has quit [Remote host closed the connection]
erichmenge has joined #ruby
Takehiro has quit [Remote host closed the connection]
fermion has joined #ruby
Takehiro has joined #ruby
t95974 has quit [Remote host closed the connection]
<csmrfx> Ok, I grouped em with parenthesis dstr.scan(/(param=)(\w*)([;|"])/) { |rr| p rr }
<csmrfx> now it works, thanks Hanmac rcassidy
t13990 has joined #ruby
Taichouchou has joined #ruby
ar_ has joined #ruby
sendoushi has quit [Read error: Connection reset by peer]
bluenemo has joined #ruby
bluenemo has quit [Changing host]
bluenemo has joined #ruby
sendoushi has joined #ruby
Progster has joined #ruby
<csmrfx> varified: dstr.scan(/(#{strt})(\w*)([#{enrt}|"])/) { |rr| p rr[1] }
<csmrfx> pretty readable, huh
Hanmac has quit [Ping timeout: 276 seconds]
banghouse has joined #ruby
Taichouchou has quit [Client Quit]
Taichouchou has joined #ruby
joephelius has joined #ruby
fbernier has quit [Ping timeout: 272 seconds]
fastred has quit [Quit: fastred]
choffstein has quit [Remote host closed the connection]
Taichouchou has quit [Client Quit]
Taichouchou has joined #ruby
Morkel has joined #ruby
<csmrfx> at least it can be commented after x-yfying it
Zespre has quit [Ping timeout: 260 seconds]
Zespre has joined #ruby
emmanuel__ has quit [Ping timeout: 252 seconds]
<csmrfx> when using variables in a regexp, can vars be reset or does the regxp need to be re-created?
jlogsdon has quit [Ping timeout: 252 seconds]
<csmrfx> +when creating a regexp instance into a var
Hanmac has joined #ruby
<fowl> huh
davidcelis has quit [Quit: K-Lined.]
<fowl> you mean x = /someregex/ or /someregex#{x}/
apeiros_ has quit [Remote host closed the connection]
savage- has joined #ruby
<csmrfx> If one do: byrd = "fowl"; rexp = /A #{byrd}; and then byrd = "apeiros", which will it match?
<csmrfx> it = rexp
<csmrfx> ah
<fowl> r would be /A fowl/
<csmrfx> It will interpolate when instancing
<csmrfx> not lazy
<csmrfx> gosh
<csmrfx> can it be made lazily?
jorge_ has joined #ruby
jorge_ has quit [Remote host closed the connection]
<fowl> rexp = -> { /A #{byrd}/ }
<atmosx> [*] CVE-2010-EASY Android local root exploit (C) 2010 by 743C
<atmosx> ahaha that's fancy...
<csmrfx> fowl you put the rexp in a lambda block?
Zespre has quit [Ping timeout: 246 seconds]
nopolitica has quit [Ping timeout: 252 seconds]
<fowl> csmrfx: yes then change byrd and call it
<csmrfx> bybybybyytfbyyrdbyyrd
<fowl> compare against regx[]
<Muz> Everybody's heard that the byrd is the wyrd.
<csmrfx> I mean, it almost defeats the purpose of interpolating if can not re-use
sh1nji has joined #ruby
<fowl> considering that string interpolation works the same way i think you should stop crying
uris_ has joined #ruby
<csmrfx> bwah!
Araxia has joined #ruby
freeayu__ has joined #ruby
<csmrfx> bwyah! it return an arr in an arr
waxjar has quit [Quit: Computer has gone to sleep.]
<csmrfx> next: I put the lime in the coconut
limes has joined #ruby
tomsthumb_ has joined #ruby
josemota has quit [Quit: WeeChat 0.3.8]
Araxia has quit [Client Quit]
answer_42 has quit [Ping timeout: 276 seconds]
uris has quit [Ping timeout: 240 seconds]
freeayu has quit [Ping timeout: 246 seconds]
mneorr1 has quit [Quit: Leaving.]
codeFiend has joined #ruby
elhu has quit [Quit: Computer has gone to sleep.]
Zespre has joined #ruby
wvms has left #ruby [#ruby]
Eldariof59-ru has quit []
elhu has joined #ruby
t13990 has quit [Remote host closed the connection]
maesbn has quit [Remote host closed the connection]
<csmrfx> hm, vim doesn't like my lambda-regexp-block-groups
t51205 has joined #ruby
maesbn has joined #ruby
answer_42 has joined #ruby
freeayu__ has quit [Ping timeout: 246 seconds]
xclite has joined #ruby
<csmrfx> hm, or it's probably the #{} in the middle
cantonic has quit [Quit: cantonic]
aganov has quit [Quit: aganov]
bradhe has quit [Remote host closed the connection]
vectorshelve has quit [Quit: Page closed]
baroquebobcat has joined #ruby
Taichouchou has quit [Remote host closed the connection]
Taichouchou has joined #ruby
Morkel has quit [Quit: Morkel]
maesbn has quit [Ping timeout: 268 seconds]
flargh2 has joined #ruby
Taichouchou has quit [Client Quit]
Taichouchou has joined #ruby
Rochefortes has joined #ruby
Morkel has joined #ruby
markprovan has joined #ruby
shiki has quit [Remote host closed the connection]
<csmrfx> thank you fowl! rather nice
jprovazn is now known as jprovazn_away
<flargh2> Anyone know how I can generate symbols in an extension so valgrind can show line number?
chussenot has quit [Remote host closed the connection]
Rochefort has quit [Ping timeout: 246 seconds]
chussenot has joined #ruby
Rochefort has joined #ruby
<Mon_Ouie> Compile with $CFlAGS << " -g"
<flargh2> I've tried that and still no line numbers.
Rochefortes has quit [Read error: Connection reset by peer]
_keith has left #ruby [#ruby]
aantix has joined #ruby
apok has joined #ruby
aantix has quit [Read error: Connection reset by peer]
<flargh2> I can get line numbers with a hand-made makefile using -g in both LDFLAGS and CFLAGS without using the extension. But I can't seem to get them for the extension.
Taichouchou has quit [Client Quit]
aantix has joined #ruby
Taichouchou has joined #ruby
Taichouchou has quit [Remote host closed the connection]
elhu has quit [Ping timeout: 252 seconds]
ckrailo has joined #ruby
<flargh2> Is there something special about running ruby under valgrind that blocks line numbers?
Taichouchou2 has joined #ruby
<Hanmac> shevy do you want to be my magican that converts my camels into snakes?
kpshek has quit []
djbender has joined #ruby
MetaCosm has quit []
gani has joined #ruby
ikaros has joined #ruby
iori has joined #ruby
iori has quit [Read error: Connection reset by peer]
iori has joined #ruby
axl__ has joined #ruby
elhu has joined #ruby
savage- has quit [Remote host closed the connection]
<shevy> Hanmac nah, I need to finish this rewrite
<shevy> 4000 lines of old code still left
banghouse has quit [Quit: What if the hokey pokey really is what it's all about?]
sailias has quit [Quit: Leaving.]
banghouse has joined #ruby
chrisja has joined #ruby
apok has quit [Quit: apok]
banghouse has quit [Client Quit]
banghouse has joined #ruby
macmartine has joined #ruby
axl_ has quit [Ping timeout: 244 seconds]
axl__ is now known as axl_
<csmrfx> >> "CanICamelThis"..gsub!(/(.)([A-Z])/,'\1_\2').downcase!
<al2o3cr> -e:1:in `eval': undefined method `gsub!' for main:Object (NoMethodError), from -e:1:in `eval', from -e:1:in `<main>'
<csmrfx> >> "CanICamelThis".gsub!(/(.)([A-Z])/,'\1_\2').downcase!
<al2o3cr> (String) "can_icamel_this"
wobr1 has quit [Ping timeout: 252 seconds]
<csmrfx> close, close
havenn has quit [Remote host closed the connection]
tk__ has quit [Quit: ばいばい]
Spooner has joined #ruby
Synthead has joined #ruby
gmci has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<Hanmac> csmrfx yeah ... you could do it for me in my c++ binding :P
cezar has joined #ruby
cezar has quit [Client Quit]
gani has left #ruby ["leaving.."]
<djbender> whois tuxbiker
<djbender> dammit sorry.
bradhe has joined #ruby
jasonLaster has joined #ruby
monobit_ has quit []
asteve has joined #ruby
t51205 has quit [Remote host closed the connection]
t59808 has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
x77686d has joined #ruby
<Muz> >> meh = ""; "CanICamelCaseThis".scan(/([A-Z])([a-z]*)/) do meh << "#{$1}#{$2}_" end; meh.sub(/_$/, '')
<al2o3cr> (String) "Can_I_Camel_Case_This"
<Muz> >> meh = ""; "CanICamelCaseThis".scan(/([A-Z])([a-z]*)/) do meh << "#{$1}#{$2}_".downcase end; meh.sub(/_$/, '')
<al2o3cr> (String) "can_i_camel_case_this"
<csmrfx> Hm, flattening hash with arrays of arrays in to simple list: hash key\n arr1\n arr2\n ...?
pyreal has joined #ruby
<csmrfx> hash.each_pair{ |k,v| v.each { |arr| #interplox 2 string } } seems glungy
<Spooner> >> meh = ""; "CanICamelCaseThis".scan(/([A-Z])([a-z]*)/).map(&:downcase).join("_")
<al2o3cr> -e:1:in `eval': undefined method `downcase' for ["C", "an"]:Array (NoMethodError), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<Spooner> oops
insecurlex has joined #ruby
<Spooner> >> meh = ""; "CanICamelCaseThis".scan(/([A-Z][a-z]*)/).map(&:downcase).join("_")
<al2o3cr> -e:1:in `eval': undefined method `downcase' for ["Can"]:Array (NoMethodError), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
<Spooner> I should give up or use pry first :)
<csmrfx> dont you need exactly one A-Z and zero or more a-z
<Hanmac> >> "CanICamelCaseThis".scan(/[A-Z][a-z]*/).map(&:downcase).join("_")
<al2o3cr> (String) "can_i_camel_case_this"
<lectrick> There's no const_added hook, is there
insecurlex has quit [Remote host closed the connection]
<Spooner> Hanmac : I totally forgot how scan works :)
enricostn has joined #ruby
sailias has joined #ruby
TPFC-SYSTEM has joined #ruby
apeiros_ has joined #ruby
xclite has quit [Remote host closed the connection]
arkiver has quit [Quit: Leaving]
<enricostn> hi, I was googling around but I cannot understand the difference between a = a || {} and a = a ||= {}, with a undefined in both cases
<Hanmac> >> "CanICamelCaseThis".scan(/[[:upper:]][:lower:]]*/).map(&:downcase).join("_")
<al2o3cr> (eval):1: warning: regular expression has ']' without escape: /[[:upper:]][:lower:]]*/, (eval):1: warning: regular expression has ']' without escape: /[[:upper:]][:lower:]]*/
<Hanmac> >> "CanICamelCaseThis".scan(/[[:upper:]][[:lower:]]*/).map(&:downcase).join("_")
<al2o3cr> (String) "can_i_camel_case_this"
flip_digits has joined #ruby
<Spooner> enricostn : the former one doesn't work if a is undefined (only if a is nil).
Rochefort has quit [Ping timeout: 246 seconds]
<limes> could someone tell me how to / where to fix > http://pastebin.com/7M2NxV3U < observer.rb:126:in `add_observer': observer needs to respond to `update' (NoMethodError) cant find a hint on google...
Norm has joined #ruby
<enricostn> Spooner: in irb if I type a = a || {} I get {}
jorge_ has joined #ruby
luxurymode has joined #ruby
<Spooner> enricostn : You do indeed. I was wrong. Well, there is no difference then. ||= is just shorthand (like +=)
<Norm> can a gemspec file define groups, like a Gemfile? or do i have to configure groups in the gemfile?
eywu has joined #ruby
<Muz> Norm: groups are a feature of Bundler and belong in the Gemfile, not hte gemspec.
<Muz> The gemspec is used for building the gem that's shipped by RubyGems.
<Mon_Ouie> There are differences, a ||= {} is more like a || (a = {}) (and does implicitly define local variables)
atmosx has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<Norm> Muz: ok thanks
<Spooner> Norm : bundler does assign :default and :development groups though.
sixtycakes has joined #ruby
<Spooner> Based on the gemspec.
<Norm> the distinction between Gemfile and gemspecs is still a little hazy
<Norm> Spooner: got it
chimkan_ has joined #ruby
<Mon_Ouie> If you call it with a method, the setter will never be called if the getter returns something that isn't false or nil
<Norm> if i define dependencies in my Gemfile, will they get loaded by bundler/setup?
<Hanmac> (or undefined :D)
pdelgallego has quit [Ping timeout: 246 seconds]
<Spooner> Norm : Yeah, it is a great shame that the functionality of bundler is separated from rubygems.
<enricostn> Mon_Ouie: how I could check this in irb?
Squarepy has quit [Quit: Leaving]
<Spooner> norm dependencies how?
<Mon_Ouie> The typical example uses hashes. h = Hash.new(0); h['foo'] ||= 1; p h
pdelgallego has joined #ruby
<Mon_Ouie> ^ the hash will still be empty
<Mon_Ouie> Actually
<Norm> Spooner: in my gemfile, if i do "gem 'eventmachine'", it seems that bundler knows to load it
<Mon_Ouie> >> h = Hash.new(0); h['foo'] ||= 1; h
<al2o3cr> (Hash) {}
<Sou|cutter> Norm: depends on what groups they're in
x77686d has quit [Ping timeout: 246 seconds]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
<Mon_Ouie> >> h = Hash.new(0); h['foo'] = h['foo'] || 1; h
<al2o3cr> (Hash) {"foo"=>0}
stopbit has quit [Read error: Connection reset by peer]
<Spooner> It does. I think you want to use "gemspec" method in your Gemfile?
kn330 has joined #ruby
havenn has joined #ruby
<Mon_Ouie> (Still getting used to having that bot here :)
Vert has quit [Read error: Connection reset by peer]
<Norm> Spooner: yeah, i do have 'gemspec' in there. but if this just loads the gemspec file, i lose the ability to declare dependencies for a specific group
<Muz> Mon_Ouie: you mean it has a use other than people trying to break it?!
stopbit has joined #ruby
<Norm> Spooner: so, as i see it, i have to declare my "global" dependencies in my gemspec, and the per-group dependencies in the gemfile?
<Muz> Norm: dependencies in the gemspec should be items that anyone who wants to use your gem in a production environment will need to run it. Deps in your Gemfile are items you'll need to develop on your gem before you package and ship it.
<Sou|cutter> gemspec has the concept of development dependencies
<Sou|cutter> but gemspec is certainly not as flexible as Gemfile groups
mohits has quit [Ping timeout: 260 seconds]
<Norm> Muz: got it
the_jeebster has joined #ruby
<Muz> Example: Gemfile contains 'cucumber' for testing your development, but you dont' want other people who install your gem to need to install cucumber just to use your lib.
<Norm> Muz: right, i wanted to use the Gemfile to define groups other than just prod & test
<Norm> seems that's not exactly how it's going to work :)
<Spooner> norm Sadly, yes, I think that is what you need to do, but really your gemspec is all that is run by your gem when used by others, so adding more deps in your Gemfile doesn't really help.
<Muz> That is a very rudimentary overview of the differentiation between where you list deps though.
<Sou|cutter> Muz: in gemspec you can use add_development_dependency
<Muz> Sou|cutter: yup, but then there are times when you may want to have gems installed for your local development that you don't want others downstream to /need/
lesce has joined #ruby
<Muz> Like I said, a very rudimentary overview. But yeah, locally, you may be maintaining all manner of additional guff in your Gemfile for your project and local gemset that aren't pertinent to development deps in your gemspec.
<Sou|cutter> Muz: add_development_dependency is effectively equivalent to putting a gem in a development group in bundler
mahmoudimus has joined #ruby
andrenkov has quit [Quit: leaving]
iori has quit [Remote host closed the connection]
<Sou|cutter> users of your gem will not have development dependencies added to their dependency tree
jrajav has joined #ruby
markprovan has left #ruby [#ruby]
* Muz is aware of the difference between spec.add_dependency, and spec.add_development_dependency. :)
<enricostn> Mon_Ouie: in this case for example http://rails.francik.name/tutorial/chapter/12#35 look at add and index methods
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
<Muz> Sou|cutter: we have all manner of internal gems we use here that I wouldn't want to have people expect to have access to in order to make further downstream changes
Morkel has quit [Quit: Morkel]
bluenemo has quit [Remote host closed the connection]
<Sou|cutter> that sounds like a messy situation
<Cork> i'm looking for a text parser that uses templates (sort of a revers template rendering format)
<Cork> has anyone heard of something like that?
t59808 has quit [Remote host closed the connection]
randomautomator has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
t25789 has joined #ruby
oc_ has left #ruby [#ruby]
davidcelis has joined #ruby
<Mon_Ouie> enricostn: What exactly about them?
jorge_ has quit [Remote host closed the connection]
xorigin has quit [Quit: leaving]
senny has quit [Remote host closed the connection]
pskosinski has quit [Read error: Connection reset by peer]
ly_gs has quit [Remote host closed the connection]
hadees has quit [Quit: hadees]
spanner has quit [Ping timeout: 268 seconds]
withnale has joined #ruby
robotmay has quit [Remote host closed the connection]
liluo has quit [Remote host closed the connection]
havenn_ has joined #ruby
lesce has quit [Quit: Leaving]
flagg0204 has quit [Ping timeout: 240 seconds]
spanner has joined #ruby
flagg0204 has joined #ruby
cbuxton has joined #ruby
mmitchell has quit [Remote host closed the connection]
<Hanmac> shevy is "create_billboard_chain" still a good name for snake_case? :(
apok has joined #ruby
xclite has joined #ruby
x77686d has joined #ruby
kenichi has joined #ruby
<eric-wood> fuck contenteditable
<eric-wood> every browser generates different markup
<eric-wood> and it's all bullshit
xclite has quit [Remote host closed the connection]
<eric-wood> anyone here ever do anything with it?
<eric-wood> I could use some insights
<enricostn> Mon_Ouie: in the add method they use ||= operator, but in the index method they use ||
savage- has joined #ruby
xclite has joined #ruby
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
<Mon_Ouie> I guess for some reason they don't need to set session[:car] to {} in index
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
<Mon_Ouie> They may not need it at all, in fact
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
shevy has quit [Ping timeout: 252 seconds]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
mikepack has joined #ruby
kn330 has quit [Read error: Connection reset by peer]
<enricostn> Mon_Ouie: do you mean that in cart = session[:cart] ||= {} if session[:cart] is nil or undefined then cart but also session[:cart] will be set to {}?
havenn has quit [Remote host closed the connection]
savage- has quit [Remote host closed the connection]
<Mon_Ouie> session[:cart] can't be undefined
machuga has joined #ruby
otters has quit [Quit: WeeChat 0.3.8]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
ibash has joined #ruby
<Mon_Ouie> That undefined part only applies for variables
jrajav has quit [Quit: The best darkness is strange and surprising]
savage- has joined #ruby
apok has quit [Quit: apok]
<Mon_Ouie> And, yes that's what will happen
<enricostn> ah ok
<kapowaz> is there any way of ensuring that the output from a shell command invoked as part of a ruby script doesn't ever get output to stdout?
<kapowaz> I'm running `someutil --options` and it's outputting some things regardless
<enricostn> Mon_Ouie: ok, I got it. thank you!
<kapowaz> I'd like it to be entirely quiet so that I can provide my own output based on the processed results
hoelzro is now known as hoelzro|away
<Mon_Ouie> You can use IO.popen and get the input as an IO stream
djbender has quit [Quit: djbender]
<Mon_Ouie> Well, the output of that program
maletor has joined #ruby
graft has joined #ruby
graft has quit [Changing host]
graft has joined #ruby
CodeFriar is now known as c00kiemonster
hadees has joined #ruby
<kenichi> if you're running `something` and seeing output, isn't it more likely that output is going to stderr?
<kenichi> kapowaz: ^^
niklasb has joined #ruby
dhruvasagar has quit [Ping timeout: 248 seconds]
<kapowaz> that's also possible
tommyvYo has quit [Quit: Computer has gone to sleep.]
azm has quit [Ping timeout: 268 seconds]
<kenichi> try `something 2>&1` or something like that
<kapowaz> but I have no control over how that program works :(
<kapowaz> aha
<kapowaz> perfect!
<kapowaz> thanks!
mmitchell has joined #ruby
<kenichi> np
<kapowaz> that redirects stderr to stdout ?
<kenichi> y
chimkan___ has joined #ruby
<kapowaz> excellent, sidesteps ruby completely :)
mmitchell has quit [Remote host closed the connection]
t25789 has quit [Remote host closed the connection]
t59202 has joined #ruby
fyolnish has quit [Remote host closed the connection]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
w400z has quit []
jwmann has joined #ruby
jwmann has quit [Max SendQ exceeded]
carloslopes has quit [Quit: Leaving.]
chimkan_ has quit [Ping timeout: 240 seconds]
Advocation has quit [Quit: Advocation]
mengu has joined #ruby
_bart has quit [Ping timeout: 246 seconds]
Vert has joined #ruby
djbender has joined #ruby
alien_move has joined #ruby
<alien_move> hi
shevy has joined #ruby
<alien_move> what's the difference between <%= and <% ?
Neo17 has joined #ruby
<sixtycakes> <%= will execute and print the result
<sixtycakes> <% just executes
brasten has quit [Quit: brasten]
Morkel has joined #ruby
bontaq has joined #ruby
djbender has quit [Client Quit]
<alien_move> thanks sixtycakes
yoklov has joined #ruby
brasten has joined #ruby
otters has joined #ruby
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
psp250 has joined #ruby
psp250 has left #ruby ["Leaving"]
fabrice31 has quit [Remote host closed the connection]
poga has joined #ruby
A124 has joined #ruby
adamkittelson has joined #ruby
matled has quit [Quit: leaving]
A124 has quit [Client Quit]
matled has joined #ruby
jdripper has quit [Quit: Leaving.]
machty has quit [Ping timeout: 246 seconds]
zommi has quit [Quit: Leaving.]
jrajav has joined #ruby
t59202 has quit [Remote host closed the connection]
t36602 has joined #ruby
bowlowni_ has quit [Read error: Connection reset by peer]
bowlowni has joined #ruby
clocKwize has quit [Quit: clocKwize]
machty has joined #ruby
cirwin has joined #ruby
sendoushi has quit [Remote host closed the connection]
pricees has joined #ruby
ringotwo has joined #ruby
ibash has quit [Quit: ibash]
maletor has quit [Quit: Computer has gone to sleep.]
ananthakumaran has quit [Ping timeout: 240 seconds]
jasonLaster has quit [Remote host closed the connection]
codeFiend has quit [Quit: codeFiend]
jasonLaster has joined #ruby
stkowski has joined #ruby
ananthakumaran has joined #ruby
c00kiemonster is now known as codefriar
<eam> naming convention for rubygems seems to be "clever and artsy" as opposed to "descriptive of function"
<davidcelis> eam: You mean naming my BreweryDB wrapper "brewhouse" is a bad idea?
<rking> eam: Hehe, well, it's better than CPAN where the good names get hogged by the first implementation, not the best implementation.
iamjarvo has joined #ruby
<codefriar> using rspec, how can I test that a method throws an error when the results of a method it calls are X ?
<eam> rking: always an issue, I agree
<Sou|cutter> yeah, BreweryDBWrapper is the worst
<iamjarvo> does a teardown method in a testhelper get called after each test
<davidcelis> right? that's a shitty gem name
<rking> Like "hpricot" then "nokogiri". I don't really need them to be more descriptive than that.
<iamjarvo> or just after the suite
* davidcelis sticks with Brewhouse
<eam> not sure it's better though. I'd prefer "posix_spawn" over "spoon" for example
<rking> codefriar: Mock then wrap in a lambda and assert that it throws.
<Hanmac> "YetAnotherStupidLongName" ?
cirwin has quit [Ping timeout: 276 seconds]
codeFiend has joined #ruby
<Sou|cutter> codefriar: lambda { someCode(X) }.should raise_error(ErrorType) or something
w400z has joined #ruby
adeponte has joined #ruby
jasonLaster has quit [Ping timeout: 246 seconds]
A124 has joined #ruby
<eam> anyway I figure if I'm going to make gems I should embrace the community standards. I've been sitting around all morning with a thesaurus and thinking of puns
tewecske has joined #ruby
<Sou|cutter> nobody's going to use your gem anyway, just pick whatever comes to your brain
<rking> codefriar: http://rubydoc.info/gems/rspec-mocks/frames + what Sou|cutter said.
A124 has left #ruby [#ruby]
ikaros has quit [Quit: Ex-Chat]
<Sou|cutter> and so the most popular gem ever with the stupidest name ever was born!
jasonLaster has joined #ruby
<codefriar> I don't think I've ever used lambda
<davidcelis> codefriar: how do you sleep at night
mahlon has joined #ruby
<rking> eam: Aww, come on! posix_spawn vs spoon is a no-brainer. "Spoon" is like a "fork", and there's no need to spell out what is basically an incidental implementation detail in a gem that could be coded also in Win32.
<codefriar> badly
artOfWar has joined #ruby
<limes> `add_observer': observer needs to respond to `update' (NoMethodError) | who can help out telling me how to fix that ? http://pastebin.com/7M2NxV3U | line 27
jasonLaster has quit [Remote host closed the connection]
<rking> codefriar: RSpec is using it in a particular kind of way, here. There are more general cases for it.
<eam> rking: nah I think it's really harmful actually. I know what posix_spawn() is, but now I have to remember it's in this weirdass spoon module
jasonLaster has joined #ruby
<eam> and I don't mean to pick on spoon, it's a prevalent issue
maletor has joined #ruby
<eam> reinventing names for established things outside the ruby environment just makes for confusion imo
<rking> eam: But it's not only a "posix_spawn" gem. It's more about prefork/postfork abstraction.
twigmorewelsh has quit [Ping timeout: 246 seconds]
<eam> eh?
<rking> No, I'm mixing it up. =D
<rking> Kind of proving your point. =D
<eam> see? !!
<iamjarvo> the answer to my earlier question is it gets run after each tet if in ahelper file
<rking> I was actually thinking of Spork.
<eam> yeah
apok has joined #ruby
<eam> name unrelated to function :
<eam> :(
<canton7> limes, given that line 27 is an 'end' statement, do you mean 26? :P
yoklov has quit [Quit: computer sleeping]
<rking> eam: Naming is one of the two hard problems in computing.
* zeknox is falling in love with nokogiri
<limes> canton7: possible too :) but what does he want me to do ? just cant find nothing on the internet -.-
jrajav has quit []
<eam> rking: it's just something I noticed as unique to the ruby community
<eam> most other languages tend to use functionally descriptive identifiers
<canton7> limes, your Dummy class needs to implement the function 'update', as the error says
<Sou|cutter> nokogiri is alright, but for whatever reason (even after compiling a custom libxml) I can't seem to get encodings to work
<eam> (for the most part, not as an absolute rule)
lolzie has joined #ruby
<canton7> limes, sorry, wrong way around. In order for the websocket to be given as an observer to Dummer, which includes Observable, it needs to implement 'update'
<canton7> s/Dummer/Sunny
koshii has joined #ruby
<limes> canton7: and this is the point .. just dunno how what to put there... any ideas or code snippets to fixx ? :)
jarek has quit [Quit: jarek]
<canton7> *Dummy. grr
<lolzie> Hi guys: puts line.split(//).map { |x| x.downcase.tr('a-z', '1-26') }
<canton7> limes, what are you trying to do?
jasonLaster has quit [Ping timeout: 260 seconds]
<lolzie> Why does that not output the numerical position of each letter?
c0rn_ has joined #ruby
<lolzie> Input 'sky' returns 6,6,6 :\
<koshii> Hey guys, is the "@" character something that has to be escaped? When I add this to by ruby code: cmd = `ssh -o ConnectTimeout=120 root@` I get a wrong number of arguments error.
<koshii> (it works fine without it)
<Sou|cutter> it's really a libxml issue I suppose
<limes> create upd server listening wich puts its received data to a websocket wich presents its data to an html page kind of an live ticker
<rking> eam: The Ruby names are a unique balance of forces on that problem, yes, but I've not suffered for it, much. Very many of them are clever but clear if you know the origins.
<eam> rking: that's my problem, I don't know the ruby origins -- only the generic platform features I want
<rking> koshii: Shouldn't be, though technically that depends on the shell invoked.
<koshii> rking: bash?
<eam> koshii: appears you're missing a hostname
<koshii> eam: That's on another line. I'm reading a list of hosts from a text file.
<rking> koshii: It's on another line?
Eiam has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<koshii> err in the code
<rking> How would it get sent to the shell invocation, then?
<lolzie> haha
kenichi has quit [Remote host closed the connection]
<rking> At least lolzie got some lulz out of the situation.
<koshii> def ssh cmd = `etc` puts cmd end
<canton7> limes, the problem being that you haven't written the code that tweels the WebSocket instance how to be an observer
<koshii> then later, ssh line, with line being the current line from the list of hosts
<canton7> s/tweels/tells
ananthakumaran has quit [Ping timeout: 272 seconds]
tiripamwe has quit [Ping timeout: 240 seconds]
<koshii> Oh, does puts insert a carriage return?
w400z has quit [Quit: Computer has gone to sleep.]
<fowl> yup
Takehiro has quit [Remote host closed the connection]
<rking> koshii: I'm confused. Only the stuff in between ` and ` are going to go to the command invocation.
nilg has quit [Remote host closed the connection]
ephemerian has left #ruby [#ruby]
<lolzie> rking: I'm not sure it's you that's confused
ananthakumaran has joined #ruby
<limes> canton7: im quite new to all this an, got a working udp server und a working socket server but just cant figure out how to put them together :(
w400z has joined #ruby
insecurlex has joined #ruby
<koshii> rking: What I want to do is ssh into each server and run a few commands.
Criztian has quit [Ping timeout: 252 seconds]
<rking> koshii: You're passing line to the ssh method, but the ssh method expects no arguments.
<rking> It's like my wife.
* rking looks over shoulder.
miho has quit [Ping timeout: 240 seconds]
pskosinski has joined #ruby
<fowl> +1
<koshii> rking: Oh so I'm actually doing it backwards from how I should be doing it?
Takehiro has joined #ruby
<koshii> rking: I should be passing TO the ssh def
JoshLambert has joined #ruby
<canton7> limes, you could do $mim.add_observer(ws, :send)
<JoshLambert> I have a question about Ruby arrays
<canton7> that would make notify_observers (line 10) cause ws#send to be called
<limes> koshii: might take a look at http://rush.heroku.com that should do the job i think
<lectrick> Is there any way to hook into when a class definition finishes/closes?
<fowl> koshii: give the method some args, then you can interpolate with #{}
<canton7> limes, (well, you could in theory: I haven't tried it)
<JoshLambert> How do I access the email address value from within the loop? "http://pastie.org/4575399"
<rking> koshii: You want something more like this: https://gist.github.com/25050c98e6a41d666c3c
<limes> canton7: ill try :)
flip_digits has quit [Quit: Computer has gone to sleep.]
<eam> koshii: you might find this useful: https://rubygems.org/gems/mssh
<rking> fowl talks about it, I code about it. That's the winner's difference, right there.
<koshii> Aha
<koshii> rking: Thank you!
kenichi has joined #ruby
<canton7> johnduhart2, the email address will be in item['vlue']
<canton7> * item['value']
<koshii> limes / eam: too complex for now :-) But thank you, these are bookmarked for later.
<fowl> koshii: also, your lines might have \n on the end so you might want to chomp them
<canton7> JoshLambert, ^^
<JoshLambert> canton7: Ok, thanks.
<JoshLambert> canton7: I'm a PHP guy trying to get my head around RoR.
<limes> canton7: gives me "`add_observer': wrong number of arguments (2 for 1) (ArgumentError)"
jorge_ has joined #ruby
<koshii> fowl: How can I know if they have \n at the end of them? And chomp is some kind of built-in method?
resure_ has joined #ruby
<fowl> koshii: if they are printing out on each line then they have a newline because print() doesnt put a newline at the end, puts() does
twigmorewelsh has joined #ruby
<limes> koshii: http://rush.heroku.com/handbook/remote its not that complex :)
<koshii> fowl: Right.
eywu has quit [Quit: Leaving.]
<canton7> anyway brb
<fowl> koshii: String#chomp
bier_ has quit [Ping timeout: 252 seconds]
<lolzie> Is it possible to achieve "str".tr('a-z','1-26') # without the latter being parsed as 1-2, 6?
<lolzie> I'd like the z to be replaced by a 26
jjbohn is now known as jjbohn|afk
<koshii> Got it.
eywu has joined #ruby
<koshii> fowl: Wouldn't it be easier for me to just use print() then?
lurch_ has quit [Quit: lurch_]
<rippa> lolzie: str.gsub(/./) {|c| (c.ord-96)}
jrajav has joined #ruby
<lolzie> I was hoping to avoid ord stuff and have a clear cut transliteration, but if there's no alternative! ta
<rippa> str.gsub(/[a-z]/) {|c| (c.ord-96)}
machuga is now known as machuga|away
eywu has quit [Client Quit]
<rippa> transliteration is for char-to-char conversion
cout_ is now known as cout
insecurlex has quit [Remote host closed the connection]
<lolzie> 96 is horribly.. unobvious
haxrbyte has quit [Ping timeout: 246 seconds]
<fowl> koshii: you chomp it so that you aren't running `ssh ...\n` or `ssh ...\cr\lf` though it probably work with \n at the end
<rking> lolzie: You could do c.ord-?a.ord-1
insecurlex has joined #ruby
Takehiro has quit [Ping timeout: 248 seconds]
beneggett has quit [Quit: Computer has gone to sleep.]
<rking> I'm not a fan of MagicNumbers, either.
<fowl> rking: what about magicfilaments?
<rking> Cunningham et Cunningham, http://c2.com/cgi/wiki?MagicNumber
tiripamwe has joined #ruby
<koshii> rking: Since I actually want to run that df -h on the servers (appending it to the SSH command-line string), do I really need a whole def for it, and does the way I have it structured make sense in that case?
macmartine has quit [Quit: Computer has gone to sleep.]
<rking> koshii: Splitting out a method is good for basically two (?) things: composing into other methods, or communicating intent.
<rking> For this one I think it communicates intent.
ly_gs has joined #ruby
<rking> Replaces a comment with a method name.
Vert has quit [Read error: Connection reset by peer]
elhu has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
<rking> Wait wait
<rking> No no, that du shouldn't happen in ``s, that'll execute it on localhost.
<koshii> rking: Makes sense, but how can I pass my `df -h` to the other method command-line argument? Ruby is treating it like a separate local command.
<lolzie> rking: that's an awesome lil wiki
<koshii> Yeah that's what I thought.
<fowl> use Net::SSH at least
<koshii> fowl: I insist on learning more basic Ruby before I do this kind of stuff. :-)
<koshii> fowl: These are kindergarden questions, I realize...
niklasb has quit [Ping timeout: 245 seconds]
miho has joined #ruby
t36602 has quit [Remote host closed the connection]
Criztian has joined #ruby
Bauer1 has quit [Ping timeout: 246 seconds]
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
t34155 has joined #ruby
<koshii> rking: Do you see what I want to do? I want to setup separate definitions for several different kinds of server tests (let's say, disk free, uname -a and maybe mdadm status).
answer_421 has joined #ruby
<rking> koshii: This is closer to how I'd code this. https://gist.github.com/25050c98e6a41d666c3c#gistcomment-405797
<rking> koshii: Ok, for a list of commands I'd do it more like…
answer_42 has quit [Remote host closed the connection]
<rking> [BTW grahh... gist comment killed indentation/highlighting]
<koshii> Noticed that
<koshii> Kinda weird eh
carloslopes has joined #ruby
jorge_ has quit [Remote host closed the connection]
apok has quit [Remote host closed the connection]
<rking> Do you want to loop over all the commands for each server, or all the servers for each command?
apok has joined #ruby
<rking> machine a: df, uname -a, madm stats; machine b: df, uname -a, madm status, machine c: …etc, right?
bier_ has joined #ruby
<koshii> Exactly.
bradhe has quit [Remote host closed the connection]
sterex has joined #ruby
<koshii> I don't know what is motivating you to be so helpful right now, but thanks.
BiHi has quit [Quit: Computer has gone to sleep]
<lectrick> I want to find the guy who exposed who _why was and fist him.
fyolnish has joined #ruby
skattyadz has quit [Quit: skattyadz]
jrajav has quit [Quit: The best darkness is strange and surprising]
<koshii> lectrick: And who was _why? :-)
poga has quit [Remote host closed the connection]
<lectrick> Well, he apparently didn't want people to know
fearoffish has quit [Ping timeout: 240 seconds]
limes has quit [Ping timeout: 245 seconds]
<fowl> koshii: bruce wayne
<koshii> rking: Awesome. What's with the brackets? Are you creating something like a tuple there?
<rking> koshii: An Array object.
yosinof has joined #ruby
<koshii> Fair enough :-)
<koshii> rking: This makes sense, very elegant. Thank you for the help!
<rking> koshii: Hang on, I'm actually running it, and finding some issues. =) 1min
<koshii> Heh
<koshii> I didn't know about this File.readlines either
niklasb has joined #ruby
fyolnish has quit [Ping timeout: 246 seconds]
limes has joined #ruby
Yiq has joined #ruby
<fowl> koshii: in pry you can do ls File and see all methods available to file instances and the File class
<koshii> fowl: pry?
<rking> koshii: There, like that: https://gist.github.com/25050c98e6a41d666c3c#gistcomment-405834https://gist.github.com/25050c98e6a41d666c3c#gistcomment-405834
<Yiq> how do i launch the interpreter from cmd prompt?
<fowl> koshii: then you do `cd File` and walk around in it like the matrix
<fowl> koshii: http://pryrepl.org
<rking> fowl: Which episode?
<limes> koshii: still need a way to execute ? i tried cmd = %x[ssh root@host.name \'df -h\'] ; puts cmd wich worked welll
ananthakumaran has quit [Ping timeout: 240 seconds]
Squarepy has joined #ruby
<rking> There's one where they go all upside-downy, and I don't think that would be welcoming for a beginner.
<koshii> Geez there is just so much going on with Ruby stuff, I don't know how you guys keep up.
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<fowl> rking: the second and third are the only movies i can legitimately say i fell asleep watching
ananthakumaran has joined #ruby
jgarvey has joined #ruby
<rking> Hehe, yeah, major disappointments. Relevant: http://youtu.be/M1Wm9nGJcYo
<koshii> rking: So you're chomping the \n from the server yes?
adamkittelson has quit [Remote host closed the connection]
<Spooner> Yiq : irb
<koshii> Is that all that chomp does? Removes the last character?
<rking> koshii: Yeah, it's generally what you mean.
<rking> koshii: gem install pry-full
adamkittelson has joined #ruby
<rking> Then pry, then from there do ? ''.chomp
<fowl> rking: lol
<koshii> rking: I need pry for this script to work now?
<rking> koshii: No, pry is a general Ruby-exploration thing for Neo-like people.
<koshii> :-)
<koshii> I see I see
<rking> ? ''.chomp # blue pill
<rking> $ ''.chomp # blue pill
<fowl> rking: 5k337lord
<koshii> Installing :-)
<rking> Urr, s/blue/red on that 2nd one.
<koshii> Wow that's a lot of gems being installed.
mmitchell has joined #ruby
<rking> That's pry-full doin its thang. Don't let it alarm you.
nirix has quit [Quit: Computer has gone to s…zZzZz]
fearoffish has joined #ruby
<koshii> Handy though!
<koshii> Is this a suitable replacement for RDoc and ri and these things that are annoying when I'm installing gems?
fyolnish has joined #ruby
Jay_Levitt has joined #ruby
<koshii> rking: Why did you puts with `echo ...` ?
<rking> koshii: Haha, because I was testing.
<rking> No echo on the real version.
<koshii> OK :)
<rking> Though actually I advocate echo before any real command execution.
<koshii> It's a good idea
<rking> Same goes for shel for n in *; do echo ___; done
<fowl> rking: do you know the diff between ``, %x[] and system()
a_a_g has joined #ruby
jso has quit []
<rking> fowl: I thought `` == %x[], other than the delimiters.
<rking> But I was also assuming there was some other motivation for the ``s, but probably that's silly of me to assume.
insecurlex has quit [Remote host closed the connection]
<koshii> rking: Can you explain your crazy regex here? puts "server: \e[32m#{server}\e[0m"
<fowl> \[Xm is color codes
<fowl> \e
<rking> koshii: I don't know if it's a replacement for RDoc/ri in every sense — it's certainly how I interface the documentation, though.
<rking> koshii: Hehe, yeah, just splashin in some color.
<apeiros_> koshii: not a regex
voodoofish430 has joined #ruby
<rking> "Color is the 3rd dimension of your monitor, after X and Y."
<koshii> :-)
<koshii> Looks and works great
cirwin has joined #ruby
mmitchell has quit [Ping timeout: 276 seconds]
<limes> also PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W $(if [[ $? = 0 ]];then echo "\[\033[01;34m\]";else echo "\[\033[01;31m\]";fi)\$\[\033[00m\] ' is quite handy for your console to show true or false in different colors :D
Eldariof-ru has joined #ruby
ilyam has joined #ruby
<Yiq> is ruby on rails the "only" used framework in ruby?
fyolnish has quit [Ping timeout: 260 seconds]
<koshii> Bloody hell you guys are wizards.
<fowl> Yiq: yes, rails IS ruby and ruby IS rails, they are one in the same.
sepp2k has quit [Remote host closed the connection]
<canton7> Yiq, sinatra and camping are also popular
mmitchell has joined #ruby
<Hanmac> Yiq: depending what you understand with "framework"
<fowl> come on #ruby you're suffering from delusions! there is none other than the Mighty Rails
shadoi has joined #ruby
<koshii> rking: Are those color codes exclusive to Ruby or is that something that will work equally well in bash scripts?
<davidcelis> canton7: also padrino
<Mon_Ouie> zsh's %F{blue} beats writing escape codes manually :p
<canton7> davidcelis, true
<Mon_Ouie> koshii: They're a convention followed by many terminals
<davidcelis> canton7: camping has too many project sites, IMO
<canton7> davidcelis, i've never been a particular fan of it personally
<Mon_Ouie> Called ANSI codes if you want to look them up
<koshii> Great.
<koshii> Mon_Ouie: Thanks
<rking> koshii: Works equally well when output to any decently-capable terminal (meaning Windows "cmd" doesn't make the cut). The only trick is somehow outputting the Esc char, which echo "\e[33mfoo\e[0m" will in fact do from bash, but not from other shells.
machuga|away is now known as machuga
<rking> koshii: There are color gems that are better (in that they're cleaner to read and also work in more situations. Really what you want to do, in general, is test if the output stream is_tty? before you start spewing escape codes)
<koshii> rking: Duly noted then, thanks.
<rking> Mon_Ouie: What enables %F{___} ?
<Mon_Ouie> I don't know exactly, I know I use them in my prompt
insecurlex has joined #ruby
<Mon_Ouie> autoload colors; colors I assume
Takehiro has joined #ruby
insecurlex has quit [Remote host closed the connection]
Yiq has left #ruby [#ruby]
<koshii> rking: And what if I want to suppress some lines, like I don't really care about udev and tmpfs results from df -h; do I do that with Ruby or with sed?
<rking> Mon_Ouie: Hrm. That isn't it. But I'll find out.
a_a_g has quit [Ping timeout: 240 seconds]
<rking> koshii: Definitely ruby! =D
<koshii> Heh
<rking> There are several options about how you can structure your code for that. You could simply just do a substitution to get rid of those lines even from commands that don't have them, but that's kind of an "expedient" thing to do.
<koshii> rking: OK, but it isn't really helpful to check for and strip those out for uname and uptime and mdadm etc
<rking> Right
<koshii> :-) What you said, I guess.
<rking> I gotta go for now, but you're on the right track.
<koshii> OK
<koshii> Thanks rking!
<rking> The reason I'm anti-sed in this case is that it's involving another language, which requires readers of the code to understand more languages, and requires the writer of the code to better escape delimiters and stuff.
<rking> Playing "How many backslashes do I need" Plinko isn't always fun.
<koshii> Yeah, I'm not a fan of the idea either, I'm just not sure how I can separate this out since you have it setup in an array.
bradhe has joined #ruby
kpshek has joined #ruby
brianpWins has quit [Quit: brianpWins]
<koshii> Ideally I want small output that I can (eventually) pipe to XMPP
insecurlex has joined #ruby
<koshii> So probably I need to cut down a lot of this. Some of which I can do by adjusting the actual commands, some of which I guess I'm going to have to RegEx the hell out of.
<koshii> For now, the color codes can stay. ;-)
headius has quit [Quit: headius]
br4ndon has joined #ruby
chussenot has quit [Ping timeout: 246 seconds]
t34155 has quit [Remote host closed the connection]
t17958 has joined #ruby
pdtpatrick has joined #ruby
opus__ has joined #ruby
w400z has quit [Quit: Computer has gone to sleep.]
CoverSlide has joined #ruby
insecurlex has quit [Remote host closed the connection]
berserkr has quit [Ping timeout: 252 seconds]
jgrevich has joined #ruby
Tomasso has quit [Ping timeout: 268 seconds]
mmitchel_ has joined #ruby
gloomer has joined #ruby
khakimov has joined #ruby
mmitchell has quit [Ping timeout: 246 seconds]
bradhe has quit [Remote host closed the connection]
ilyam has quit [Quit: ilyam]
phinfonet has joined #ruby
baphled has joined #ruby
mxbtty has joined #ruby
khakimov has quit [Client Quit]
jasonLaster has joined #ruby
virunga has quit [Remote host closed the connection]
xclite has quit [Remote host closed the connection]
ringotwo has quit [Read error: Connection reset by peer]
mikepack has quit [Remote host closed the connection]
ringotwo has joined #ruby
adac has quit [Ping timeout: 246 seconds]
jazz_ has joined #ruby
johnlcox_ has joined #ruby
gen0cide_ has joined #ruby
Synthead has quit [Read error: Operation timed out]
graft has quit [Quit: leaving]
jazz_ has left #ruby [#ruby]
xclite has joined #ruby
krz has joined #ruby
Synthead has joined #ruby
johnlcox has quit [Ping timeout: 260 seconds]
johnlcox_ is now known as johnlcox
t17958 has quit [Remote host closed the connection]
mikepack has joined #ruby
t82688 has joined #ruby
eric has joined #ruby
Guest24845 has joined #ruby
eric is now known as Guest3180
jasonLaster has quit [Ping timeout: 256 seconds]
Guest3180 has quit [Client Quit]
berserkr has joined #ruby
lurch_ has joined #ruby
Guest24845 is now known as ShadowBelmolve_
jjbohn|afk is now known as jjbohn
_bart has joined #ruby
brasten has quit [Quit: brasten]
mrdodo has joined #ruby
ShadowBelmolve_ has quit [Read error: Connection reset by peer]
theRoUS has quit [Ping timeout: 260 seconds]
ShadowBelmolve_ has joined #ruby
flargh2 has quit [Remote host closed the connection]
w400z has joined #ruby
chimkan___ has quit [Quit: chimkan___]
Bosma has joined #ruby
twigmorewelsh has quit [Ping timeout: 246 seconds]
jrajav has joined #ruby
ElderFain_ is now known as ElderFain
twigmorewelsh has joined #ruby
hoelzro|away is now known as hoelzro
Eiam has joined #ruby
elaptics is now known as elaptics`away
jonathanwallace has quit [Remote host closed the connection]
adac has joined #ruby
Danielpk has joined #ruby
adeponte has quit [Remote host closed the connection]
Criztian_ has joined #ruby
<Danielpk> i trying to run mailcatcher with PHP but i getting one error when i try to send email: http://pastebin.com/u82YwLgm
<Danielpk> any1 know how i can fix it?
sailias has quit [Quit: Leaving.]
<davidcelis> with... PHP?
<cirwin> Danielpk: gem install mailcatcher
<Danielpk> cirwin: i did it
flak has joined #ruby
Criztian has quit [Ping timeout: 244 seconds]
<Danielpk> when i run with my user work fine, but when apache try to run i get this error.
<Mon_Ouie> That message says the gem isn't installed and shows installed gems
flak is now known as Guest28365
<cirwin> Danielpk: are you using rvm or something like that?
<cirwin> you need to install the gem so that apache can access it
<Mon_Ouie> Yes, if you install a gem only for a single user and not in a system-wide directory, it can obviously only be accessed by that specific user
SCommette has quit [Quit: SCommette]
joephlius has joined #ruby
t82688 has quit [Remote host closed the connection]
jorge_ has joined #ruby
SCommette has joined #ruby
t72746 has joined #ruby
<Danielpk> i using rvm.. but when i su www-data and try to run mail catcher all work fine… just when i try to run with php i get this error.
rippa has quit [Ping timeout: 248 seconds]
chimkan has joined #ruby
SCommette has quit [Client Quit]
theRoUS has joined #ruby
arooni-mobile has joined #ruby
Godslastering has joined #ruby
hadees has quit [Read error: Connection reset by peer]
joephelius has quit [Ping timeout: 240 seconds]
jso has joined #ruby
xclite has quit [Remote host closed the connection]
hadees has joined #ruby
wallerdev has joined #ruby
virunga has joined #ruby
Guest28365 is now known as rippa
CannedCorn has joined #ruby
havenn_ has quit [Remote host closed the connection]
kirun has joined #ruby
pskosinski has quit [Read error: Connection reset by peer]
jarred has joined #ruby
jarred has quit [Read error: Connection reset by peer]
axl_ has quit [Remote host closed the connection]
jarred has joined #ruby
axl_ has joined #ruby
ilyam has joined #ruby
ananthakumaran has quit [Ping timeout: 264 seconds]
ananthakumaran has joined #ruby
<arooni-mobile> if i have a instance variables for a given class... should they all be declared within the class's constructor method, or can i declare them within the instance methods when i need them?
machty has quit [Ping timeout: 246 seconds]
<Mon_Ouie> Don't cross post
elaptics`away is now known as elaptics
<Mon_Ouie> Especially when you've already been given an answer which you've ignored
burgestrand has joined #ruby
<arooni-mobile> Mon_Ouie, i waited 5-10 minutes between posts
<arooni-mobile> no one addressed it to me
<arooni-mobile> i..e @arooni-mobile; so i didnt know if someone responded
<Mon_Ouie> I answered on #ruby-lang one minute after you asked your question…
<arooni-mobile> ok i see thta now
jorge_ has quit [Remote host closed the connection]
<arooni-mobile> my apologies... i usually am used to folks addressing the asker via username
twigmorewelsh has quit [Ping timeout: 246 seconds]
h4mz1d has joined #ruby
tiripamwe has quit [Ping timeout: 244 seconds]
Russell^^ has joined #ruby
tayy has joined #ruby
darren has joined #ruby
mmitchel_ has quit [Remote host closed the connection]
mmitchell has joined #ruby
fantazo has quit [Remote host closed the connection]
wo66le is now known as nickyhof
enricostn has left #ruby [#ruby]
reactormonk has quit [Ping timeout: 240 seconds]
kpshek has quit []
paolooo has quit [Ping timeout: 245 seconds]
chussenot has joined #ruby
SCommette has joined #ruby
bluethud9765 has joined #ruby
reactormonk has joined #ruby
matrixise has joined #ruby
niklasb has quit [Ping timeout: 260 seconds]
uris_ has quit [Ping timeout: 246 seconds]
imami|afk is now known as banseljaj
lurch_ has left #ruby [#ruby]
berserkr has quit [Quit: Leaving.]
yosinof has quit [Quit: Leaving]
Taichouchou2 has quit [Remote host closed the connection]
LouisGB has quit [Ping timeout: 245 seconds]
Bosma has quit [Ping timeout: 252 seconds]
jarred has quit [Quit: jarred]
jasonLaster has joined #ruby
machuga is now known as machuga|away
slingle has joined #ruby
jarred has joined #ruby
Squarepy has quit [Quit: Leaving]
seich- is now known as seich
tommyvYo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
johnlcox has quit [Quit: Computer has gone to sleep.]
<slingle> can someone explain to me what is inside a rack.session cookie/
<matti> slingle: Marshmallows.
<matti> ;]
<slingle> lol...thanks
<matti> Welcome ;]
RubyPanther has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
bluethud9765 has quit [Remote host closed the connection]
johnlcox has joined #ruby
Progster has quit [Ping timeout: 245 seconds]
<asteve> slingle: i like toffee in mine
adac has quit [Ping timeout: 256 seconds]
Axsuul has joined #ruby
nightmutewrack has joined #ruby
<slingle> lol...it looks like a base64 string but i can't seem to get it to decode
Takehiro has quit [Remote host closed the connection]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
<matti> slingle: In a binary blob in base64
LouisGB has joined #ruby
mohits_ has joined #ruby
twigmorewelsh has joined #ruby
havenn has joined #ruby
kpshek has joined #ruby
Juul has joined #ruby
pskosinski has joined #ruby
matty5000 has quit [Ping timeout: 252 seconds]
nightmutewrack has quit [Remote host closed the connection]
resure_ has quit []
luckman212 has joined #ruby
resure_ has joined #ruby
resure_ has quit [Remote host closed the connection]
mohits has quit [Ping timeout: 252 seconds]
resure_ has joined #ruby
matrixise has quit [Read error: Operation timed out]
FeelingLuckyPun has joined #ruby
FeelingLuckyPun has quit [Read error: Connection reset by peer]
rubious has quit [Quit: Leaving...]
lmfao00 has joined #ruby
ilyam has quit [Quit: ilyam]
tayy has quit [Ping timeout: 246 seconds]
h4mz1d has quit [Ping timeout: 276 seconds]
azm has quit [Ping timeout: 276 seconds]
matrixise has joined #ruby
mikepack has quit [Remote host closed the connection]
theRoUS has quit [Ping timeout: 260 seconds]
h4mz1d has joined #ruby
slingle has quit [Ping timeout: 245 seconds]
Eldariof59-ru has joined #ruby
JustinCampbell has joined #ruby
rubious has joined #ruby
wpaulson has joined #ruby
recycle has quit [Remote host closed the connection]
adac has joined #ruby
pfaff has joined #ruby
recycle has joined #ruby
t72746 has quit [Remote host closed the connection]
jarred has quit [Quit: jarred]
pu22l3r has joined #ruby
t22681 has joined #ruby
Progster has joined #ruby
uris has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
axl_ has quit [Quit: axl_]
Eldariof-ru has quit [Ping timeout: 276 seconds]
mikepack has joined #ruby
kaen has quit [Read error: Connection reset by peer]
kaen has joined #ruby
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
erichmenge has quit [Quit: Linkinus - http://linkinus.com]
axl_ has joined #ruby
ananthakumaran has quit [Ping timeout: 272 seconds]
tayy has joined #ruby
kaen has quit [Remote host closed the connection]
wpaulson_ has joined #ruby
kaen has joined #ruby
wpaulson has quit [Read error: Connection reset by peer]
wpaulson_ is now known as wpaulson
kaen has quit [Remote host closed the connection]
mohits_ has quit [Ping timeout: 265 seconds]
theRoUS has joined #ruby
jasonLaster has quit [Remote host closed the connection]
mmealling1 has joined #ruby
jasonLaster has joined #ruby
Guest78690 has quit [Quit: WeeChat 0.3.8]
kaen has joined #ruby
mmealling1 has left #ruby [#ruby]
Musfuut has joined #ruby
resure__ has joined #ruby
havenn has quit [Remote host closed the connection]
Criztian_ has quit []
resure_ has quit [Ping timeout: 276 seconds]
locriani has quit [Remote host closed the connection]
mneorr has quit [Quit: Leaving.]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
baphled has quit [Ping timeout: 272 seconds]
jasonLaster has quit [Ping timeout: 245 seconds]
mneorr has joined #ruby
chussenot has quit [Remote host closed the connection]
beneggett has joined #ruby
chussenot has joined #ruby
ananthakumaran has joined #ruby
slingle has joined #ruby
fyolnish_ has joined #ruby
DrShoggoth has joined #ruby
<slingle> matti: you have a code snippet that will allow me to decode what is in the cookie value?
beneggett has quit [Client Quit]
mvangala_ has quit [Remote host closed the connection]
shadoi has quit [Quit: Leaving.]
locriani has quit [Remote host closed the connection]
beneggett has joined #ruby
jasonLaster has joined #ruby
qwerxy has quit [Ping timeout: 264 seconds]
<rcassidy> Danielpk: tried #rvm ? i just got some good help in there lol
havenn has joined #ruby
nwest has quit [Quit: Computer has gone to sleep.]
locriani has joined #ruby
locriani has quit [Changing host]
locriani has joined #ruby
<canton7> slingle, http://rack.rubyforge.org/doc/Rack/Session/Cookie.html, click on load_session to see its source
azm has joined #ruby
azm has quit [Changing host]
azm has joined #ruby
havenn has quit [Remote host closed the connection]
<Danielpk> rcassidy: i will try. thx
fyolnish_ has quit [Ping timeout: 260 seconds]
Filuren has joined #ruby
_pdelgallego has joined #ruby
juarlex_ has joined #ruby
Stalkr_ has quit [Read error: Connection reset by peer]
br4ndon has quit [Quit: Lorem ipsum dolor sit amet]
limes has quit [Quit: limes]
juarlex has quit [Ping timeout: 260 seconds]
_pdelgallego has quit [Read error: Connection reset by peer]
t22681 has quit [Remote host closed the connection]
mwilson has joined #ruby
t10876 has joined #ruby
matty5000 has joined #ruby
shadoi has joined #ruby
venkatk_ has joined #ruby
chessguy has joined #ruby
shinobi_one has joined #ruby
mwilson has quit [Excess Flood]
<shinobi_one> list = []
mwilson has joined #ruby
mike4_ has joined #ruby
<shinobi_one> (1..5).each { |i| list << "user#{i}" }
<shinobi_one> i'm looking to do something like this in one line, just to see how it compares with python code. any suggestions?
luckyruby has joined #ruby
janoli has joined #ruby
jenrzzz has joined #ruby
<apeiros_> shinobi_one: map
<Mon_Ouie> Array.new(5) { |i| "user#{i} }
<Mon_Ouie> Array.new(5) { |i| "user#{i}" }
<canton7> (1..5).map{ |i| "user#{i}" }
<apeiros_> Mon_Ouie: that starts at 0
<Mon_Ouie> Array.new(5) { |i| "user#{i+1}" } :p
<apeiros_> list = (1..5).map { |i| "user#{i}" }
tayy has quit [Remote host closed the connection]
wedgeV has joined #ruby
jasonLaster has quit [Remote host closed the connection]
jasonLaster has joined #ruby
ar_ has quit [Quit: Leaving]
<Synthead> Can I use regex in Dir[...] ?
<rcassidy> list = (1..5).map { |i| "user#{i}" }
<rcassidy> >> list = (1..5).map { |i| "user#{i}" }
<al2o3cr> (Array) ["user1", "user2", "user3", "user4", "user5"]
<rcassidy> was what i meant to do...
<rcassidy> lol
<shinobi_one> using map is the sexy way i think
<shinobi_one> :P
<apeiros_> Synthead: no
<apeiros_> Synthead: you can use globbing expressions
<apeiros_> (so the "no" is actually a "yes" for regex in general, but a "no" for pcre/pcre-like regex)
dbck has joined #ruby
<shinobi_one> in case anyone was curious, here's the "sexy" way in python i would think
<shinobi_one> list = ["user%s" %i for i in range(1,6)]
<Synthead> apeiros_: hm, okay, so if I were to match /^[0-9]{14}\.jpg$/, I'd have to state [0-9] 14 times?
<apeiros_> Synthead: I think so. I'm not a glob-expert. you can use '[0-9]'*14 :)
chussenot_ has joined #ruby
banseljaj is now known as imami|afk
jasonLaster has quit [Ping timeout: 244 seconds]
<Synthead> apeiros_: ooh, string functions! never thought of that!
<apeiros_> Synthead: s/functions/methods/
<apeiros_> there, fixed that for you.
<Hanmac> >>(1..6).map(&"user%s".method(:%))
<al2o3cr> (Array) ["user1", "user2", "user3", "user4", "user5", "user6"]
Shogun has joined #ruby
<apeiros_> Hanmac: lol :)
<apeiros_> nice
<apeiros_> ugly, but nice
<shinobi_one> Hanmac: -.- too ugly xP
Shogun has quit [Client Quit]
mneorr has quit [Quit: Leaving.]
eugeneglova has joined #ruby
<Synthead> haha
Taichouchou2 has joined #ruby
<Synthead> still slips out every once in a while ;)
jonathanwallace has joined #ruby
<Synthead> apeiros_: '[0-9]' * 14 + '.jpg' worked awesome, thanks!
eugeneglova has left #ruby [#ruby]
chussenot has quit [Ping timeout: 246 seconds]
chussenot_ is now known as chussenot
fforbeck has quit [Quit: Leaving]
xorigin has joined #ruby
havenn has joined #ruby
tayy has joined #ruby
twigmorewelsh has quit [Ping timeout: 246 seconds]
chussenot_ has joined #ruby
Eldariof27-ru has joined #ruby
t10876 has quit [Remote host closed the connection]
t46457 has joined #ruby
mwilson has quit [Excess Flood]
mwilson has joined #ruby
Taichouchou2 has quit [Ping timeout: 252 seconds]
twigmorewelsh has joined #ruby
tayy_ has joined #ruby
nanderoo has quit [Quit: Leaving.]
chussenot has quit [Ping timeout: 246 seconds]
chussenot_ is now known as chussenot
entrenador has joined #ruby
jrajav has quit [Quit: The best darkness is strange and surprising]
Eldariof59-ru has quit [Ping timeout: 245 seconds]
tayy has quit [Ping timeout: 240 seconds]
mneorr has joined #ruby
tayy_ has quit [Remote host closed the connection]
capsule_toy has joined #ruby
mmitchell has quit [Remote host closed the connection]
entrenador has left #ruby [#ruby]
Takehiro has joined #ruby
adambeynon has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
ph^_ has joined #ruby
Guest37999 has quit [Ping timeout: 276 seconds]
kpshek has quit []
x77686d has quit [Quit: x77686d]
Eldariof-ru has joined #ruby
mmitchell has joined #ruby
kpshek has joined #ruby
scant has joined #ruby
mxbtty has quit [Quit: Leaving.]
ph^ has quit [Ping timeout: 252 seconds]
phinfonet has quit [Quit: Linkinus - http://linkinus.com]
x77686d has joined #ruby
pyreal has quit [Quit: pyreal]
Takehiro has quit [Ping timeout: 272 seconds]
Eldariof27-ru has quit [Ping timeout: 260 seconds]
luckyruby has quit [Remote host closed the connection]
mwilson has quit [Excess Flood]
ben225 has joined #ruby
mwilson has joined #ruby
anoldhacker has left #ruby ["No matter how dark the night, somehow the Sun rises once again"]
jcromartie has joined #ruby
<scant> when i call Class.methods(false) and Class.singleton_methods, i get different results. but isn't methods returning all of the singleton_methods defined for the Class class?
w400z has quit []
beneggett has quit [Ping timeout: 264 seconds]
ben225 is now known as beneggett
pdelgallego has joined #ruby
pdelgallego has quit [Read error: Connection reset by peer]
<apeiros_> scant: methods(false) returns all methods defined on Class' own singleton class
x77686d has quit [Client Quit]
<apeiros_> singleton_methods returns those in Class' singleton class' ancestry too
<apeiros_> check Class.method(one_of_those_from_singleton_methods).owner
davorb has joined #ruby
ilyam has joined #ruby
<apeiros_> still a bit a confusing result :-/
mike4_ has quit [Ping timeout: 276 seconds]
xclite has joined #ruby
<scant> yeah... so singleton methods are inherited?
<scant> shouldn't singleton_methods(true) return the same thing as methods(true)?
<apeiros_> sure. that's why class X; def self.bar; end; end; class Y < X; end; Y.bar # works
<apeiros_> was wondering that and other things too. don't really have an answer
<scant> haha ok
mwilson has quit [Excess Flood]
<scant> going to get out of the rabbit hole then
pdelgallego has joined #ruby
phinfonet has joined #ruby
<scant> thx
<apeiros_> I'd also expect :new to show up on Class.methods(false)
mwilson has joined #ruby
<apeiros_> it might have to do with ruby cheating on the lower level classes/modules (Kernel, Object, Module and Class)
<scant> but new is an instance method
t46457 has quit [Remote host closed the connection]
<apeiros_> not only :)
t30944 has joined #ruby
<apeiros_> my_class = Class.new
<apeiros_> that one is Class::new
<apeiros_> not Class#new
<apeiros_> though…
<Hanmac> each class is a module, an Module is a Class :P
<apeiros_> since Class is_a? Class it *could* be the same
<Hanmac> i mean "Module is a class"
Eldariof-ru has quit []
<scant> Class.method :new gives me Class#new
mwilson has quit [Excess Flood]
havenn has quit [Remote host closed the connection]
mwilson has joined #ruby
mrdodo has quit [Remote host closed the connection]
<apeiros_> yeah, ruby reports it as the instance method. so that question can be considered answered
jenrzzz has quit [Ping timeout: 240 seconds]
<scant> i guess we can sleep ok knowing that we may never need to know these answers
qwerxy has joined #ruby
itcharlie has quit [Quit: Leaving]
<apeiros_> osx update… brb
kpshek has quit [Ping timeout: 246 seconds]
<Hanmac> ;new is an instance_method of Class ...
apeiros_ has quit [Remote host closed the connection]
<Hanmac> its only accessable as an singleton(class)method because Class is also an instance of Class
mwilson has quit [Excess Flood]
geekbri has quit [Remote host closed the connection]
mwilson has joined #ruby
<troessner> ah, the joys of rubys object model
<troessner> :)
<scant> why don't Class.methods false and Class.singleton_methods give me the same thing?
apeiros_ has joined #ruby
<shinobi_one> Koans anyone? lol
himsin has quit [Ping timeout: 246 seconds]
ph^_ has quit [Remote host closed the connection]
ph^ has joined #ruby
nicoulaj has joined #ruby
<Hanmac> scant because they both methods are defined in Module ... and singleton_methods(true) shows them too
mneorr has quit [Quit: Leaving.]
jbw has quit [Ping timeout: 264 seconds]
mneorr has joined #ruby
<Hanmac> >> Module.methods(false) == Module.singleton_methods(false)
<al2o3cr> (TrueClass) true
yoklov has joined #ruby
aelesbao has joined #ruby
ph^ has quit [Ping timeout: 260 seconds]
aelesbao has left #ruby [#ruby]
venkatk_ has quit [Quit: This computer has gone to sleep]
<scant> so where does BasicObject get its methods from? BasicObject.methods false gives me nothing
<Mon_Ouie> >> BasicObject.instance_methods
<al2o3cr> (Array) [:==, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__, :__id__]
athit has joined #ruby
<scant> BasicObject.methods
<scant> >> BasicObject.methods
<al2o3cr> (Array) [:allocate, :new, :superclass, :freeze, :===, :==, :<=>, :<, :<=, :>, :>=, :to_s, :included_modules, :include?, :name, :ancestors, :instance_methods, :public_instance_methods, :protected_instance_methods, :private_instance_methods, :constants, :const_get, :const_set, :const_defined?, :const_missing, :class_variables, :remove_class_variable, :class_variable_get, :class_variable_set, :class_variable_defined?, :public_constant, :private_constant, ...
<al2o3cr> ... :module_exec, :class_exec, :module_eval, :class_eval, :method_defined?, :public_method_defined?, :private_method_defined?, :protected_method_defined?, :public_class_method, :private_class_method, :autoload, :autoload?, :instance_method, :public_instance_method, :nil?, :=~, :!~, :eql?, :hash, :class, :singleton_class, :clone, :dup, :initialize_dup, :initialize_clone, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :frozen?, :inspect, :methods, ...
<al2o3cr> ... :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :respond_to_missing?, :extend, :display, :method, :public_method, :define_singleton_method, :object_id, :to_enum, :enum_for, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__, :__id__]
<scant> sorry XP
<Mon_Ouie> I'd say jrajav should change the bot for that
<apeiros_> agreed
<ged> scant: From object.c? Where do you mean "where does [it] get its method from?"
<apeiros_> max output of ~200 chars
<Mon_Ouie> scant: those are the methods you can call on BasicObject itself
<Mon_Ouie> Not on its instances
<scant> >> BasicObject.methods false
<al2o3cr> (Array) []
<Mon_Ouie> And since BasicObject doesn't have any so-called class methods, methods(false) is empty
<scant> what are these methods if they aren't class methods?
chrisja has quit [Quit: leaving]
<ged> Instance methods of its singleton.
w400z has joined #ruby
<scant> so they are singleton methods?
<ged> Yes.
<Mon_Ouie> No
<scant> >> BasicObject.singleton_methods
<al2o3cr> (Array) []
<Mon_Ouie> BasicObject doesn't have any of these
<Mon_Ouie> It gets some methods from Class, Module and Object though
<Mon_Ouie> In virtue of being an instance of Class
<scant> ohh i see
<scant> smh
<scant> thanks for the help
mrdodo has joined #ruby
<fowl> scant: mon ouie is wise, he's been rewriting his brain in ruby 2.0
mascool has joined #ruby
CannedCorn has quit [Quit: Computer has gone to sleep.]
<scant> XD
levieraf has joined #ruby
ringotwo has quit [Read error: Connection reset by peer]
<levieraf> hi guys
<levieraf> i have a question
Dreamer3 has joined #ruby
<levieraf> about oop with ruby
ringotwo has joined #ruby
<cirwin> levieraf: the suspense
<levieraf> how i can implementation a interface in ruby
kpshek has joined #ruby
<ged> Mon_Ouie: The "so-called class methods" that it *doesn't* have would be singleton methods, yes?
kristopolous has left #ruby ["Leaving"]
<cirwin> levieraf: you just define the same methods on all the subclasses
<levieraf> how i can implement a interface in ruby
MasterIdler_ has joined #ruby
<levieraf> sorry
s0ber_ has joined #ruby
<levieraf> cirwin, for example?
[MAN] has joined #ruby
<Mon_Ouie> ged: Yeah
jbw has joined #ruby
<cirwin> class A; def do_foo; end; end
<cirwin> class B; def do_foo; end; end
ananthakumaran has quit [Quit: Leaving.]
imami|afk is now known as banseljaj
<cirwin> if you really want to make the interface explicit you could define: class Base; def do_foo; raise NotImplementedError; end; end
<cirwin> and then class A < Base; end
t30944 has quit [Remote host closed the connection]
<cirwin> but you don't need to
<ged> levieraf: You can put methods that raise NotImplementedError in a Module, then mix that in to classes whose interface you wish to enforce.
t75588 has joined #ruby
chare has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
s0ber has quit [Ping timeout: 252 seconds]
<burgestrand> Even then you usually don’t do that, because a NoMethodError or NotImplementedError usually does not matter which.
s0ber_ is now known as s0ber
<ged> Yep.
<levieraf> cirwin, ged i need create: Create an interface Electric that has the methods IsCharged and Charge. IsCharged should return false unless Charge has been called
<burgestrand> Interfaces would mostly be useful if ruby cared about types.
<Mon_Ouie> Defining a blank method in a module could actually screw things up in some cases
<levieraf> I know in php java
<levieraf> but
scant has quit [Ping timeout: 240 seconds]
<levieraf> in ruby
<Mon_Ouie> If the method is already implemented in a superclass of the class including the module
<levieraf> I am new to ruby
<ged> Also true.
vegeek-ng has joined #ruby
<burgestrand> levieraf: why do you need to use an interface for that?
mmitchell has quit [Remote host closed the connection]
<levieraf> is a practice for me
mmitchell has joined #ruby
<levieraf> burgestrand, is a practice for me
<Hanmac> levieraf imo ruby Mixins/(an usecase of Module) are very more better then php's interfaces
azm has quit [Ping timeout: 248 seconds]
<Mon_Ouie> Don't try enforcing practices coming from other languages on Ruby
mxbtty has joined #ruby
mistergibson has quit [Remote host closed the connection]
<Mon_Ouie> (Actually, that applies for pretty much all languages; they all have their own idioms)
<levieraf> my question is
<levieraf> in ruby
<levieraf> the interfaces
<levieraf> they're not how java for example?
<Hanmac> levieraf look at Enumerable ... all the methods only depend on an "each" method, or more easy look at Comparable
crazed has quit [Read error: Connection reset by peer]
<Mon_Ouie> Yeah, suspense adds to the thrill in a movie but on IRC… the thrill you get from wondering what verb someone is going to use is much smaller :p
resure__ has quit [Remote host closed the connection]
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
crazed has joined #ruby
<apeiros_> levieraf: you can write a whole sentence on a single line in irc, you know?
<Mon_Ouie> Ruby doesn't have a concept of interfaces
<Hanmac> imo the ruby way it MORE better
<voodoofish430> modules come close to interfaces
<levieraf> apeiros_, thanks
<Mon_Ouie> It has classes and mixins; sometimes a class that includes a module is expected to accept a certain interface.
fasta_ has quit [Remote host closed the connection]
fasta has joined #ruby
rippa has quit [Ping timeout: 260 seconds]
Dreamer3 has quit [Quit: Leaving...]
<Mon_Ouie> For instance, a class that includes Comparable is expected to implement the <=> method to compare objects
<Hanmac> as far as i knew, in php interfaces cant have methods with a body ... imo thats very shitty
<levieraf> Mon_Ouie, thanks man
<levieraf> so
beneggett has quit [Quit: Computer has gone to sleep.]
chussenot has quit [Quit: chussenot]
yxhuvud has quit [Ping timeout: 252 seconds]
fmcgeough has quit [Quit: fmcgeough]
twigmorewelsh has quit [Ping timeout: 276 seconds]
Dreamer3 has joined #ruby
<levieraf> if need create a interface called Electric and them need have two methos called IsCharged and Charge.
beneggett has joined #ruby
<levieraf> sorry guys
<apeiros_> levieraf: ruby doesn't have Java style interfaces
<apeiros_> a module doesn't enforce certain methods to be present
<levieraf> apeiros_, like you would create this
<apeiros_> levieraf: don't apply idioms of other languages
<apeiros_> solve problems and ask for how to do it idiomatically in this language
<apeiros_> i.e., ask for how to solve a *problem*, not for how to *translate a solution*
Dreamer3 has quit [Client Quit]
<Mon_Ouie> If you're trying to make exercises to practice Ruby, don't add requirements about the class structure or method names; finding those is pretty much solving the exercise in practice.
<levieraf> apeiros_, ok, how to solve a problem?
und3f has joined #ruby
carloslopes has quit [Quit: Leaving.]
<apeiros_> o0
h4mz1d has quit [Ping timeout: 246 seconds]
<Mon_Ouie> Just set yourself practical goal about what your program should do, like parsing a BMP file or connecting IRC and responding to commands, etc.
qwerxy has quit [Quit: offski]
asteve has quit []
<apeiros_> levieraf: you'll have to formulate/phrase out your problem…
carloslopes has joined #ruby
JoshLambert has quit [Quit: Page closed]
chessguy has quit [Remote host closed the connection]
pdelgallego has quit [Quit: pdelgallego]
Dreamer3 has joined #ruby
Dreamer3 has quit [Remote host closed the connection]
carloslopes has quit [Read error: Connection reset by peer]
jrist_ has joined #ruby
luist has joined #ruby
jrist has quit [Read error: Connection reset by peer]
opus__ has quit [Quit:]
x77686d has joined #ruby
chessguy has joined #ruby
<luist> hey guys…. im trying to run: cd /var/www/git.myproject.com.br/gitorious/ && bundle install but i'm getting Could not locate Gemfile
<luist> can anyone help me?
beneggett has quit [Ping timeout: 276 seconds]
jeff_sebring has joined #ruby
<levieraf> well
<apeiros_> luist: sounds like there's no Gemfile in /var/www/git.myproject.com.br/gitorious/…
<levieraf> thanks guys
* apeiros_ puts on captain obvious hat
<luist> apeiros_: i run gem install bundler … is that right?
carloslopes has joined #ruby
<Mon_Ouie> That's what gives you the bundle command
chessguy has quit [Remote host closed the connection]
<Mon_Ouie> But you still need to create the Gemfile to use it
<apeiros_> the Gemfile must be supplied by your project. in your case I'd assume that the project is gitorious
<apeiros_> (of course, you didn't tell… so all I have is your path…)
<Mon_Ouie> I'd have thought it was myproject.com, which is hosted on gitorious
justinmcp has joined #ruby
beneggett has joined #ruby
johnlcox_ has joined #ruby
<apeiros_> there we go about assumptions and why making the people who help you making assumptions is BAD
alphabitcity has joined #ruby
<luist> apeiros_: yes it is
tommyvYo has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
<alphabitcity> Code style question: Which do you prefer? 1 or 2: http://pastie.org/4576731 .. haven't found anything in the style guides
<luist> apeiros_: well i'd give any information that is relevant :)
ilyam has quit [Quit: ilyam]
<Mon_Ouie> You broke my parser, I got into an infinite loop
jords has joined #ruby
statix_ has quit [Ping timeout: 252 seconds]
johnlcox has quit [Ping timeout: 240 seconds]
<Mon_Ouie> (the second "making" is what broke it)
johnlcox_ is now known as johnlcox
<apeiros_> Mon_Ouie: should probably have been 'make'
<burgestrand> alphabitcity: *shrug* I would’ve accepted either on
<apeiros_> anyway, I think there's some odd geometrical shape laying around here supposed to throw people into an infinite loop - wanna see Mon_Ouie?
<Mon_Ouie> alphabitcity: I'd use the first one, keeping all arguments indented at the same level
<apeiros_> alphabitcity: I prefer 3)
<Mon_Ouie> Sure
<apeiros_> alphabitcity: which would be 2) but the first arg on its own line too
thatRD has quit [Quit: thatRD]
<alphabitcity> burgestrand / Mon-Ouie: thanks
<apeiros_> option 1 just all too quickly ends up with being too wide too…
shiki has joined #ruby
mmitchell has quit [Remote host closed the connection]
<alphabitcity> apeiros_: hmm interesting
<apeiros_> also I align my hashes
ilyam has joined #ruby
<alphabitcity> as in after the key? you align all the values?
<luist> apeiros_: err how do i supply the gemfile :P
mmitchell has joined #ruby
matrixise has quit [Ping timeout: 246 seconds]
<apeiros_> alphabitcity: http://pastie.org/4576750
<apeiros_> also I have trailing , in my hashes
machuga|away has quit [Quit: machuga|away]
<apeiros_> (otherwise I tend to have too many syntax errors when I add elements to the hash…)
<apeiros_> luist: gitorious should…
<alphabitcity> apeiros_: interesting, how do you feel about moving the closing )} to the last line of the hash?
<apeiros_> luist: is gitorious a rails app? or at least a ruby app?
hadees has quit [Quit: hadees]
<luist> apeiros_: i have no idea.. im just following the tutorial :)
<apeiros_> alphabitcity: I only do that when the hash is the only argument and starts with the ( of the method
<apeiros_> luist: well, gitorious seems closed source, so not much I could help, sry
miho has quit [Ping timeout: 240 seconds]
<alphabitcity> apeiros_: ok, thank you
BRMatt has quit [Quit: ZNC - http://znc.sourceforge.net]
chson has joined #ruby
<apeiros_> alphabitcity: hm, though then I actually don't have {} :)
BRMatt has joined #ruby
<alphabitcity> apeiros_: ah yes, good point
<apeiros_> oh, great, sublime was set to tabs instead of spaces… reload http://pastie.org/4576750 :)
chson has quit [Remote host closed the connection]
<Mon_Ouie> I've actually heard of gitorious as an open source alternative to github
<alphabitcity> apeiros_: i like your addition the best, thanks
<apeiros_> Mon_Ouie: thought so too
<apeiros_> but quick google only gave me a pay-to-use solution…
<apeiros_> maybe I google-failed
<apeiros_> alphabitcity: yw
<Mon_Ouie> https://gitorious.org/gitorious hosted on itself it seems
<apeiros_> Mon_Ouie: I don't see gitorious itself there…
chessguy has joined #ruby
<apeiros_> or is it mainline?
<Mon_Ouie> mainline is the webiste itself
<Mon_Ouie> The other are related projects
<apeiros_> ok
<luist> apeiros_: ok i downloaded gitorious files again and got the Gemfile and stuff… thanks :)
<apeiros_> luist: I suggest you paste an `ls -la` of your /var/www/git.myproject.com.br/gitorious/
<apeiros_> luist: ah, ok
jjbohn has quit [Quit: Leaving...]
kpshek has quit []
fermion has quit [Quit: Textual IRC Client: http://www.textualapp.com/]
nicoulaj has quit [Remote host closed the connection]
pdelgallego has joined #ruby
mmitchell has quit [Remote host closed the connection]
mmitchell has joined #ruby
thunderstrike has quit [Read error: Connection reset by peer]
<luist> apeiros_: http://pastie.org/4576819
<luist> apeiros_: error :(
<apeiros_> luist: read it
thunderstrike has joined #ruby
<apeiros_> it contains the information on how to solve your error
<apeiros_> >> libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
<al2o3cr> -e:1:in `eval': (eval):1: unknown regexp options - kgr (SyntaxError), (eval):1: syntax error, unexpected keyword_for, expecting $end, ...ls/installing_nokogiri.html for help with installing depende..., ... ^, from -e:1:in `<main>'
<apeiros_> gah
hubub has joined #ruby
* apeiros_ smacks al2o3cr
* apeiros_ needs a new way to quote
<luist> apeiros_: where is the mkmf.log :T
<apeiros_> you don't need that
<apeiros_> the relevant line is the one I just pasted.
<apeiros_> luist: when you get an error, always read all of it. and really read it. it's hard the first few times.
<apeiros_> but you get used to it. often the relevant bits are in the message. sometimes more obvious, sometimes less. but the more often you actually do read those messages, the easier you will spot the relevant part.
jrist_ is now known as jrist
<Muz> When you get help, listen to it. And really listen to it. It's hard the first few times.
hadees has joined #ruby
<Hanmac> xD
paulovittor23 has quit [Remote host closed the connection]
<luist> apeiros_: ah ok… was trying to find what package contained libxslt
<luist> apeiros_: found out
<Hanmac> PS: you need the -dev package too for building
[MAN] has quit [Quit: Leaving...]
Dreamer3 has joined #ruby
jenrzzz has joined #ruby
<luist> thats the one that i installed :)
und3f has quit [Quit: Leaving.]
robustus has quit [Ping timeout: 244 seconds]
GoGoGarrett has quit [Remote host closed the connection]
stat1x has joined #ruby
<Hanmac> but why do you use an nearly outdated ruby?
<robacarp> this is confusing the shit out of me: http://pastebin.com/9RCw5xNV
<apeiros_> not nearly
<apeiros_> it is outdated
justinmcp has quit [Remote host closed the connection]
<Hanmac> yeah ... and next year we chould bury it :P
justinmcp has joined #ruby
<rcassidy> apeiros_: just quote with one '>' :p
davorb has quit [Quit: Computer has gone to sleep.]
erichmenge has joined #ruby
JustinCampbell has quit [Remote host closed the connection]
<apeiros_> robacarp: check the lines you get in the backtrace
<apeiros_> I doubt the error happens there
<apeiros_> but it's odd
<apeiros_> robacarp: alternatively: assign the full_path to a variable
<apeiros_> use that variable in both your debug output and in the File.rm
Morkel has quit [Quit: Morkel]
nilg has joined #ruby
<apeiros_> robacarp: in a related note: `File.rm image.full_path if File.exist? image.full_path` is a race condition. just rm and rescue the exception
codeFiend has quit [Ping timeout: 246 seconds]
<apeiros_> (probably Errno::ENOENT, but I don't know from where you get File.rm)
LouisGB has quit [Ping timeout: 268 seconds]
maletor has quit [Quit: Computer has gone to sleep.]
hoelzro is now known as hoelzro|away
thunderstrike has quit [Remote host closed the connection]
<robacarp> apeiros_: eh, yea, thats supposed to be FileUtils.rm
troessner has quit [Ping timeout: 260 seconds]
<robacarp> how is that a race condition?
brennen has joined #ruby
fantazo has joined #ruby
<apeiros_> robacarp: you assume that nothing removes the file between your test and when you remove it
<Mon_Ouie> Someone could remove the file after you check for its existence but before you remove it
<robacarp> apeiros_: okay, fair enough.
<apeiros_> classic race condition since you don't lock/enforce that assumption :)
cakehero has quit [Quit: Computer has gone to sleep.]
<robacarp> any idea why it makes it to the else in the first place, then wipes the object out?
<Sou|cutter> If all you want to do is a simple conversion of an Excel file to csv, is there something lighter-weight than roo?
iamjarvo has quit [Ping timeout: 246 seconds]
maletor has joined #ruby
<robacarp> apeiros_: yea, nothing relevant in the stack trace...just the typical call chain.
carloslopes has quit [Quit: Leaving.]
<apeiros_> robacarp: what happens when you assign the full_path to a variable?
Vert has joined #ruby
<robacarp> well, the problem is not the full path, the problem starts before that.
<robacarp> commenting out the fileutils.rm line, 24 in the pastie, changes nothing
hubub has quit [Quit: hubub]
vegeek-ng has quit [Quit: Leaving]
<apeiros_> there is no line 24 in your paste
<apeiros_> line 24 is output…
<robacarp> (the image becomes nil after the check to see if it is nil)
<apeiros_> do you mean line 13?
kvirani has quit [Remote host closed the connection]
erichmenge has quit [Quit: Be back later]
<robacarp> well, line 13 correlates to line 24, input/output
<apeiros_> something is missing
mmitchell has quit [Remote host closed the connection]
statix_ has joined #ruby
<robacarp> well, at least I'm not crazy
<apeiros_> do you have any block that is defined in the same lexical scope?
<savage-> DHH speaking in Dutch about his beautiful home in Spain: http://www.youtube.com/watch?v=wT-QXuUaAZY
cirwin has left #ruby [#ruby]
<apeiros_> because that's the only thing that could change image to nil right in between. it'd also need to be threaded…
mmitchell has joined #ruby
wvms has joined #ruby
<apeiros_> otherwise the only other option is that not all code is there.
jrist has quit [Ping timeout: 245 seconds]
<apeiros_> oh, robacarp, what does `defined?(image)` print?
<robacarp> apeiros_: there is a pty block above, but the code isn't threaded
workmad3 has joined #ruby
<apeiros_> put it after line 5 please
mwilson has quit [Excess Flood]
mwilson has joined #ruby
<robacarp> apeiros_: image
<robacarp> er...dammit...
<robacarp> "method"
t75588 has quit [Remote host closed the connection]
stat1x has quit [Ping timeout: 260 seconds]
<apeiros_> ok. image is not a variable…
<apeiros_> you've got your answer then.
t31597 has joined #ruby
<apeiros_> that method for some reason once returns an image, once nil. your bug is there.
banseljaj has quit [Ping timeout: 252 seconds]
rclark has joined #ruby
rclark has quit [Client Quit]
<robacarp> something does not follow
machty has joined #ruby
sixtycakes has quit [Remote host closed the connection]
adeponte has joined #ruby
<apeiros_> robacarp: ?
<apeiros_> care to paste the image method?
ryanf has joined #ruby
banseljaj has joined #ruby
<robacarp> its not a method I've defined, its an activerecord relation
dbck has quit [Quit: Be back later]
mmitchell has quit [Remote host closed the connection]
<robacarp> this construct works sanely in other places
mmitchell has joined #ruby
<Hanmac> activerecord? the evil spawn of rails?
luist has quit [Quit: luist]
answer_421 has quit [Quit: WeeChat 0.3.8]
justinmcp has quit [Remote host closed the connection]
TheShadowFog has joined #ruby
wedgeV has quit [Quit: wedgeV]
<robacarp> okay, I don't really understand _why_ this fixes it, but prefixing every instance of image with self. fixes it.
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
invisime has joined #ruby
<robacarp> which means it was some sort of scope issue.
<robacarp> I can't really comprehend why or how the scope of image was getting overridden lower on the chain, but whatever.
bbttxu has quit [Quit: bbttxu]
arooni-mobile has quit [Ping timeout: 240 seconds]
Taichouchou2 has joined #ruby
Z_Mass has joined #ruby
tommyvYo has joined #ruby
tommyvYo has quit [Changing host]
tommyvYo has joined #ruby
<laen_> Dude, no! You're going to destroy the skyscraper!
<laen_> er..
gfontenot has quit []
<laen_> Sorry, wrong window.
codeFiend has joined #ruby
<Hanmac> robacarp you itself destroy the scope
<robacarp> apeiros_: thanks for looking
reactormonk has quit [Ping timeout: 260 seconds]
<invisime> so I'm having trouble with a nil value from a json parameter when it really is there: http://pastebin.com/9nGfqnPT am I missing something really obvious?
<Hanmac> >> def image;end;if(false);image = 4;else;p defined?(image);end
<al2o3cr> (String) "local-variable", Console: "local-variable"
Dreamer3 has quit [Quit: Leaving...]
<Hanmac> robacarp: your       "image = Image.new" is the evil
Dreamer3 has joined #ruby
Taichouchou2 has quit [Ping timeout: 245 seconds]
reactormonk has joined #ruby
arooni-mobile has joined #ruby
joshman_ has quit [Ping timeout: 264 seconds]
athit has quit [Quit: leaving]
<adeponte> Axsuul: hey, if you are interested just want to let you know that I finished the rewrite, added some fullstack tests and things seem to be working now. https://github.com/realpractice/wrap_in_module
alanp has joined #ruby
alanp has quit [Read error: Connection reset by peer]
sixtycakes has joined #ruby
<robacarp> Hanmac: yes, I'm starting to see that, but I don't really understand why that destroys the scope when that line shouldn't be getting called
alanp has joined #ruby
<Hanmac> yeah ... but ruby does get prepared that now a local variable may exist
SubliminalSquee has joined #ruby
<robacarp> which doesn't seem like rational behavior
<Hanmac> you could see it there:
<Hanmac> >> def image;6;end;if(false);image = 4;else;p defined?(image),image;end
<al2o3cr> (Array) ["local-variable", nil], Console: "local-variable", nil
johnlcox has quit [Quit: Computer has gone to sleep.]
davidcelis has quit [Quit: K-Lined.]
<robacarp> wait, does al2o3cr just execute random ruby code starting with >>?
<Hanmac> >>"i am an ruby-bot"
<al2o3cr> (String) "i am an ruby-bot"
Filuren has quit [Quit: Leaving...]
<brennen> well that's rad.
nickyhof has quit [Ping timeout: 245 seconds]
<savage-> >> Process.pid
<al2o3cr> (Fixnum) 27805
alanp_ has quit [Ping timeout: 240 seconds]
<savage-> >> system('du -skh')
<al2o3cr> (NilClass) nil
<robacarp> anyway, Hanmac, you're right, but I'm not sure I agree with the way ruby is handling the situation.
<Hanmac> savage not try it :P the bot is currently nearly unbreakable :P
<savage-> lol
<savage-> ok :)
<koshii> To whomever it was that suggested I download pry earlier today... Thanks. :-)
<savage-> >> loop { puts 'hello' }
<al2o3cr> hello, Console: hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, hello, he...
<savage-> hahaha
<savage-> clever.
<savage-> >> puts 'hi'
<al2o3cr> (NilClass) nil, Console: hi
<robacarp> >> loop { fork }
<al2o3cr> [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno: 11), [FATAL] Failed to create timer thread (errno..., [FATAL] Failed to create timer thread (errno: 11)
* robacarp wanders off...
<Hanmac> >> "test"
<al2o3cr> (String) "test"
t31597 has quit [Remote host closed the connection]
<invisime> >> "stop trying to break me, please"
<al2o3cr> (String) "stop trying to break me, please"
<apeiros_> robacarp: still there?
<savage-> >> 1_000_000.times { 1_000_000.times { puts 'hi' } }
<robacarp> apeiros_: yep
<Hanmac> !panic
<al2o3cr> hi, Console: hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, hi, h...
<al2o3cr> SWEET ZOMBIE JESUS
<al2o3cr> Still alive~
<apeiros_> remove line 9 from your pastie
t14598 has joined #ruby
<koshii> >> 1 + 2 = 2
<al2o3cr> -e:1:in `eval': (eval):1: syntax error, unexpected '=', expecting $end (SyntaxError), 1 + 2 = 2, ^, from -e:1:in `<main>'
<koshii> Sweet
<Hanmac> !apocalype
kpshek has joined #ruby
<Hanmac> !panic
<al2o3cr> PANIC
<al2o3cr> Still alive~
<koshii> This channel is about to get crazy annoying isn't it :-)
<apeiros_> savage-, Hanmac, stop flooding
<savage-> sorry
mneorr has quit [Quit: Leaving.]
<erikwb> >> "what"
<al2o3cr> (String) "what"
<savage-> stop it
<savage-> do not abuse the bot.
mmitchell has quit [Remote host closed the connection]
arooni-mobile has quit [Ping timeout: 276 seconds]
<robacarp> apeiros_: yea, I was just discussing that if I change that to self.image, it stops breaking
<koshii> :-P
<erikwb> get that thing out of here :)
<apeiros_> robacarp: yes, and I think I know why
sixtycakes has quit [Remote host closed the connection]
mmitchell has joined #ruby
<Hanmac> robacarp ... i think you need "self.image =" currect?
<apeiros_> if commenting out line 9 removes the issue too (without all the `self.`s), then I know the reason
johnlcox has joined #ruby
<robacarp> ruby seems to lookahead and create local scope given the contents of the if-blocks regardless of which will execute.
<robacarp> a sort of branch prediction.
<apeiros_> yes. you create an lvar image
<apeiros_> which shadows your method image
<Mon_Ouie> if blocks don't create a new scope
chare has quit [Ping timeout: 260 seconds]
<Mon_Ouie> statements* rather
<apeiros_> the moment when that actually happens is odd
<apeiros_> which is why I didn't consider it
<apeiros_> but it most certainly is the reason
vlad__ has joined #ruby
<apeiros_> in short: you do not need all those selfs. but you must not shadow the image method
<erikwb> >> 100000.times { puts "evalbots in irc are a really bad idea" }
<al2o3cr> (Fixnum) 100000, Console: evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in irc are a really bad idea, evalbots in...
<vlad__> >> `id`
<al2o3cr> -e:1:in `eval': No such file or directory - id (Errno::ENOENT), from (eval):1:in `<main>', from -e:1:in `eval', from -e:1:in `<main>'
erikwb was kicked from #ruby by apeiros_ [I said don't]
beneggett has quit [Ping timeout: 240 seconds]
<vlad__> >> system("id")
<al2o3cr> (NilClass) nil
erikwb has joined #ruby
<Muz> You can PM the bot.
<Muz> By which I mean, you can be irritating somewhere we don't have to see it.
<apeiros_> if you guys can't use that bot responsibly in channel then he gets muted.
<eam> this is a terrible idea
gurps has quit [Quit: bye]
<Muz> You can be unoriginal in private too, and try to break it through means mostly tried and patched.
<Hanmac> vlad__: there very few binaries
<Hanmac> >> Dir["usr/bin/*"]
theRoUS has quit [Ping timeout: 260 seconds]
glistle has quit [Remote host closed the connection]
<Hanmac> >> Dir["usr/bin/*"]
<Muz> Hanmac: the bot's been muted from the channel.
Foxandxss has joined #ruby
gurps has joined #ruby
vlad__ has quit [Client Quit]
<Hanmac> ;'(
wpaulson has joined #ruby
<invisime> Muz: like a boss^h^h^h^h mod
<erikwb> lollin so hard
<otters> "like a mod"
<otters> sloppy
<rking> otters + =1
<robacarp> apeiros_: well, yea, I'm only selfing the one assignment statement. Thanks again for looking.
<apeiros_> yw
ssspiff has joined #ruby
ssspiff has joined #ruby
ssspiff has quit [Changing host]
sspiff has quit [Ping timeout: 246 seconds]
matrixise has joined #ruby
RubyPanther has joined #ruby
* robacarp sighs, goes to fight coworkers with nerf darts
ilyam has quit [Remote host closed the connection]
ilyam has joined #ruby
xaxxon has joined #ruby
jords has quit [Ping timeout: 245 seconds]
qwerxy has joined #ruby
riley526 has joined #ruby
iamjarvo has joined #ruby
stkowski has quit [Quit: stkowski]
dpk has quit [Quit: Asleep at the keyboard.]
pdelgallego has quit [Quit: pdelgallego]
Chryson_ has joined #ruby
internet_user has quit [Remote host closed the connection]
mwilson has quit [Excess Flood]
mwilson has joined #ruby
alphabitcity has quit [Quit: Leaving.]
davidcelis has joined #ruby
potatosalad has joined #ruby
pdelgallego has joined #ruby
nateberkopec has quit [Quit: Leaving...]
stopbit has quit [Quit: Leaving]
<potatosalad> Does anyone happen to know why this works in Ruby 1.9.3-p194?
<potatosalad> true if []...what-the-heck?
hadees has quit [Quit: hadees]
apok_ has joined #ruby
luxurymode has quit [Quit: Computer has gone to sleep.]
kpshek has quit []
tfitts has quit [Ping timeout: 265 seconds]
pdelgallego has quit [Client Quit]
xclite has quit [Remote host closed the connection]
<potatosalad> also, 'why does this work?' if BasicObject...what?
<apeiros_> potatosalad: what do you consider "work" there?
<apeiros_> and why should it "not work"?
<apeiros_> [] is a true-ish value in ruby
ibash has joined #ruby
<apeiros_> so is *everything* except false/nil
apok has quit [Ping timeout: 265 seconds]
apok_ is now known as apok
<potatosalad> right, but why am I allowed to do []...what-the-heck?
levieraf has quit [Remote host closed the connection]
<fowl> what-the-heck!
<potatosalad> exactly
<apeiros_> I don't get your issue
t14598 has quit [Remote host closed the connection]
verto is now known as verto|off
<apeiros_> [] is an empty array
<potatosalad> try it outside the if statement
<potatosalad> [] doesn't matter
<potatosalad> you can use whatever you want
t97547 has joined #ruby
<potatosalad> true if (BasicObject...non-existant-method)
<fowl> thanks potatosalad you gave me a lul, and i'll never forget you for that
gen0cide_ has quit [Quit: Computer has gone to sleep.]
<apeiros_> potatosalad: doesn't apply
<potatosalad> I'm curious if that's a ruby bug or intended, if it's intended I'd like to know why it works
<apeiros_> $ ruby -e 'p "hi" if BasicObject.foobar'
<apeiros_> -e:1:in `<main>': undefined method `foobar' for BasicObject:Class (NoMethodError)
<potatosalad> right, do multiple dots
<apeiros_> that'd be a range…
gen0cide_ has joined #ruby
<potatosalad> yup, and why does it not evaluate the right hand side of that range?
<apeiros_> and it'd seem that ruby shortcuts to not even evaluate the range
<apeiros_> probably all it sees is "literal which is not nil/false - conditions met"
<apeiros_> it doesn't need to evaluate it
<Hanmac> >> true if []...what-the-heck?# works
<Hanmac> >> true if []..what-the-heck? #works not
<potatosalad> yeah, what's the difference between the two?
<apeiros_> that's interesting
<fowl> well take a what-the-heck and push it up your callstacks
shiki has quit [Ping timeout: 264 seconds]
mwilson has quit [Excess Flood]
<apeiros_> ah, .. can be a flip-flop too
mwilson has joined #ruby
<potatosalad> where are the differences in .. and ... documented?
<apeiros_> might be due to that
<apeiros_> potatosalad: a..b is range including b, a...b is range excluding b
<apeiros_> and flip-flop… google 'ruby flip-flop'
<potatosalad> aperios_: thanks, I couldn't remember the difference
shiki has joined #ruby
<apeiros_> potatosalad: also, use tab-completion. less embarrassing :-p
<apeiros_> (for nicks)
<apeiros_> the docs on range: ri Range
<apeiros_> (documents .. and ... literals)
hsbt is now known as hsbt_away
bowlowni has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
mmitchell has joined #ruby
hemanth has quit [Ping timeout: 260 seconds]
SCommette has quit [Quit: SCommette]
w400z has quit []
<potatosalad> apeiros_: weird, thanks for the flip flop suggestion (and the tab suggestion)
<Hanmac> apeiros_ when you activate the bot again i can show you what happend
<apeiros_> banisterfiend: :-p
<fowl> can i get a voice apeiros_
wpaulson has quit [Quit: Colloquy for iPhone - http://colloquy.mobi]
<Hanmac> >>puts RubyVM::InstructionSequence.compile("true if []...what-the-heck?").disasm
<al2o3cr> (NilClass) nil, Console: == disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========, 0000 trace 1 ( 1), 0002 getspecial "flipflag/<compiled>-0x000000012ece80-0", 0, 0005 branchif 17, 0007 newarray 0, 0009 dup , 0010 branchunless 50, 0012 dup , 0013 setspecial "flipflag/<compiled>-0x000000012ece...
<apeiros_> I don't do personal favors fowl, sorry.
<Hanmac> as you can see, there is some flipflag magic inside
<erikwb> >> File.read("/usr/bin/timeout")
<al2o3cr> (String) ...
<al2o3cr> ... "\x7FELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00>\x00\x01\x00\x00\x00P\"@\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\xD0\xC5\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x008\x00\t\x00@\x00\x1C\x00\e\x00\x06\x00\x00\x00\x05\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00@\x00\x00\x00\x00\x00@\x00@\x00\x00\x00\x00\x00\xF8\x01\x00\x00\x00\x00\x00\x00\xF8\x01\x00\x00\x00\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x ...
<al2o3cr> ... 008\x02\x00\x00\x00\x00\x00\x008\x02@\x00\x00\x00\x00\x008\x02@\x00\x00\x00\x00\x00\x1A\x00\x00\x00\x00\x00\x00\x00\x1A\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00\x00\x00\xA4\xB1\x00\x00\x00\x00\x00\x00\xA4\xB1\x00\x00\x00\x00\x00\x00\x00\x00 ...
<al2o3cr> ... \x00\x00\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\xD0\xBD\x00\x00\x00\x00\x00\x00\xD0\xBD`\x00\x00\x00\x00\x00\xD0\xBD`\x00\x00\x00\x00\x00\xF4\x06\x00\x00\x00\x00\x00\x00\xF8\x10\x00\x00\x00\x00\x00\x00\x00\x00 ...
<al2o3cr> ... \x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00\xE8\xBD\x00\x00\x00\x00\x00\x00\xE8\xBD`\x00\x00\x00\x00\x00\xE8\xBD`\x00\x00\x00\x00\x00\xF0\x01\x00\x00\x00\x00\x00\x00\xF0\x01\x00\x00\x00\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00T\x02\x00\x00\x00\x00\x00\x00T\x02@\x00\x00\x00\x00\x00T\x02@\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00D\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00P\xE5td\x04\x00\x00 ...
<Hanmac> oO
<al2o3cr> ... \x00\xF4\xA0\x00\x00\x00\x00\x00\x00\xF4\xA0@\x00\x00\x00\x00\x00\xF4\xA0@\x00\x00\x00\x00\x00\xFC\x02\x00\x00\x00\x00\x00\x00\xFC\x02\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00Q\xE5td\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\b\x00\x00\x00\x00\x00\x00\x00R\xE5td\x04\x00\x00\x00\xD0\xBD\x00\x00\x00\x00\x00\x00 ...
<al2o3cr> ... \xD0\xBD`\x00\x00\x00\x00\x00\xD0\xBD`\x00\x00\x00\x00\x000\x02\x00\x00\x00\x00\x00\x000\x02\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00/lib/ld-linux-x86-64.so.2\x00\x00\x00\x04\x00\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00GNU\x00\x00\x00\x00\x00\x02\x00\x00\x00\x06\x00\x00\x00 ...
<al2o3cr> ... \x00\x00\x00\x04\x00\x00\x00\x14\x00\x00\x00\x03\x00\x00\x00GNU\x00\xAF\xC0\xBC4dE=&2NsY,\x98.u\x8D0\xC1H\b\x00\x00\x00S\x00\x00\x00\x01\x00\x00\x00\x06\x00\x00\x00\x04MA\x00 ...
<rking> Haha
<fowl> haha
<al2o3cr> ... \x01\x1C\x12S\x00\x00\x00T\x00\x00\x00U\x00\x00\x00V\x00\x00\x00W\x00\x00\x00X\x00\x00\x00Y\x00\x00\x00\x00\x00\x00\x00)\x1D\x8C\x1C9\xF2\x8B\x1C\xB3\xA2\xF7\x123\xC4\xF7\x12\xBDPv\x9E\xE5bA\xF5\x96\xA0\x89\x97\xCF,cr\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00t\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00 ...
erikwb was kicked from #ruby by apeiros_ [erikwb]
<al2o3cr> ... \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x95\x03\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x94\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00s\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x002\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x00\x00\x00 ...
<robacarp> ...
<al2o3cr> ... \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x9A\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\f\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xF0\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x03\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 ...
<al2o3cr> ... \x84\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00R\x03\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00v\x03\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00V\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00N\x03\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x ...
<al2o3cr> ... 00\x00\x00R\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xDB\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00r\x01\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xC3\x02\x00\x00\x12\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x ...
<fowl> that kid was waiting for just that moment
<eam> bizarro world where apeiros_ kicks ewag because a bot is spamming
w400z has joined #ruby
<scriabin> glug glug glug
<apeiros_> eam: you might want to use your brain and figure out why the bot is spamming
<Axsuul> adeponte: thanks for the heads up!
<Hanmac> hm ... that binary has many "\x00" ... it looks a bit "oversized"
<eam> apeiros_: it's because it's buggy
hsbt_away is now known as hsbt
<eam> I thought everyone discovered that eval bots were a bad idea like 20 years ago
<rking> Hanmac: Probably aligning and stuff. For some kind of speed thing.
<apeiros_> eam: not an excuse to spam the channel.
<rking> eam: No way, eval bots are fun.
<eam> apeiros_: so fix the bot
<apeiros_> eam: not my bot.
<eam> then ban it
alien_move has quit [Quit: Leaving]
<eam> it is trivial to prevent flooding
<apeiros_> eam: and no, I won't fix technology to avoid stupid behaviour by users
<eam> not smart
<apeiros_> eam: he caused the flood knowingly and willingly
<apeiros_> it's NOT a technological issue I'm dealing with
neersighted has quit [Quit: http://neersighted.com]
<eam> >> ENV
<eam> apeiros_: yeah it is, you just don't realize it
<apeiros_> you want to get kickbanned too?
<eam> do what you like
<apeiros_> I don't like banning, if that's what you're alleging.
<eam> you clearly do, that's well established
<apeiros_> but I will do it if you're too fucking stupid to behave.
<eam> you also like namecalling, but will ban me if I return the favor :)
* brennen gets some popcorn.
<Axsuul> everyone chill out, and let's play http://stripe-ctf.com
<apeiros_> eam: you can continue this discussion in pm
<eam> zero interest
<tommylommykins> on a less testosteroneful note
<apeiros_> so you're just in for the show. thought as much.
<tommylommykins> are refinements going in 1.9.4?
<potatosalad> Hanmac, apeiros_: thanks for your help on the flipflag
<tommylommykins> Or are they too slow?
pdelgallego has joined #ruby
<eam> apeiros_: I call it like I see it
<apeiros_> eam: yeah, you're spreading nonsense. and you'll stop it now.
<apeiros_> if you have comments about op-ing in channel, you do it in pm or I'll kickban.
c0rn_ has quit [Quit: Computer has gone to sleep.]
<eam> I've got comments about a poorly designed bot which floods
<eam> and distracts from meaningful discussion in this channel
<apeiros_> eam: you can tell jravav (that's his nick I think?)
<eam> yaeh I know, I pulled his user information out of his bot
lukekhamilton has joined #ruby
potatosalad has left #ruby [#ruby]
mmitchell has quit [Remote host closed the connection]
<rking> tommylommykins: Hrm, what are they?
<Hanmac> eam come back again when you manage to break the bot apart :P
<rking> tommylommykins: Don't take my curiosity as a preference for things less-testosteroneful.
mmitchell has joined #ruby
<tommylommykins> rking: non-global monkeypatching
xorigin has quit [Quit: leaving]
workmad3 has quit [Ping timeout: 245 seconds]
<tommylommykins> I know it's been implemented, but I don't know if it there to stay yet
<tommylommykins> apparantly it is veeery slow
<eam> Hanmac: already did
w400z has quit []
<rking> tommylommykins: Aha. What defines the areas where it applies or doesn't?
null- has joined #ruby
<tommylommykins> that explains it better than I could :)
<eam> Hanmac: the bot is capable of making network connections to external entities
<eam> >> require "socket"; s=TCPSocket.open("google.com", 80); s.print "GET / HTTP/1.0\r\n\r\n"; puts s.read
ly_gs has quit [Remote host closed the connection]
w400z has joined #ruby
Agis__ has joined #ruby
<eam> Hanmac: that's unsafe for a number of reasons which goes well beyond the issue of channel disruption
<eam> I can launch attacks from it
<eam> (even if you prevent socket from loading)
t97547 has quit [Remote host closed the connection]
<eam> this bot is not well sandboxed
<Hanmac> so ... where is the problem? :D
t98524 has joined #ruby
Z_Mass has quit [Ping timeout: 260 seconds]
<Hanmac> eam it is ... try to kill the bot itself
<eam> 15:45 <al2o3cr> (NilClass) nil, Console: HTTP/1.0 200 OK, Date: Thu, 23 Aug 2012 22:45:50 GMT, Expires: -1, Cache-Control: private, max-age=0, Content-Type: text/html; charset=ISO-8859-1, Set-Cookie: PREF=ID=fc85ca90b9beb998:FF=0:TM=1345761950:LM=1345761950:S=WCxXAnamXCMYYwYG; expires=Sat, 23-Aug-2014 22:45:50 GMT; path=/; domain=.google.com, Set-Cookie: NID=63=NnbO2Zwwmc3ayAfqchnPMTdLUR6QDB7d2agdL4yjTRELGrJAGK_KLOhJ5EimBFP1unDVQ60k3uHMFN...
<eam> Hanmac: no, it's not
<davidcelis> lol
<Hanmac> its a LowRangeRubyCannon :D
<eam> Hanmac: you don't understand what sandboxing entails
<shevy> did eam kill the bot already
johnlcox has quit [Ping timeout: 268 seconds]
Synthead has quit [Quit: p33 ba115]
<shevy> hmm looks like a bug
vitor-br has quit [Ping timeout: 276 seconds]
fridim_ has quit [Ping timeout: 246 seconds]
<Hanmac> eam and you dont understand how the bot has changed since Mon and i are involved?
<eam> I do
<eam> and you don't understand that there are countless other exploits
<eam> I'm not sharing nearly all of the tricks
<eam> but what I'm telling you, as someone who clearly has more domain experience, is that your bot is exploitable and likely will continue to be for a long time
specialGuest has joined #ruby
<eam> I can still initiate network connections from it
specialGuest has quit [Changing host]
specialGuest has joined #ruby
<eam> so just be aware
fridim_ has joined #ruby
tds has joined #ruby
<eam> my main objection is that the bot's presence detracts from the discussion, btw
<eam> no amount of reactionary patching will address that
<tds> what's the cleanest way to make a class method also an instance method?
neersighted has joined #ruby
ilyam_ has joined #ruby
<shevy> eam show us a trick!
<eam> I've already shown them several
<apeiros_> tds: module_function. but goes the other way round.
<apeiros_> 00:54 eam: my main objection is that the bot's presence detracts from the discussion, btw
enroxorz has joined #ruby
enroxorz has quit [Changing host]
enroxorz has joined #ruby
<Hanmac> eam yeah the bot was sandboxed before ... but when you try to make it save it loses MANY features you could need from ruby
<tds> apeiros_: i don't think module_function will work in the context of a class though?
<apeiros_> of which eam is totally unblamable himself :-p
<apeiros_> tds: sure does. Class is a subclass of Module
sebicas has quit [Quit: sebicas]
<shevy> tds well. class Foo; def self.test; Foo.new.test; end; def test; puts 'Hi there; end; end Foo.test
<shevy> forgot a '
CannedCorn has joined #ruby
ilyam has quit [Ping timeout: 246 seconds]
ilyam_ is now known as ilyam
<tds> apeiros_: I know that it is, but I tried that earlier, and it doesn't work for some reason
<tds> I get: "NoMethodError: undefined method `module_function' for A:Class"
cherrypeel has joined #ruby
kirun has quit [Quit: Client exiting]
lukekhamilton has quit [Read error: Connection reset by peer]
<tds> shevy: it involves setting an instance variable either on the class or on the instance, so context is important
<apeiros_> tds: hm, seems like it is indeed actively removed from Class
<apeiros_> too bad
<Hanmac> tds as far as i know module_function only works on modules?
caveat- has quit [Ping timeout: 252 seconds]
<shevy> tds and this instance variable is defined how or where?
<shevy> because in your original question you did not include the ivar requirement :-)
<apeiros_> Hanmac: yes. I thought it'd work on classes too, given that Class < Module. but seems it's undef'ed
apok has quit [Remote host closed the connection]
apok has joined #ruby
iamjarvo has quit [Ping timeout: 240 seconds]
<Hanmac> defining the exact same method on a class and an instance does not make much sense
<tds> shevy: both the class method and instance method require a reference to @foo -- for the class method, it is a class instance variable, and for the instance method it is not
<shevy> hmmmm
<tds> Hanmac: it does in the context of what I am doing
<tds> or maybe it doesn't…I dunno
apok_ has joined #ruby
<tds> basically my domain models need a gateway to talk to a web service
chessguy has quit [Remote host closed the connection]
<tds> my finder methods are class methods
<tds> and they need to access that gateway
<tds> my update methods are instance methods
<tds> they also need access to that gateway
Dr4g is now known as Dr4g|sleep
<tds> i just want a method called gateway that returns @gateway
<tds> this allows me to override @gateway in my tests with a mock
uris has quit [Quit: leaving]
<Hanmac> tds define it in a module as instance_method and then include AND extend it to your class
Takehiro has joined #ruby
<tds> i was just thinking that as you said it :)
Emmanuel_Chanel has quit [Quit: Leaving]
codeFiend has quit [Ping timeout: 246 seconds]
<tds> that seems like the best way to do it, especially given the duplication across all my domain models
<tds> thanks
mmitchell has quit [Ping timeout: 240 seconds]
apok has quit [Ping timeout: 276 seconds]
apok_ is now known as apok
apok has quit [Remote host closed the connection]
jeff_sebring has quit [Quit: Leaving]
apok has joined #ruby
Juul has quit [Quit: Leaving]
pwf has left #ruby [#ruby]
Agis__ has quit [Quit: Agis__]
Takehiro has quit [Ping timeout: 244 seconds]
beneggett has joined #ruby
lukekhamilton has joined #ruby
beneggett has quit [Client Quit]
jgarvey has quit [Quit: Leaving]
brianpWins has joined #ruby
<rking> Is this as idiomatic as it gets to make a Hash from an array plus a transformation?: Hash[*arr.map { |e| [ e*2, e ] }.flatten]
caveat- has joined #ruby
<rking> Surely not.
<apeiros_> drop the * and the flatten
<rking> Aha
<rking> Just another input that Hash[] can take? An Array of 2-item arrays?
chessguy has joined #ruby
chimkan___ has joined #ruby
<apeiros_> yes
<apeiros_> as of 1.8.7
<rking> K, thanksmuch.
<rking> See guys? apeiros_ is good for more than just kickbanning.
* rking runs.
<apeiros_> :-p
<rking> =D
<apeiros_> fun fact, only a tiny minority has ever been kicked by me. even less banned. so if you've been, maybe, just maybe it was because of you :-p (not directed at rking)
nexp has joined #ruby
Monie has joined #ruby
Monie has quit [Changing host]
Monie has joined #ruby
<rking> Just ribbing you because of the botstuff.
RoomieGunns has joined #ruby
chimkan has quit [Ping timeout: 240 seconds]
chimkan___ is now known as chimkan
emsilva has joined #ruby
emsilva has quit [Changing host]
emsilva has joined #ruby
<Hanmac> apeiros_ need to be praised because he took the might of the banister away :D
<apeiros_> lol
awarner has quit [Remote host closed the connection]
<rking> banisterfiend had might, once?
emmanuel__ has joined #ruby
shiki has quit [Remote host closed the connection]
<Hanmac> rking yeah ... he was channel op today
<apeiros_> he has op
bradhe has joined #ruby
phinfonet has quit [Quit: Linkinus - http://linkinus.com]
nexp has quit [Quit: nexp]
<rking> Haha. Worth reading scrollback?
shiki has joined #ruby
<rking> Banister is a few pintles short of a sturdy staircase, IMO.
nexusxp has joined #ruby
sixtycakes has joined #ruby
<apeiros_> no, he has op as in he can op himself. fflush (the channel owner) gave him.
CannedCorn has quit [Quit: Computer has gone to sleep.]
robbyoconnor has quit [Ping timeout: 276 seconds]
robbyoconnor has joined #ruby
moshee has quit [Ping timeout: 248 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Progster has quit [Ping timeout: 252 seconds]
nari has joined #ruby
hadees has joined #ruby
t-mart has joined #ruby
sixtycakes has quit [Remote host closed the connection]
tewecske has quit [Quit: Leaving.]
t98524 has quit [Remote host closed the connection]
t44879 has joined #ruby
fridim_ has quit [Read error: Connection timed out]
TheShadowFog has quit [Remote host closed the connection]
fridim_ has joined #ruby
r0bby has joined #ruby
pricees has quit [Quit: leaving]
robbyoconnor has quit [Ping timeout: 256 seconds]
riley526_ has joined #ruby
riley526 has quit [Ping timeout: 276 seconds]
sterex has quit [Read error: Connection reset by peer]
sterex has joined #ruby
bradhe has quit [*.net *.split]
caveat- has quit [*.net *.split]
RubyPanther has quit [*.net *.split]
juarlex_ has quit [*.net *.split]
mahlon has quit [*.net *.split]
x77686d has quit [*.net *.split]
ged has quit [*.net *.split]
__class__ has quit [*.net *.split]
eighty4 has quit [*.net *.split]
idoru has quit [*.net *.split]
infinitiguy has quit [Ping timeout: 260 seconds]
eighty4 has joined #ruby
r0bby_ has joined #ruby
cbuxton has quit [Ping timeout: 245 seconds]
danhunter has joined #ruby
<danhunter> i seem to be getting a conflict between gems
<danhunter> and I'm wondering if it's due to one of the gems not privatizing it's modules
<danhunter> is that a thing?
r0bby has quit [Ping timeout: 252 seconds]
<Hanmac> danhunter what is exactly your problem?
<danhunter> two gems both use Faraday, they both inherit Faraday::Middleware to setup call methods
<danhunter> one of the gems is calling the call/initialize method of the other gem
ged has joined #ruby
RubyPanther has joined #ruby
juarlex_ has joined #ruby
bradhe has joined #ruby
x77686d has joined #ruby
idoru has joined #ruby
__class__ has joined #ruby
mahlon has joined #ruby
fyolnish has joined #ruby
ged is now known as Guest46405
r0bby_ has quit [Ping timeout: 252 seconds]
jarred has joined #ruby
Guest46405 is now known as ged
nari has quit [Ping timeout: 252 seconds]
elaptics is now known as elaptics`away
savage-_ has joined #ruby
savage- has quit [Read error: Connection reset by peer]
alphabitcity has joined #ruby
jjang has joined #ruby
codeFiend has joined #ruby
fyolnish has quit [Ping timeout: 260 seconds]
machty_ has joined #ruby
machty has quit [Ping timeout: 276 seconds]
machty_ is now known as machty
TheShadowFog has joined #ruby
v0n has quit [Ping timeout: 246 seconds]
xbayrockx has quit []
cakehero has joined #ruby
r0bby_ has joined #ruby
beneggett has joined #ruby
Foxandxss has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
r0bby_ is now known as robbyoconnor
seanstickle has joined #ruby
qwerxy has quit [Quit: offski]
banisterfiend has quit [Ping timeout: 272 seconds]
banisterfiend has joined #ruby
pskosinski has quit [Quit: http://www.redeclipse.net -- Fast-paced online FPS]
jerrad has joined #ruby
<jerrad> hey guys
<jerrad> real quick, could you help me out with a regex?
BrokenCog has quit [Quit: leaving]
<jerrad> so when i try and run this
<jerrad> result = searchText.gsub(/(^[a-zA-Z0-9_].?)|[\W-,]([a-zA-Z0-9_])|[\W-,]/, "\\L$1\\u$2")
BrokenCog has joined #ruby
BrokenCog has quit [Changing host]
BrokenCog has joined #ruby
<jerrad> i get this output: invalid regular expression; can't use character class as a start value of range: /(^[a-zA-Z0-9_].?)|[\W-,]([a-zA-Z0-9_])|[\W-,]/
<banisterfiend> >> 1
<al2o3cr> (Fixnum) 1
<seanstickle> #regex is your friend here
<jerrad> the regex validates though in other languages, i tested it
HRida has joined #ruby
<banisterfiend> >> "Hanmac, stop saying disrespectful things about your lord and master"
<al2o3cr> (String) "Hanmac, stop saying disrespectful things about your lord and master"
gfontenot has joined #ruby
<fowl> milords a maniac sir
c0rn_ has joined #ruby
<jerrad> >> "Just A Smalltown Girl Living In A Lonely World".gsub(/(^[a-zA-Z0-9_].?)|[\W-,]([a-zA-Z0-9_])|[\W-,]/, "\\L$1\\u$2")
<al2o3cr> -e:1:in `eval': (eval):1: empty range in char class: /(^[a-zA-Z0-9_].?)|[\W-,]([a-zA-Z0-9_])|[\W-,]/ (SyntaxError), from -e:1:in `<main>'
mucker has joined #ruby
M- has joined #ruby
danhunter has quit [Quit: danhunter]
nilg has quit [Read error: Connection reset by peer]
davejacobs has joined #ruby
davidcelis has quit [Quit: K-Lined.]
kenichi has quit [Remote host closed the connection]
nilg has joined #ruby
adac has quit [Ping timeout: 248 seconds]
chare has joined #ruby
matty5000 has quit [Read error: Operation timed out]
BrokenCog has quit [Quit: leaving]
apeiros_ has joined #ruby
brianpWins has quit [Quit: brianpWins]
capsule_toy has quit []
Emmanuel_Chanel has joined #ruby
alphabitcity has left #ruby [#ruby]
c0rn_ has quit [Quit: Computer has gone to sleep.]
c0rn_ has joined #ruby