<zenspider>
maybe I'm out of it because I've been nose down all day thinking about diffing tree based structures... but ... have we talked about this before?
rwk1 has joined #ruby-lang
<zzak>
not really, just nice to have MiniTest::Spec::DSL
<zenspider>
ah. right. THAT was the context I was missing
<zzak>
:D
Averna has joined #ruby-lang
spuk has joined #ruby-lang
mrsolo has quit [Quit: Leaving]
mistym has quit [Remote host closed the connection]
rwk1 has quit [Ping timeout: 245 seconds]
sepp2k has quit [Remote host closed the connection]
idkazuma has quit [Remote host closed the connection]
ykk has joined #ruby-lang
jMCg has quit [Ping timeout: 260 seconds]
ros3bud has joined #ruby-lang
ykk has quit [Ping timeout: 272 seconds]
ros3bud has quit [Remote host closed the connection]
ros3bud has joined #ruby-lang
mrfoo has quit [Quit: Page closed]
madb055 has joined #ruby-lang
r0bgleeson has joined #ruby-lang
r0bgleeson has quit [Quit: WeeChat 0.3.8]
mistym has joined #ruby-lang
jMCg has joined #ruby-lang
jMCg has quit [Changing host]
jMCg has joined #ruby-lang
maerch has joined #ruby-lang
<zenspider>
rawr
Xzyx987X has quit [Ping timeout: 272 seconds]
maerch has quit [Ping timeout: 272 seconds]
soknee has joined #ruby-lang
soknee has quit [Client Quit]
bzalasky has joined #ruby-lang
Xzyx987X has joined #ruby-lang
havenwood has joined #ruby-lang
spuk has quit [Ping timeout: 245 seconds]
spuk has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
jacktrick has quit [Quit: Leaving]
<postmodern>
besides Gem::Version, are there any other libraries that can handle arbitrary versions, such as 3.5.30729 or 6,1,7601,17514
amerine has joined #ruby-lang
pygmael has joined #ruby-lang
EvilJStoker has quit [Quit: EvilJStoker is gone :(]
brianpWins has quit [Quit: brianpWins]
rwk1 has joined #ruby-lang
chendo has quit [Ping timeout: 256 seconds]
maxmanders has joined #ruby-lang
bzalasky has joined #ruby-lang
rwk1 has quit [Ping timeout: 258 seconds]
chendo has joined #ruby-lang
gix has quit [Quit: Client exiting]
maxmande_ has joined #ruby-lang
maxmanders has quit [Ping timeout: 240 seconds]
pygmael has quit [Quit: pygmael]
pygmael has joined #ruby-lang
bpot__ has quit []
dreinull_ has quit []
L0rdShrek____ has quit []
pygmael has quit [Client Quit]
<zenspider>
yay... much much faster
amerine has quit [Quit: Computer has gone to sleep.]
pkondzior___ has quit []
franckverrot has quit []
Domon_ has joined #ruby-lang
maxmande_ has quit [Ping timeout: 258 seconds]
kain_ has joined #ruby-lang
kain has quit [Ping timeout: 240 seconds]
r0bgleeson has joined #ruby-lang
swav has quit [Remote host closed the connection]
brianpWins has joined #ruby-lang
EvilJStoker has joined #ruby-lang
EvilJStoker is now known as Guest31852
dhruvasagar has joined #ruby-lang
Gaelan has joined #ruby-lang
Gaelan_ has quit [Ping timeout: 252 seconds]
jbsan has quit [Quit: jbsan]
maerch has joined #ruby-lang
lcdhoffman has joined #ruby-lang
jbsan has joined #ruby-lang
ruby-lang896 has joined #ruby-lang
ruby-lang896 has quit [Client Quit]
maerch has quit [Ping timeout: 256 seconds]
tylersmith has joined #ruby-lang
Guest31852 has quit [Changing host]
Guest31852 has joined #ruby-lang
<ros3bud>
"/[^aeiou]/.match('apple')" <--- I would like this to return false bc the first letter is a vowel, but it's returning 'p' - suggestions?
Guest31852 is now known as JStoker
ros3bud has quit [Remote host closed the connection]
fosky has joined #ruby-lang
ruby-lang078 has joined #ruby-lang
JStoker is now known as EvilJStoker
havenwood has quit [Remote host closed the connection]
ruby-lang078 has quit [Client Quit]
kurko_ has quit [Ping timeout: 240 seconds]
gregmoreno has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has joined #ruby-lang
ivanoats has quit [Changing host]
dingus_khan has quit [Ping timeout: 252 seconds]
gix has joined #ruby-lang
rwk1 has joined #ruby-lang
rwk1 has quit [Read error: Connection reset by peer]
rwk1_ has joined #ruby-lang
agarie has quit [Remote host closed the connection]
tomzx_mac has joined #ruby-lang
gregmoreno has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
woollyams has quit [Quit: Computer has gone to sleep.]
perry has joined #ruby-lang
havenwood has joined #ruby-lang
chendo has quit [Remote host closed the connection]
chendo has joined #ruby-lang
kain_ is now known as kain
mistym has quit [Remote host closed the connection]
his_shadow has quit [Ping timeout: 245 seconds]
stevechiagozie has quit [Quit: Computer has gone to sleep.]
brianpWins has quit [Quit: brianpWins]
ivanoats has quit [Remote host closed the connection]
Guest___ has joined #ruby-lang
davejlong has joined #ruby-lang
xxaM has joined #ruby-lang
swav has joined #ruby-lang
hahuang65 has joined #ruby-lang
rwk1_ has quit [Remote host closed the connection]
swav has quit [Ping timeout: 272 seconds]
matti has joined #ruby-lang
intellitech has quit [Ping timeout: 272 seconds]
<rking>
Anyone have a coverage tool they prefer over cover_me ?
kain has quit [Quit: exit]
tcopp has joined #ruby-lang
wmoxam has quit [Ping timeout: 272 seconds]
davejlong has quit [Quit: Leaving.]
Gaelan has quit [Remote host closed the connection]
Guest___ has quit [Ping timeout: 245 seconds]
chendo has quit [Ping timeout: 246 seconds]
bzalasky has quit [Remote host closed the connection]
chendo has joined #ruby-lang
rwk1 has joined #ruby-lang
face has joined #ruby-lang
agarie has joined #ruby-lang
ros3bud has joined #ruby-lang
security has joined #ruby-lang
rwk1 has quit [Ping timeout: 272 seconds]
megha has quit [Ping timeout: 272 seconds]
bzalasky has joined #ruby-lang
intellitech has joined #ruby-lang
rwk1 has joined #ruby-lang
Gaelan has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
ros3bud has quit [Remote host closed the connection]
jxie has joined #ruby-lang
bluepojo has quit [Remote host closed the connection]
pygmael has joined #ruby-lang
maerch has joined #ruby-lang
maerch has quit [Ping timeout: 272 seconds]
bluepojo has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 258 seconds]
bluepojo has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
brianpWins has joined #ruby-lang
cschneid has quit [Ping timeout: 245 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
Gaelan has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 252 seconds]
chendo has quit [Quit: Computer has gone to sleep.]
ivanoats has joined #ruby-lang
cschneid has joined #ruby-lang
davidbalber|away is now known as davidbalbert
bzalasky has joined #ruby-lang
woollyams has joined #ruby-lang
TheNotary has quit [Ping timeout: 245 seconds]
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
priodev has quit [Ping timeout: 245 seconds]
priodev has joined #ruby-lang
JohnBat26 has joined #ruby-lang
Gaelan has joined #ruby-lang
kgrz has joined #ruby-lang
chessguy has quit [Remote host closed the connection]
ryanf has quit [Quit: leaving]
vlad_starkov has quit [Remote host closed the connection]
rippa has joined #ruby-lang
TheNotary has joined #ruby-lang
davidbalbert is now known as davidbalber|away
asio has quit [Ping timeout: 264 seconds]
rwk1 has quit [Remote host closed the connection]
yianna has joined #ruby-lang
yianna is now known as ykk
kgrz has quit [Quit: Computer has gone to sleep.]
maerch has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
maerch has quit [Ping timeout: 256 seconds]
madb055 has quit [Ping timeout: 272 seconds]
kain has joined #ruby-lang
tomzx_mac has quit [Read error: Operation timed out]
madb055 has joined #ruby-lang
Gaelan has quit [Ping timeout: 240 seconds]
ivanoats has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
madb055 has quit [Ping timeout: 256 seconds]
maerch has joined #ruby-lang
ryanf has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
ykk has quit [Remote host closed the connection]
DEac- has quit [Read error: Connection reset by peer]
DEac- has joined #ruby-lang
thufir_ has joined #ruby-lang
tcopp has quit [Ping timeout: 272 seconds]
ykk has joined #ruby-lang
rwk1 has joined #ruby-lang
ykk has quit [Remote host closed the connection]
rwk1 has quit [Ping timeout: 272 seconds]
r0bgleeson has quit [Ping timeout: 245 seconds]
Axsuul has joined #ruby-lang
kgrz has joined #ruby-lang
MehLaptop has joined #ruby-lang
noop has joined #ruby-lang
ndch has joined #ruby-lang
rwk1 has joined #ruby-lang
ritek has quit [Read error: Connection reset by peer]
ritek has joined #ruby-lang
dmoctezuma has joined #ruby-lang
dmoctezuma has quit [Read error: Connection reset by peer]
ritek has quit [Ping timeout: 272 seconds]
gregmoreno has quit [Remote host closed the connection]
MehLaptop has quit [Remote host closed the connection]
kgrz has quit [Quit: Computer has gone to sleep.]
benlovell has joined #ruby-lang
thufir_ has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
benlovell has quit [Client Quit]
maerch has quit [Ping timeout: 252 seconds]
agarie has quit [Remote host closed the connection]
ndch has quit [Remote host closed the connection]
mjio has quit []
dhruvasagar has joined #ruby-lang
concernedcitizen has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
agarie has joined #ruby-lang
cored has quit [Ping timeout: 264 seconds]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
fragamus has joined #ruby-lang
rippa has quit [Ping timeout: 240 seconds]
agarie has quit [Ping timeout: 272 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
gregmoreno has joined #ruby-lang
dhruvasagar has joined #ruby-lang
gregmoreno has quit [Ping timeout: 246 seconds]
apeiros_ has joined #ruby-lang
security is now known as fire
agarie has joined #ruby-lang
mistym has quit [Remote host closed the connection]
<dkannan>
because this is the first gem i am publishing
<lewis1711>
aha, thanks dkannan
<dkannan>
uploaded successfully. just took some time
<dkannan>
lewis1711: np
voker57_ has joined #ruby-lang
voker57 has quit [Ping timeout: 272 seconds]
kgrz has joined #ruby-lang
xcombelle has joined #ruby-lang
io_syl has quit [Quit: Computer has gone to sleep.]
<gnufied>
wondering what gem it is ?
<gnufied>
:-)
maxmanders has joined #ruby-lang
rwk1 has quit [Read error: Connection timed out]
vlad_starkov has joined #ruby-lang
maerch has quit [Quit: leaving]
kgrz has quit [Ping timeout: 258 seconds]
maxmanders has quit [Ping timeout: 258 seconds]
dkannan has quit [Quit: dkannan]
maxmanders has joined #ruby-lang
<injekt>
'easy_rails_money'
<injekt>
also g'morning
gnufied has quit [Quit: Leaving.]
<yorickpeterse>
morning kids
maxmanders has quit [Quit: Computer has gone to sleep.]
<whitequark>
moo
maxmanders has joined #ruby-lang
Averna has quit [Quit: Leaving.]
maxmanders has quit [Client Quit]
gnufied has joined #ruby-lang
maxmanders has joined #ruby-lang
<injekt>
indeed
thebastl has joined #ruby-lang
xxaM has quit [Quit: taskkill /f y u no work]
rwk1 has joined #ruby-lang
intellitech has quit [Quit: intellitech]
<lewis1711>
"incorrect header check (Zlib::DataError)" any idea what that means? Do i have an incorrect version of zlib? I get it when I try to use the open method of open-uri
<injekt>
it means the response zlib headers are probably broken
Averna has quit [Remote host closed the connection]
<yorickpeterse>
how is that any better?
<ddfreyne>
It is side-effect free
<yorickpeterse>
ehm, it's doing exactly the same
<ddfreyne>
Unfortunately, it generates intermediate objects, which is why I never use it
<ddfreyne>
yorickpeterse: #merge does not modify the object, but merely returns a new one
<lianj>
no Hash#[] love?
<ddfreyne>
I’d just create a hash and loop over it… no shame there
<yorickpeterse>
ddfreyne: it has literally zero benefits that I can think of since `hash` is still modified internally by #inject
<ddfreyne>
yorickpeterse: It isn’t… if everything were immutable, it would still work
<yorickpeterse>
On top of that hash.merge actually creates a new object instead of re-using it
idkazuma has joined #ruby-lang
ros3bud has joined #ruby-lang
<ddfreyne>
yorickpeterse: This is exactly why #inject is not useful in this situation
poga_ has joined #ruby-lang
<yorickpeterse>
Regardless, I really don't see the bad thing of modifying the target object as long as you're initially creating a blank one
<yorickpeterse>
If you were modifying something passed as an argument then yes, it would be wrong
<dominikh>
rule of thumb: if you have need `; foo` in your inject block, you're abusing it.
<yorickpeterse>
rule of thumb: if you make such statements come up with good examples that don't add extra overhead
<dominikh>
#each.
<lianj>
dominikh: addition: if you work around `; foo`, its still abusing
<ddfreyne>
yorickpeterse: Use #each
dr_bob has quit [Quit: Leaving.]
<ddfreyne>
yorickpeterse: Just like foldl/foldr in functional programming languages (and #inject:into: in Smalltalk), the block is not supposed to have side effects
<dominikh>
inject is an alias for reduce. now look up what reduce is for. it's not used for "convoluted loop"
poga has quit [Ping timeout: 245 seconds]
<yorickpeterse>
I'm still waiting for good reasons but having said that I have better things to do
maxmanders has quit [Quit: Computer has gone to sleep.]
<ddfreyne>
yorickpeterse: inject/fold/reduce is meant for reducing/folding a collection into a single value, hence the name
<ddfreyne>
For instance, a list becomes a single value that is the maximum value found in the list, or the minimum, or the product, or the sum…
maxmanders has joined #ruby-lang
<whitequark>
there's also #each_with_object
<inkjet>
I went there
<yorickpeterse>
each_with_object is new to me
<whitequark>
specifically for #inject abusers
<lianj>
:D
<whitequark>
module Enumerable; alias inkjet inject; end
<inkjet>
^
<whitequark>
... cannot ... resist
maxmanders has quit [Client Quit]
<lianj>
module Enumerable; alias inkjet each_with_object; end
chendo has quit [Quit: Computer has gone to sleep.]
<lianj>
ads, i see none
<ddfreyne>
yorickpeterse: Oh yeah, I definitely do not recommend using #merge at all
inkjet is now known as injekt
tbuehlmann has quit [Remote host closed the connection]
chrismar035 has joined #ruby-lang
hramrach has quit [Ping timeout: 276 seconds]
maxmanders has joined #ruby-lang
lele|w has quit [Ping timeout: 264 seconds]
lele|w has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
maxmanders has joined #ruby-lang
Gaelan has joined #ruby-lang
jtperreault has left #ruby-lang ["WeeChat 0.3.7"]
sailias1 has joined #ruby-lang
ykk has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
snk_ is now known as snk
emocakes has quit [Quit: emocakes]
kgrz has quit [Quit: Computer has gone to sleep.]
llaskin has joined #ruby-lang
llaskin has quit [Changing host]
llaskin has joined #ruby-lang
<llaskin>
is there any reason why this: "#{(date + 5).strftime("%m/%d/%Y")}#{(time + 600).strftime("%l:%M %p")}" would sometimes output "04/02/2013 12:14 PM" and sometimes output 04/02/201312:14 PM
<yxhuvud>
Dunno, but I'd recommend using DateTime instead.
<whitequark>
yorickpeterse: I've spent last 20 minutes fixing reporting of location for tNL
<whitequark>
it just occured to me that it might be that no one ever needs to look at that
ustrajun_ has joined #ruby-lang
<yxhuvud>
llaskin: but if I were to guess, %l pads with empty space if there is only one digit.
<whitequark>
meh just fixed it.
stevechiagozie has joined #ruby-lang
<yorickpeterse>
whitequark: tNL being newlines?
<whitequark>
yorickpeterse: yes
<whitequark>
yorickpeterse: 37!!!!!
<whitequark>
hell yes I spent last two days trying to achieve that
jerrytgarcia has joined #ruby-lang
<yorickpeterse>
Not sure if location info for newlines would be useful
<llaskin>
yxhuvud: interesting, how would you fix that then?
maxmanders has joined #ruby-lang
kgrz has joined #ruby-lang
<yorickpeterse>
and congrats on the tests
ustraju__ has joined #ruby-lang
ustrajunior has quit [Ping timeout: 264 seconds]
<yxhuvud>
llaskin: by reading the docs and choosing an option that outputs what you need.
<yorickpeterse>
that's not a really useful answer
ustrajun_ has quit [Ping timeout: 243 seconds]
bjensen has left #ruby-lang [#ruby-lang]
<llaskin>
i thought %l would actually do it...
runeb has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 258 seconds]
Gaelan has quit [Remote host closed the connection]
poga_ has quit [Remote host closed the connection]
lele|w has quit [Ping timeout: 240 seconds]
forrest has joined #ruby-lang
lele|w has joined #ruby-lang
Gaelan has quit [Ping timeout: 260 seconds]
pygmael has quit [Quit: pygmael]
ustraju__ has left #ruby-lang [#ruby-lang]
<whitequark>
ok I guess I need to fix line numbers now...
MaddinX__ has quit [Remote host closed the connection]
<yorickpeterse>
YES PLEASE
<yorickpeterse>
and column numbers :>
<yorickpeterse>
I'll buy your babbies
<yorickpeterse>
hmmm....carrot cake
ustrajunior has joined #ruby-lang
ustrajunior has quit [Client Quit]
MartynKeigher has quit [Excess Flood]
ustrajunior has joined #ruby-lang
sepp2k has joined #ruby-lang
randallagordon has quit [Ping timeout: 245 seconds]
MartynKeigher has joined #ruby-lang
stef_204 has joined #ruby-lang
<yorickpeterse>
oh boy, sugar rush
randallagordon has joined #ruby-lang
ustrajunior has quit [Remote host closed the connection]
ustrajunior has joined #ruby-lang
kgrz has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
<whitequark>
yorickpeterse: u drunk?
<yorickpeterse>
Can you get drunk from drinking tea?
<yorickpeterse>
Because if so I'm smashed
ustrajunior has quit [Quit: ustrajunior]
<whitequark>
omg whyyyyy
ustrajunior has joined #ruby-lang
<whitequark>
why the fuck does old ruby_lexer use random strings as yacc_value for operators and stuff, but for keywords it suddenly uses LINE NUMBERS?!
* whitequark
ragequits
ustrajunior has quit [Client Quit]
ustrajunior has joined #ruby-lang
<yorickpeterse>
because line numbers are webscale and truly unique
<whitequark>
yorickpeterse: no the unique part is the token itself
<whitequark>
but e.g. :kDEF, 1 means that it is a def encountered on line 1
<whitequark>
both the snarky noninformative commit message (I'd say "and comments" but which comments?) and the hacky code.
<yorickpeterse>
In general I don't really get the idea of writing snarky commit messages, docs, etc
<yorickpeterse>
After all, you're the one dealing with it primarily
<yorickpeterse>
So either you don't give a fuck or....something I don't understand
<yorickpeterse>
(this is not aimed at anybody in specific, just in general)
<yorickpeterse>
s/in//
<whitequark>
yorickpeterse: I do write those sometimes, when I'm really freakin' tired. I almost always make them informative, i.e. you can sed out the swearing and something useful is still left.
<whitequark>
you're right after all.
<whitequark>
arrrgh
<whitequark>
helper methods in _extras.rb are tied to particular structure of rules in parser.y
<whitequark>
what is this I don't even
<whitequark>
especially considering how ruby20 will probably get another parse.y in there
<whitequark>
yorickpeterse: note though, right now I'm hacking ruby_parser so that it would write line numbers in zenspider-style, i.e. as it was before
<whitequark>
(I broke it due to removing aforementioned lexer quirk)
<whitequark>
31!
<yorickpeterse>
zenspider-style?
<whitequark>
yorickpeterse: as it was before.
<yorickpeterse>
can't remember what it was before tbh
<whitequark>
um...
<yorickpeterse>
"weird" will suffice
<whitequark>
* Known Issue: line number values can be slightly off. Parsing LR sucks.
<whitequark>
(esp given that has precisely nothing to do with parsing LR)
<yorickpeterse>
ah
<whitequark>
I'm just fixing the code so that existing tests would pass
<yorickpeterse>
Ragel/Bison don't provide info such as line/column numbers?
<whitequark>
also Sexps from sexp_processor cannot even *represent* column numbers
<whitequark>
yorickpeterse: Bison doesn't care about them (and it should not)
<whitequark>
Ragel doesn't care about them (and it should not)
<yorickpeterse>
well yeah, but I can imagine that they keep track of it somewhere
<whitequark>
nope, that's your job
<yorickpeterse>
hmpf
<whitequark>
you can trivially do that in ragel, like in one line
<whitequark>
there's some more magic required to transform "stream position" to line/column number but it's pretty simple
rwk1 has quit [Remote host closed the connection]
<whitequark>
for bison, more code is needed to accomodate for stuff spanning multiple tokens/lines
<whitequark>
but it's your code again
<yorickpeterse>
Hm, I feel I should gemify my Ripper layer at some point in case some poor soul has to use Ripper
<yorickpeterse>
It's by no means perfect and has a few quirks but it's a lot better than standard Ripper
<whitequark>
yorickpeterse: why not use my better ruby_parser? :|
<yorickpeterse>
oh I would once it's usable
<yorickpeterse>
but still, it's a waste to throw away what might save others time
maxmanders has quit [Quit: Computer has gone to sleep.]
lcdhoffman has quit [Quit: lcdhoffman]
<whitequark>
ok, let's now try to hack unicode support in... :/
<yorickpeterse>
hahaha
<yorickpeterse>
good luck
maxmanders has joined #ruby-lang
<whitequark>
I'm not sure. Ragel is table based. Does that mean that if I make a character range 128-0x10ffff, it will create table entries accordingly?
<whitequark>
probably yes
dustint has joined #ruby-lang
<whitequark>
oh actually this would be pretty easy
pygmael has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
rwk1 has joined #ruby-lang
rwk1 has quit [Read error: Connection reset by peer]
rwk1 has joined #ruby-lang
spuk has quit [Read error: Connection reset by peer]
runeb has quit [Ping timeout: 260 seconds]
<whitequark>
>> $-Й
<whitequark>
grh
<whitequark>
why the hell $-Й is not a valid gvar name even in 2.0?!
<whitequark>
whereas $Й is valid
<yxhuvud>
I'm not certain I understand why that is a problem.
<yorickpeterse>
because it doesn't make sense
<yorickpeterse>
Ruby claims to have proper support for various encodings, allowing you to use weird names like that (at least that's the idea)
<whitequark>
yorickpeterse: um so I just added unicode support
<whitequark>
that was REALLY wasy
<whitequark>
*easy
<yorickpeterse>
oh?
<whitequark>
yea, just define proper alnum, lower and upper character classes
<whitequark>
and that's it
<whitequark>
c_unicode = c_any - [\x00-\x7f];
<yorickpeterse>
wat
<whitequark>
ugh
<yorickpeterse>
that's it?
<whitequark>
I already leverage ruby's own unicode support for parsing utf-8
swav has quit [Ping timeout: 252 seconds]
pygmael has quit [Quit: pygmael]
<whitequark>
so the only thing I need is to convince ragel that anything > 0x7f is a lowercase character
<whitequark>
(because ruby thinks so)
maxmanders has quit [Quit: Computer has gone to sleep.]
swav has joined #ruby-lang
pygmael has joined #ruby-lang
<whitequark>
oh I think I accidentally most tests
maxmanders has joined #ruby-lang
Kenpachi has joined #ruby-lang
rippa has joined #ruby-lang
maxmanders has quit [Client Quit]
vbatts2 has left #ruby-lang [#ruby-lang]
vbatts has joined #ruby-lang
gnufied has joined #ruby-lang
alessio_1occo has quit [Ping timeout: 258 seconds]
alessio_rocco has joined #ruby-lang
chrismar035 has quit [Ping timeout: 256 seconds]
ndch has joined #ruby-lang
chrismar035 has joined #ruby-lang
bin7me has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
XxBlakeFailxX has quit [Ping timeout: 256 seconds]
bzalasky has joined #ruby-lang
superlou has joined #ruby-lang
jerrytgarcia has quit [Read error: Connection reset by peer]
maxmanders has joined #ruby-lang
jerrytgarcia has joined #ruby-lang
davejlong1 has joined #ruby-lang
davejlong1 has quit [Client Quit]
kgrz has joined #ruby-lang
davejlong has quit [Ping timeout: 240 seconds]
<yorickpeterse>
ugh, I really didn't sleep well last night
<yorickpeterse>
trying to fight falling asleep here in the office
<zzak>
youre probably crashing from too much tea and cake
tomzx_mac has joined #ruby-lang
<yorickpeterse>
Nah, I played Bioshock for a bit too long last night
ndch has quit [Remote host closed the connection]
lcdhoffman has joined #ruby-lang
tomzx_mac_ has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
gregmoreno has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 256 seconds]
XxBlakeFailxX has joined #ruby-lang
<injekt>
tea and crumpets
rwk1 has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
rwk1 has joined #ruby-lang
<superlou>
Does anyone know how to set the value in a hash at nested keys specified in an array? For example, my_hash.set_value(['a','b','c']) = 'new value' would do my_hash['a']['b']['c'] = 'new value'
gregmoreno has quit [Ping timeout: 255 seconds]
dhruvasagar has quit [Ping timeout: 260 seconds]
<superlou>
pulling my hair out trying to find something that uses a dynamic number of keys but isn't gross
XxBlakeFailxX has quit [Ping timeout: 260 seconds]
mixandgo has quit [Quit: mixandgo]
<yorickpeterse>
haha Ruby:
<yorickpeterse>
hash = {}; Hash[:a, :b, :c] = 10 # => ArgumentError: wrong number of arguments(4 for 2)
<yorickpeterse>
superlou: don't think that's possible out of the box
pygmael has quit [Quit: pygmael]
<yorickpeterse>
(note that said error stays the same when you increase the amount of values that are being assigned)
<superlou>
yorickpeterse: yeah, i've been digging through the api trying to find something that matches
<superlou>
i'm willing to write something, but it seems gross to rebuild the entire hash just to set one value
<yorickpeterse>
eh, sec
<superlou>
problem is I can't find a way to get a hash value by reference
<injekt>
why dont you just use a recursive hash?
<yorickpeterse>
damn it inkjet, that's what I was going for
<zzak>
i should buy a boat
<superlou>
inkjet, not sure i understand? I can use a recursive function to find the value, but setting it on the original hash is where I'm stuck
bzalasky has quit [Remote host closed the connection]
<superlou>
since when you get the value, you get a copy of it
<injekt>
damn it yorickpeterse see what you did
<injekt>
superlou: right, your hash needs to be a recursive hash
tonni_ has quit [Remote host closed the connection]
<injekt>
superlou: you want to set the value whilst you do it too no?
<whitequark>
yorickpeterse: what's the problem?
glebm has quit [Quit: Computer has gone to sleep.]
dhruvasagar has quit [Ping timeout: 260 seconds]
<superlou>
injekt: that would be ideal, but since i end up getting a copy of the value, i was resorting to finding another way to set it later on. Having to only recurse once would be better.
<yorickpeterse>
it's dirty?
<yorickpeterse>
I can't see myself maintaining such a large case statement
<whitequark>
yorickpeterse: ok?
<yorickpeterse>
in unrelated news, it seems that it's hard to find decent slides on the web about static code analysis
<yorickpeterse>
(where "the web" is slideshare)
<whitequark>
ummm no
<whitequark>
search ACM
<whitequark>
then you can fetch the articles from behind the paywall with, um, some services (or through your uni access)
<yorickpeterse>
uni?
<whitequark>
university
<yorickpeterse>
I don't have any?
<yorickpeterse>
Also, I'm just looking to see how others did talks about this
<yorickpeterse>
whitequark: make sure you fix your GH branches as well, they're still outdated
pr0ton has joined #ruby-lang
<whitequark>
yorickpeterse: hrm
<whitequark>
it's not yet ready for you to hack on until I fix that last issue
<yorickpeterse>
k
<whitequark>
but
<whitequark>
I do have things to discuss with you, right now
vlad_sta_ has quit [Read error: Connection reset by peer]
sandbags has quit [Remote host closed the connection]
<whitequark>
first. I do not like the design of sexp_processor, and I like its absence of support for column numbers, and the fact that it is probably supposed to be monkey-patched by every project like RP does, even less
<whitequark>
considering all this, I think it makes sense to fork ruby_parser after (if?) I get the ragel lexer integrated to the upstream, and migrate it to Furnace's sexps.
MaddinXx has joined #ruby-lang
<yorickpeterse>
throwing this in: why not get rid of that sexp crap, use foundry and disregard keeping it somewhat compatible with that's out there?
<whitequark>
well, because I wanna let the community use the better version
<yorickpeterse>
releasing a separate gem would allow that as well
<yorickpeterse>
Also, I'm going to be hated for saying this but I have to: I don't like dealing with people that originally wrote that code
<injekt>
you've pretty much rewritten it no? or am i missing that
<whitequark>
I think it makes sense to ship a converter to sexp_processor format with my fork. people shouldn't really change their code, and I suspect that change will be required.
<yorickpeterse>
The fact that it's riddled with angry/snarky comments is enough for me to dispise it
<whitequark>
injekt: rewritten the lexer, will rewrite the parser.
<injekt>
whitequark: so you deserve credit for the entire thing in the form of a new gem
<whitequark>
basically I rewrote, or will rewrite everything except most parse.y originated rules
<whitequark>
injekt: I still use zenspider's test cases though.
<whitequark>
he deserves attribution for that, they've helped enormously. but you're also right.
<injekt>
whitequark: then give credit within those files
<injekt>
I'd personally prefer to see a new gem
<yorickpeterse>
Realistically speaking I think the chance of this getting merged in is rather small
<whitequark>
injekt: it won't hurt to try to integrate the ragel lexer to upstream. why not?
<whitequark>
so far I've kept it compatible.
<yorickpeterse>
well, consider this:
<injekt>
whitequark: sure if you can get it merged upstream and have commit bit that's great
<yorickpeterse>
The lexer is rewritten from scratch, the parser will be as well. The S-expression stuff will also be rewritten
<whitequark>
commit bit ROFL, I do not think that will ever happen
<yorickpeterse>
That leaves you with about 80% of code being rewritten from scratch
<whitequark>
injekt: yorickpeterse: yeah yeah, I'll release the gem
<whitequark>
also, suggestion on name?
<yorickpeterse>
whitequark-parser
<whitequark>
meh no.
<yorickpeterse>
eh, give me a second
<injekt>
lol
<injekt>
inkjet
<injekt>
of course
<yorickpeterse>
inkjet-parser
<yorickpeterse>
powered by HP
<whitequark>
inkjet_parser
<injekt>
haha
<whitequark>
well, I think I would even seriously consider that, maybe
ros3bud has quit [Remote host closed the connection]
<breakingthings>
I'm squatting parakeet which I regret as I've changed the name of the project :d
<breakingthings>
And I can't… just remove it, or anything.
<yorickpeterse>
you can request it to be removed as well I believe
skade has quit [Quit: Computer has gone to sleep.]
<rue>
If there’s one good thing about the community’s penchant for not really clever clever names, it’s that good, descriptive names are often available.
<yorickpeterse>
heh
<whitequark>
breakingthings: you can
Guest85414 has joined #ruby-lang
<whitequark>
gem yank every single version of it
<breakingthings>
whitequark: I believe I tried that.
<breakingthings>
Maybe I f'ed up.
<whitequark>
breakingthings: it should work.
ros3bud has joined #ruby-lang
<breakingthings>
I suppose I might give it a go again at some point.
beawesomeinstead has joined #ruby-lang
<whitequark>
yorickpeterse: what I actually want help with is a) AST and b) location merging
<whitequark>
the ast part is kinda easy. I do not break RP compatibility for no reason, but I will fix pointless idiosyncrasies
<whitequark>
like 0 instead of s(:args) for proc { || }
<whitequark>
the location mering part is much more tricky
<whitequark>
as in, there's an s(:defn) node. what do you want its location to point to? function name? the `def`?
<whitequark>
note that the function name itself is a symbol and doesn't have associated location itself, ie s(:defn, :whatever, s(:args, ...))
<yorickpeterse>
let me see what Ripper does
<yorickpeterse>
oh yeah that's right
<whitequark>
the def keyword, of course
<yorickpeterse>
it's fucking crazy
<yorickpeterse>
nope
<whitequark>
nope?
<yorickpeterse>
the end of the whole method
<yorickpeterse>
let me verify that to be sure
<whitequark>
oh perfect
<whitequark>
the most useless choice of all
<whitequark>
why am i not surprised
thejspr_ has joined #ruby-lang
<yorickpeterse>
fucking eval.in is still down
<yorickpeterse>
ah yes
<yorickpeterse>
Ripper doesn't store the exact line numer in the :def node. However, when you call `lineno` in the corresponding callback it will point to the `end` block of the definition
<yorickpeterse>
*However*, the location of the method name *is* correct
<yorickpeterse>
err wait wait, I believe that was the column number
<yorickpeterse>
shit's long ago, let me verify (again)
<yorickpeterse>
(this is what you get when you write a layer around it and then forget about it)
<whitequark>
also I'm going to make this shit work with Bundler so I could test dependent apps with the git version of the parser on travis
<yorickpeterse>
get rid of all the hoe crap
<whitequark>
oh definitely
Gaelan has joined #ruby-lang
swav has joined #ruby-lang
ivanoats has quit [Read error: Connection reset by peer]
ivanoats has joined #ruby-lang
wmoxam has quit [Ping timeout: 258 seconds]
wmoxam has joined #ruby-lang
rushed has joined #ruby-lang
<whitequark>
yorickpeterse: also there are two things to consider
<whitequark>
BEGIN{} nodes which aren't supposed to go in AST
<whitequark>
(jruby wraps the ast into a special object specifically for these nodes)
stef_204 has joined #ruby-lang
<whitequark>
and the diagnostics
<whitequark>
RP sends warnings to /dev/null
<whitequark>
def warning s; # nothing for now; end
<whitequark>
I think that there should be an ability to request lists of warnings, and maybe even recoverable errors, from the parser
<whitequark>
like you can from clang
<whitequark>
warnings would certainly be a great benefit for your linter
<yorickpeterse>
well yeah. Also, I kinda like the SAX approach of Ripper for a parser
<yorickpeterse>
though how it handles errors is, surprise, stupid
<whitequark>
argh
<yorickpeterse>
unless you define `on_parse_error` it silently ignores it and tries to continue parsing
<whitequark>
yorickpeterse: you kinda can add SAX-style parsing to the parse.y's in the parser
<whitequark>
I'm not really into it and I would just make it emit an AST
<whitequark>
but I'm not opposed to the idea. if you want to implement it, I'll accept the code
<whitequark>
ofcourse there should be an AST builder on top of that interface.
wmoxam has quit [Ping timeout: 264 seconds]
<yorickpeterse>
well, come to think of it a SAX parser is only needed when the default AST is shit
<yorickpeterse>
which is the case with Ripper
djwonk has quit []
<yorickpeterse>
If it emits a sane AST to begin with that should be fine for, say, 95% of all cases
<whitequark>
yea
<whitequark>
I'm fairly sure that SAX is mostly useful in XML because for 100-megabyte files the DOM storage space would be truly enormous
<whitequark>
not so for executable code
brianpWins has joined #ruby-lang
<yorickpeterse>
also, what exactly do you mean with BEGIN{} nodes?
<whitequark>
yorickpeterse: um, BEGIN{} ?
<whitequark>
don't you know that BEGIN and END are keywords?
<yorickpeterse>
Nope
<whitequark>
ohhh
<yorickpeterse>
What do they do?
<whitequark>
it's a remnant from awk(1)
<yorickpeterse>
wat
<whitequark>
well they were taken from awk to perl
<whitequark>
then from perl to ruby
mistym has quit [Remote host closed the connection]
carloslopes has quit [Remote host closed the connection]
<whitequark>
BEGIN{} takes whatever code is in it, and hoists it to the top of the file.
stevechiagozie has quit [Quit: Computer has gone to sleep.]
<zenspider>
oh. oops. yes. the second y
<injekt>
sure, but synopsys is an electrical company
<zenspider>
huh. I wonder how far spread that is
<injekt>
aye
<zenspider>
shit
<injekt>
I checked seattlerb's other stuff haven't found another yet
<zenspider>
fuck
<injekt>
I think it's just that one :)
<zenspider>
nope. plenty have it
<zenspider>
all old projects
glebm has joined #ruby-lang
<injekt>
hah
<zenspider>
fixed
<zenspider>
thanks
glebm has quit [Client Quit]
<zenspider>
TheNotary: plenty of applications for something like that. write a tool that parses a file, modifies the ast, and generates new ruby from it
Gaelan has joined #ruby-lang
<zenspider>
flay uses it to generate N-way diffs in similar code
<zenspider>
the nice thing is, the AST is unambiguous where the actual ruby might be totally different
<zenspider>
x if y
<zenspider>
vs
<zenspider>
if y then x end
<TheNotary>
aha! I'm with you now!
<TheNotary>
I'm really bad with language parsing right now, I should make that my next research subject.
wmoxam has joined #ruby-lang
TheNotary has quit [Quit: Leaving]
anonymuse has quit [Quit: Leaving...]
glebm has joined #ruby-lang
robbyoconnor has joined #ruby-lang
davejlong has quit [Quit: Leaving.]
rwk1 has joined #ruby-lang
setmeaway2 has quit [Read error: Connection reset by peer]
emocakes has joined #ruby-lang
robbyoconnor has quit [Remote host closed the connection]
<zenspider>
Fuzzy Duplication Detection in Flay | polishing ruby by ryan davis - http://t.co/aOIfCntzrM
Gaelan has quit [Remote host closed the connection]
robbyoconnor has joined #ruby-lang
<zenspider>
man... I have wanted that for YEARS
<drbrain>
postmodern: … and bogo bit flipped
<postmodern>
drbrain, isn't this the streisand effect?
<drbrain>
postmodern: not exactly
<drbrain>
similar, though
<postmodern>
drbrain, i guess i wont troll flameeyes about having to compile a stage1 gentoo system just to visit https://bugs.gentoo.org/ :P
Gaelan has joined #ruby-lang
<postmodern>
drbrain, although i am seeing a pattern of contributors leaving because their patches got ignored
<drbrain>
there's no patch here, just an abandoned bug report
<drbrain>
I'm pretty sure that if Nobu says "I need more data" then he needs more data
<postmodern>
drbrain, i guess that's a side effect of how many bugs are submitted and not having enough bug ranglers
<drbrain>
he does commit nearly four times more often than anyone else
wmoxam has quit [Ping timeout: 264 seconds]
<postmodern>
right, he doesn't have the time to babysit every issue
<drbrain>
nobu responded to the issue the day after it was filed
<drbrain>
then no response for 8 months, so I closed it
<postmodern>
seems reasonable
<drbrain>
then somebody cares about it, but wants to participate in a drama-fest instead of contributing
<postmodern>
yeah, whenever i get my bugs rejected, i re-submit with more information / a better patch
ros3bud_ has quit [Remote host closed the connection]
mrfelix has quit [Quit: Computer has gone to sleep.]
Weems has quit [Ping timeout: 248 seconds]
idkazuma has quit [Remote host closed the connection]
sepp2k1 has quit [Remote host closed the connection]
rwk1 has quit [Remote host closed the connection]
maek has joined #ruby-lang
maxmande_ has quit [Quit: Computer has gone to sleep.]
<maek>
rbenv is pretty backed into our chef/deployment setup
<maek>
about to build a ruby outside rbenv to see if its the problem
<maek>
also rbenv exec saves you from the rehash I think
<andrewvos>
chruuuuuuby
<maek>
postmodern: since you are here. anything like gemsets or is that up to bundler?
brianpWins has quit [Quit: brianpWins]
ndch has joined #ruby-lang
<postmodern>
maek, i either use bundler or chgems
<postmodern>
maek, chgems is like chroot for gems
<maek>
oh chgems
<maek>
ty
<maek>
i feel like I will be using this on my work station
<maek>
appreciate the link/work :)
<drbrain>
maek: why do you want to mirror gems?
<maek>
drbrain: big company feels we should have all of our deployment dependencies internally and we have partners that dont have direct internet access
Weems has joined #ruby-lang
Weems has quit [Changing host]
Weems has joined #ruby-lang
<drbrain>
maek: you should talk to evan in #rubygems about your requirements
<drbrain>
he may have a better solution than `gem mirror`
<maek>
when gem mirror worked it worked nicely. mirrored the whole of rubygems.org in about 2 hours
<maek>
makes metadata, etc and the next time you run it it gets only the diffs