<darix>
i know of one rfc that let's the server tell the client about common folders like trash,sentmail,postponed...
<erikh>
IMAP is absurdly complicated.
<erikh>
yeah
<drbrain>
it's also absurdly powerful
<darix>
i actually like imap:)
<erikh>
drbrain: oh, no disagreement
<erikh>
I still weep for those implementing conformant servers though
idkazuma has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
<chris2>
imap is absurdly batshit insane
totallymike has joined #ruby-lang
<darix>
erikh: i stopped looking since i found dovecot. :)
<drbrain>
or clients
<erikh>
darix: yeah, most people have
<erikh>
see also: postfix
<drbrain>
The U in UID does not stand for "unique" or "universal" or any of those things
<drbrain>
it changes depending on the actions of other clients on the mailbox
<chris2>
it means "unique" but not forever ;)
<erikh>
for the lifetime of the request, right?
<erikh>
I see to recall that
<drbrain>
no
wmoxam has joined #ruby-lang
<chris2>
no, until uidvalidity is sent
<erikh>
oh my
* erikh
runs screaming
<chris2>
which can happen at any time!
wesside_ has joined #ruby-lang
krohrbaugh has joined #ruby-lang
wesside_ has quit [Client Quit]
<erikh>
I tried once
<drbrain>
if you get back UIDs 1, 2, 3 and another client deletes message 2 you get an update saying "2 is gone" and you're expected to adjust
<erikh>
I really tried really hard
<drbrain>
s/expected/required
<erikh>
heh
<erikh>
that was the thing -- so much SHOULD and not enough MUST
<chris2>
also, its fun if you press delete right now on msg two and that event comes in
<erikh>
I gave up once I hit a search bug in exchange that would cause my client implmeentation to infinitely recurse, but not on cyrus, courier, and dovecot
<drbrain>
because if you don't and you also delete message 2 you will delete the wrong item
<erikh>
that was years ago though. my first real rails app, must have been 2003 or 2004, something like that.
sepp2k1 has quit [Remote host closed the connection]
znz_jp has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
ozzloy has joined #ruby-lang
ozzloy has quit [Changing host]
ozzloy has joined #ruby-lang
synthetix has quit [Ping timeout: 248 seconds]
<yoshie902a>
I am using "require './mycode'" in IRB, but I keep changing it and needing to re-require it, but it fails the second time. I tried "load './mycode'" but that gives me a load error:cannot load such file. how to I re-require my file?
<darix>
yoshie902a: put your test code into a file
<darix>
add require 'pry' (After installing it)
<darix>
and at the position you want to debug
<darix>
add
<darix>
binding.pry
<darix>
hth
sduckett has joined #ruby-lang
<yoshie902a>
darix: I do that sometimes, but in this case, it's faster to run the irb
<brownies>
'evening
<brownies>
i have a silly question...
<brownies>
i have an array and i would like to search for the first element that matches a condition. if the elemnet is found, return that element; if no match is found, return nil.
fosky has quit [Remote host closed the connection]
nathanstitt has quit [Quit: I growing sleepy]
<rickhull>
check Enumerable
<rickhull>
which is mixed in
<brownies>
aha
<brownies>
derp. thanks.
<rickhull>
Enumerable#find cheers
slippyd has joined #ruby-lang
nettsundere has joined #ruby-lang
aspro has joined #ruby-lang
aspro has quit [Client Quit]
aspro has joined #ruby-lang
yoshie902a has left #ruby-lang [#ruby-lang]
asunderland has joined #ruby-lang
nettsundere has left #ruby-lang [#ruby-lang]
nettsundere has joined #ruby-lang
dingus_khan has joined #ruby-lang
nettsundere has quit [Client Quit]
nettsundere has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
Rubennn has quit [Ping timeout: 256 seconds]
rue_XIV has joined #ruby-lang
Rubennn has joined #ruby-lang
rue has quit [Ping timeout: 252 seconds]
wmoxam has quit [Ping timeout: 256 seconds]
nettsundere has quit [Ping timeout: 255 seconds]
ikrima has joined #ruby-lang
ozzloy has quit [Ping timeout: 245 seconds]
dhruvasagar has joined #ruby-lang
<dingus_khan>
hi, I'm pretty new to IRC, so can someone tell me how to stop "corrundum" from reminding me about "karma" every minute? Thanks judofyr, very funny, but it's annoying now
krohrbaugh has quit [Quit: Leaving.]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Remote host closed the connection]
<rickhull>
at what point did corundum focus his karma laser on you?
<dingus_khan>
every minute it flashes a reminder about karma
<erikh>
drbrain: ^
<rickhull>
corundum: karma?
<dingus_khan>
when someone names judofyr apparently told it to
<erikh>
hm
<erikh>
hehe
<erikh>
I've not ... seen this feature before
<dingus_khan>
corrundum: shut the fuck up
<dingus_khan>
that didn't work
vlad_starkov has quit [Ping timeout: 260 seconds]
<erikh>
dingus_khan: type /ignore corundum
<erikh>
that should help for now
<erikh>
I pinged the author of the bot, he can help later
<rickhull>
when did this start? and what did it say about judofyr?
levifig has quit [Excess Flood]
<erikh>
he's probably out, it's quitting/dinner time where he lives
<dingus_khan>
so I don't think the ignore worked, and it started yesterday
<erikh>
hmm
<erikh>
what irc client?
<dingus_khan>
Xchat
<dingus_khan>
judofyr typed this: " corundum: remind dingus_khan about karma every minut"
<rickhull>
try clicking on corundum in the user list
<rickhull>
haha
<erikh>
oh
<erikh>
wow
<dingus_khan>
judofyr typed this: " corundum: remind dingus_khan about karma every minute"*
<erikh>
daaaaamn
headius has quit [Quit: headius]
<erikh>
corundum: stop reminding dingus_khan
<dingus_khan>
motherfucker! lol
<erikh>
that asshat.
<erikh>
corundum: remind judofyr not to abuse the bot every minute
levifig has joined #ruby-lang
<dingus_khan>
I tried telling it to stop in the window of the bot, lol
<rickhull>
last time i played with corundum he would respond in chan
<erikh>
yeah
<dingus_khan>
yeesh
<erikh>
dingus_khan: I think I fixed it. working?
<erikh>
well, are you still getting messages?
<dingus_khan>
have no idea if it stopped or if I've broken something in xchat to the point where it doesn't blink anymore, lol
<erikh>
ok, I got it
<dingus_khan>
i just closed the corundum window for the last time, I think it stopped
<erikh>
I left a little gift for magnus too
<dingus_khan>
lol thanks guys, appreciate the help! :D
krohrbaugh has joined #ruby-lang
<erikh>
yeah, that's infuriating
dankest has quit [Quit: Leaving...]
fosky has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 248 seconds]
<dingus_khan>
yeah, I came on to ask about this maddening regex, and I went slightly more nuts
nathanstitt has joined #ruby-lang
<dingus_khan>
I've spent most of today on this, and two article, Eloquent Ruby, the study material I've been given, or RubyMonk has brought me any clarity on why this isn't working... http://pastebin.com/i2m8LwMG
<dingus_khan>
articles*
Domon has joined #ruby-lang
krohrbaugh has joined #ruby-lang
sailias has quit [Ping timeout: 248 seconds]
<dingus_khan>
holy shit, nevermind, I'm an idiot
Nisstyre-laptop has quit [Quit: Leaving]
lguardiola has quit [Quit: Leaving]
Wardrop has joined #ruby-lang
<Wardrop>
Does anyone know how to stop bundler from hijacking my attempts to run scripts and binaries installed by gems not included in the Gemfile?
dingus_khan has quit [Ping timeout: 246 seconds]
<Wardrop>
I'm in the root of my application directory, attempting to invoke a gem not part of my application, but get the annoying error: "Could not find <x> amongst: […, …]"
<Wardrop>
If I `cd` out of the directory containing the Gemfile, it works
<Wardrop>
In my case, I'm trying to launch my app with phusion passenger, but because passenger isn't a listed dependancy (and rightfully so; any rack web server is fine), it won't run.
krohrbaugh has quit [Quit: Leaving.]
sailias has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
arubin has joined #ruby-lang
<erikh>
Wardrop: are you using rvm or something?
<erikh>
or are you just trying to do rails with bundler?
<Wardrop>
I am using RVM. I didn't think this was an RVM issue though.
headius has joined #ruby-lang
symm- has quit [Ping timeout: 260 seconds]
ikrima has quit [Quit: Computer has gone to sleep.]
bzalasky has joined #ruby-lang
<erikh>
Wardrop: rvm installs a thing called rubygems-bundler which means bundle exec always runs if there's a gemfile in the directory
<erikh>
which is working properly if it's denying something outside of your gemfile.
<erikh>
the short is: don't use rvm or rubygems-bundler. I'm not sure how you do the latter.
jkyle has quit [Quit: leaving]
<erikh>
but if you need bundle exec, and need to start passenger with a rails app, you're gonna have a bad day regardless
<erikh>
I'd suggest using a Gemfile group to add passenger (e.g., 'webtest' or 'production' or what-have-you)
<erikh>
that way it's easy to turn on and off.
corundum has quit [Quit: okay bye]
corundum has joined #ruby-lang
Nautes has quit [Quit: Leaving]
wmoxam has quit [Ping timeout: 245 seconds]
alessio_rocco has quit [Remote host closed the connection]
<Wardrop>
erikh: Thanks erik.
krohrbaugh has joined #ruby-lang
ozzloy has joined #ruby-lang
ozzloy has quit [Changing host]
ozzloy has joined #ruby-lang
krohrbaugh has quit [Client Quit]
Nisstyre-laptop has quit [Quit: Leaving]
totallymike has quit [Ping timeout: 276 seconds]
GarethAdams has quit [Read error: Connection reset by peer]
bzalasky has quit [Remote host closed the connection]
jovy88 has quit [Read error: Connection reset by peer]
jovy88 has joined #ruby-lang
chmullig has joined #ruby-lang
Guest85414 has joined #ruby-lang
retro|cz has joined #ruby-lang
tylersmith has quit [Remote host closed the connection]
tylersmith has joined #ruby-lang
robbyoconnor has joined #ruby-lang
vlad_starkov has joined #ruby-lang
krz has joined #ruby-lang
pskosinski has quit [Quit: pskosinski]
vlad_starkov has quit [Ping timeout: 255 seconds]
ikrima has joined #ruby-lang
wmoxam has joined #ruby-lang
intellitech has joined #ruby-lang
io_syl has joined #ruby-lang
io_syl has quit [Client Quit]
bzalasky has joined #ruby-lang
cordax has joined #ruby-lang
cordax has quit [Client Quit]
krohrbaugh has joined #ruby-lang
stardiviner has joined #ruby-lang
aspro has quit [Quit: Bye!]
dankest has joined #ruby-lang
chrishunt has quit [Quit: ZzZzZz...]
chrishunt has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
Asher1 has quit [Quit: Leaving.]
kgrz has joined #ruby-lang
asunderland has quit [Ping timeout: 256 seconds]
chrishunt has quit [Quit: ZzZzZz...]
dingus_khan has joined #ruby-lang
baba has joined #ruby-lang
asunderland has joined #ruby-lang
pkrnj has quit [Ping timeout: 255 seconds]
megha has quit [Ping timeout: 255 seconds]
chrishunt has joined #ruby-lang
pkrnj has joined #ruby-lang
wmoxam has quit [Ping timeout: 264 seconds]
Asdasd has quit [Ping timeout: 252 seconds]
asunderland has quit [Ping timeout: 268 seconds]
<crankharder>
is there a quick method to get every super class of a given object up to Object?
<dingus_khan>
right right, makes sense--just wondering if there was sneaky or compact other way to do it, lol. thanks!
<dingus_khan>
a sneaky*
<apeiros>
dingus_khan: it depends on your specific task
<injekt>
^
<injekt>
was just typing this
<apeiros>
if all of your description is just "I want to split" then the answer is "String#split"
jovy88 has quit [Read error: Connection reset by peer]
<apeiros>
for hopefully obvious reasons
<dingus_khan>
right, so without pandering for solutions, I'm trying to split up arithmetic operations symbols from integers in a string, I think I get it though
jovy88 has joined #ruby-lang
<injekt>
ah maybe you want scan ;)
<dingus_khan>
need to read on group_by, that's a new one to me
<dingus_khan>
ahhhh scan! completely forgot about that guy
<dingus_khan>
lots to remember, lol
<injekt>
the devil is in the details, we need the details
<dingus_khan>
I wish the ruby-docs were a little more in-depth, sigh...
dr_bob has joined #ruby-lang
<dingus_khan>
ok, so it's a "reverse polish notation" calculator implementation, just writing instance method(s) to separate out the operators from the integers in the funky order they come in and apply the operations to the integers, following RPN rules
dhruvasagar has quit [Ping timeout: 276 seconds]
<dingus_khan>
I feel like it seems straightforward enough, and my personal instinct is to use a regexp pattern to strip out the series of operations that are going to need to be divied up and ordered according to the order of operations
<dingus_khan>
seem like a good approach?
<injekt>
I would probably tokenize it
<dingus_khan>
I have no idea what that means. lol
<dingus_khan>
newb here, sorry
benlovell has joined #ruby-lang
<injekt>
well technically string.split is tokenizing but you probably want to write a parser, using regexp for this is going to get nasty pretty quickly
<dingus_khan>
I'm only vaguely familiar with the concept of parsing--by context I assume you mean a mechanism with which to check the components of a collection for a pattern, right?
krohrbaugh has joined #ruby-lang
<dingus_khan>
and thanks for that insight on tokenizing, I feel like I could use a good article recommendation on that subject if anyone's got one!
<injekt>
dingus_khan: right, google 'ruby polish notation' you'll find quite a few write ups, and code that already does this
<dingus_khan>
oooh damn, I have no idea what lambdas are yet, haven't quite reached that part yet, but thanks for the suggestion! I really need to be able to come up with this entirely on my own from an almost intuitive place, which is a tall order for someone like me at this point
<dingus_khan>
but I will look for writeups discussing the approaches!
krohrbaugh has quit [Ping timeout: 260 seconds]
mucker has joined #ruby-lang
<Paradox>
did you know that hotels use white linens because bleach is cheaper than detergent?
mucker has quit [Ping timeout: 245 seconds]
<whitequark>
inkjet: huh?
<whitequark>
lexers are essentially regexps, or at least all lexer generators I know are implementing them
<whitequark>
Paradox: won't that degrade the fabric quickly
<Paradox>
whitequark, guests degrade it even faster
<whitequark>
haha
<whitequark>
also, how is this related to ruby
dhruvasagar has joined #ruby-lang
<Paradox>
its not
<Paradox>
think of it as…standup
<whitequark>
schtandup
dankest has quit [Read error: Connection reset by peer]
<charliesome>
i've used it and it seems like every IDE with an integrated form designer out there
roadt has joined #ruby-lang
skade has joined #ruby-lang
Squarepy has joined #ruby-lang
<erikh>
whitequark: no, I haven't done perl for a while now
<erikh>
I love perl, I just don't have much use for it anymore I Guess.
<erikh>
a lot of things I like to do these days are concurrent, and I love the consistency of ruby
<erikh>
and other lispy langauges
<erikh>
although go is teasing that hard
krohrbaugh has joined #ruby-lang
Bosox20051 has quit [Ping timeout: 255 seconds]
<r0bgleeson>
erikh: that 'mst' guy is weird, he has a serious dislike for ruby for some reason.
<erikh>
he doesn't hate ruby
<erikh>
he just prefers perl
<erikh>
and mst has changed a lot, especially in the last two years
kgrz has quit [Quit: Computer has gone to sleep.]
<erikh>
and he's always been brilliant -- ignoring him is not a wise decision whether or not you agree with him
<r0bgleeson>
I don't have much time for him, I've seen him humor & presentation style in a few videos.
<r0bgleeson>
if he doesn't like ruby he certainly puts the effort into "pointing it" out.
<erikh>
eh, your loss
krohrbaugh has quit [Ping timeout: 260 seconds]
<r0bgleeson>
i dont think so
<r0bgleeson>
he's a loud mouth
<r0bgleeson>
i dont have time for those
<erikh>
hmm. can I not care?
<r0bgleeson>
of course :D
<erikh>
just being frank here
<r0bgleeson>
i dont care if you dont care tbh :P
<erikh>
haha
<r0bgleeson>
and im not speaking to you specifically.
<r0bgleeson>
just in general.
pandy has quit [Remote host closed the connection]
pandy has joined #ruby-lang
mbj has joined #ruby-lang
cofin has joined #ruby-lang
jds has joined #ruby-lang
<jds>
Hi there
<jds>
I have a rails app, with gems managed by bundler. Some of those gems (all the ones from a git repo rather than from rubygems.org?) have had their gemspec modified
<ironcamel>
damn, everyone knows mst it seems like
<ironcamel>
i think infamous is the right term
<jds>
That is, the file on disk has been magically rewritten, with, for example, 's.version = Foo::VERSION' getting replaced by 's.version = "2.3.3"'
<jds>
Is this a rubygems 2 feature or what?
<injekt>
jds: bundler is managing those gems, not rubygems
<r0bgleeson>
jds: have you checked the git repositories to see if they have changed?
<jds>
r0bgleeson: yeah, the diff shows working copy changes of the gemspec
kgrz has joined #ruby-lang
<r0bgleeson>
jds: I don't know but I wouldn't think it is either rubygems or bundler. neither rewrite your gemspec. a hard-coded version is normally from generating the gemspec or maintaining the version manually in the gemspec itself.
<injekt>
r0bgleeson: I think they do actually
<injekt>
just checked and something I use from a git repo has rewritten my gemspec
<injekt>
yorickpeterse: yeah one will help you quicker though so you can spend less time in there
<r0bgleeson>
jds: can I know why it is causing you issues?
<r0bgleeson>
injekt: that doesn't count as "re-writing" it for me. it evaluates it, stores it in a cache, not really "re-writing" it but "evaluating" & storing a copy in disk.
<r0bgleeson>
rewrite implies the original is lost, which it is not.
mitchty has joined #ruby-lang
<jds>
r0bgleeson: by 'original' you mean the version on github?
<jds>
It's replacing the only copy of the gemspec I have on disk
<injekt>
r0bgleeson: no but it's rewritten, if they didn't have that the gemspec would look exactly the same as when it was downloaded, but they download it then rewrite it
<injekt>
yeah
<injekt>
it replaces it, so it rewrites it
<injekt>
:D
<r0bgleeson>
alright, I stand corrected, then
<jds>
r0bgleeson: It was causing us issues due to a flaw in our app. We were referencing module Foo before the foo gem got required, but it's worked up until now because foo.gemspec had "require 'foo/version'", thus creating Foo::VERSION
<jds>
Which is a fault on our part, but took quite a while to figure out
dhruvasagar has quit [Ping timeout: 246 seconds]
<r0bgleeson>
jds: gotcha.
<injekt>
this is the part where I'd say it's a retarded thing to do, but I think bundler actually got that right
<r0bgleeson>
i dont see an issue w/ bundler doing that.
<jds>
(and was slightly crazy-making due to it breaking on some machines but working fine on others that hadn't yet run 'bundle update')
<r0bgleeson>
its their copy.
<r0bgleeson>
get your own if you want one.
<r0bgleeson>
its git after all :p
<r0bgleeson>
jds: yeah, I've had head-banging moments like that before.
dhruvasagar has joined #ruby-lang
tylersmith has joined #ruby-lang
symm- has joined #ruby-lang
Domon has quit [Remote host closed the connection]
Fisix_AIX has joined #ruby-lang
tylersmith has quit [Ping timeout: 252 seconds]
sush24 has joined #ruby-lang
r0bgleeson has quit [Quit: WeeChat 0.3.8]
r0bgleeson has joined #ruby-lang
Asher has joined #ruby-lang
<whitequark>
erikh: ruby and OTHER lispy languages?
Domon has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 252 seconds]
krohrbaugh has joined #ruby-lang
<tarruda>
in C extension, if I bind a block to its calling scope for later use using rb_block_proc(), how can I free the block/scope when I no longer need it?
dr_bob has quit [Quit: Leaving.]
fsvehla has quit [Quit: fsvehla]
megha has joined #ruby-lang
<charliesome>
tarruda: it just happens
ikrima has quit [Quit: Computer has gone to sleep.]
baba has quit [Ping timeout: 276 seconds]
<charliesome>
make sure you keep the proc somewhere the GC can see it while you still need it though
krohrbaugh has quit [Ping timeout: 252 seconds]
dr_bob has joined #ruby-lang
dr_bob has quit [Read error: Connection reset by peer]
<tarruda>
charliesome: whats the best way to do that? assign it to a ruby variable?
fsvehla has joined #ruby-lang
<charliesome>
tarruda: you can't assign to ruby variables from c extensions
<tarruda>
charliesome: what can I do then?
<charliesome>
tarruda: look into Data_Make_Struct and Data_Wrap_Struct and friends
<charliesome>
otherwise if you're storing the proc in a stable memory location
<charliesome>
you can call rb_gc_register_address
<charliesome>
but make sure to unregister it when you're done
<tarruda>
charliesome: ok, thanks
<tarruda>
charliesome: where can I read more about rb_gc_register_address ? README.EXT doesn't seem to mention it
<yorickpeterse>
injekt: which one, #rubyonrails?
<yorickpeterse>
Hm, I suppose this also applies to common Ruby
<tarruda>
charliesome: nvm already found it
<r0bgleeson>
tarruda: I don't know much about C API but I think rb_gc_register_address is same as rb_global_variable if that helps.
vlad_starkov has joined #ruby-lang
<injekt>
yorickpeterse: yeah
mezamashiman has quit [Quit: leaving]
krz has quit [Quit: krz]
Domon has quit [Remote host closed the connection]
<r0bgleeson>
yorickpeterse: STI may be another solution to that problem, where Problem defines #type, and that is set to ProjectB::Problem.
<yorickpeterse>
well, the thing is that that does not tie into AR
<yorickpeterse>
I tried looking into where AR stores the class but it seems to be somewhere deep down where I don't want to write hacks
nertzy3 has quit [Ping timeout: 245 seconds]
<tarruda>
r0bgleeson: yes, rb_global_variable definition in gc.c shows that all it does is delegate the call to rb_gc_register_address.
<r0bgleeson>
in what sense? #type/STI is supported by AR.
<yorickpeterse>
oh?
<r0bgleeson>
oh wait, it still wouldn't work, because instances of GemA::Project would have a different type to begin with, but you may be able to "coerce" them with a hack.
<injekt>
yeah sti is supported by ar, it sucks ballbags
<yorickpeterse>
not sure if I'm entirely following you, do you have a basic example of it?
<r0bgleeson>
yorickpeterse: sure, give me a minute.
<injekt>
tarruda: that's just the decision that's been made based on the safe level. I have to head out now someone else might be able to explain it better
<tarruda>
injekt: ok thanks, I will investigate it further
<shime>
I guess it's safe to use Logger.new(nil) instead
<shime>
thanks!
tylersmith has quit [Ping timeout: 255 seconds]
GeissT has quit [Quit: MillBroChat AdIRC User]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
<PhilG>
I am (again) getting really excited about ruby and I have been programming a bit before. But I need a project or problem to work on! In future I would love to contribute to OSS but for now I would just like to start on a tiny reallife problem
<PhilG>
That's the advice which I have gotten on StackOverflow (plus a few downvotes) but I have been out of doing anything code related for a few months
<PhilG>
lianj Hence the search for suggestions
<lianj>
how should we know what you like?
<PhilG>
You can't and you don't have to. I am just looking for a small library or a problem people might have
<lianj>
for a beginner, choose something you want to improve or automate something in your daily life.
krohrbaugh has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<PhilG>
yeah well, that is what I am searching for right now...
<apeiros>
~10y ago everybody and his stepchild wrote an irc bot
krohrbaugh has quit [Ping timeout: 252 seconds]
<erikh>
~10y ago?
<erikh>
more like 15 minutes ago, and for the last 20 years
<lianj>
internet year. last month
<erikh>
apeiros: that was just when you were doing it :)
<erikh>
mr. silverplatter
shime has quit [Ping timeout: 264 seconds]
jvrmaia has joined #ruby-lang
breakingthings has joined #ruby-lang
<PhilG>
if starters wrote irc bots, it can't be that hard. Maybe I can start a bit of research about it
scampbell has joined #ruby-lang
<GarethAdams>
I'm using HighLine, what do I need for left/right cursor keys to work properly during input and not just dump ^[[C and ^[[D into the terminal?
adambeynon has joined #ruby-lang
<gnufied>
Highline doesn't do that
<erikh>
PhilG: cinch is a good library
<gnufied>
GarethAdams: you want readline
mistym has joined #ruby-lang
<PhilG>
gnufied: Thanks, I will also try and connect to the IRC without using any gems
<GarethAdams>
gnufied: that's all I needed, now I see that prompt.ask("Question? ") { |q| q.readline = true } does the job :)
<apeiros>
erikh: exactly :)
tomzx_mac has quit [Ping timeout: 248 seconds]
<apeiros>
I'm just not sure whether I'm everybody or the stepchild
cofin has joined #ruby-lang
jvrmaia_ has joined #ruby-lang
jvrmaia has quit [Ping timeout: 256 seconds]
rwk1 has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
<erikh>
apeiros: nah, you're everybody
<erikh>
I did a thing ages ago called dbot
<erikh>
it's on my github still I think
<erikh>
and now I have another bot up there, but it's cinch-based.
jvrmaia has quit [Remote host closed the connection]
rsl has joined #ruby-lang
pasties has joined #ruby-lang
<PhilG>
Who is or was active on SO?
<judofyr>
never been active, but I'm following some tags on email and answering
czman has joined #ruby-lang
jamilbk has quit [Read error: Connection reset by peer]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
czman has quit [Client Quit]
erpuds has joined #ruby-lang
seoaqua has joined #ruby-lang
heftig has quit [Quit: Quitting]
dr_bob has quit [Quit: Leaving.]
heftig has joined #ruby-lang
seoaqua has quit [Ping timeout: 264 seconds]
dr_bob has joined #ruby-lang
sush24 has quit [Ping timeout: 252 seconds]
sush24 has joined #ruby-lang
dezasseis has quit [Quit: Leaving.]
runeb has joined #ruby-lang
Bosox20051 has joined #ruby-lang
tylersmith has joined #ruby-lang
priodev has quit [Read error: Operation timed out]
sush24 has quit [Quit: This computer has gone to sleep]
ryez has joined #ruby-lang
chrishunt has quit [Quit: ZzZzZz...]
jxie has joined #ruby-lang
tylersmith has quit [Ping timeout: 264 seconds]
priodev has joined #ruby-lang
<crankharder>
why would bundler install rails 0.9.5 when i have '< 4' specified
sush24 has joined #ruby-lang
<apeiros>
0.9.5 is < 4, isn't it? :)
totallymike has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
<totallymike>
I just learned about RVM wrapper. That's pretty rad.
<totallymike>
I started talking here a minute ago, but it turns out I wasn't connected. D'oh.
<injekt>
rails 0.9.5 oO
<totallymike>
Either way, rvm wrapper is pretty handy for scriptably getting an RVM environment set up. It works to great effect in FreeBSD init scripts which have a highly isolated environment on their own.
runeb has quit [Remote host closed the connection]
imperator has quit [Quit: Leaving]
<totallymike>
Basically, "rvm wrapper <ruby string> <binary that SHOULD work>" and it generates a shell script that inits your rvm environment and then runs said binary for you.
<totallymike>
However, this is in reference to a conversation twelve hours old that I disconnect halfway through, so it may not be of relevance to anyone.
krohrbaugh has joined #ruby-lang
<injekt>
you could also use chruby and not have to do any of that
<totallymike>
The only modification I had to make in order to get it working in FreeBSD init scripts was insert something in it that modified $PATH because FreeBSD maintains an empty $PATH variable in the init scripts.
<totallymike>
injekt: You may be right. I don't know much about chruby, and I use RVM a lot. This was the easiest, fastest way to get a single-user ruby environment running on init for me.
<injekt>
totallymike: Sure, I'm glad it's worked well for you
dezasseis has joined #ruby-lang
<totallymike>
chruby does look nice though. I'll investigate it some day. Thanks for pointing it out.
megha has quit [Ping timeout: 245 seconds]
krohrbaugh has quit [Ping timeout: 256 seconds]
gnufied has joined #ruby-lang
<cout>
oh this is lovely
<cout>
I used cirwin's references patch to figure out what's holding on to my activerecord objects
<cout>
apparently it's a thread object
<cout>
hmm.
megha has joined #ruby-lang
asunderland has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
<injekt>
r0bgleeson: neat book
<r0bgleeson>
injekt: so it is you I share that folder with
<injekt>
r0bgleeson: yup its my folder
<r0bgleeson>
:)
ykk` has joined #ruby-lang
<injekt>
I share it with like 8 people including yourself
<r0bgleeson>
injekt: dont delete any books :D
<ykk`>
hey anyone have some experience with writing a packet sniffer for ruby?
<injekt>
r0bgleeson: :P
<andrewvos>
I have experience sniffing packets I find on the street
<injekt>
andrewvos: you live on the wrong kind of streets to be doing that
tsan has joined #ruby-lang
kgrz has quit [Ping timeout: 260 seconds]
machuga has left #ruby-lang [#ruby-lang]
tsan has quit []
apeiros has quit [Remote host closed the connection]
<ykk`>
or maybe he lives on the right kind of streets to be doing that?
* andrewvos
slowly winks
<ykk`>
lol
wallerdev has joined #ruby-lang
PhilG1 has joined #ruby-lang
yfeldblum has quit [Ping timeout: 264 seconds]
PhilG2 has joined #ruby-lang
PhilG1 has quit [Remote host closed the connection]
PhilG has quit [Remote host closed the connection]
nettsundere has quit [Quit: nettsundere]
PhilG2 has quit [Remote host closed the connection]
PhilG has joined #ruby-lang
tylersmith has joined #ruby-lang
vbatts|work has quit [Ping timeout: 264 seconds]
<yorickpeterse>
nerds: can you specify a base class for another class during runtime?
<yorickpeterse>
as in, after the child class has been declared
<yorickpeterse>
so `class Foo; end; Foo.inherits(Bar)`
wallerdev has quit [Client Quit]
<PhilG>
I don't think so
<injekt>
yorickpeterse: you can't change the superclass of a class like that no, but charliesome wrote something to do so
skade has quit [Quit: Computer has gone to sleep.]
nXqd has quit [Ping timeout: 260 seconds]
tylersmith has quit [Ping timeout: 248 seconds]
<cout>
yorickpeterse: it's pretty easy to change the base class from C
<cout>
yorickpeterse: from ruby, you can add a new immediate ancestor using #extend
<injekt>
...
brixen_ has left #ruby-lang [#ruby-lang]
<MouseTheLuckyDog>
IS there a way to "flush" the stdin?
benlovell has quit [Ping timeout: 264 seconds]
<injekt>
cout: that doesn't do what you think it does
brixen has joined #ruby-lang
<injekt>
MouseTheLuckyDog: $stdin.flush
anonymuse has joined #ruby-lang
<cout>
injekt: what doesn't?
elia has quit [Ping timeout: 245 seconds]
<injekt>
cout: extend does not change any base class
<cout>
injekt: I didn't say that it does
<injekt>
"yorickpeterse: it's pretty easy to change the base class from C; from ruby, you can add a new immediate ancestor using #extend"
<injekt>
maybe I misread that
headius has joined #ruby-lang
<r0bgleeson>
yorickpeterse: you can't change the superclass of Foo(< Object), at least not on MRI with pure ruby. I think Rubinius lets you swap ancestors in & out in pure ruby.
<r0bgleeson>
last time I tried that the VM crashed a lot
<r0bgleeson>
so the answer is probably: no :p
<injekt>
r0bgleeson: doesn't that article do exactly that?
<r0bgleeson>
which article?
<r0bgleeson>
oh sorry
<r0bgleeson>
missed it
<r0bgleeson>
injekt: that's C, so not really.
<injekt>
r0bgleeson: scroll down to the ruby? lol
<injekt>
the c code is taken from core, not an extension
brianpWins has quit [Quit: brianpWins]
<r0bgleeson>
injekt: that's snazy
<r0bgleeson>
i dont have time to read it all
carloslopes has joined #ruby-lang
sush24 has quit [Ping timeout: 268 seconds]
<yorickpeterse>
hmmm
<r0bgleeson>
rubinius can do it without any code at all fwiw
<injekt>
yorickpeterse: tl;dr dont do it
<yorickpeterse>
well, we did solve our problem otherwise using *drumroll*
<MouseTheLuckyDog>
injekt, sorry, afk but will $stdin.flush empty the input buffers. I'm using system and when the command hits the first input it exits the program like if I chooise a quit option at that point.
<cout>
injekt: that ruby code is making use of a bug that only exists on a small subset of ruby versions
<injekt>
cout: so?
<cout>
injekt: no need to be rude...
<injekt>
oO
wallerdev has joined #ruby-lang
<injekt>
cout: I wasn't being rude..
cofin has quit [Quit: cofin]
cofin has joined #ruby-lang
carloslopes has quit [Ping timeout: 252 seconds]
barttenbrinke has quit [Ping timeout: 276 seconds]
t_ has joined #ruby-lang
<yorickpeterse>
yeah man, don't be an ass
<yorickpeterse>
so yeah, concerns
<yorickpeterse>
basecamp
<injekt>
omakase
judofyr has quit [Remote host closed the connection]
mucker has quit [Quit: leaving]
<yorickpeterse>
well the syntax of concerns *does* take away some of the cruft when dealing with self.included
<injekt>
yup
<injekt>
and handles module dependencies
krz has quit [Quit: krz]
mucker has joined #ruby-lang
tsan has joined #ruby-lang
<PhilG>
Anybody got an Idea how to test a cinch bot?
<injekt>
PhilG: ping dominikh he's the author and he loves helping out people
cofin has quit [Quit: cofin]
<injekt>
PhilG: I should also note that you should just forget about testing your cinch bot
<lianj>
injekt: author yes. but he loves nothing ;)
<injekt>
lianj: :D
<PhilG>
That is what I have been expecting, unfortunately
<yorickpeterse>
yeah it uses type checking so there are no bugs
krohrbaugh has joined #ruby-lang
<MouseTheLuckyDog>
The question is
<injekt>
duck checking too
<injekt>
type ducking?
<injekt>
all of them
<yorickpeterse>
it also checks for racist conditions
<dominikh>
:D that one actually made me chuckle
<lianj>
no, just smart crowd testing
<injekt>
yeah, and if there's none, it makes sure some are inserted
<MouseTheLuckyDog>
The question is not whether the code is ever wrong, but whether testing can make it less wrong.
tsan has left #ruby-lang [#ruby-lang]
<PhilG>
Thanks for the examples by cout
<injekt>
MouseTheLuckyDog: that's the philosophy behind worthwhile testing
bzalasky has quit [Remote host closed the connection]
krohrbaugh has quit [Client Quit]
<injekt>
me and dominikh discussed writing tests for cinch back when I wrote the original implementation (disclaimer: it was entirely rewritten anyway) and testing it was not helpful
krohrbaugh has joined #ruby-lang
<injekt>
dominikh and I*
<PhilG>
But wait, instead of actually testing the outout of a cinch bot, I could test what actually does the work (plugins)
<injekt>
dominikh: asshole
Fisix_AIX has quit [Quit: Leaving]
<dominikh>
injekt: love you too.
<injekt>
PhilG: right
<MouseTheLuckyDog>
Oh god the google doodle today is really sophisticated.
<PhilG>
Wow, there is two other "big" IRC Bot libs, last commits from 2 years ago
<injekt>
you should use butler and bug apeiros
* injekt
runs
ryez has quit [Ping timeout: 245 seconds]
carloslopes has joined #ruby-lang
<apeiros>
:D
<MouseTheLuckyDog>
injekt, Is that like some amethodology? "worthwile testing"?
<apeiros>
he can't mean butler. that's 4y old iirc
<dominikh>
PhilG: they weren't good 2 years ago, either :)
<injekt>
apeiros: :D
<injekt>
apeiros: silverplatter? :D
nXqd has quit [Remote host closed the connection]
<apeiros>
that might be at 2y atm
<PhilG>
dominikh: Probably :)
<apeiros>
priorities… *sob* :)
<injekt>
heh
<PhilG>
How long has butler been dead? :D
<gnufied>
since forver!
<dominikh>
:D
<apeiros>
as said, 4y I think
<apeiros>
might be 5 by now
<gnufied>
I heard about butler when I was ruby noobie
<gnufied>
now I confuse it with bundler
<apeiros>
I stopped working on it when I started to work for the current company
<gnufied>
:-)
<apeiros>
back then it kicked every other irc bot's ass
<cout>
I wrote an irc bot framework in 2002 but accidentally rm -f'd it :(
<apeiros>
it still has good code in it
<gnufied>
I wrote some tests for butler if apeiros remembers.
<apeiros>
I barely remember anything from 5y ago :)
<apeiros>
wild days ;-)
<cout>
apeiros: I barely remember anything from yesterday
<apeiros>
cout: you're more successful at drinking alcohol than I then, I guess :-p
<cout>
apeiros: I don't drink at all
<cout>
I'm just getting old
<gnufied>
:/
<gnufied>
none of us are getting younger, if that makes it easier
brettchalupa has quit [Quit: brettchalupa]
<apeiros>
cout: that's sad then…
<cout>
gnufied: it does :)
<dominikh>
I stopped using butler (and started working on Cinch) when it randomly used 100% CPU :P
<gnufied>
that was supposed to be easter egg
<gnufied>
use 100% cpu randomly
brettchalupa has joined #ruby-lang
<cout>
morse code implemented as CPU spikes?
<dominikh>
must've been a hell of a message
brettchalupa has quit [Client Quit]
<apeiros>
dominikh: never understood why it did that for you
<apeiros>
never used more than 1% for me
<dominikh>
apeiros: hehe. it ran fine for months, and one day bam, 100% CPU
<apeiros>
did you use windows back then?
<dominikh>
never investigated it, I just shut down the bot :P
<injekt>
then used the awesome cinch bot i wrote
<dominikh>
injekt: I never used your cinch
<injekt>
oh wait no you wrote your own because you didn't like cinch then we merged
<injekt>
LOL
<dominikh>
apeiros: actually, no idea where the bot ran at the time :/ might've been Windows
<dominikh>
injekt: "merged"
<injekt>
dominikh: bro.
<dominikh>
injekt: as in git merge -s theirs
<injekt>
:D
<apeiros>
I remember windows had an IO issue which was ruby related
tylersmith has joined #ruby-lang
<PhilG>
dominikh: do all cinch bot have an underscore attached to their name?
<dominikh>
PhilG: cinch adds underscores to the nick if the nick is taken.
GarethAdams has quit [Quit: Leaving...]
<PhilG>
dominikh: Ah okay
<apeiros>
dominikh: not numbering up? :)
<MouseTheLuckyDog>
In ruby is there something similar to #ifdef debug?
<dominikh>
apeiros: nope, doing ______ until it fails :P
<apeiros>
binding.pry if $debug
<apeiros>
dominikh: good luck with that on servers with short nick limits :D
* apeiros
has seen server with 8 char limits, teh horror
<dominikh>
apeiros: if you need that many underscores you should consider using a more original nickname :D
<apeiros>
well, CIA (not the US agency) has quite a lot of bots e.g. :)
<dominikh>
had.
<apeiros>
had?
<dominikh>
CIA has been gone for a while now
<apeiros>
oh
MaddinXx has joined #ruby-lang
<dominikh>
you know, after the whole "our data is gone and we had no backups of anything" incident
<PhilG>
dominikh: Ways to change realname etc of the bots?
<MouseTheLuckyDog>
dominikh, How about _ for a nickname. That solves the too many underscores problem.
krohrbaugh has quit [Read error: Operation timed out]
ykk` has quit [Quit: ykk`]
krohrbaugh has joined #ruby-lang
krohrbaugh1 has quit [Read error: Connection reset by peer]
<apeiros>
dominikh: iirc I even proc-ified nickname changing
<dominikh>
apeiros: hm?
<apeiros>
you could supply a proc to determine the next nickname in case of collisions
dr_bob has left #ruby-lang [#ruby-lang]
<dominikh>
heh
<dominikh>
yagni
ykk` has joined #ruby-lang
<dominikh>
apeiros: in Cinch you can specify a list of nicks to try. and when that fails you really should ask yourself why ;)
chrishunt has joined #ruby-lang
<apeiros>
IMO that's fine for clients with a real user who can interfere in case of repeated failure. for an automated system I prefer watertight solutions ;-)
<dominikh>
could always react on the nick in use error and do your own business
<apeiros>
that's basically what that proc did
adambeynon has quit [Ping timeout: 260 seconds]
<apeiros>
does
<apeiros>
whatever
<dominikh>
did :P
<apeiros>
watching sc2 now :-p
<dominikh>
accept reality
kgrz has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
vbatts|work has joined #ruby-lang
cofin has joined #ruby-lang
<gnufied>
watching dota2
<gnufied>
:D
lguardiola has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
mytrile has joined #ruby-lang
gjaldon has joined #ruby-lang
io_syl has joined #ruby-lang
voker57_ has joined #ruby-lang
lguardiola has joined #ruby-lang
adambeynon has joined #ruby-lang
ddfreyne has quit [Excess Flood]
ddfreyne has joined #ruby-lang
vbatts|work has quit [Quit: MeSoChatty 0.3.8]
vbatts|work has joined #ruby-lang
vlad_starkov has joined #ruby-lang
__butch__ has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 252 seconds]
duckinator has quit [Quit: Nickname collision due to Services enforced nickname change, your nick was overruled]
__butch__ has quit [Ping timeout: 252 seconds]
kgrz has quit [Ping timeout: 245 seconds]
__butch__ has joined #ruby-lang
enebo has joined #ruby-lang
tdy has quit [Ping timeout: 251 seconds]
asunderland has quit [Quit: leaving]
kgrz has joined #ruby-lang
PhilG has quit [Remote host closed the connection]
duckinator has joined #ruby-lang
gjaldon has quit [Remote host closed the connection]
jperry2 has quit [Quit: jperry2]
jperry2 has joined #ruby-lang
voker57_ has quit [Ping timeout: 276 seconds]
voker57_ has joined #ruby-lang
Nautes has joined #ruby-lang
pkrnj has joined #ruby-lang
stu314 has joined #ruby-lang
ykk` has quit [Quit: ykk`]
symm- has joined #ruby-lang
Nautes has quit [Quit: Leaving]
<stu314>
Hi, I have a question regarding a recent change in 1_9_3 branch: the code in include/ruby/missing.h changed and now it reads: if !defined(HAVE_STRUCT_TIMEVAL) || !defined(HAVE_STRUCT_TIMESPEC) ; then [ if defined(HAVE_TIME_H) {include <time.h>}; if defined(HAVE_SYS_TIME_H) {include <sys/time.h>} ]. I think the exclamation marks (negation) are wrong.
<stu314>
Because later in that file are the structs defined if !defined(HAVE_STRUCT_TIMEVAL), ...
sepp2k has joined #ruby-lang
<stu314>
And the code in configure defines HAVE_STRUCT_TIMEVAL and HAVE_STRUCT_TIMESPEC if it found them in time.h or sys/time.h.
brettchalupa has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
Mon_Ouie has quit [Ping timeout: 252 seconds]
erpuds has quit [Quit: erpuds]
<manveru>
gnufied: you play?
bcardarella has joined #ruby-lang
<gnufied>
manveru: a bit.
<bcardarella>
#method_a calls #method_b. Is there a way from #method_b to get the name of the calling method? So in my simple example I would expect something like calling_method => :method_a
<yorickpeterse>
You can't do something like `foo = 10; foo.get_variable_name` though
<MouseTheLuckyDog>
I have wriotten a function which tests variables to see if they match crietia. If they don't I want to print "variable failed test" where variable is the variable name.
<yorickpeterse>
you can't resolve variable names based on values
<yorickpeterse>
you'd have to explicitly pass a string/symbol to those methods
<yorickpeterse>
(for the variable names)
<MouseTheLuckyDog>
instead of passing the variable name could I pass a string with the variable name, create a local variable to store the value of the variable, then print the string and the variable.
malev has joined #ruby-lang
<yorickpeterse>
def test_something(data, name); p "#{name} is invalid" unless data; end # Most basic form
<MouseTheLuckyDog>
Something like: def print variable(foo_str); puts "#{foo_str} =#{value of the variable whose name is foo_str}"
jperry2 has left #ruby-lang [#ruby-lang]
<MouseTheLuckyDog>
sorry
<MouseTheLuckyDog>
Something like: def print_variable(foo_str); puts "#{foo_str} =#{value of the variable whose name is foo_str}"
<MouseTheLuckyDog>
print_variable("mydata") : Output is "mydata = value".
hahuang65 has joined #ruby-lang
plusk has quit [Quit: plusk]
jperry_ has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
mistym_lunch is now known as mistym
intellitech has joined #ruby-lang
intellitech has quit [Changing host]
intellitech has joined #ruby-lang
MaddinXx has quit [Remote host closed the connection]
<injekt>
MouseTheLuckyDog: yorickpeterse> you can't resolve variable names based on values
wallclockbuilder has joined #ruby-lang
<injekt>
local variables anyway
adambeynon has joined #ruby-lang
malev has quit [Ping timeout: 245 seconds]
rwk1 has joined #ruby-lang
<MouseTheLuckyDog>
injekt, How about the other given a string with a variable name get the value?
<injekt>
MouseTheLuckyDog: huh?
<MouseTheLuckyDog>
Look at my example.
<injekt>
MouseTheLuckyDog: you mean `foo = "bar"; do_something("foo") #=> "bar"` ?
<MouseTheLuckyDog>
Something like: def print_variable(foo_str); puts "#{foo_str} =#{value of the variable whose name is foo_str}"
<MouseTheLuckyDog>
print_variable("mydata") : Output is "mydata = value".
<injekt>
no
<injekt>
you can't fetch local variables by their labels like that
<yorickpeterse>
You can see local variables as a human readable ID where only you actually know the human readable form
<yorickpeterse>
(that's not entirely correct but close enough)
totallymike has quit [Ping timeout: 252 seconds]
rwk1 has quit [Ping timeout: 245 seconds]
<injekt>
yorickpeterse: yeah but it wouldn't work in the way MouseTheLuckyDog wants it too because scope would have changed. Unless I'm missing what you're saying
apeiros has quit [Remote host closed the connection]
<yorickpeterse>
what I'm saying is that as far as I know MRI is not capable of retrieving values by variable names (as passed during runtime), or the other way around
<yorickpeterse>
unless you use eval()
apeiros has joined #ruby-lang
<yorickpeterse>
>> var_name = 'number'; number = 10; eval("#{var_name}")
<injekt>
yorickpeterse: yeah I'm saying that wouldn't work because scope would have changed (with eval, that is)
<yorickpeterse>
>> module Kernel; alias evil eval; end; evil("huehuehue")
<eval-in>
yorickpeterse => /tmp/execpad-02c42f5b9140/source-02c42f5b9140:2:in `eval': undefined local variable or method `huehuehue' for main:Object (NameError) ... (http://eval.in/23884)
chrishunt has quit [Quit: ZzZzZz...]
<yorickpeterse>
injekt: eval() doesn't introduce a new scope
<yorickpeterse>
class_eval and instance_eval do however
<PhilG>
How would I capture multiple words in a regular expression?
<yorickpeterse>
well, as in they evaluate in a different one
<injekt>
yorickpeterse: lol im saying using print_variable and eval wouldn't work because the local variable would be evaluated within the context of the method, not the original scope
breakingthings has quit [Quit: breakingthings]
<injekt>
yorickpeterse: not that eval introduces a new scope silly face
judofyr has joined #ruby-lang
MaddinXx has joined #ruby-lang
<yorickpeterse>
aah
<yorickpeterse>
also, today I discovered void pointers in C
<MouseTheLuckyDog>
Any idea why the second system fails to take it's input from the tty?
solars has quit [Ping timeout: 264 seconds]
megha has quit [Ping timeout: 245 seconds]
baba has joined #ruby-lang
machuga|away has left #ruby-lang [#ruby-lang]
<eam>
MouseTheLuckyDog: what platform?
<MouseTheLuckyDog>
Linux
skade has quit [Quit: Computer has gone to sleep.]
ikrima has quit [Quit: Computer has gone to sleep.]
<eam>
should work fine
<eam>
what do you mean "fails to take its input?"
<MouseTheLuckyDog>
If your running on linux try it.
<eam>
yeah I did, it looks fine to me, what specific problem do you have?
<drbrain>
MouseTheLuckyDog: why don't you require 'io/console; $stdin.raw; $stdin.noecho
<drbrain>
?
<MouseTheLuckyDog>
The first time system is called irb acts like it was started from a the commandline. The second time it justs terminates like it got bad input.
idkazuma has quit [Remote host closed the connection]
setmeaway has quit [Ping timeout: 255 seconds]
<MouseTheLuckyDog>
Sorry I foget to mentionm. The problem only shows up if you press an escape sequence.
<eam>
which sequence?
<MouseTheLuckyDog>
Like a cursor key.
<eam>
those are multiple character sequences
<MouseTheLuckyDog>
Yeah.
<eam>
you're reading part of it, and the rest sits in the io buffer and the second irb reads it
voker57 has quit [Read error: Connection reset by peer]
<eam>
to protect against that, dump characters until the buffer is empty before going onto the second system()
<MouseTheLuckyDog>
drbrain. I never tried the noecho, did try raw or rather raw!
<drbrain>
MouseTheLuckyDog: they're cross-platform versions of system "stty ..."
<eam>
you need to read more than just one getc()
<eam>
io/console is a good idea but that's not the problem
<drbrain>
when I run the io/console version it appears to work fine for me
<eam>
drbrain: the key is "Sorry I foget to mentionm. The problem only shows up if you press an escape sequence."
<drbrain>
I pressed the up-arrow and it read "\e[A" and went to irb again
<drbrain>
↑ is an escape sequence, right?
<MouseTheLuckyDog>
drbrain, what is the opposite of $stdin.noecho?
<eam>
MouseTheLuckyDog: strace it, give us what read() sees
enebo has joined #ruby-lang
Guest83841 has joined #ruby-lang
richcollins has quit [Quit: richcollins]
pandy has quit [Remote host closed the connection]
cofin has quit [Quit: cofin]
mrfelix has quit [Quit: Computer has gone to sleep.]
<MouseTheLuckyDog>
eam: I put strace in both the first and the second and compared the reads. The last read is the only one that is different.
<MouseTheLuckyDog>
The first time: read(0, "1\n", 1024) = 2 and the the second time: ead(0, 0x7ff805a53000, 1024) = -1 EAGAIN (Resource temporarily unavailable)
<MouseTheLuckyDog>
s/ead/read/
<MouseTheLuckyDog>
drbrain: It's the C++ just reads input from stdin. I added stuff to record where in the code it is, and what the input it is getting is.