<drbrain>
erikh: if you have to pre-declare dependencies it might be better to run everything through tsort then run each item in order
<erikh>
drbrain: well, this is (get ready to laugh) actually going to be exposed via minitest
<drbrain>
you should be able get parallelism by handing off between groups
kurko_ has joined #ruby-lang
<erikh>
so tests A B and C all define a certain subset of common dependencies, I want the scheduler to recognize they are already "up" and not tear them down and create them again
<drbrain>
ah
kurko_ has quit [Client Quit]
<erikh>
I mean, I could re-tsort between each add, I suppose
<drbrain>
actually, that shouldn't matter
<drbrain>
"foo is already up, move to the next item"
<erikh>
right
<erikh>
my other concern is tests hanging because someone didn't set up dependencies right
saxy has joined #ruby-lang
<erikh>
e.g., where tsort would create a split brain more or less
<erikh>
I dunno. this is still very immature, I'll give it a think
<drbrain>
if you didn't connect your graph properly, then orphaned nodes would start up at the very beginning
<erikh>
damnit, why do you have to be so right and stuff
<drbrain>
they'd just be treated as roots
<erikh>
ok, i'll look at it after I clean up
<drbrain>
I can see how orphaned roots could cause problems, though
<drbrain>
… but you might be able to detect a failure after processing all the roots
topaz has joined #ruby-lang
saxy has quit [Ping timeout: 246 seconds]
qwerxy has quit [Quit: offski]
mporter has joined #ruby-lang
My_Hearing has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 264 seconds]
charliesome has joined #ruby-lang
mwjcomputing has joined #ruby-lang
toretore has quit [Quit: Leaving]
kurko_ has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
kurko_ has quit [Quit: Computer has gone to sleep.]
lcdhoffman has joined #ruby-lang
kurko_ has joined #ruby-lang
zomgbie has joined #ruby-lang
cosah has joined #ruby-lang
chessguy has joined #ruby-lang
thone_ has joined #ruby-lang
dedis3 has joined #ruby-lang
ddd has joined #ruby-lang
chimkan has joined #ruby-lang
zomgbie has quit [Ping timeout: 268 seconds]
chimkan has quit [Read error: Connection reset by peer]
methods has joined #ruby-lang
thone has quit [Ping timeout: 260 seconds]
chimkan has joined #ruby-lang
methods1 has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
methods1 has left #ruby-lang [#ruby-lang]
methods has quit [Ping timeout: 264 seconds]
dedis3 has quit [Remote host closed the connection]
CaptainJet has quit [Ping timeout: 252 seconds]
skaragianis has joined #ruby-lang
chimkan has quit [Read error: Connection reset by peer]
chimkan has joined #ruby-lang
flip_digits has joined #ruby-lang
Kingy has quit [Quit: Leaving]
chimkan has quit [Read error: Connection reset by peer]
<drbrain>
zzak: needs cleanup for commented-out stuff, but it looks good otherwise
gregmoreno has joined #ruby-lang
<zzak>
thanks, i dont think i really got it working right and it still needs some tests
* drbrain
nods
<zzak>
it was just returning a bunch of classes and methods
<zzak>
no real rhyme or reason
<ddd>
drbrain: at some time in the near future, would you be willing to review a couple gems I created for plausibility of stated purpose and code quality?
<ddd>
(figure the most you can do is ask, and the most that can happen is being told no :) )
mwjcomputing has quit [Ping timeout: 244 seconds]
<zzak>
drbrain: any suggestions on how to gather everything better?
<drbrain>
ddd: I can give it a shot
<zzak>
i think part of the problem, its gathering methods, classes, etc separately
<zzak>
so you could end up with a few different #each, but no way of knowing what they belong to
<drbrain>
zzak: rdoc/generator/json_index.rb does something similar
mporter has quit [Quit: This computer has gone to sleep]
<drbrain>
zzak: it's got a searchIndex and a longSearchIndex
<drbrain>
the former has #name, the latter #full_name
<drbrain>
so you could do similarity based on #name, but display #full_name when giving the list
<zzak>
nice
<drbrain>
… since you'd be working from the ri cache, it might be a little more complicated to make the association than that, since the objects aren't all loaded
<zzak>
right
<drbrain>
ddd: do you know about codeclimate.com?
<ddd>
drbrain: https://github.com/dtf-gems/dtf is the main umbrella gem. and the one mainly needing review. dtf-session is the one I'm currently working on, dtf-rvm is not started. dtf-skeleton is just the base layout repo for future gems going forward. so really its just dtf (which I think i've completed, thus the request for review) and dtf-session is in infancy but could probably be stand a bit of checking.
<ddd>
drbrain: yes, and each of those projects has codeclimate pages :)
<drbrain>
awesome
<drbrain>
ddd: anything in particular you want me to look at?
<drbrain>
ddd: randomly poking may not be useful to you
<ddd>
drbrain: http://dtf-gems.daviddwdowney.com is the mission statement for what this actually all is. dtf gem is my idea of how to accomplish that. (the 'plausibility of stated purpose checkup). as for the dtf gem itself, if the code looks clean, childish, or of good quality
<ddd>
just the first 2 paragraphs on the daviddwdowney.com link are all that really apply. the rest is just project format
<zzak>
i wonder if there is a code review community somewhere in rubyland
<drbrain>
#mendicant shares code reviews
<zzak>
are they still active?
<ddd>
basically trying to find people outside of myself to see if i'm accomplishing my goals. *I* can say to myself it looks good, but that doesn't mean anything if no one else can figure out what i'm doing :)
<ddd>
zzak: yeah I too wish there were community members that did code reviews. didn't know mendicant did reviews though.
<drbrain>
the IRC channel has lurkers
<drbrain>
and the mailing list is active too
<ddd>
oh cool!
<zzak>
ddd: it wasnt long ago people were scheduling office hours to do code reviews
<ddd>
even if no one ever actually uses dtf, i figure its a good idea of where my coding skills are, so a review would let *me* know if i've actually learned anything :)
<zzak>
you can even setup your own probably
<zzak>
theres also that code reading club, but im not sure what they're up to lately
wyhaines has joined #ruby-lang
<zzak>
"setup your own probably", meaning a review event with mendicant
<drbrain>
ddd: I've always found it difficult to maintain more than one branch
<ddd>
zzak: yeah, i'd gladly sign up for that. I'm so unsure of my current skill level that I seriously question my ability to provide listenable advice. thats another reason i'm asking someone i consider of a higher skill level than myself to review
<zzak>
your own community would be difficult
<zzak>
ddd: thats how you learn
<ddd>
yeah exactly. this is what i think i can do. did i do good on what i've done so far, and in either case of yes or no, what can i do to improve it?
<ddd>
zzak: I'm one of the members of that, they're reviewing thor right now.
<ddd>
its more a lets all look on how this actually works group
<zzak>
ddd: sweet, maybe ask them to review your gem?
<zzak>
its a possibility at least
<ddd>
no, they're more trying to learn known community used apps like sinatra, rails, thor, etc.
<ddd>
like an inside look type group
<zzak>
i think it wouldnt hurt to ask
<zzak>
you might get a few people to help, maybe not the whole group
<ddd>
many people don't know where in the actual code that sinatra starts, how it sets itself up, how it then handles requests etc
<ddd>
yeah good point
<zzak>
worth a shot
<ddd>
yep. most they can say is no
<zzak>
there are other communities you could ask as well, like reddit
<ddd>
drbrain: btw, yes, I know i drastically have to change/improve/fix the test where I'm actually making the system calls in order to generate the help checks. I so just do not have a better idea yet. (Which makes me think my implementation of the overall help system is robably wrong)
<ddd>
zzak: I so will not use reddit. to me reddit is a bunch of lets trash everything we can and get upvoted when we do it group
<zzak>
ddd: sometimes tho, the best way to learn and get reviews is by contributing to other peoples projects that already have an active community reviewing commits
<drbrain>
ddd: can you point me to the code? I haven't encountered it yet
zomgbie has joined #ruby-lang
<ddd>
drbrain: the help or the whole project?
<drbrain>
ddd: this part: "where I'm actually making the system calls in order to generate the help checks"
<ddd>
the reason I'm having difficulties finding a different way is because I'm using Trollop for the options and help system.
thinkdev_ has quit [Remote host closed the connection]
<ddd>
i haven't figured out how to build a test object without walking through Trollop, and haven't figured out how to walk through Trollop without actually calling it, in order *to* test it
My_Hearing has quit [Ping timeout: 246 seconds]
My_Hearing has joined #ruby-lang
zomgbie has quit [Ping timeout: 276 seconds]
kurko_ has quit [Client Quit]
<zzak>
down to 1 page of pull requests!
<ddd>
nice :)
madish has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121026125834]]
<drbrain>
ddd: I'd think for testing help_response you could call OptionParser#parse_cmds directly
lcdhoffman has joined #ruby-lang
<ddd>
lookin
<ddd>
g
<drbrain>
op = OptionParser.new; op.parse_cmds %w[create_user -h]
<drbrain>
ddd: also, line 15 of feature_steps.rb, I prefer @cmds.each |command, expected|
<ddd>
ahh, i think i didn't do it that way because initially I was messing with ruby's ARGV directly and then changed it to put it into arg
<ddd>
sec
mwjcomputing has joined #ruby-lang
<ddd>
yeah, definitely need to rewrite that. which means i might need to rewrite feature_Steps.rb L9-12 too
<ddd>
s/S/s/
KA_ has joined #ruby-lang
<ddd>
least he hasn't said its idiotic, childish, or just purely bad code yet, thats a good sign :)
stonerfish has joined #ruby-lang
<tubbo>
hey all..having some trouble installing ffi in my vendored gem directories
<tubbo>
like using bundler
<tubbo>
i can install vagrant fine with `gem install vagrant`, but using bundler installing ffi craps out
<tubbo>
i'm using 1.9.3-p286 installed from homebrew and bundler to manage my gems
<zzak>
you need to install libffi
<tubbo>
this is in a chef cookbooks dir, btw
<zzak>
homebrew probably
<tubbo>
nice :)
<zzak>
im on ubuntu, so idk
<zzak>
but we have libffi-dev
<zzak>
not sure what homebrew has
<tubbo>
yeah that seems to work
<ddd>
brew search ffi
<drbrain>
tubbo: I bet the ruby for `gem` uses GCC, but the `gem` under RVM uses clang
<ddd>
i too forget what brew has for that
<ddd>
drbrain: only if gcc-4.2 isn't found unless mpapis changed the ordering
<drbrain>
ddd: the ^~~~~~ makes me think clang, GCC 4.2 doesn't have those kinds of errors AFAIK
<ddd>
we were checking for gcc-4.2 off the hop and if that was found then use that over apple's new clang
<ddd>
sec
<tubbo>
i am not using rvm actually
<tubbo>
(sorry ddd)
<tubbo>
just bundler
<drbrain>
tubbo: oh, weird
<ddd>
tubbo: no need to apologize. I may have been part of the project, but I truly only care that you use what works best for you, not any single specific project.
<ddd>
so if rvm isn't it, thats perfectly fine
<tubbo>
it certainly was at one time
kurko_ has joined #ruby-lang
<tubbo>
but now i don't really need any other versions of ruby
diegoviola has joined #ruby-lang
<tubbo>
so i just want to use this one i installed from homebrew all the time, and then manage my gems w/bundler
<drbrain>
tubbo: since that was fixed two years ago, upgrading to a newer FFI should fix your problem
<tubbo>
hm, it's trying to load 0.6.3
<tubbo>
pretty old version
<ddd>
drbrain: were those few things mentioned about those feature lines the only thing you found 'off', or you still reviewing?
<tubbo>
alright there we go. had to force it @ 1.1.5
<drbrain>
ddd: I don't see a bunch of other stuff that stands out
<drbrain>
on code climate you don't have anything below a C which is much better than rdoc or rubygems
<drbrain>
ddd: so, code wise, I don't see anything particularly wrong
<tubbo>
ugh, now it can't load vagrant/cli
<tubbo>
god dammit
<tubbo>
chef is so hard
<drbrain>
tubbo: maybe the latest 0.x ffi would do it
<ddd>
cool. thank you for looking at it. you say nothing particularly wrong code wise. what do you think of the idea for its existence?
<tubbo>
this doesn't seem like an ffi problem
<tubbo>
ffi compiles now
<drbrain>
ddd: I like minitest, so I'm biased
<ddd>
got it :)
<tubbo>
i like minitest too but sometimes it's so hard to get it set up the way i want
<erikh>
drbrain: sorry for the late reply; this seems pretty stable so I think I'm just going to stick with it and flush out the rest of the interface for now
<zzak>
i think the age of the weekly new testing frameworks in ruby is past and most people stick with their guns
<erikh>
if there's breakage, I'll patch in the tsort stuff post-hoc
<tubbo>
compared to rspec
<ddd>
thanks for looking at it. least now i know the code itself is quality, and the implementation is decent, regardless of thoughts about the reasons for its existence. i needed an outside influence before i allowed myself to believe it was of quality value (the code)
<tubbo>
zzak: thank GOD. we really don't need more than 2
<erikh>
options are always good
<tubbo>
true
<zzak>
yes but there was that time when there was a new framework every week it seemed like
<erikh>
even if those options aren't popular, sometimes they bring ideas to the table that are really good, and get integrated into other systems
<erikh>
zzak: my aching hard disk
<drbrain>
erikh: yup!
<erikh>
so many 200 line files. what's a brother to do?
<zzak>
its good tho
<zzak>
sometimes if you have to work on legacy code
<zzak>
there were frameworks that were great then, just arent active anymore
<drbrain>
erikh: my average line count in rdoc is 513
<tubbo>
i think a while back there wasn't as big of a testing scope as there is now
<tubbo>
like when i started with rails no one was doing Selenium or regression testing
<tubbo>
there was no capybara (just webrat)
<drbrain>
sorry, missed markdown.rb, with markdown.rb, 843
<drbrain>
… which is 16367 lines by itself
phact has joined #ruby-lang
<erikh>
drbrain: clearly rdoc is bad software
<drbrain>
clearly
wyhaines has quit [Remote host closed the connection]
mwjcomputing has quit [Quit: Leaving]
<zzak>
-1 i keep separate handcrafted powerpoint presentations on every class i write
<ddd>
and you write those presentations in ed right?
<jashank>
o_O
<zzak>
ddd: actually they start out as pdf's then i use an online converter i found using google
<zzak>
its way better than rdoc could ever hope to be
<erikh>
yay, it's marshalling state between runs now
<erikh>
!!
<erikh>
I can start them all up in one run, and trash all them in the next
<ddd>
zzak: awesome! now you just need to refactor! :)
<zzak>
eek, i just murdered yutaka's name
phact has left #ruby-lang [#ruby-lang]
zomgbie has joined #ruby-lang
CaptainJet has joined #ruby-lang
<zzak>
drbrain: there's a few tickets for keiju, but they haven't been online for over a year..
<drbrain>
zzak: nice
<zzak>
should i reassign them?
<zzak>
(just tickets from github)
<drbrain>
I'd just put a ping on them
<zzak>
already done
<drbrain>
they'll probably get taken care of in the next week or so
<zzak>
for existing tickets in redmine, ive uploaded patches from github and closed pull request, reassigned if necessary
<zzak>
only 20 pull requests left
<zzak>
marc-andre and luis are helping too! :D
<zzak>
go go ruby core!
zomgbie has quit [Ping timeout: 252 seconds]
synthetix has joined #ruby-lang
<drbrain>
zzak: yeah, I think that's a perfect way to go about it
<zzak>
drbrain: is someone reviewing 1.8.7 tickets?
<drbrain>
zzak: if it's not a security fix it'll be rejected
<zzak>
ok, im willing to be security patch release time all those will get reviewed
<zzak>
willing to bet*
<drbrain>
zzak: there's some boilerplate around that you can close those tickets with if you want to go through them, but make sure they're fixed in trunk
swarley has quit [Remote host closed the connection]
<zzak>
i think ill leave that up to 1.8.7 maintainer, redmine says knu or shyouhei
<zzak>
ill just ping him, if anything it will be the last pull request open and someone should see it
<drbrain>
I bet it was a mistake
<zzak>
too much sake
brianpWins has joined #ruby-lang
dorei has quit []
lcdhoffman has quit [Quit: lcdhoffman]
dRbiG has quit [Ping timeout: 268 seconds]
phact has quit [Ping timeout: 246 seconds]
areil has joined #ruby-lang
dedis has joined #ruby-lang
dedis has quit [Excess Flood]
dedis has joined #ruby-lang
dedis has quit [Excess Flood]
ghanima has joined #ruby-lang
<ghanima>
I was wondering if I can ask your opinion... I am working with an HTML table I have pulled from nokogiri. The table is nested and classified in 3 ways. What I am trying to do is organize the results were each classification is in its own array(i think)... example [class1[entry0][element1, element2, element3]]
<ghanima>
is this the right apporach
mjio has joined #ruby-lang
blazes816 has quit [Quit: blazes816]
dedis has joined #ruby-lang
dedis has quit [Excess Flood]
rohit has joined #ruby-lang
kurko_ has quit [Ping timeout: 246 seconds]
rekky has joined #ruby-lang
zomgbie has joined #ruby-lang
kurko_ has joined #ruby-lang
saxy has joined #ruby-lang
dedis has joined #ruby-lang
dedis has quit [Excess Flood]
zomgbie has quit [Ping timeout: 255 seconds]
dedis has joined #ruby-lang
dedis has quit [Remote host closed the connection]
gregmore_ has joined #ruby-lang
saxy has quit [Remote host closed the connection]
saxy has joined #ruby-lang
<zzak>
woo, down to 2 open pull requests, that nobu 1 and a net/http patch in progress
gregmoreno has quit [Ping timeout: 265 seconds]
saxy has quit [Read error: Connection reset by peer]
andrewhl has quit [Remote host closed the connection]
saxy has joined #ruby-lang
<drbrain>
ghanima: I think { class1 => { entry0 => [elements] } } might be better (Hashes as the outer containers)
ryanlecompte has quit [Remote host closed the connection]
<drbrain>
ghanima: at least, if class1 and entry0 are names
<ghanima>
drbrain: thanks man that helps
ryanlecompte has joined #ruby-lang
iCharlie has quit [Quit: leaving]
CaptainJet has quit []
deltree_ has quit [Quit: ChatZilla 0.9.89 [Firefox 16.0.1/20121010144125]]
<zzak>
drbrain: is feedback considered 100%?
<drbrain>
on bugs.ruby-lang.org? no
<drbrain>
it means "if you don't respond in the next month or so it might get closed'
<drbrain>
maybe, I haven't seen many committers use % Done
dedis has joined #ruby-lang
<zzak>
same
<zzak>
i wonder if ruby doesn't need a CONTRIBUTING file for github pull requests, that encourages people to open tickets on redmine
<rohit>
Github should allow you to disable PR's for your repo
<drbrain>
rohit: ruby/ruby doesn't want to
<zzak>
yeh, PR's are good entry for new people
<zzak>
but redmine is preferred, as most committers dont monitor both
<zzak>
redmine just isn't very user-friendly
<zzak>
also, 5 hours later ive reviewed all the open pull-requests.. that took forever..
<rohit>
But pull requests aren't really looked at are they? I mean they aren't merged as-is. They are converted to diffs and posted on bugs.ruby-lang.org or committed manually by a ruby core member right?
<zzak>
right
<zzak>
they're good for discussion, and new people
<zzak>
there are committers who monitor pull requests and give feedback
<rohit>
This has probably been discussed before but just out of curiosity why isn't there a separate list for ruby-core discussions and ruby-issues? Having each comment on a ruby issue delivered as part of the ruby-core mailing list can be quite overwhelming :)
RantriX has joined #ruby-lang
<drbrain>
rohit: there's ruby-talk for general discussion
<zzak>
there is ruby-talk
<drbrain>
but I rather like the tight integration between bugs.ruby-lang.org and the mailing list
gjaldon has joined #ruby-lang
<zzak>
ditto
<drbrain>
it's easier to track progress when the discussion of a feature is tied to an issue
<zzak>
ruby-core notifications are just enough activity for me, any more and i go crazy, and any less and im bored
krz has joined #ruby-lang
<rohit>
Not talking about ruby-talk. Talking about separating the tight integration. I guess it's a good thing for those involved regularly with ruby internals :)
<zzak>
drbrain: ive been meaning to sign up for ruby-cvs
<drbrain>
zzak: I only occasionally read it
<zzak>
just for private discussion
<zzak>
ive gotten replies to my commits before
<drbrain>
when I need to figure out what happened it's much more useful than svn or git history
Nisstyre-laptop has joined #ruby-lang
<zzak>
yeah
stonerfish has quit [Quit: Leaving.]
<zzak>
the cvs mailing list must be tied to the ChangeLog well
datanoise has quit [Ping timeout: 276 seconds]
<zzak>
at least links committer email properly
<zzak>
because people have replied directly to commits ive made
<rohit>
Sorry for asking naive questions but are there any plans to migrate Ruby from svn to git soon?
<drbrain>
rohit: it's been discussed a few times, but no plans at present
<rohit>
drbrain, ok, thanks :)
<VGoff>
Is it because you can use git for doing doing things with CVS? So the urgency doesn't seem to be there, if there would be any urgency at all?
<drbrain>
VGoff: there's at least one committer that can't use git properly on windows
<VGoff>
I deal with people on Windows constantly, so I know how that is.
<rohit>
Ruby committers work on windows? Cool. Last month at the local user group meetup, there were a few students so we started an ad-hoc walkthrough Ruby and they started downloading Ruby for Windows installer and I'm like OMG things are going to break but it worked perfectly well :) (I'm boxed in linux world)
dr_bob has quit [Read error: Connection reset by peer]
gjaldon has joined #ruby-lang
KA_ has quit [Quit: KA_]
shtirlic has joined #ruby-lang
mfn has quit [Quit: WeeChat 0.3.2]
mfn has joined #ruby-lang
aetcore has quit [Remote host closed the connection]
chimkan has joined #ruby-lang
workmad3 has joined #ruby-lang
aetcore has joined #ruby-lang
diegovio1a has joined #ruby-lang
JohnBat26 has joined #ruby-lang
diegoviola has quit [Ping timeout: 260 seconds]
diegovio1a is now known as diegoviola
rolfb has joined #ruby-lang
cosah has quit [Ping timeout: 246 seconds]
cosah has joined #ruby-lang
workmad3 has quit [Ping timeout: 245 seconds]
cantonic has joined #ruby-lang
chimkan has quit [Read error: Connection reset by peer]
<yorickpeterse>
Morning
chimkan has joined #ruby-lang
mytrile has joined #ruby-lang
shtirlic has quit [Remote host closed the connection]
<rolfb>
morning
RantriX has quit [Remote host closed the connection]
chimkan has quit [Client Quit]
fuzzy8balls has joined #ruby-lang
dr_bob has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
gsav has joined #ruby-lang
cosah has quit [Ping timeout: 246 seconds]
knu has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
agarcia has joined #ruby-lang
knu has joined #ruby-lang
saxy has quit [Remote host closed the connection]
saxy has joined #ruby-lang
saxy_ has joined #ruby-lang
saxy has quit [Read error: Connection reset by peer]
KA_ has joined #ruby-lang
chendo_ has quit [Ping timeout: 260 seconds]
qwerxy has joined #ruby-lang
qwerxy has quit [Client Quit]
ttilley has quit [Quit: ttilley]
chendo_ has joined #ruby-lang
jxie has joined #ruby-lang
fsvehla has quit [Quit: fsvehla]
JohnBat26 has quit [Read error: Operation timed out]
saxy_ has quit [Remote host closed the connection]
JohnBat26 has joined #ruby-lang
saxy has joined #ruby-lang
<hakunin>
Curious if there are simple ways of taking the stderr output of some "shelled-out" command and turning it into a ruby exception. Or does it have to be done manually?
<yorickpeterse>
Ruby expression as in?
<hakunin>
yorickpeterse: exception
<yorickpeterse>
Oh, I read expression
<yorickpeterse>
err, you could use Open3 for this
<hakunin>
so manually :)
<yorickpeterse>
yes
saxy has quit [Ping timeout: 240 seconds]
<hakunin>
i was imagining something akin to system (which returns false on non-zero exit) but with extra sauce for taking the external error more "personally"
chendo_ has quit [Ping timeout: 246 seconds]
JohnBat26 has quit [Ping timeout: 252 seconds]
vlad_starkov has quit [Ping timeout: 264 seconds]
chendo_ has joined #ruby-lang
<hakunin>
might be a good microgem idea, i have a whole bunch of them piling up from this thing i'm working on. thin image_magick dsl with convenient piping, lazy tempfiles, and now irritable shell-outs :)
wallerdev has quit [Quit: wallerdev]
<hakunin>
thin, lazy, and irritable... fun bunch
<hakunin>
all good things in programs, bad in humans
rue|w has joined #ruby-lang
gnufied has joined #ruby-lang
dc5ala has joined #ruby-lang
<erikh>
I thought about adding | to String and IO to emulate piping
<erikh>
never really got around to it
<hakunin>
erikh: i think there' a project that does it
<erikh>
been a while since I've had to deal with it
zomgbie_ has joined #ruby-lang
JohnBat26 has joined #ruby-lang
<hakunin>
erikh: these bloated libs are more trouble than they're worth imo. I wrote a tiny wrapper that assembles strings via a thin block-based dsl, it reads and works great.
zomgbie has quit [Ping timeout: 260 seconds]
<hakunin>
for my purpose of creating complex imagemagick-based renderers it works wonders for readability, yet relatability to IM cli
slaytanic has quit [Read error: Connection reset by peer]
slaytanic has joined #ruby-lang
robotmay has joined #ruby-lang
fsvehla has joined #ruby-lang
vlad_starkov has joined #ruby-lang
<erikh>
dunno, I found that there's a pretty significant performance difference between telling magick to run all these things sequentially at once and then shit out an image, then having it shit out an image between each step
mytrile has quit [Remote host closed the connection]
mytrile has joined #ruby-lang
mytrile_ has joined #ruby-lang
mytrile has quit [Read error: Connection reset by peer]
sepp2k has joined #ruby-lang
zomgbie_ has quit [Ping timeout: 245 seconds]
aetcore has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
fsvehla has quit [Read error: Connection reset by peer]
<erikh>
holy wow, it's almost 2am
<andrewvos>
erikh: You never leave
fsvehla has joined #ruby-lang
qwerxy has joined #ruby-lang
<hakunin>
erikh: that's a serious concern. will have to address it. as of now, way too much actual IM functionality to write, and learning how to jam things on one command is a pain, can't afford just yet...
bastilian has joined #ruby-lang
workmad3 has joined #ruby-lang
<yorickpeterse>
whitequark: I owe you a beer. That little suggestion of you to write a helper for generating AST nodes (the `s(:string, 'foo')` bit may have just saved me a day or two worth of work
<yorickpeterse>
Sadly Ripper is the only decent parser atm where I don't have to spend time making the parser itself work with new Ruby syntax features and the likes
<yorickpeterse>
Having said that I haven't spent a whole lot of time looking at ruby_parser
<zenspider>
yorickpeterse: how so?
<yorickpeterse>
whitequark: does this support arrays as arguments?
<whitequark>
yorickpeterse: indeed
<yorickpeterse>
nice
<whitequark>
library code should not needlessly restrict users
<zenspider>
ripper is also not decent for many of the reasons that whitequark has pointed out.
<whitequark>
even if I don't use a certain feature, that doesn't mean nobody can
<zenspider>
ruby19 -rripper -rpp -e "pp Ripper.sexp \"I'm a little teapot\""
Axsuul has quit [Ping timeout: 255 seconds]
<yorickpeterse>
zenspider: Yes, Ripper has quite a few downsides and I don't plan on using it forever. However, for the time being it saves me quite a bit of time as I don't have to worry about it support syntax feature X
<yorickpeterse>
Nor do I have to wait for developer X to implement it
fsvehla has quit [Read error: Connection reset by peer]
<yorickpeterse>
If I want to support jruby/rbx for my linter I'll have to move away but I haven't really found something that works cross platform and isn't slow as shit
justinram has joined #ruby-lang
<yorickpeterse>
I also *require* line numbers to be correct, though ironically Ripper gets this wrong sometimes as well
<whitequark>
yorickpeterse: I should point out that I use ruby_parser while developing a Ruby implementation and it's indeed good enough for that
<zenspider>
slow as shit. thanks.
<whitequark>
well, if "2x slower than MRI" is "slow as shit" then you are probably using the wrong language :)
fsvehla has joined #ruby-lang
<zenspider>
well... assuming you make something people want to use.... things like metric-fu and code climate all want to use these tools in the same process. don't overlap with my #s
<yorickpeterse>
zenspider: that wasn't directly targeted at ruby_parser
<yorickpeterse>
it's just a general requirement I have
<zenspider>
just indirectly
<yorickpeterse>
whitequark: Hmm
<whitequark>
zenspider: my one should be explicitly included as a module. I don't pollute global namespace
<yorickpeterse>
Wait, ruby_parser's s() is global?
<whitequark>
yup
<zenspider>
sure is
<whitequark>
I dislike that
<yorickpeterse>
Hrmpf, that's a bit of a no-no
<yorickpeterse>
For tests it's fine but outside of that I'm not too happy with that
<yorickpeterse>
I suppose that if I'm going to rewrite this AST I might as well look at ruby_parser
<yorickpeterse>
zenspider: does ruby_parser work on rbx/jruby?
<zenspider>
of course
<zenspider>
rbx used to use ruby_parser as its parser
<yorickpeterse>
Does it handle the Ruby 2.0 named parameters, or are there any plans for it?
<whitequark>
zenspider: wait what?!
<whitequark>
that's kind of nice, but why did they abandon it?
RantriX has joined #ruby-lang
<zenspider>
whitequark / yorickpeterse : I don't care if you don't like it... you're about 8-9 years late to the game on this
<yorickpeterse>
Eh?
<zenspider>
whitequark: I can't answer your question.
<yorickpeterse>
Any reason for that not being s(:const, :Foo), s(:const, :Bar)?
<yorickpeterse>
Last I need is more inconsistency in the output, Ripper already has plenty of that
<zenspider>
yorickpeterse: I don't support ruby 2.0 yet. it's not even finalized. I'll support it when someone contributes it or when I get around to it, but I won't get around to it before it is final
<whitequark>
zenspider: I'd have appreciated that reply in the issue I have created.
<zenspider>
that's not inconsistent, that's what ruby is doing internally.
<zenspider>
Foo::Bar isn't 2 consts sitting next to each other.
<whitequark>
yorickpeterse: yeah, you're misunderstanding how ASTs work here
<zenspider>
Foo; Bar is
<whitequark>
the nesting is inherent
<whitequark>
think of how a naïve, AST-walking interpreter could evaluate that expression
<zenspider>
and don't use Ruby19Parser unless you have good reason to
<zenspider>
or wait... you're not expecting it to work across, are you?
<zenspider>
tho... that may be doable
<zenspider>
it could have bad repercussions ... I'll have to mull
mytrile has quit [Remote host closed the connection]
<whitequark>
zenspider: personally I don't care about 1.8 at all
<zenspider>
no, that's NOT what it is returning.... read it again
<whitequark>
so I just use Ruby19Parser and it's fine
fsvehla has quit [Read error: Connection reset by peer]
<whitequark>
yorickpeterse: Ripper is indeed correct, it basically returns the same nested structure
<whitequark>
the semantics is identical, the presentation differs a bit
<zenspider>
well... it differs painfully :P
<zenspider>
so many [['s in ripper... :(
<yorickpeterse>
The structure is different, what I meant was why RubyParser doesn't return another s() for the second segment
<yorickpeterse>
instead it just returns a symbol itself
<yorickpeterse>
which strips out the column number for it, which is useful for analysis
<whitequark>
Foo:: \\\nBar ?
<whitequark>
err
<yorickpeterse>
RubyParser.new.parse('Foo::Bar')[2].class # => Symbol
<whitequark>
technically you can write that, but I doubt it's actually useful
<yorickpeterse>
I expected that to be a Sexp
fsvehla has joined #ruby-lang
<yorickpeterse>
The reason I'd want that is so that you actually have the column number available when checking if that particular part of the path exists
<yorickpeterse>
So you can say something like "Undefined constant Bar at column 6"
<whitequark>
yorickpeterse: RP does not report column numbers at all
<yorickpeterse>
oh?
<yorickpeterse>
Well, there goes my reason to use it :)
<zenspider>
this is beyond annoying. have fun with that.
<zenspider>
later
<yorickpeterse>
zenspider: you're not particulary open to other people's opinions/discoveries are you?
vlad_starkov has joined #ruby-lang
<zenspider>
oh... is THAT what this is? huh...
<yorickpeterse>
and I think you just prove my point. Either way, as nice as ruby_parser looks I'm afraid I won't be using it if it doesn't contain any information on column numbers since I have to have that information available.
<yorickpeterse>
There's no point in saying "Undefined variable foo on line 1, column 0" when it's on column 246
<yorickpeterse>
Might as well say "Undefined variable somewhere but I don't know where"
gnufied has quit [Quit: Leaving.]
<whitequark>
he has a point. I'd like to see column numbers as well, but I'm for some reason afraid that this won't happen in foreseeable future.
vlad_starkov has quit [Ping timeout: 260 seconds]
<yorickpeterse>
whitequark: did your melbourne patch ever got accepted?
<yorickpeterse>
* get
<whitequark>
yorickpeterse: it is "delayed"
<yorickpeterse>
Oh?
<whitequark>
which, as far as I understand it, means that the author doesn't give a fuck.
<whitequark>
maybe I should just publish it as a gem with some new name.
<yorickpeterse>
Any particular reason they delayed it?
* whitequark
wonders why github is so slow, as well as the rest of overseas internet
<banisterfiend>
whitequark: bugt it's currently the only pure ruby parser that can reliably parse all 1.9 code, no?
<banisterfiend>
but*
<whitequark>
banisterfiend: I'm fine with 98.7% (or how much zenspider has) and actually understandable source code
<whitequark>
I don't get why everyone hates yacc.
<whitequark>
yacc/racc is pretty much the only way to make a high-performance parser in Ruby
<whitequark>
parslet? treetop? pft. slow as shit, and also memory hogs.
<whitequark>
I've gone through every single parsing library and they're all cool, as in hipster cool, and also absolutely unusable when you need to parse megabytes of text.
<whitequark>
look at the code it generates
<whitequark>
if @@ref_83===@stack.last #RubyLexer::KeywordToken & -{, :ident=>/^(when|else|end)$/, , , }
slyphon has quit [Read error: Connection reset by peer]
svyatov has joined #ruby-lang
asaaki has joined #ruby-lang
FiXato has joined #ruby-lang
asaaki has quit [Max SendQ exceeded]
asaaki has joined #ruby-lang
asaaki has quit [Max SendQ exceeded]
saxy has joined #ruby-lang
asaaki has joined #ruby-lang
asaaki has quit [Excess Flood]
svyatov has quit [Client Quit]
qwerxy has joined #ruby-lang
ground has quit [Quit: Bye]
mistym_ has quit [Remote host closed the connection]
slyphon has joined #ruby-lang
stardiviner has joined #ruby-lang
wyhaines has quit [Ping timeout: 248 seconds]
wyhaines has joined #ruby-lang
richardjapenga has quit [Quit: Leaving]
elight has joined #ruby-lang
saxy has quit [Remote host closed the connection]
Uranio has joined #ruby-lang
wyhaines has quit [Ping timeout: 252 seconds]
elight has quit [Remote host closed the connection]
elight has joined #ruby-lang
asaaki has joined #ruby-lang
headius has joined #ruby-lang
amaya_ has quit [Quit: ChatZilla 0.9.88.2 [Firefox 16.0.2/20121024073032]]
qwerxy has quit [Quit: offski]
saxy has joined #ruby-lang
<zzak>
good morning!
slyphon has quit [Ping timeout: 245 seconds]
<zzak>
whitequark: have you used racc much?
areil has quit [Remote host closed the connection]
esad has quit [Quit: Computer has gone to sleep.]
qwerxy has joined #ruby-lang
apeiros_ has joined #ruby-lang
saxy has quit [Remote host closed the connection]
saxy has joined #ruby-lang
andrewhl has joined #ruby-lang
fletch` has joined #ruby-lang
leopard_me has joined #ruby-lang
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby-lang
saxy has quit [Ping timeout: 240 seconds]
methods has joined #ruby-lang
hakunin has quit [Ping timeout: 240 seconds]
saxy has joined #ruby-lang
esad has joined #ruby-lang
rue|w has quit [Remote host closed the connection]
madish has joined #ruby-lang
saxy has quit [Remote host closed the connection]
esad has quit [Client Quit]
GarethAdams has quit [Remote host closed the connection]
GarethAdams|Work has joined #ruby-lang
methods has quit [Read error: Connection reset by peer]
slyphon has joined #ruby-lang
methods has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
gsav has joined #ruby-lang
chimkan has joined #ruby-lang
saxy has joined #ruby-lang
gsav has quit [Client Quit]
svyatov has joined #ruby-lang
<whitequark>
zzak: yes
<whitequark>
both racc and other parsers, yes. mainly treetop from the PEG camp, but they're pretty much all the same.
<whitequark>
I've used racc with ragel-generated lexer btw.
saxy has quit [Remote host closed the connection]
synthetix has joined #ruby-lang
<zzak>
whitequark: do you know anything about the racc parser debugging methods? ie: racc_shift, racc_reduce, racc_accept, racc_e_pop, racc_next_state, etc etc
Croms has quit [Read error: Connection reset by peer]
kaliya has joined #ruby-lang
<mixandgo>
methods: it's doing some calculations on the value
rippa has joined #ruby-lang
leopard_me has quit [Quit: Computer has gone to sleep.]
<mixandgo>
methods: I was wondering if there is a better way to reference the class method or if it should be defined differently
<zzak>
whitequark: i'd like to get a patch together to better explain debugging with racc, would you want to help?
kith_ is now known as kith
<methods>
you could do something like @options = {} and then @options[k]=v instead of instance_variable_set .. or if you didn't have to parse you could just @options = { some defaults }.merge( args.first ) if you want
<whitequark>
zzak: sure! correctly using these methods could provide valuable features, e.g. not only "unexpected tWHATEVER" but "unexpected tWHATEVER, expecting tCOLON2 or tCOMMA"
GarethAdams|Work has quit [Changing host]
GarethAdams|Work has joined #ruby-lang
GarethAdams|Work is now known as GarethAdams
<methods>
mixandgo: I'm not sure
<whitequark>
racc is actually a very simple finite state machine
<whitequark>
zzak: the inner workings of that machine are explained in the Bison docs
<whitequark>
have you read it?
<zzak>
i have them bookmarked, but not read through them yet
<kaliya>
Hi. I installed MRI 1.9.3 through RVM on a new Debian system and cucumber 1.2.1. When I run cucumber on a .feature with no step definitions, the output doesn't show me the usual tips on how to create steps... Uhh I'm wandering what I could have done wrong. Tips? TIA :)
<whitequark>
zzak: highly recommend
<whitequark>
in fact I wasn't able to write working code for racc until I read them
<whitequark>
there is some really tricky stuff with S/R and R/R conflicts
<whitequark>
imo we need *less* stuff in stdlib, not more.
<whitequark>
definitely not SOAP, for example.
<whitequark>
thankfully it was evicted in 1.9 transition or something like that
apeiros_ has quit [Remote host closed the connection]
<whitequark>
otoh I'm not sure why ruby-debug is a gem. it certainly should have been placed in stdlib.
Guest601 has left #ruby-lang [#ruby-lang]
agarcia has quit [Quit: Konversation terminated!]
Rhawb has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
<tockitj_>
whitequark, also more documentation :)
esad has joined #ruby-lang
Rhawb347 has joined #ruby-lang
Rhawb has left #ruby-lang [#ruby-lang]
krohrbaugh has quit [Quit: Leaving.]
vlad_starkov has quit [Ping timeout: 240 seconds]
Uranio has quit [Quit: WeeChat 0.3.8]
<whitequark>
wait, do we have _three_ option parsing libs?
<whitequark>
getopt, getoptlong and optparse?
saxy has joined #ruby-lang
<soahccc>
Is there a autoloader library available for ruby? I've made one but it has a annoying issue which I can't resolve
Rhawb347 has quit [Client Quit]
Rhawb has joined #ruby-lang
<Rhawb>
Hello. I was wondering if it was possible to overload the "=" operator. My reading has told me no, but I was hoping it was somehow possible.
<whitequark>
soahccc: Kernel#autoload
<whitequark>
Rhawb: there is no = operator
<soahccc>
whitequark: This is lazyloading no autoloading
<soahccc>
Rhawb: You can define setter methods but generally overriding = isn't possible I think
<whitequark>
soahccc: define autoloading then
<whitequark>
Dir["lib/**/*.rb"] { |it| require it } ?
<whitequark>
*Dir[].each
<Rhawb>
Thank you. That is what I had concluded as well. And what do you mean = is not an operator. Isn't it an assignment operator? Or do you just mean its technically a method?
<soahccc>
More or less what Rails is capable of. I couldn't find a standalone version though
<soahccc>
Rhawb: Model.property = "foo" will call Model#property=
ryanlecompte has quit [Remote host closed the connection]
bastilian has quit [Quit: Leaving...]
zomgbie_ has quit [Ping timeout: 265 seconds]
jtoy has joined #ruby-lang
rue|w has joined #ruby-lang
jtoy has quit [Remote host closed the connection]
jtoy has joined #ruby-lang
cyri_ has joined #ruby-lang
cantonic has joined #ruby-lang
<jtoy>
how would you guys process the lines in a large file in groups, the file typically has 300k+ lines ? I basically want to do File.open(path).each_slice(100).{|lines| ……. }
yxhuvud2 has joined #ruby-lang
saxy has quit [Remote host closed the connection]
rekky has joined #ruby-lang
diegoviola has quit [Ping timeout: 252 seconds]
rue|w has quit [Ping timeout: 255 seconds]
<zzak>
whitequark: words
saxy has joined #ruby-lang
cyri_ has quit [Client Quit]
yxhuvud has quit [Ping timeout: 246 seconds]
rekky has quit [Client Quit]
cyri_ has joined #ruby-lang
saxy has quit [Ping timeout: 240 seconds]
justinram has quit [Read error: Connection reset by peer]
elight has quit [Remote host closed the connection]
datanoise has quit [Ping timeout: 252 seconds]
dasil003 has joined #ruby-lang
davidbalber|away is now known as davidbalbert
sailias has joined #ruby-lang
bastilian has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
qwerxy has joined #ruby-lang
heftig has joined #ruby-lang
fletch` has quit []
pkrnj has quit [Quit: Computer has gone to sleep.]
havenn has joined #ruby-lang
mistym is now known as mistym_lunch
rsl has joined #ruby-lang
bastilian has quit [Client Quit]
Mon_Ouie has joined #ruby-lang
krohrbaugh has joined #ruby-lang
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
esad has quit [Quit: Computer has gone to sleep.]
zomgbie has joined #ruby-lang
esad has joined #ruby-lang
zomgbie has quit [Ping timeout: 240 seconds]
qwerxy has quit [Quit: offski]
leopard_me has quit [Quit: Computer has gone to sleep.]
synthetix has quit [Remote host closed the connection]
datanoise has joined #ruby-lang
zomgbie has joined #ruby-lang
wyhaines has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
datanoise has quit [Ping timeout: 256 seconds]
qwerxy has joined #ruby-lang
pkrnj has joined #ruby-lang
saxy has joined #ruby-lang
mistym has joined #ruby-lang
rekky has quit [Quit: rekky]
rekky has joined #ruby-lang
apeiros_ has joined #ruby-lang
qwerxy has quit [Client Quit]
Nisstyre has joined #ruby-lang
<drbrain>
whitequark: I think we used to have four option parsing libs
saxy has quit [Remote host closed the connection]
krohrbaugh1 has quit [Quit: Leaving.]
<chris2>
certainly more than that
saxy has joined #ruby-lang
zomgbie has quit [Ping timeout: 256 seconds]
krohrbaugh has joined #ruby-lang
zomgbie has joined #ruby-lang
<drbrain>
chris2: I mean, in stdlib
vlad_starkov has quit [Ping timeout: 246 seconds]
<chris2>
i only remember 2. well, 3 with -s
saxy has quit [Ping timeout: 240 seconds]
<chris2>
hm, getopts vs getoptlong
<eam>
optparse
<chris2>
and optparse, yes
qwerxy has joined #ruby-lang
<soahccc>
Is it somehow possible to get the "full" constant name when undefined? I'm afraid that it is not because everything is an object and therefore in Foo::Bar Bar needs Foo defined already... I despair!
havenn has quit [Remote host closed the connection]
<drbrain>
as if there were an implied () around it
<Mon_Ouie>
Maybe .{8}*? means any amount of groups of 8 characters, non-greedy?
<drbrain>
if I change it to ((?:.{8})*?) my tests still pass
<drbrain>
and macruby stops complaining
<erikh>
8 characters, match 0 or more times, non-greedy
<banisterfiend>
Mon_Ouie: can you write me a regex
<drbrain>
erikh: yeah
lcdhoffman has joined #ruby-lang
<Mon_Ouie>
banisterfiend: What are you trying to match?
<mars777>
If anybody knows how to pass values from collected to ruby , and from ruby to collect d, or something like that please message me.
<banisterfiend>
Mon_Ouie: pipe implementation currently using this: PIPE = /(?<=[^'"])(?<=.)*?\|(?=.*)(?<=[^'"])/
<banisterfiend>
Mon_Ouie: it breaks up a command line into separate commands, but is careful not to confuse "' |" or '|' for a pipe
<banisterfiend>
Mon_Ouie: but i want to allow this structure too: command1 arg | command2 arg | { |a| a.ruby! } | command3 arg
<banisterfiend>
Mon_Ouie: so i want to be able to interpolate blocks into the pipe chain
<banisterfiend>
so i need to support { |a| } (where |a| can exist or not, and have multiple args, like ordinary blocks)
cyri_ has joined #ruby-lang
<Mon_Ouie>
I wouldn't use a regex for that (not for all of it, at least)
topaz has quit [Changing host]
topaz has joined #ruby-lang
<banisterfiend>
Mon_Ouie: well aside from the { |a| } syntax it's an enough easy regex, so it's a pity if i have to change the whole strategy just to support { |a| }, but you're saying i should write a proper parser ?
<Mon_Ouie>
The parsing part wouldn't do much really, mostly a tokenizer (and inserting a Ruby tokenizer in between)
<Mon_Ouie>
If you allow curly braces to be used within the block, a regexp won't be able to detect the end correctly
<bougyman>
because you cannot arbitrarily match nested group tags with regexp.
qwerxy has joined #ruby-lang
<bougyman>
but you can with oniguruma
<Mon_Ouie>
(Well, Oniguruma can do that, but it would be *very* ugly)
<bougyman>
hahah
<bougyman>
exactly.
<bougyman>
and very inefficient.
CapnKernul has joined #ruby-lang
vlad_sta_ has joined #ruby-lang
<banisterfiend>
Mon_Ouie: ah ok, so i can find the location of the first '{' and then process that string until i have a complete ruby expression, then from that point go back to the normal split on |
vlad_starkov has quit [Ping timeout: 246 seconds]
<Mon_Ouie>
Yes, though I'd rather try to only detect '{' immediately after '|' (except for whitespace)
<banisterfiend>
Mon_Ouie: Yeah
<banisterfiend>
Mon_Ouie: k00, thx for the chat
<Harzilein>
hmm
qwerxy has quit [Quit: offski]
<Harzilein>
a char class with '|', '\', '-', ' ' in it is a bit unwieldy in a regex, is there an easy way i can encapsulate it in a variable?
<erikh>
var = %r![|\ -]!
<Harzilein>
erikh: i was thinking of making it from an array of characters
<erikh>
to overcomplicate it?
cyri_ has quit [Quit: cyri_]
<erikh>
oh, you'll need to double the \
<Harzilein>
exactly, and i need to make sure to put the - at the end
<Harzilein>
exactly what i meant with unwieldy
<erikh>
so just write it out into a var
<erikh>
what if you want to add [ or ] ?
jordan_ has joined #ruby-lang
gregmore_ has quit [Remote host closed the connection]
<erikh>
are you going to write a conditional escaping system that only works with character classes?
<erikh>
I'm still not sure why not typing it out directly is easier in any way
vlad_starkov has joined #ruby-lang
kurko_ has joined #ruby-lang
<Harzilein>
i like to name stuff ;)
<erikh>
TREE_REGEX = "string_of_regex"
gregmoreno has quit [Ping timeout: 246 seconds]
sepp2k1 has quit [Read error: Connection reset by peer]
<Harzilein>
doesn't work though, needs another level of escaping
<erikh>
not if you add it there
<erikh>
or use %r
<erikh>
etc
<Harzilein>
TREE_REGEX = "[|\\\\ -]"
<Harzilein>
l.gsub(/^#{TREE_REGEX}*/) do |m|
<Harzilein>
"#{m.length} "
<Harzilein>
end
<Harzilein>
looks horrible
<erikh>
%r![|\\ -]!
<Harzilein>
TREE_REGEX = %r,[|\\ -],
<Harzilein>
looks slightly less horrible, but i guess i win nothing with chars there
<Harzilein>
+only
jtoy has quit [Quit: jtoy]
<erikh>
yeah, nothing but easier to read code and a faster execution time
kurko_ has quit [Ping timeout: 252 seconds]
<Harzilein>
?
MaddinXx_ has quit [Remote host closed the connection]
kurko_ has joined #ruby-lang
<Harzilein>
so how would you strip any of a number of prefix characters from an array of strings, while replacing with the length of the prefix?
fsvehla has joined #ruby-lang
<Harzilein>
oh well, i'll use your regex now, feel free to explain how it would end up more readable and faster w/ chars.
<erikh>
sure, because you're not constructing the regexp dynamically
<erikh>
it's more readable because people (should) know what a regex is
<erikh>
and therefore there's less code to understand
CapnKernul has quit [Quit: Leaving...]
<erikh>
the alternative is that to figure out why a regex composed of characters I passed it was broken, I would have to unwind your regexp creation magic to get at the actual regexp, which is all I really give a shit about
<erikh>
and then, i'd have to fix your magic to avoid breaking compatibility
<erikh>
all this when a regexp would solve the problem just as sufficiently.
<Harzilein>
is there something nice instead of gsub with a block to strip the prefix and return a tuple of the prefix length and the remaining string? the idea is that without a capture there is less _regex_ to understand
thisirs has quit [Remote host closed the connection]
bluepojo has joined #ruby-lang
Nisstyre has joined #ruby-lang
aetcore has joined #ruby-lang
Hakon has joined #ruby-lang
swarley has joined #ruby-lang
KA_ has quit [Quit: KA_]
blacktulip has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
KA_ has joined #ruby-lang
qwerxy has joined #ruby-lang
BlaXpirit has quit [Quit: Quit Konversation]
KA_ has quit [Client Quit]
KA_ has joined #ruby-lang
dorei has joined #ruby-lang
lcdhoffman has quit [Quit: lcdhoffman]
aetcore has quit []
benanne has quit [Quit: kbai]
emptyflask has joined #ruby-lang
workmad3 has joined #ruby-lang
datanoise has quit [Ping timeout: 264 seconds]
zomgbie has joined #ruby-lang
R_Macy has quit []
fsvehla has quit [Quit: fsvehla]
zomgbie has quit [Ping timeout: 260 seconds]
havenn_ has quit [Remote host closed the connection]
havenn has joined #ruby-lang
havenn_ has joined #ruby-lang
solars has quit [Ping timeout: 260 seconds]
havenn has quit [Ping timeout: 252 seconds]
esad has quit [Quit: Computer has gone to sleep.]
esad has joined #ruby-lang
fsvehla has joined #ruby-lang
headius has quit [Quit: headius]
gsav_ has joined #ruby-lang
outoftime has quit [Quit: Leaving]
pkrnj has quit [Quit: Computer has gone to sleep.]
krohrbaugh has quit [Quit: Leaving.]
datanoise has joined #ruby-lang
chimkan has joined #ruby-lang
gsav has quit [Ping timeout: 244 seconds]
kentos has quit [Quit: Leaving]
gsav_ has quit [Ping timeout: 260 seconds]
mistym has quit [Remote host closed the connection]
qwerxy has quit [Quit: offski]
Averna has joined #ruby-lang
kurko_ has quit [Ping timeout: 260 seconds]
<zenspider>
rawr
nazty has quit [Ping timeout: 252 seconds]
kurko_ has joined #ruby-lang
lcdhoffman has joined #ruby-lang
swarley has quit [Ping timeout: 260 seconds]
nazty has joined #ruby-lang
datanoise has quit [Ping timeout: 244 seconds]
swarley has joined #ruby-lang
<erikh>
meow?
emptyflask has quit [Remote host closed the connection]
<erikh>
drbrain: what you should do when you fix that is write a 3 page blog post about how bad stringscanner is and the trials you went through fixing it
<erikh>
make sure to swear at ruby-core a lot while you do it
jtoy has joined #ruby-lang
<erikh>
cause that's how problems get solved
fsvehla has quit [Quit: fsvehla]
<drbrain>
erikh: obvs
jtoy has quit [Client Quit]
fsvehla has joined #ruby-lang
KA_ has quit [Quit: KA_]
<zzak>
ruby-core actualy solves anything?
davidbalber|away is now known as davidbalbert
esad has quit [Ping timeout: 255 seconds]
KA_ has joined #ruby-lang
esad has joined #ruby-lang
<manveru>
sometimes they reluctantly allow other people to fix their mess :)
BigO has quit [Remote host closed the connection]
methods has left #ruby-lang [#ruby-lang]
<firefux>
just read some blog about refinements, is going to make it to Ruby 2.0?
<firefux>
+it
davidbalbert is now known as davidbalber|away
justinram has quit [Remote host closed the connection]
<apeiros_>
manveru: only sometimes
<apeiros_>
there's still a stringscanner patch in redmine which I submitted
<apeiros_>
like… 3y ago?
<apeiros_>
simple things it adds… capture related stuff… so you don't have to abuse $~