apeiros_ changed the topic of #ruby-lang to: Ruby 2.0.0-p0: http://ruby-lang.org (Ruby 1.9.3-p392) || Paste >3 lines of text on http://gist.github.com
mjio has joined #ruby-lang
mbj has joined #ruby-lang
glebm has joined #ruby-lang
mbj has quit [Quit: leaving]
woollyams has joined #ruby-lang
roz has joined #ruby-lang
hakunin has quit [Ping timeout: 258 seconds]
yankeefan04 has quit [Remote host closed the connection]
sepp2k has quit [Remote host closed the connection]
jfredee has joined #ruby-lang
mossplix has quit [Read error: Connection reset by peer]
marr has quit [Read error: Connection reset by peer]
mossplix has joined #ruby-lang
mbj has joined #ruby-lang
mrfelix has quit [Quit: Computer has gone to sleep.]
idkazuma has quit [Remote host closed the connection]
idkazuma has joined #ruby-lang
r0bgleeson has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
krohrbaugh has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
mossplix has quit [Read error: Connection reset by peer]
krohrbaugh has quit [Ping timeout: 252 seconds]
brianpWins has joined #ruby-lang
tylersmith has joined #ruby-lang
mossplix has joined #ruby-lang
krohrbaugh has joined #ruby-lang
hramrach has quit [Ping timeout: 276 seconds]
hramrach has joined #ruby-lang
myappleguy has quit [Quit: Leaving.]
myappleguy has joined #ruby-lang
sailias has joined #ruby-lang
mossplix has quit [Read error: Connection reset by peer]
jfredee has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
Gaelan has joined #ruby-lang
tsion has joined #ruby-lang
tsion has quit [Changing host]
tsion has joined #ruby-lang
retro|cz has quit [Ping timeout: 245 seconds]
baba has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
security has quit [Ping timeout: 248 seconds]
Gaelan has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
brianpWins has quit [Quit: brianpWins]
krohrbaugh has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
krohrbaugh has quit [Quit: Leaving.]
asahi has joined #ruby-lang
Domon has joined #ruby-lang
<asahi> hello, how can i remove a forward slash if it exists at the end of a string?
<tsion> asahi: str.chomp('/')
<asahi> tsion: thanks!
<tsion> No problem.
jgoss has quit [Ping timeout: 256 seconds]
roz has quit [Ping timeout: 276 seconds]
srbaker has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
Gaelan_ has joined #ruby-lang
mwjcomputing has joined #ruby-lang
Gaelan has quit [Ping timeout: 252 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
aemeredith has quit [Remote host closed the connection]
pkrnj_ has joined #ruby-lang
nertzy2 has quit [Quit: Leaving]
pkrnj has quit [Ping timeout: 240 seconds]
pkrnj_ is now known as pkrnj
pkrnj has quit [Quit: Computer has gone to sleep.]
Gaelan_ has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
srbaker has quit [Client Quit]
nertzy has joined #ruby-lang
pkrnj has joined #ruby-lang
aemeredith has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
bzalasky has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
srbaker has joined #ruby-lang
srbaker has quit [Client Quit]
krohrbaugh has joined #ruby-lang
tsion has quit [Quit: Leaving]
hakunin has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
synthetix has joined #ruby-lang
pasties has quit [Ping timeout: 240 seconds]
mwjcomputing has quit [Quit: Leaving]
pasties has joined #ruby-lang
r0bgleeson has quit [Ping timeout: 245 seconds]
bzalasky has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
slightair is now known as slightairx
slightairx is now known as slightair
lcdhoffman_ has joined #ruby-lang
lcdhoffman_ has quit [Client Quit]
quazimodo has quit [Ping timeout: 276 seconds]
lcdhoffman has quit [Ping timeout: 258 seconds]
Gaelan has joined #ruby-lang
Gaelan has quit [Ping timeout: 258 seconds]
kuja has quit [Ping timeout: 245 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
ryez has joined #ruby-lang
lsegal has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
totallymike has quit [Ping timeout: 240 seconds]
kuja has joined #ruby-lang
andersbr has joined #ruby-lang
Gaelan has joined #ruby-lang
quazimodo has joined #ruby-lang
baba is now known as hack
divout has joined #ruby-lang
kuja has quit [Excess Flood]
Gaelan has quit [Ping timeout: 246 seconds]
aemeredith has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
bzalasky has joined #ruby-lang
chendo has quit [Read error: Operation timed out]
bzalasky has quit [Remote host closed the connection]
kuja has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
quazimodo has quit [Ping timeout: 256 seconds]
brianpWins has joined #ruby-lang
asahi has quit [Quit: Leaving.]
chendo_ has quit [Ping timeout: 246 seconds]
chendo_ has joined #ruby-lang
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
andersbr has quit [Quit: andersbr]
hack is now known as megha
User48583_ has joined #ruby-lang
User48583 has quit [Ping timeout: 260 seconds]
bzalasky has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
aemeredith has joined #ruby-lang
tomzx_mac_ has joined #ruby-lang
tomzx_mac has quit [Ping timeout: 258 seconds]
brianpWins has quit [Quit: brianpWins]
macmartine has joined #ruby-lang
dc5ala has joined #ruby-lang
Domon has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
macmartine has quit [Quit: Computer has gone to sleep.]
brianpWins has joined #ruby-lang
krohrbaugh has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
aemeredith has quit [Remote host closed the connection]
krohrbaugh has quit [Ping timeout: 252 seconds]
bzalasky has joined #ruby-lang
aderyabin has joined #ruby-lang
mbj_ has joined #ruby-lang
mbj has quit [Ping timeout: 256 seconds]
tylersmith has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
<yorickpeterse> hai
Domon has joined #ruby-lang
mistym has quit [Ping timeout: 246 seconds]
tylersmith has quit [Quit: tylersmith]
aemeredith has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
nofxx has joined #ruby-lang
nofxx has quit [Changing host]
nofxx has joined #ruby-lang
rolfb has joined #ruby-lang
nignaztic has joined #ruby-lang
heftig has quit [Quit: Quitting]
aemeredith has quit [Ping timeout: 246 seconds]
<charliesome> yorickpeterse: yo
<charliesome> yo, rick
nignaztic has quit [Client Quit]
User48583_ has quit [Remote host closed the connection]
mhi^ has left #ruby-lang [#ruby-lang]
<yorickpeterse> never heard that one before
<charliesome> i'm thrilled i'm witty enough to make that joke to you for the first time ever
retro|cz has joined #ruby-lang
Gaelan has joined #ruby-lang
mossplix has joined #ruby-lang
jg has joined #ruby-lang
Gaelan has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
kith_ has joined #ruby-lang
mossplix has quit [Ping timeout: 252 seconds]
cored has quit [Read error: Operation timed out]
|Vargas| has joined #ruby-lang
|Vargas| has quit [Changing host]
|Vargas| has joined #ruby-lang
kith has quit [Ping timeout: 245 seconds]
krohrbaugh has quit [Ping timeout: 245 seconds]
quazimodo has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
<yorickpeterse> So C question, because my C is rusty as fuck: is there a particular benefit to using `const char *foo` instead of `char *foo`?
<yorickpeterse> seems to primarily be used for some compiler optimizations but the info so far has been a bit vague
apeiros has quit [Remote host closed the connection]
mossplix has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
tomzx_mac_ has quit [Quit: return 0;]
tomzx_mac has joined #ruby-lang
dhruvasagar has joined #ruby-lang
aemeredith has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
<yxhuvud> yorick: you can't rewrite it by accident.
<yxhuvud> which is a pretty nice property
<truls> yorickpeterse: const is treated as a slightly different type than non-const versions, so you get some type checking for if the data is modifiable or not
<truls> yorickpeterse: so you can tell from return values or parameters if the data is modifiable or not (or at least the intention)
<truls> im pretty sure google and stackoverflow has a lot better answers than mine though
Mon_Ouie has quit [Ping timeout: 255 seconds]
symm- has joined #ruby-lang
krz has joined #ruby-lang
<yorickpeterse> hmm
<truls> remember that string literals are placed in a part of memory not meant for modification
<truls> so having them as const char* is useful to protect you from trying to modify it unintentionally
<charliesome> yorickpeterse: it's mainly as a hint to other programmers i believe
<bnagy> nothing in C is a hint to other programmers. C is write only code.
<charliesome> bnagy: take that back!
<bnagy> shan't
nXqd has joined #ruby-lang
<charliesome> :<
tomzx_mac has quit [Ping timeout: 258 seconds]
rippa has joined #ruby-lang
tonni has quit [Remote host closed the connection]
<yorickpeterse> right, now I just need to figure out how to get column numbers in ragel when using C
noop has joined #ruby-lang
vlad_starkov has joined #ruby-lang
aderyabin has quit [Remote host closed the connection]
aemeredith has quit [Remote host closed the connection]
solars has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 260 seconds]
aemeredith has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
apeiros has joined #ruby-lang
aemeredith has joined #ruby-lang
aemeredith has quit [Remote host closed the connection]
aemeredith has joined #ruby-lang
tonni has joined #ruby-lang
symm- has quit [Ping timeout: 258 seconds]
dr_bob has joined #ruby-lang
nofxx has quit [Remote host closed the connection]
aemeredith has quit [Remote host closed the connection]
Caius has quit [Ping timeout: 252 seconds]
krohrbaugh has joined #ruby-lang
benlovell has joined #ruby-lang
Guest2782 has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 276 seconds]
mytrile has joined #ruby-lang
<whitequark> truls: no, not really, unfortunately
<whitequark> C standard does not require that string literals be placed into .rodata.
<whitequark> on linux, they are; on win32, they are not (not necessarily? I stumbled into that).
<whitequark> the standard defines write access to the content of a string literal as "undefined behavior".
Guest2782 has quit [Excess Flood]
Ca1us has joined #ruby-lang
kxra has joined #ruby-lang
Ca1us has quit [Changing host]
Ca1us has joined #ruby-lang
<whitequark> ... another place when the standard mindlessly slaps UB onto something implementation-defined in practice.
<kxra> so, im new to ruby and writing a simple grep program, and can't figure out what's wrong with it searching file names rather than within files
dr_bob has quit [Read error: Connection reset by peer]
<injekt> kxra: want to provide a little more info if you're looking for help?
<kxra> injekt: sure, like what? i can just show you my code so far
<injekt> sure
rob_ has left #ruby-lang [#ruby-lang]
cored has quit [Ping timeout: 240 seconds]
<injekt> kxra: so your query is searching filenames within a dir, otherwise file contents, I dont see any issues
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<injekt> there's no need for line 41 though, and you should use File.read(location) over File.open(location).read
<truls> whitequark: thanks for the clarification
baz_ has quit [Quit: Leaving]
postmodern has quit [Quit: Leaving]
r0bby has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 256 seconds]
r0bby has quit [Read error: No route to host]
cored has quit [Ping timeout: 264 seconds]
r0bby has joined #ruby-lang
<manveru> kxra: i'd avoid loading the whole file into memory :)
r0bby_ has joined #ruby-lang
r0bby has quit [Read error: Connection reset by peer]
<manveru> kxra: https://gist.github.com/manveru/5386322 kinda like that
cored has joined #ruby-lang
mbj_ has quit [Ping timeout: 240 seconds]
JohnBat26 has joined #ruby-lang
solars has quit [Ping timeout: 256 seconds]
rippa has quit [Ping timeout: 240 seconds]
woollyams has quit [Ping timeout: 260 seconds]
vlad_starkov has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
maxmanders has joined #ruby-lang
mjio has quit []
kith_ is now known as kith
solars has joined #ruby-lang
<kxra> manveru: thanks. how does that avoid loading it into memory? what does it do instead?
<apeiros> manveru: why chomp?
celinedior has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
mossplix has quit [Ping timeout: 240 seconds]
<shachaf> apeiros: Presumably because puts already adds a newline. And the weird behaviour where it checks if the string ends with a newline is awful and we'd all rather pretend it didn't exist.
<shachaf> Or maybe that's just me. :-)
<whitequark> >> puts "foo\n"
<eval-in> whitequark => foo ... (http://eval.in/16382)
<whitequark> ugh :(
<whitequark> :((((
<manveru> heh
Averna has quit [Quit: Leaving.]
<manveru> you're right, puts is smart
<manveru> forget the chomp then
<shachaf> I'd rather my code was unsmart.
<whitequark> oh it also does shit with arrays
<whitequark> shachaf: +1
<manveru> why do you use ruby then :P
<shachaf> OK, I don't mind smart code so much. I'd rather my code was *simple*.
<shachaf> manveru: I don't!
<Boohbah> shachaf: i think you're using the wrong language :)
<shachaf> Boohbah: Haskell is the wrong language?
<manveru> indeed
<shachaf> then i don't want to be right ! !!
mossplix has joined #ruby-lang
blacktulip has joined #ruby-lang
tonni has quit [Remote host closed the connection]
drumond19 has joined #ruby-lang
marr has joined #ruby-lang
alessio_rocco has joined #ruby-lang
dr_bob has joined #ruby-lang
mossplix has quit [Ping timeout: 252 seconds]
dagobah has joined #ruby-lang
gnufied has joined #ruby-lang
mossplix has joined #ruby-lang
glebm has quit [Quit: Computer has gone to sleep.]
mbj has joined #ruby-lang
tonni has joined #ruby-lang
chendo_ has quit [Ping timeout: 258 seconds]
chendo_ has joined #ruby-lang
kain has quit [Quit: exit]
swav has quit [Remote host closed the connection]
chendo_ has quit [Ping timeout: 258 seconds]
chendo_ has joined #ruby-lang
chendo_ has quit [Changing host]
chendo_ has joined #ruby-lang
io_syl has quit [Ping timeout: 245 seconds]
gnufied has quit [Quit: Leaving.]
io_syl has joined #ruby-lang
glebm has joined #ruby-lang
TheNotary has quit [Ping timeout: 245 seconds]
krohrbaugh has joined #ruby-lang
toretore has joined #ruby-lang
gnufied has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 255 seconds]
Gaelan has joined #ruby-lang
judofyr has joined #ruby-lang
Gaelan has quit [Ping timeout: 276 seconds]
TheNotary has joined #ruby-lang
solars has quit [Read error: Operation timed out]
solars has joined #ruby-lang
chimmy has joined #ruby-lang
mossplix has quit [Ping timeout: 240 seconds]
vlad_starkov has quit [Remote host closed the connection]
mossplix has joined #ruby-lang
brianpWins has quit [Quit: brianpWins]
heftig has joined #ruby-lang
chimmy has left #ruby-lang [#ruby-lang]
TheNotary has quit [Ping timeout: 260 seconds]
<yorickpeterse> whitequark: http://i.imgur.com/0L6rxRJ.png why do you have so much shit in your top bar?
Wildhoney has joined #ruby-lang
<ddfreyne> What wm is that?
<wnd> reminds me of i3
security has joined #ruby-lang
megha has quit [Ping timeout: 248 seconds]
xxaM has quit [Ping timeout: 260 seconds]
<whitequark> i3
<whitequark> yorickpeterse: what do you mean by "shit"?
xxaM has joined #ruby-lang
swav has joined #ruby-lang
<whitequark> stuff on left is desktops; useful. stuff on right is tray; also useful. stuff in the middle is i3's default which I can't be bothered to change.
El_loco has joined #ruby-lang
heftig has quit [Ping timeout: 245 seconds]
<kxra> manveru: okay i made lots of changes, but now i also want it to be able to check for regexps
<kxra> it now works more like grep
<kxra> or like grep -r -n
<andrewvos> # Cool way to check argument count!
<whitequark> ... $. works in #each_line
mossplix has quit [Ping timeout: 252 seconds]
<kxra> andrewvos: i'm new, everything is cool
<kxra> =P
<injekt> you can remove one of those blocks
swav has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
TheNotary has joined #ruby-lang
swav has joined #ruby-lang
postmodern has joined #ruby-lang
<yorickpeterse> whitequark: a lot of crap
<yorickpeterse> why do you need ipv6 info in there?
<yorickpeterse> or your local ip
<wnd> i3status has that by default
charliesome_ has joined #ruby-lang
<whitequark> yorickpeterse: um, local ip is useful...
charliesome has quit [Disconnected by services]
charliesome_ is now known as charliesome
mossplix has joined #ruby-lang
<yorickpeterse> I just don't see how you need that all the time
TheNotary has quit [Ping timeout: 258 seconds]
skade has joined #ruby-lang
noop has quit [Ping timeout: 255 seconds]
<whitequark> yorickpeterse: as said: I'm too lazy to reconfigure it
jbsan has quit [Quit: jbsan]
chessguy has quit [Remote host closed the connection]
kain has joined #ruby-lang
<whitequark> grrr, rails autoloader is an incredible piece of shit
TheNotary has joined #ruby-lang
<whitequark> why the fuck is it even active in production (and why does it fail in multithreaded environment)
<injekt> what autoloader?
krohrbaugh has joined #ruby-lang
<judofyr> I thought it used a preloader in prod
Axsuul has quit [Ping timeout: 264 seconds]
<whitequark> hahaha no
<judofyr> but hey, I also thought Rails wouldn't allow running remote code as a part of query parsing, so yeah
<whitequark> well yes, but the preloader sucks. and because of that autoloader is also used
<whitequark> lemme find the issue
<whitequark> #7770
<judofyr> how's the Rails issue tracker btw?
<judofyr> 468 open issues
<judofyr> jesus
<whitequark> what the fuck who closed it
<whitequark> "not reproduced in master" have he tried actually reading the comment?
<whitequark> grrr.
beiter has joined #ruby-lang
<mbj> whitequark: +1 regarding rails autoloader is shit.
<mbj> whitequark: One of the reasons I moved away from rails
krohrbaugh has quit [Ping timeout: 252 seconds]
<charliesome> rails has some great stuff
noop has joined #ruby-lang
<charliesome> but god damn if it doesn't shit me all the time
<whitequark> ^
<injekt> +1
<charliesome> an example:
<mbj> The whole concept of autoloading just tries to fix a symptom not the root problem.
<lianj> are slow loading tests one of the great features?
<charliesome> is there a way to change how a model object is parameterized without defining a to_param method on the model?
<whitequark> mbj: a symptom of using ruby, indeed
<mbj> whitequark: ^
<injekt> charliesome: probably not, to_param is defined on Object (I believe as an alias for to_s) and it's used everywhere
<charliesome> injekt: that's horrid
<injekt> charliesome: yup
<whitequark> charliesome: why?
<charliesome> routing concerns don't belong on the model
<charliesome> they belong in the router
<judofyr> one day I'll release/finish my framework. and you will all rejoice!
<whitequark> oh, all this "decouple routing from models" talk
<whitequark> please proceed to play in the sandbox
<injekt> the rails router is incredibly dumb
<charliesome> whitequark: ?
<ddfreyne> What does the rails autoloader do?
<injekt> ddfreyne: autoloads!
<charliesome> i'm not regurgitating some blog i read, it's something that i've decided really annoys me
<ddfreyne> go back to bed, injekt!
<injekt> ddfreyne: :D
<whitequark> charliesome: so far, every "better" solution included writing 5x more code for every single link
<injekt> ddfreyne: config.autoload_paths
<whitequark> because, supposedly, architecture and so
<judofyr> injekt: I love how you define Rails routes in a nested-structure, which is then flattened into a list of regexps, which is then parsed by Journey, which re-creates a nested structure for performance \o/
<charliesome> config.routes.to_params_lol_whatever = { MyModel => -> obj { whatever } }
<charliesome> done
<charliesome> whitequark: mvc means you have to write 5x more code to get anything done
<charliesome> lol omg i have a 1 file guestbook, why overcomplicate it?
<injekt> judofyr: exactly, it makes me cringe
<whitequark> charliesome: no?
<charliesome> whitequark: no that's basically your argument
mossplix has quit [Ping timeout: 252 seconds]
<charliesome> you don't have to write 5x more code for every single link if you decouple routing from models
tbuehlmann has joined #ruby-lang
<charliesome> you can keep your links the same as they are
<whitequark> charliesome: I was referring specifically to manveru's (I think) hate for url_for
<charliesome> oh
<charliesome> i love url_for it rocks
<whitequark> your to_param solution is kinda fine but just superfluous imo
<charliesome> but the fact you need to define a method on your model class to change how the routing works is a bit lol
<whitequark> I mean yes you can decouple to_param from models but I don't quite see the point. Shuffling code around
<injekt> although would it require an extra query to the router for fetching a models parameterized value
<injekt> that is, something more than a simple method call
<lianj> link_to(crap, 'tag-attribute' => user_data) => ohai xss
<whitequark> charliesome: one thing you can do with that is combine multiple incompatible frameworks in one app
<whitequark> eg suppose if Rails had to_param and Sinatra did too, they *could* conflict. but that is entirely theoretical.
<charliesome> sure
<whitequark> not sure if it is ever useful in practice.
<charliesome> i don't actually have any reasons why to_param on the model class is evil and shit
chessguy has joined #ruby-lang
<charliesome> but it annoys me because i know that's not where it belongs
security is now known as megha
<whitequark> one of these issues. "it's bad but not enough to warrant a change."
<injekt> there's a lot of those
<charliesome> it's sort of the same as how you *can* do something like User.current safely and correctly
<charliesome> but you don't because it's not a very good idea
Gaelan has joined #ruby-lang
<whitequark> Thread.current[] yeah
<charliesome> sure
<whitequark> it's bad not because lolarchitecture, but because this way you couple current user to a thread
<injekt> I think I've only used that for a multi-tenant app, and didn't even really need it there
<charliesome> but it breaks the whole point of trying to do mvc in the first place
<whitequark> this has very real, practical implications
<charliesome> whitequark: you could argue that that's a lolarchitecture reason
<charliesome> coupling a user to a thread is bad architecture
<whitequark> charliesome: I have a bug because of that in the app I'm currently working on
<charliesome> it's the same as coupling a user to anything else that doesn't really have much to do with user
<whitequark> not specifically User.current, just coupling of in-flight req data to thread.
<whitequark> so it's not lolarchitecture :)
mossplix has joined #ruby-lang
<charliesome> do you mind if i ask what it is?
<whitequark> add thread pools and the user gets reused
<whitequark> (pun not intended)
<charliesome> no i mean, what your specific in flight req data is
<whitequark> ah. it's Honeybadger.context() in sidekiq
glebm has quit [Quit: Computer has gone to sleep.]
<whitequark> hb doesn't clear context at the start of sidekiq job, despite claiming integration with sidekiq
<charliesome> ah right
<whitequark> it's not really about rails but it's the same issue
<charliesome> so i think if it's something like that, it's acceptable to stick shit in Thread.current
Gaelan has quit [Ping timeout: 255 seconds]
<whitequark> well, I'd say it is acceptable too. but you need to know what you're doing. this is why Thread.current is a bad solution.
kith has quit [Read error: Connection reset by peer]
kith has joined #ruby-lang
toretore has quit [Read error: Connection reset by peer]
dagobah_ has joined #ruby-lang
<charliesome> Thread.current is a poor man's dynamic scoping
toretore has joined #ruby-lang
<whitequark> hmmm no, I disagree
<whitequark> dynamic scoping, by itself, doesn't play well with multithreading
pasties has quit [Ping timeout: 240 seconds]
dagobah has quit [Read error: Connection reset by peer]
<charliesome> whitequark: sure it can
<whitequark> charliesome: your code needs to be explicitly aware of the threading environment
<whitequark> in order to use dynamic scoping
<charliesome> not necessarily
<charliesome> there's no reason the dynamic scoping mechanism can't be thread aware
<whitequark> exactly
<whitequark> it *needs* to be thread aware
<whitequark> whereas lexical scoping doesn't
<charliesome> so *your code* doesn't need to be thread aware
<whitequark> I'm talking about implementation, ofc
<charliesome> the implementation of the dynamic scoping needs to be
<charliesome> but i would expect that
<charliesome> lexical scoping also has threading issues
<charliesome> if two threads see the same binding
<whitequark> charliesome: no, that's an issue with threading and closures
<whitequark> specifically, that closures are not always reentrant. if they depend on a value from a mutable binding.
chessguy has quit [Remote host closed the connection]
<charliesome> same difference
<charliesome> i don't see your concerns about dynamic scoping and threading though
El_loco has quit [Remote host closed the connection]
<whitequark> charliesome: "same difference"?
<charliesome> my point is
<whitequark> C's lexical scoping, for example, doesn't interact with multithreading in any way
pasties has joined #ruby-lang
<charliesome> most lexical scoping doesn't care about threads at all
<charliesome> except perl's
<whitequark> yea
<charliesome> if there was a language with dynamic scoping and threads, i would expect the dynamic scoping to be implemented in a threads aware way
<charliesome> and if it wasn't, then that's a major WTF in my books
<whitequark> concerns about dynamic scoping and threading: for example, I don't like how most variables throughout the program can become a point of contention in a multithreaded environment
<whitequark> it depends on implementation details, of course
<whitequark> for example you can implement it so that all variables are looked up in thread-local storage
<whitequark> no "a = 1; Thread.new { puts a }" for you, then
<manveru> whitequark: wtf is url_for?
<whitequark> manveru: url_for(@post) # => "/posts/1-my-cool-post"
<charliesome> whitequark: well in that case a is a lexical binding so that'd work
<charliesome> dynamic scoping is very useful, but it should be opt-in
<manveru> oh, i don't do rails
<manveru> so no that wasn't me
<whitequark> manveru: didn't you hate rails routing?
<whitequark> and praise ramaze's
mossplix has quit [Ping timeout: 240 seconds]
<whitequark> I'd expect you hate url_for for much the same reasons as well :)
GarethAdams has joined #ruby-lang
<whitequark> charliesome: yeah, with opt-in it's easier
<charliesome> there's still that edge case though
<whitequark> however I somewhat dislike how your suggestion binds two not clearly related concepts together
<charliesome> what should 'local a = 1; Thread.new { puts a }' do?
<whitequark> I mean you now have to remember not just how threading works and, as a distinct collection of facts, how dynamic scope works
<whitequark> but a 'dot-product' of threading ∙ dynamic scoping
arsemyonov has joined #ruby-lang
glebm has joined #ruby-lang
<whitequark> charliesome: I think that a naive Thread.current implementation, coupled with just as naive dynamic scoping (def dynscope(var, value); oldvalue = T.c[var]; T.c[var] = value; yield; ensure; T.c[var] = oldvalue; end) is the best solution here
lupine has joined #ruby-lang
<whitequark> not extending the language itself in any way
mossplix has joined #ruby-lang
<whitequark> grrr, I want TracePoint to be FASTER
<judofyr> whitequark: is it noticeable in Racc?
<whitequark> 5.9 second tests with TP; 2.4 seconds without
<whitequark> judofyr: the problem is that it instruments all the code, not just racc
<whitequark> and the hottest is in the lexer, where I don't need it at all
<judofyr> whitequark: why do you need to enable it when running tests?
<whitequark> judofyr: erm... to collect coverage for .y files?
<judofyr> ah, right
kxra has left #ruby-lang ["WeeChat 0.3.7"]
<whitequark> >> END{a=1}; p a
<eval-in> whitequark => nil ... (http://eval.in/16394)
<whitequark> why. the. fuck. doesn't END introduce a scope?!
<whitequark> BEGIN does
mossplix has quit [Ping timeout: 252 seconds]
<judofyr> >> BEGIN{a=1]; p a
<eval-in> judofyr => /tmp/execpad-8b291493c56a/source-8b291493c56a:2: BEGIN is permitted only at toplevel ... (http://eval.in/16395)
<whitequark> yeah it fails right on the klBEGIN token
<charliesome> judofyr: consequence of eval.in's begin..end wrapper :(
<judofyr> whitequark: but I don't see how BEGIN creates a new scope
<judofyr> ruby -e'BEGIN{a=1};p a' # => 1
* whitequark scratches his head
<charliesome> whitequark: file a bug report
<whitequark> oh, local_push is commented for some reason there
<charliesome> actually no
<whitequark> /*%%%*/
<whitequark> /* local_push(0); */
<whitequark> /*%
<whitequark> %*/
kain has quit [Quit: exit]
<charliesome> i know why BEGIN doesn't create a new scope
kain has joined #ruby-lang
<whitequark> charliesome: I DONT WANNA KNOW
<charliesome> cat crap | ruby -ne 'BEGIN { a = … } do stuff on a END { print a }'
<judofyr> isn't that the whole point of BEGIN? (to not create a scope
<judofyr> yeah, in -n/-p
<charliesome> whitequark: its actually perfectly reasonable
<charliesome> BEGIN/END have their places
<whitequark> let's have two parse.y's.
<whitequark> one for -e, and another for everything else
<charliesome> whitequark: that sounds like even more complexity
<charliesome> something i'm sure you'd complain about
<charliesome> when some quirks in the grammar affect -e and some don't
<whitequark> charliesome: that sounds like a language which makes sense
<judofyr> sometimes I wish matz wasn't trying to replace Perl
mossplix has joined #ruby-lang
rking has quit [Ping timeout: 245 seconds]
<charliesome> judofyr: would ruby have taken off if he didn't try to take over perl?
<judofyr> charliesome: or, wasn't trying to replace Perl's one-liners
<charliesome> judofyr: see previous question
<judofyr> charliesome: I'm not sure
rking has joined #ruby-lang
glebm has quit [Ping timeout: 245 seconds]
<judofyr> charliesome: I wasn't there in the early days
krohrbaugh has joined #ruby-lang
heftig has joined #ruby-lang
glebm has joined #ruby-lang
oneirophren has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 252 seconds]
retro|cz has quit [Ping timeout: 255 seconds]
toretore has quit [Read error: Connection reset by peer]
toretore has joined #ruby-lang
dvorak has joined #ruby-lang
voker57 has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
tbuehlmann has quit [Remote host closed the connection]
qwebirc146 has joined #ruby-lang
qwebirc146 has left #ruby-lang [#ruby-lang]
Monpoke has joined #ruby-lang
<Monpoke> Hello world :)
<judofyr> hey Monpoke
<judofyr> what's up?
<Monpoke> How are you ? :)
<judofyr> fine, fine
<Monpoke> Nothing and you ? ^^
r0bby_ has quit [Ping timeout: 256 seconds]
<judofyr> working :)
<Monpoke> ^^
<judofyr> Monpoke: been using Ruby a lot?
<Monpoke> I need some help if possible :3 I try to convert a ruby script in php and I never practize it ^^'
<Monpoke> No ^^"
<judofyr> Monpoke: from Ruby to PHP, or from PHP to Ruby?
<Monpoke> Ruby to PHP ^^
<Monpoke> In ruby script, i try to convert this line : chunk = code[i..-1]
<Monpoke> PHP : $chunk = $code[$i-1] ?
<judofyr> >> code = "Hello world!"; chunk = code[6..-1]
<eval-in> judofyr => "world!" (http://eval.in/16396)
<judofyr> Monpoke: nope, it's a slice. it takes a subset of the string from `i` to the end
<Monpoke> Hum, okay, so it's seem like substr
<Monpoke> Okaaay ^^
<judofyr> I would guess: subtr($str, $i)
<Monpoke> I think that is : substr($str, $i, -1) in this case ^^
<Monpoke> I will try
<Monpoke> XD
<GarethAdams> I think this is more a question for a ##php channel
sush24 has joined #ruby-lang
<judofyr> Monpoke: looking at php.net/substr: "If length is omitted, the substring starting from start until the end of the string will be returned."
<judofyr> GarethAdams: well, this channel isn't exactly crowded :)
<judofyr> I think we'll sort it out
<GarethAdams> :)
<GarethAdams> I wouldn't wish the depths of the PHP documentation on anyone, but each to their own
mbj has quit [Quit: Lost terminal]
<Monpoke> GarethAdams: It's more a ruby question ^^
<Monpoke> judofyr: Thanks, it's work ^^
<judofyr> Monpoke: anything else?
<Monpoke> For the moment no :)
nkr has joined #ruby-lang
<Monpoke> code[i..-1], Like you start from $i character, and you get -1 character, it is like $str[$i-1] ^^
<Monpoke> Thanks :)
<judofyr> Monpoke: (a..b) is a Range in Ruby. in this case it's a range from i to -1, which then means "from character i to the end of the string" on code[]
<Monpoke> Aaaahh xD
<Monpoke> Okaay ^^"
postmodern has quit [Quit: Leaving]
<Monpoke> Sorry, so it's substr function usefull ^^"
<judofyr> Monpoke: this will do the same: a = (i..-1); code[a]
mossplix has quit [Ping timeout: 264 seconds]
<judofyr> Monpoke: which can be a bit surprising. String#[] is quite powerful.
<lupine> just beware encoding and ruby version differences
<judofyr> >> "Hello world"[4]
<eval-in> judofyr => "o" (http://eval.in/16397)
<judofyr> >> "Hello world"[4, 2
<eval-in> judofyr => /tmp/execpad-6dafa46954f8/source-6dafa46954f8:3: syntax error, unexpected keyword_end, expecting ']' (http://eval.in/16398)
<judofyr> >> "Hello world"[4, 2]
<eval-in> judofyr => "o " (http://eval.in/16399)
<judofyr> >> "Hello world"[4..6]
<eval-in> judofyr => "o w" (http://eval.in/16400)
<judofyr> >> "Hello world"[/\w+/]
<eval-in> judofyr => "Hello" (http://eval.in/16401)
<lupine> "£3"[0..0] might surprise you, for instance
<judofyr> >> "£3"[0..0]
<eval-in> judofyr => "£" (http://eval.in/16402)
<judofyr> lupine: does that have anything to do with encodings?
<lupine> encoding and ruby version
benlovell has quit [Quit: Computer has gone to sleep.]
<judofyr> ah, right
<lupine> in 1.8, you just get "\302"
<Monpoke> (I read)
<lupine> and #size would return 3
<lupine> >>"£3".size
<eval-in> lupine => 2 (http://eval.in/16403)
<lianj> bytesize vs size
<lupine> >>"£3".force_encoding("BINARY").size
<eval-in> lupine => 3 (http://eval.in/16404)
<lupine> anyway, it's a minefield, keep an eye on iut
<judofyr> >> "£3".bytesize
<eval-in> judofyr => 3 (http://eval.in/16405)
<Monpoke> Hum okay for a =(...
<Monpoke> Ruby is really interesting ^^
<judofyr> Monpoke: anyway, we're just rambling
<lianj> >> [:bytesize, :size].map{|m| "£3".send(m) }
<eval-in> lianj => [3, 2] (http://eval.in/16406)
<judofyr> lianj: now you're just complicating everything with map and send and blocks and whatnot
* lupine wonders if ruby1.8 is going to be the IE6 of its day
swav has quit [Remote host closed the connection]
<lianj> judofyr: :p
<lupine> oh, and for range addressing in ruby, if you might at some point have a range with zero elements, don't forget to use ... rather than ..
<Monpoke> Syntax seem not easy ^^'
srbaker has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
<Monpoke> And this, chunk[/\A([a-z]\w*)/, 1], The "1" represents what ? ^^
<lianj> first match
Mon_Ouie has joined #ruby-lang
<Monpoke> Okaay :)
<Monpoke> Thanks :)
<lianj> s/match/capture
<judofyr> Monpoke: as I mentioned, String#[] is very "overloaded"
<Monpoke> Yes I see that ^^"
<lianj> yea, i think not many use it for regexp
mossplix has joined #ruby-lang
<judofyr> lianj: I use it often for regexp
divout has quit [Remote host closed the connection]
<Monpoke> ^^'
krohrbaugh has joined #ruby-lang
mossplix has quit [Quit: mossplix]
myappleguy has quit [Quit: Leaving.]
vlad_starkov has joined #ruby-lang
retro|cz has joined #ruby-lang
mossplix has joined #ruby-lang
krohrbaugh has quit [Ping timeout: 276 seconds]
totallymike has joined #ruby-lang
mbj has joined #ruby-lang
pskosinski has joined #ruby-lang
mytrile has joined #ruby-lang
Gaelan has joined #ruby-lang
benlovell has joined #ruby-lang
* whitequark coughs
<whitequark> 18>> p () {}
<eval-in> whitequark => /tmp/execpad-063a1c0dfa35/source-063a1c0dfa35:2: warning: don't put space before argument parentheses ... (http://eval.in/16407)
<charliesome> haha
<whitequark> 19>> p () {}
<eval-in> whitequark => /tmp/execpad-32c5b408f449/source-32c5b408f449:2: syntax error, unexpected ')' ... (http://eval.in/16408)
<whitequark> 20>> p () {}
<eval-in> whitequark => nil ... (http://eval.in/16409)
<whitequark> THREE DIFFERENT BEHAVIORS
<charliesome> this is my favourite
<charliesome> 18>> p p nil
<eval-in> charliesome => nil ... (http://eval.in/16410)
<charliesome> wait what
<charliesome> i swear it once said "warning: parenthesize argument for future version"
<charliesome> and that never actually happened
<whitequark> charliesome: I think you need -w
<charliesome> oh
<charliesome> even setting $-w and then evalling doesn't cause a warning
Gaelan has quit [Ping timeout: 276 seconds]
r0bgleeson has joined #ruby-lang
<whitequark> dunno
<judofyr> whitequark: I guess the 1.8 warning is about the 1.9 error, but somehow they re-implemented it in 2.0. wat?
<whitequark> judofyr: no
<whitequark> 19>> p (1) {}
<eval-in> whitequark => 1 ... (http://eval.in/16413)
idkazuma has joined #ruby-lang
<judofyr> uhm
<whitequark> grrr it should have displayed a warning
myappleguy has joined #ruby-lang
<whitequark> $ ruby -vw -e 'p (1) {}'
<whitequark> ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
<whitequark> 1
<whitequark> -e:1: warning: (...) interpreted as grouped expression
myappleguy has left #ruby-lang [#ruby-lang]
<whitequark> they just forgot the () case
<whitequark> there's quite a bit of these omissions in 1.9 grammar
My_Hearing has joined #ruby-lang
<whitequark> also def foo; BEGIN{}; end is one of those
Mon_Ouie has quit [Ping timeout: 264 seconds]
<whitequark> ::A ||= 1 is missing from both 1.8 and 1.9 for, i guess, much the same reasons
<whitequark> how did people live without git rebase
<judofyr> whitequark: they didn't commit
<judofyr> anyway, I really don't want to know more about Ruby's lexer/parser
<judofyr> I have enough problems
<whitequark> judofyr: u no write 2.0 support? :(
mossplix has quit [Ping timeout: 240 seconds]
<judofyr> whitequark: if you diff parse.y I can implement the actions
sepp2k has joined #ruby-lang
<judofyr> whitequark: also, have you merged in the ruby19 branch?
vlad_starkov has quit [Remote host closed the connection]
<whitequark> judofyr: ages
<whitequark> re diff: have this locally, will push
<Monpoke> ^poi
<Monpoke> yuiop
<judofyr> Monpoke: ehm?
r0bby_ has joined #ruby-lang
Gaelan has joined #ruby-lang
sailias has quit [Quit: Leaving.]
swav has joined #ruby-lang
r0bby_ is now known as robbyoconnor
yalue has joined #ruby-lang
thinkdevcode has joined #ruby-lang
scampbell has joined #ruby-lang
xcombelle has joined #ruby-lang
thinkdevcode has quit [Remote host closed the connection]
noop has quit [Ping timeout: 252 seconds]
<whitequark> judofyr: check out master
<whitequark> I've implemented a few things
<judofyr> whitequark: woot, I'm in the contributors \o|
<judofyr> oops
<judofyr> I meant
<judofyr> \o?
<judofyr> damn it
<judofyr> \o/
divout has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<kith> how do i make a case insensitive query in sequel?
<whitequark> judofyr: pushed ruby20 branch, it fails tests
robbyoconnor has quit [Ping timeout: 245 seconds]
<whitequark> judofyr: the idea is that ruby20 can contain arbitrary shit and will be rebased to form atomic self-contained commits
<whitequark> which are then picked to master.
carloslopes has joined #ruby-lang
noop has joined #ruby-lang
<judofyr> whitequark: ah, right
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
cored has quit [Ping timeout: 240 seconds]
smt has joined #ruby-lang
krohrbaugh has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
cored has joined #ruby-lang
<Monpoke> judofyr: My sister who make mistakes -__-
synthetix has quit [Ping timeout: 256 seconds]
lguardiola has joined #ruby-lang
<judofyr> Monpoke: hah. she wants to be a programmer too!
<Monpoke> I don't think :D
dustint has joined #ruby-lang
<GarethAdams> judofyr: do you have a hook-hand attachment?
<judofyr> GarethAdams: I just switched to US keyboard layout
krohrbaugh has quit [Ping timeout: 245 seconds]
<judofyr> (from NO)
<Monpoke> Ubuntu 12.04 is low to install xD
mistym has quit [Remote host closed the connection]
<judofyr> Monpoke: what are you using now?
<Monpoke> I'm on windows 7 on this pc
<Monpoke> Other, pc is too on w7
<Monpoke> And I install a small server on ubuntu :)
robbyoconnor has joined #ruby-lang
dustint has quit [Ping timeout: 256 seconds]
krz has quit [Quit: krz]
charliesome has quit [Quit: Textual IRC Client: www.textualapp.com]
dustint has joined #ruby-lang
tonni has quit [Remote host closed the connection]
sush24 has quit [Quit: This computer has gone to sleep]
r0bby has joined #ruby-lang
cordax has joined #ruby-lang
robbyoconnor has quit [Ping timeout: 245 seconds]
dustint has quit [Quit: Leaving]
Uranio has joined #ruby-lang
mistym has joined #ruby-lang
<whitequark> judofyr: pushed ** support
r0bby_ has joined #ruby-lang
r0bby has quit [Ping timeout: 245 seconds]
dustint has joined #ruby-lang
MaddinXx_ has joined #ruby-lang
<tommylommykins> assuming #ruby-lang is also #ruby-stdlib, I have a proposal!
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
<whitequark> tommylommykins: http://bugs.ruby-lang.org/
<r0bgleeson> great case for the gemification of the stdlib
tonni has joined #ruby-lang
<whitequark> r0bgleeson: if only we could send PRs which will actually get handled...
<Monpoke> This syntax means that is multidimensionnal array : tokens << [:IDENTIFIER, identifier] ?
<whitequark> >> tokens = []; tokens << [:IDENTIFIER, 1]
<eval-in> whitequark => [[:IDENTIFIER, 1]] (http://eval.in/16423)
<Monpoke> So, If I understand, If same :Identifier is used, last value will be overwritten ?
r0bby_ has quit [Ping timeout: 245 seconds]
<whitequark> Monpoke: no
<whitequark> >> tokens = []; 3.times { tokens << [:IDENTIFIER, 1] }; tokens
<eval-in> whitequark => [[:IDENTIFIER, 1], [:IDENTIFIER, 1], [:IDENTIFIER, 1]] (http://eval.in/16424)
andersbr has joined #ruby-lang
<Monpoke> Hum, okay ^^
<Monpoke> Thnaks :)
<GarethAdams> it's only a multidimensional array in the sense that it's an array inside an array. There's no extra magic functionality around that
<r0bgleeson> whitequark: I think attached patchs on the tracker get more traction
rsl has joined #ruby-lang
<whitequark> r0bgleeson: this is exactly the problem
<whitequark> you attach a patch on the bugtracker, and after a year or two it will maybe get merged.
idkazuma has quit [Remote host closed the connection]
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
thebastl has joined #ruby-lang
dumfries has quit [Ping timeout: 240 seconds]
<whitequark> judofyr: pushed %i/%I support.
<judofyr> whitequark: \o/
<judofyr> whitequark: you're doing it one-by-one?
dustint has quit [Ping timeout: 240 seconds]
<whitequark> judofyr: hm?
<whitequark> I'm fixing lexer so you can just dabble with parse rules
Gaelan has quit [Remote host closed the connection]
Gaelan has joined #ruby-lang
<judofyr> whitequark: oh right
rippa has joined #ruby-lang
breakingthings has joined #ruby-lang
dumfries has joined #ruby-lang
celinedior has quit [Quit: celinedior]
<judofyr> whitequark: is ruby20.y up to date? or is it just ruby19.y?
<judofyr> oh
<judofyr> I just diff'd it
sailias1 has joined #ruby-lang
<whitequark> yea
Uranio has quit [Ping timeout: 245 seconds]
My_Hearing has quit [Ping timeout: 245 seconds]
<whitequark> judofyr: do you have any work on top of ruby20 branch/
My_Hearing has joined #ruby-lang
<whitequark> judofyr: my point being, I just incorporated everything from it to master.
anonymuse has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
<judofyr> whitequark: nope. haven't done shit.
Gaelan has joined #ruby-lang
<judofyr> whitequark: what's missing from the 2.0-parser?
<judofyr> have you ported all of the rules?
<whitequark> judofyr: um... no
<judofyr> but you've ported some of them?
<whitequark> it's half-done
<whitequark> it's easier to follow the diffs
Gaelan has quit [Remote host closed the connection]
<whitequark> or I can reference the pending rules for you
Gaelan has joined #ruby-lang
thone has joined #ruby-lang
kogent has joined #ruby-lang
synthetix has joined #ruby-lang
cordax has quit [Quit: Computer has gone to sleep.]
<Monpoke> GarethAdams: Okay ^^
<Monpoke> Sorry for late x')
vlad_starkov has joined #ruby-lang
dustint has joined #ruby-lang
<whitequark> ...
<whitequark> >> ->{ yield &foo }
<eval-in> whitequark => /tmp/execpad-25b4c9cdd7c7/source-25b4c9cdd7c7:2: block argument should not be given (http://eval.in/16425)
<whitequark> why?
<judofyr> >> ->{|&foo| foo.call(1) }.call { |a| a * 2 }
<eval-in> judofyr => /tmp/execpad-95d4a9962f82/source-95d4a9962f82:2: syntax error, unexpected '|' ... (http://eval.in/16426)
<judofyr> 20>> ->{|&foo| foo.call(1) }.call { |a| a * 2 }
<eval-in> judofyr => /tmp/execpad-429c636b8c0d/source-429c636b8c0d:2: syntax error, unexpected '|' ... (http://eval.in/16427)
<whitequark> grr
<judofyr> wasn't this supported once?
<whitequark> ->(&foo) { foo.call(1) }.call { |a| a * 2 }
<judofyr> doh
<whitequark> >> ->(&foo) { foo.call(1) }.call { |a| a * 2 }
<eval-in> whitequark => 2 (http://eval.in/16428)
<judofyr> as you can see: I rarely use stabby lambda
<whitequark> hmm wat the diff
wallerdev has joined #ruby-lang
<whitequark> grrrr I fucking hate parse.y right now
<whitequark> the parse.y currently in parser corresponds to at least 1.9.2, not 1.9.3
<whitequark> might be earlier
<whitequark> oh. no, 1.9.3
<whitequark> reversed the diff accidentally
<whitequark> ... though I still hate parse.y
Gaelan has quit [Remote host closed the connection]
<judofyr> there were diffs in parse.y between 1.9.2 and 1.9.3 too? :(
<whitequark> yea
<whitequark> a = b = m c
Gaelan has joined #ruby-lang
rolfb has quit [Quit: Leaving...]
<whitequark> some other ones which are probably not user-visible
<whitequark> also m(a,)
<whitequark> no way to check via eval-in :)
wesside has joined #ruby-lang
<whitequark> ahha, and some of these differences are indeed not present in parser's parse.y
<whitequark> :(
mistym has quit [Remote host closed the connection]
<whitequark> as in, *really* subtle differences
<whitequark> like 19>> def foo; a:b; end
<whitequark> grr
<whitequark> 19>> def foo; a:b; end
<eval-in> whitequark => nil (http://eval.in/16429)
My_Hearing is now known as Mon_Ouie
<whitequark> this won't parse on 1.9.2
idkazuma has joined #ruby-lang
<Mon_Ouie> We can have an optional comma at the end of an argument list too?
<whitequark> >> p(1,)
<eval-in> whitequark => 1 ... (http://eval.in/16430)
wallerdev has quit [Quit: wallerdev]
<Mon_Ouie> Hm, I remember someone asking why that didn't work not too long ago. Guess he wasn't using the latest version.
<injekt> god dammit ruby
andersbr has quit [Quit: andersbr]
<Monpoke> >>> raise "ok"
<eval-in> Monpoke => /tmp/execpad-1bc9850d0816/source-1bc9850d0816:2: syntax error, unexpected '>' ... (http://eval.in/16432)
<Monpoke> >>>raise "ok"
<eval-in> Monpoke => /tmp/execpad-8b5e291b1a79/source-8b5e291b1a79:2: syntax error, unexpected '>' ... (http://eval.in/16433)
<Monpoke> >> raise "ok"
<eval-in> Monpoke => /tmp/execpad-7f2481979ef6/source-7f2481979ef6:2:in `<main>': ok (RuntimeError) (http://eval.in/16434)
alessio_rocco has quit [Ping timeout: 256 seconds]
madb055 has quit [Ping timeout: 256 seconds]
dhruvasagar has quit [Ping timeout: 264 seconds]
erpuds has joined #ruby-lang
<zzak> inkjet D:
outoftime has joined #ruby-lang
<whitequark> ugh, the insane static env-snooping behavior first appeared in 1.9.3
<whitequark> we should totally have flat versioning for ruby. 192. 193. 200. etc.
nertzy2 has joined #ruby-lang
dustint has quit [Ping timeout: 252 seconds]
nertzy has quit [Ping timeout: 240 seconds]
rippa has quit [Ping timeout: 240 seconds]
beiter_ has joined #ruby-lang
totallymike has quit [Quit: WeeChat 0.4.0]
<zzak> you're about 20 years too late
<whitequark> zzak: that was intended as a humorous remark, not an actual suggestion.
totallymike has joined #ruby-lang
<zzak> same
<whitequark> :D
<whitequark> in unrelated news... I'm not sure if I want to write ruby code anymore. srsly.
beiter has quit [Ping timeout: 245 seconds]
beiter_ is now known as beiter
twintail has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
<whitequark> the mental image of the parsing process doesn't want to go away. and it is not pretty.
<zzak> you need to take a break
<whitequark> yea. with a flamethrower
<zzak> go fishing, thats what i did :D
<whitequark> fishing with a flamethrower! yay!
<zzak> probably have better luck than i did haha
<whitequark> it's an optimization: the fish is already cooked when/if you catch it
* whitequark sighs
<whitequark> if I ever want to overflow ryan's inbox, I have an almost unlimited supply of RP bugs now
<zzak> hes usually pretty good about responding
<zzak> which is impressive considering the number of projects he maintains
rolfb has joined #ruby-lang
<whitequark> you mean responding like "no, ignore him"?
<zzak> sometimes you gotta be the bad guy
<zzak> but give him some credit ;)
<whitequark> sometimes I wonder about the true extend of stockholm syndrome in this community. but it's unrelated.
<whitequark> he didn't respond for most of my RP filings but I can totally understand him here, at least
<whitequark> I think the easier way to fix RP is to deprecate it :)
alessio_rocco has joined #ruby-lang
<zzak> not stockholm, its called respect, and i think he's earned it anyways
<judofyr> stockholm is a nice city
<injekt> what about london syndrome
mbj has quit [Quit: Lost terminal]
<whitequark> everyone can write a lot of code. not everyone can ensure others contribute to their code. it needs work
dustint has joined #ruby-lang
<whitequark> otherwise you end up spreading your time between seventy-five projects you have to maintain yourself.
madb055 has joined #ruby-lang
<judofyr> I have seventy-five dormant project that I don't have to maintain :D
<whitequark> though I do respect the dedication required for doing that for almost ten years.
<judofyr> sigh. sometimes I wish I were better at completing projects
<zzak> thats the role of the maintainer, just because he's not merge happy doesn't make him a bad maintainer
beiter_ has joined #ruby-lang
dvorak has quit [Ping timeout: 252 seconds]
beiter has quit [Ping timeout: 245 seconds]
beiter_ is now known as beiter
tonni has quit [Remote host closed the connection]
<judofyr> whitequark: btw, do you have any thoughts on I/O in Ruby? blocking, non-blocking, co-routines, streams etc?
dvorak has joined #ruby-lang
<whitequark> zzak: compare with Linux maintenance culture. they're not merge-happy yet that does not mean all trivial contributions are rejected just because. quite the opposite in fact
<whitequark> judofyr: use JRuby+netty if you care about IO, otherwise it doesn't matter.
<zzak> whitequark: i think youll find his demeanor much different when theres actually a patch presented
<zzak> but anyways
<judofyr> whitequark: hm. what interface to work with it? streams? callbacks? coroutines? promises?
io_syl has quit [Ping timeout: 245 seconds]
andersbr has joined #ruby-lang
<whitequark> judofyr: whatever's more convenient with you?
<whitequark> I find EM impossible to debug
<whitequark> so avoid coroutines
beiter_ has joined #ruby-lang
beiter has quit [Ping timeout: 245 seconds]
beiter_ is now known as beiter
<injekt> I find EM impossible to do anything
nXqd has quit [Ping timeout: 264 seconds]
<judofyr> whitequark: my biggest issue now is how to handle backpressure in a good way (without using blocking calls everywhere)
<whitequark> > pull.
<whitequark> judofyr: backpressure?
io_syl has joined #ruby-lang
nXqd has joined #ruby-lang
<judofyr> whitequark: e.g. you stream a file from one server to the other. how do you avoid filling up the write-buffer if the receiver is slower than the sender.
<judofyr> whitequark: that article was way above my head
<whitequark> judofyr: same
<whitequark> hmmm
kristofferrr has joined #ruby-lang
<judofyr> whitequark: e.g. if you have a WebSocket-endpoint that streams data continually, you don't want someone to be able to DDoS it by just connecting and not reading any data.
<whitequark> judofyr: when the buffer is filled the call either blocks or returns -EAGAIN
<whitequark> plus epoll has bits for readability and writabbility
<whitequark> local TCP buffer, that is.
<judofyr> well, EM/Node.js has its own local write buffer
<whitequark> the whole "if the receiver is slower than senver" is handled by the TCP stack and its congestion control algorithm
<whitequark> judofyr: yeah. you need to bypass that.
<whitequark> I'd be... not... surprised if node did not have a way to do it
<zzak> whitequark: isolated incident, but yeh, he should have done that from the get go
wallerdev has joined #ruby-lang
<judofyr> whitequark: well, how does that actually work in code without using blocking calls? e.g: sender.on('data', function(chunk) { receiver.send(chunk) })
<judofyr> whitequark: Node.js lately introduced the Stream interface which solves that
<whitequark> zzak: I guess "Send a PR" is so much harder to write than "No".
<judofyr> or, that's one of the problems it solves: http://nodejs.org./api/stream.html
<whitequark> judofyr: receiver.send(chunk) # raises IO::FuckYouException
<whitequark> or rather WaitReadable or something like that. it also clears method caches :p
<whitequark> (headius fixed it in MRI though)
<judofyr> whitequark: hm. then you'll always have to worry about #send raising an error though :/
<whitequark> judofyr: yep that's how nonblocking IO works all the way down to the POSIX
<whitequark> well
<whitequark> you can also snoop the epoll()-returned status
<zzak> whitequark: youre focusing on one incident
Monpoke is now known as Monpoke`Away
wyhaines has joined #ruby-lang
<judofyr> whitequark: well sure, but it's much nicer to work with a local write buffer. but then you still need another way to figure out "this connection is stalling"
<whitequark> judofyr: ie only send data when it returns the readable bit
swygue has quit [Read error: Connection reset by peer]
<whitequark> zzak: from what I see here, it forms a pattern. however I won't convince you of anything even with enough data points, so let's finish this discussion
<zzak> yeah, its not really fair to either party
swygue has joined #ruby-lang
gnufied has quit [Quit: Leaving.]
<judofyr> whitequark: I am aware, yes, but I don't find that a friendly model to deal with in my programs. I'd rather have an abstraction on top that adds a buffer so I can always just #send data. but then I still need a way to communicate the "stop, this guy can't handle it anymore"
<whitequark> judofyr: you'd just make a bad rewrite of TCP in your program
<judofyr> whitequark: that might be true, but it's better than dealing with WaitReadable at *every* place where you send data
<whitequark> you want exactly the same interface, but "with my own buffer" for some reason
* whitequark shrugs
<whitequark> wrap IO#send in something else
<judofyr> well yes, but I still haven't figured out a good way to communicate the backpressure :(
Monpoke`Away has quit [Ping timeout: 245 seconds]
<judofyr> I guess I should look at how other projects handle it…
<whitequark> zzak: there's also the fact that substantial refactoring of any seattlerb project is pretty much impossible without involving ryan, and he's got 75 projects. so...
krohrbaugh has joined #ruby-lang
<whitequark> I don't see how I would improve RP despite 1) wanting to 2) being able to contribute enough time to make a complete rewrite 3) being ok with occasional "fuck off" thrown at me, etc.
io_syl has quit [Quit: Computer has gone to sleep.]
<whitequark> other large-ish communities solve this by decentralizing control (KDE) or making it hierarchical (Linux)
<whitequark> (the former doesn't have an SPOF, for the latter it's Linus but a patch travels at least 2-3 levels before going to him)
<zzak> RP has quite a few less contributors than KDE or Linux
kogent has quit [Ping timeout: 245 seconds]
<whitequark> RP is also much smaller than KDE or Linux
celinedior has joined #ruby-lang
<whitequark> 4-6 orders of magnitude :)
beiter has quit [Ping timeout: 246 seconds]
<zzak> yarp
krohrbaugh has quit [Ping timeout: 252 seconds]
beiter has joined #ruby-lang
<whitequark> besides, I'm not talking about just RP but all the projects together
srbaker has quit [Quit: Computer has gone to sleep.]
|Vargas| has quit [Quit: ...]
<zzak> im not sure i see the problem there
<zzak> when you're maintainer you get to make those calls
beiter_ has joined #ruby-lang
<zzak> if you don't like the way the project is maintained, there is a fork button, end of discussion
beiter has quit [Ping timeout: 264 seconds]
beiter_ is now known as beiter
<whitequark> nope.
<whitequark> forks don't work.
nwjsmith has joined #ruby-lang
kogent has joined #ruby-lang
rolfb has quit [Quit: Linkinus - http://linkinus.com]
<whitequark> more precisely, hostile forks only work in rather extreme circumstances.
carloslopes has quit [Remote host closed the connection]
gnufied has joined #ruby-lang
twintail has quit [Quit: Leaving.]
<whitequark> what you're saying is like "oh you don't like how ruby's Encoding is screwed up? sure, the core team probably isn't going to take your suggestions into account anyway, move to Python"
<whitequark> the fact that it is true does not make that any less sad.
idkazuma has quit [Remote host closed the connection]
<whitequark> maintaining OSS projects is 10% writing code, 90% working with people whose suggestions you often don't like but need their work anyway.
mistym_ has joined #ruby-lang
mistym_ has quit [Remote host closed the connection]
sailias1 has quit [Ping timeout: 255 seconds]
<whitequark> (well, you can disregard that but then your project is mostly dead.)
beiter_ has joined #ruby-lang
beiter has quit [Ping timeout: 245 seconds]
beiter_ is now known as beiter
beiter_ has joined #ruby-lang
arsemyonov has quit [Quit: arsemyonov]
jg has quit [Quit: Leaving]
thebastl has quit [Ping timeout: 245 seconds]
beiter has quit [Ping timeout: 256 seconds]
beiter_ is now known as beiter
judofyr has quit [Remote host closed the connection]
rippa has joined #ruby-lang
mytrile has quit [Remote host closed the connection]
beiter_ has joined #ruby-lang
beiter has quit [Ping timeout: 252 seconds]
beiter_ is now known as beiter
sailias has joined #ruby-lang
tbuehlmann has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
anjen has joined #ruby-lang
swav has quit [Remote host closed the connection]
anjen has quit [Client Quit]
retro|cz has quit [Ping timeout: 258 seconds]
Gaelan has quit [Remote host closed the connection]
swav has joined #ruby-lang
nXqd has quit [Ping timeout: 240 seconds]
bzalasky has joined #ruby-lang
thebastl has joined #ruby-lang
snarfmason has joined #ruby-lang
sush24 has joined #ruby-lang
smt has quit [Quit: Konversation terminated!]
benlovell has quit [Quit: Computer has gone to sleep.]
bzalasky has quit [Remote host closed the connection]
tonni has joined #ruby-lang
sandbags2 has joined #ruby-lang
bzalasky has joined #ruby-lang
erpuds has quit [Quit: erpuds]
tonni has quit [Ping timeout: 255 seconds]
dhruvasagar has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
arsemyonov has joined #ruby-lang
krohrbaugh has joined #ruby-lang
JohnBat26 has quit [Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/]
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Connection reset by peer]
stef_204 has joined #ruby-lang
Wildhoney has quit [Ping timeout: 276 seconds]
GarethAdams has quit [Quit: Leaving...]
diogogmt has joined #ruby-lang
symm- has joined #ruby-lang
totallymike has quit [Read error: Connection reset by peer]
TheNotary has quit [Quit: Leaving]
srbaker has joined #ruby-lang
Luwe has joined #ruby-lang
headius has joined #ruby-lang
sandbags2 has quit [Remote host closed the connection]
dr_bob has left #ruby-lang [#ruby-lang]
kristofferrr has quit [Quit: ❤]
rondale_sc has quit [Ping timeout: 252 seconds]
swav has quit [Remote host closed the connection]
rondale_sc has joined #ruby-lang
erpuds has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
swav has joined #ruby-lang
totallymike has joined #ruby-lang
io_syl has joined #ruby-lang
celinedior has quit [Quit: celinedior]
retro|cz has joined #ruby-lang
joedoe has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 264 seconds]
symm- has quit [Ping timeout: 245 seconds]
__butch__ has joined #ruby-lang
Oloryn_lt2 has quit [Read error: Connection reset by peer]
symm- has joined #ruby-lang
Oloryn_lt2 has joined #ruby-lang
joedoe has quit []
__butch__ has quit [Ping timeout: 252 seconds]
tylersmith has joined #ruby-lang
Luwe has quit [Ping timeout: 246 seconds]
gnufied has quit [Quit: Leaving.]
Oloryn_lt2 has quit [Read error: Connection reset by peer]
retro|cz has quit [Ping timeout: 256 seconds]
maxmanders has quit [Quit: Computer has gone to sleep.]
Oloryn_lt2 has joined #ruby-lang
__butch__ has joined #ruby-lang
nwjsmith has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
Luwe has joined #ruby-lang
havenwood has joined #ruby-lang
breakingthings has quit []
KDiddy has joined #ruby-lang
twintail has joined #ruby-lang
dagobah_ has quit [Remote host closed the connection]
KDiddy has quit [Client Quit]
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
breakingthings has joined #ruby-lang
breakingthings has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
skade has quit [Quit: Textual IRC Client: www.textualapp.com]
retro|cz has joined #ruby-lang
andersbr has quit [Quit: andersbr]
Luwe has quit [Quit: leaving]
enebo has joined #ruby-lang
oneirophren has quit [Ping timeout: 256 seconds]
sepp2k has quit [Quit: Leaving.]
innohero has joined #ruby-lang
Gues_____ has joined #ruby-lang
Gues_____ has left #ruby-lang [#ruby-lang]
brianpWins has joined #ruby-lang
judofyr has joined #ruby-lang
<judofyr> whitequark: you here?
lguardiola has quit [Ping timeout: 256 seconds]
security has joined #ruby-lang
megha has quit [Ping timeout: 276 seconds]
dhruvasagar has quit [Ping timeout: 256 seconds]
security is now known as megha
<whitequark> judofyr: ye
<judofyr> I don't get this
<whitequark> i need source
<whitequark> also compare with %w
dc5ala has joined #ruby-lang
<whitequark> %i is almost identical to %w.
<whitequark> wrt/ parser rules, identical.
<judofyr> whitequark: http://pastie.org/private/jxtnky9xqlmv1aaz2w4mdw (ignore the ugly #updated for now)
swav has quit [Remote host closed the connection]
erpuds has quit [Quit: erpuds]
<judofyr> (and I reused #words_compose; not sure if I should have created another)
<whitequark> sec
kogent has quit [Quit: kogent]
mrsolo has joined #ruby-lang
<judofyr> oh
<judofyr> whitequark: nevermind!
<whitequark> judofyr: found it?
<judofyr> whitequark: I forgot %w(2.0)
<whitequark> yea
jonahR has joined #ruby-lang
<whitequark> judofyr: btw, I added relevant commits from mri to TODO.md.
<whitequark> feel free to remove the entries as you implement them
twintail has quit [Quit: Leaving.]
<whitequark> also I fixed I think every single edge case which was missing before
<whitequark> there are still cases where 1.9 (not 1.8 I believe) parsing follows rules laid out for 2.0
<whitequark> but fixing that would be a huge PITA and I don't think that edge-case-bug-compatibility with MRI makes sense
<judofyr> whitequark: should I create a ruby20-branch, or do one-feature-per-branch?
<whitequark> imo that stuff is simply best backported to 1.9.x series. 1.9.4 maybe
<whitequark> judofyr: both ok
<judofyr> whitequark: also, you should add ruby20.y to the coverage thingie
<whitequark> judofyr: it isn't there? crap
krohrbaugh1 has quit [Quit: Leaving.]
<judofyr> whitequark: not 90m ago at least
* judofyr rebases now
* whitequark git pushes
<whitequark> coverage: fixed
<whitequark> judofyr: wait which %w(2.0)
<whitequark> we don't do that
<whitequark> ALL_VERSIONS - %w(1.8 1.9)
<judofyr> ah, right
<whitequark> I'll add a 2.1 branch tomorrow and your tests will break
<judofyr> cool
<judofyr> whitequark: won't break it though; the coverage will be worse
<judofyr> whitequark: also, you should have added descriptions to the commits in TODO.md
<jaimef> can you do complex operations in a case/when statement? when "foo" then { } seems to not work for wrapping more than one command.
jbsan has joined #ruby-lang
tbuehlmann has joined #ruby-lang
<judofyr> jaimef: case foo; when "bar"; a; b; end
<jaimef> ahh. thanks. then seemed odd
solars has quit [Ping timeout: 264 seconds]
<whitequark> judofyr: hmm descriptions
<whitequark> they seem obvious to me :p
<whitequark> ok sec
<judofyr> 1ab3974b0efea5155da005ec08a1feee90023d98 seems obvious?
<whitequark> um yeah
<whitequark> ignore everything except rules, it's irrelevant
<whitequark> so that commit adds def foo(**kwrest)
<whitequark> and then there's an exponential explosion of rule count
<judofyr> whitequark: I meant the presence of "1ab3974b0efea5155da005ec08a1feee90023d98" in the TODO.md doesn't really help me. *opens every link in a new tab*
<judofyr> whitequark: also, where's %i/%I?
<whitequark> which clearly shows you should not use LALR(1) grammars, but that's unrelated
<whitequark> hmmm
krohrbaugh has joined #ruby-lang
andersbr has joined #ruby-lang
<judofyr> whitequark: I gave up the TODO.md. thoughts: https://github.com/whitequark/parser/pull/8
krohrbaugh has quit [Client Quit]
<whitequark> judofyr: do the rules match MRI?
<judofyr> whitequark: I have two questions: is it okay to use words_compose there too? and 2nd: is it okay to use #updated on the result from `word`?
<judofyr> whitequark: I had to rename ' ' to tSPACE
<whitequark> yeah it's expected
<whitequark> words_compose is OK
<whitequark> #updated is not
<judofyr> whitequark: I'll double check, but I think it's exactly the same
<whitequark> judofyr: you don't really need to use #updated
<whitequark> it's a remnant from a rule which is, to my knowledge, unused
<whitequark> however let me doublecheck...
<judofyr> whitequark: what should I do then?
<whitequark> oh. it is used :/
symm- has quit [Ping timeout: 256 seconds]
<whitequark> also a serious bug
krohrbaugh has joined #ruby-lang
<whitequark> judofyr: add symbols_compose, which updates :str->:sym, :dstr->:dsym
<whitequark> for the former you will also need to do #to_sym on the first child of the node
<whitequark> meanwhile I'll fix that bug...
krohrbaugh has quit [Client Quit]
marr has quit [Ping timeout: 258 seconds]
arsemyonov has quit [Quit: arsemyonov]
krohrbaugh has joined #ruby-lang
tsion has joined #ruby-lang
krohrbaugh has quit [Client Quit]
<whitequark> oh, it's pretty bad :/
<judofyr> whitequark: where does :dstr come from?
<judofyr> %I[h "#{1} b"] doesn't create it
<whitequark> judofyr: %W[foo#{bar}]
<whitequark> it'll currently fail with an unrelated error due to a lexer bug
KDiddy has joined #ruby-lang
tonni has joined #ruby-lang
erpuds has joined #ruby-lang
dc5ala has quit [Quit: Ex-Chat]
<judofyr> updated my PR
vbatts|work has joined #ruby-lang
<whitequark> judofyr: very well
divout has quit [Quit: Leaving.]
<whitequark> I'll merge that when I fix the bug
sepp2k has joined #ruby-lang
<whitequark> actually, screw green master, merging now
<judofyr> wee
mistym is now known as mistym_coffee
Wildhoney has joined #ruby-lang
qwebirc7397 has joined #ruby-lang
maxmanders has joined #ruby-lang
KDiddy has quit [Quit: Colloquy for iPad - http://colloquy.mobi]
vlad_starkov has joined #ruby-lang
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has quit [Read error: Connection reset by peer]
cwd1 has joined #ruby-lang
thebastl has quit [Remote host closed the connection]
pib1964 has quit [Remote host closed the connection]
cwd1 has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 276 seconds]
<judofyr> whitequark: what should the symbol for ""BEGIN is permitted only at toplevel" be?
lguardiola has joined #ruby-lang
<judofyr> :begin_toplevel
stef_204 has joined #ruby-lang
cored has quit [Ping timeout: 246 seconds]
breakingthings has joined #ruby-lang
<whitequark> judofyr: :begin_in_method
<whitequark> already there
<whitequark> I believe the action should be there too
<judofyr> whitequark: it's a different message in 2.0 though
cored has joined #ruby-lang
<judofyr> hm, andyes
<judofyr> you've actually implemented it
<whitequark> judofyr: change the message for all rubies
<judofyr> nevermind then :)
<whitequark> we don't care about precise wording in previous versions
forrest has joined #ruby-lang
retro|cz has quit [Read error: Operation timed out]
musl has quit [Quit: WeeChat 0.4.0]
krohrbaugh has joined #ruby-lang
musl has joined #ruby-lang
swav has joined #ruby-lang
swav has quit [Ping timeout: 256 seconds]
<yfeldblum> which is the ideal gem to use for talking to mysql?
beiter_ has joined #ruby-lang
<judofyr> yfeldblum: for plain SQL: mysql2 (it's a basic adapter)
<judofyr> yfeldblum: ORB that works great in Rails (and lots of blog posts/tutorials): ActiveRecord
<judofyr> s/ORB/ORM/
<yfeldblum> judofyr, i'm looking for a low-level gem, like a driver, not an ORM
<judofyr> yfeldblum: mysql2 then. it's the lowest level
<yfeldblum> judofyr, what's going on with the mysql gem?
beiter has quit [Ping timeout: 276 seconds]
beiter_ is now known as beiter
<judofyr> yfeldblum: I don't quite remember, mysql2 is the new hot shit anyway
<yxhuvud> not really that new anymore.
oneirophren has joined #ruby-lang
mossplix has joined #ruby-lang
<yfeldblum> judofyr, hmmm i don't see any releases of mysql2 for nearly 1.5 years
<judofyr> yfeldblum: there's some betas: http://rubygems.org/gems/mysql2/versions
<yfeldblum> judofyr, indeed there are, but i'm not counting them
<judofyr> yfeldblum: a MySQL driver isn't something that needs to be updated every month anyway
<yfeldblum> judofyr, tell that to 10gen
<judofyr> yfeldblum: hahahaha
cawaker has joined #ruby-lang
<yxhuvud> 10gen?
<judofyr> yxhuvud: company behind MongoDB
<judofyr> yfeldblum: it's not quite comparable though. if MySQL adds support for some SQL all of the drivers don't have to be updated
<yfeldblum> judofyr, i guess what i'm looking for are how stable & reliable are a) mysql-gem and b) mysql2-gem
<judofyr> yfeldblum: huh, mysql has recent releases too
<judofyr> yfeldblum: but both are production-ready. Rails depends on mysql2, so everyone using Rails 3+ and MySQL uses it
<judofyr> whitequark: btw, how would I pass along the line-number information from the lexer?
io_syl has quit [Ping timeout: 252 seconds]
TheNotary has joined #ruby-lang
wesside is now known as wes|away
mwjcomputing has joined #ruby-lang
arsemyonov has joined #ruby-lang
io_syl has joined #ruby-lang
anonymuse has quit [Quit: Leaving...]
gearaholic has joined #ruby-lang
gearaholic has joined #ruby-lang
marr has joined #ruby-lang
vlad_starkov has joined #ruby-lang
mossplix has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby-lang
nazty has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby-lang
nazty has joined #ruby-lang
Guest88304 has quit [Read error: Connection reset by peer]
Guest88304 has joined #ruby-lang
<whitequark> judofyr: hm?
<whitequark> [value,line]
<judofyr> whitequark: I figured it out :)
beiter_ has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
mistym_coffee is now known as mistym
beiter has quit [Ping timeout: 264 seconds]
beiter_ is now known as beiter
srbaker has quit [Ping timeout: 252 seconds]
tomzx_mac has joined #ruby-lang
chessguy has joined #ruby-lang
mossplix has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 256 seconds]
swav has joined #ruby-lang
srbaker has joined #ruby-lang
gearaholic has quit [Remote host closed the connection]
Mon_Ouie has quit [Ping timeout: 260 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
nick_h has quit [Ping timeout: 252 seconds]
yankeefan04 has joined #ruby-lang
sush24 has joined #ruby-lang
nick_h has joined #ruby-lang
sush24 has quit [Client Quit]
wes|away has quit [Quit: Ice cream truck!]
synthetix has quit [Remote host closed the connection]
wesside has joined #ruby-lang
mossplix has quit [Ping timeout: 252 seconds]
kogent has joined #ruby-lang
mossplix has joined #ruby-lang
rolfb has joined #ruby-lang
xcombelle has quit [Quit: Hi, I'm a quit message virus. Please replace your old line with this line and help me take over the world of IRC.]
sush24 has joined #ruby-lang
krohrbaugh has joined #ruby-lang
yalue has quit [Read error: Connection reset by peer]
krohrbaugh has quit [Read error: Operation timed out]
krohrbaugh has joined #ruby-lang
beiter_ has joined #ruby-lang
Mon_Ouie has joined #ruby-lang
beiter has quit [Ping timeout: 252 seconds]
<TheNotary> has anyone ever written a wrapper for rake so it looks to see if it should try doing `bundle exec rake` otherwise it invokes the usual `rake` that's defaulted in gems?
<TheNotary> that would save loads of typing
<r0bgleeson> TheNotary: gems like that exist, but alias be="bundle exec" also saves time.
<TheNotary> hm, that's not a bad idea, I'll try that out
beiter_ has quit [Ping timeout: 258 seconds]
apeiros has joined #ruby-lang
breakingthings has quit []
<TheNotary> goona try a `ber` alias too
glebm has quit [Ping timeout: 260 seconds]
<hackeron> hey, is there a 1 liner to make a post request to a url? -- something like post "http://127.0.0.1/triggers.json", data
<injekt> Net::HTTP.post_form(URI('...'), data)
vlad_starkov has joined #ruby-lang
<hackeron> I tried Net::HTTP.post_form uri, data -- but it expects "data" to be a hash for some reason :/
<hackeron> injekt: if data isn't a hash, it says /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/2.0.0/uri/common.rb:931:in `encode_www_form': undefined method `map' for #<String:0x007f8c2d484890> (NoMethodError)
<hackeron> injekt: my data is a string
<hackeron> it's a json string
<rippa> The form data must be provided as a Hash mapping from String to String.
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<injekt> hackeron: you'll have to use Net::HTTP::Post and set the data yourself
alessio_rocco has quit [Ping timeout: 256 seconds]
<rippa> there is also
<rippa> request_post
ryez has quit [Ping timeout: 245 seconds]
yankeefan04 has quit [Remote host closed the connection]
yankeefan04 has joined #ruby-lang
<hackeron> rippa: injekt: any easier way? -- in rspec, I just do post "/path", json_str -- is there something similar outside of rspec/controller-tests
anonymuse has joined #ruby-lang
<injekt> hackeron: no, not in stdlib
boredomist has joined #ruby-lang
<hackeron> injekt: any recommended library?
<injekt> hackeron: rest-client and excon are both ok
<injekt> I'd just use net/http myself, though
<injekt> and create helper methods
<rippa> what's hard in request_post ?
<rippa> response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
<hackeron> rippa: NameError: undefined local variable or method `http' for main:Object
<rippa> well, you have to create http object first, there's that
beiter has joined #ruby-lang
<rippa> but it's one line
judofyr has quit [Remote host closed the connection]
<injekt> Net::HTTP.new(uri.host).request(Net::HTTP::Post.new(uri.path), data)
fragamus has joined #ruby-lang
<injekt> shrug
<hackeron> pretty, lol
MaddinXx_ has quit [Remote host closed the connection]
stef_204 has joined #ruby-lang
<TheNotary> certainly not one line, but to me it feels clean and all
<hackeron> injekt: hmm, my url is uri = URI.parse("http://127.0.0.1:9292/#{path}.json") -- Net::HTTP.new(uri.host) says connection refused - I'm guessing I need to specify a port too?
<injekt> yeah using .body = string makes most sense to me too
<injekt> hackeron: uri.port to new
dustint_ has joined #ruby-lang
<injekt> new(uri.host, uri.port)
<hackeron> hmm, I think I do actually want Net::HTTP.post_form uri, data -- that almost works. My rails app gets some of the params, but the nested hash looks wrong. I get my params like this: "path"=>"/api/v1/triggers", "portal_name"=>"demo1", "token"=>"xanboxid1", "trigger"=>"{\"type\"=>\"motion-start\", \"date\"=>\"2013-04-12 14:25:17 +0100\", \"sname\"=>\"roman-room\"}"} --- notice "trigger" => stuff is wrong
dustint has quit [Ping timeout: 255 seconds]
<hackeron> if I do Net::HTTP.new(uri.host, uri.port).request(Net::HTTP::Post.new(uri.path), JSON(message)) then none of my params appear right, rails sees it as a long string
madb055 has quit [Ping timeout: 264 seconds]
pskosinski has quit [Ping timeout: 256 seconds]
<hackeron> RestClient.post "http://127.0.0.1:9292/#{path}.json", message << works beautifully :D
<hackeron> injekt: thanks for the suggestion :)
<injekt> hackeron: np!
vbatts|work has quit [Quit: MeSoChatty 0.3.8]
dustint_ has quit [Ping timeout: 264 seconds]
mossplix has quit [Ping timeout: 252 seconds]
sush24 has quit [Ping timeout: 245 seconds]
carloslopes has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
nXqd has joined #ruby-lang
zanegray has joined #ruby-lang
zanegray has quit [Client Quit]
sailias has quit [Ping timeout: 260 seconds]
pib1978 has joined #ruby-lang
dustint_ has joined #ruby-lang
mossplix has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
pskosinski has joined #ruby-lang
workmad3 has quit [Read error: Operation timed out]
zanegray has joined #ruby-lang
rolfb has quit [Quit: Linkinus - http://linkinus.com]
zanegray has left #ruby-lang [#ruby-lang]
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
guns has joined #ruby-lang
lele has quit [Ping timeout: 246 seconds]
stef_204 has joined #ruby-lang
scampbell has quit [Remote host closed the connection]
beiter_ has joined #ruby-lang
lele has joined #ruby-lang
beiter has quit [Ping timeout: 264 seconds]
beiter_ is now known as beiter
krohrbaugh1 has joined #ruby-lang
krohrbaugh has quit [Read error: Operation timed out]
rippa has quit [Ping timeout: 240 seconds]
yankeefan04 has quit [Remote host closed the connection]
zanegray has joined #ruby-lang
zanegray has quit [Max SendQ exceeded]
zanegray has joined #ruby-lang
fragamus has quit [Quit: Computer has gone to sleep.]
qwebirc7397 has quit [Quit: Page closed]
Gues_____ has joined #ruby-lang
Gues_____ is now known as Guest26186
Guest26186 has quit [Client Quit]
wyhaines has quit [Remote host closed the connection]
krohrbaugh1 has quit [Quit: Leaving.]
tbuehlmann has quit [Remote host closed the connection]
gregf has joined #ruby-lang
stef_204 has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
krohrbaugh has joined #ruby-lang
blacktulip has quit [Remote host closed the connection]
Wildhoney has quit [Ping timeout: 260 seconds]
andersbr has quit [Quit: andersbr]
vardaman has joined #ruby-lang
dustint_ has quit [Ping timeout: 248 seconds]
vlad_starkov has quit [Remote host closed the connection]
gix has quit [Ping timeout: 248 seconds]
sush24 has quit [Quit: This computer has gone to sleep]
gix has joined #ruby-lang
mossplix has quit [Ping timeout: 245 seconds]
jsaak has quit [Ping timeout: 264 seconds]
mossplix has joined #ruby-lang
maxmanders has quit [Quit: Computer has gone to sleep.]
postmodern has joined #ruby-lang
matled has quit [Write error: Broken pipe]
matled has joined #ruby-lang
krohrbaugh has quit [Quit: Leaving.]
vardaman has quit [Remote host closed the connection]
beiter has quit [Quit: beiter]
mossplix has quit [Ping timeout: 276 seconds]
srbaker has quit [Quit: Computer has gone to sleep.]
runlevel1 has joined #ruby-lang
zanegray has quit [Ping timeout: 252 seconds]
forrest has quit [Quit: Leaving]
runlevel1 has quit [Remote host closed the connection]
runlevel1 has joined #ruby-lang
erpuds has quit [Quit: erpuds]
mossplix has joined #ruby-lang
enebo has quit [Quit: enebo]
gix has quit [Ping timeout: 252 seconds]
krohrbaugh has joined #ruby-lang
krohrbaugh has quit [Client Quit]
havenwood has quit [Remote host closed the connection]
glebm has joined #ruby-lang
krohrbaugh has joined #ruby-lang
runlevel1 has quit [Quit: runlevel1]
srbaker has joined #ruby-lang
nXqd has quit [Ping timeout: 256 seconds]
runlevel1 has joined #ruby-lang
krohrbaugh has quit [Client Quit]
srbaker has quit [Client Quit]
benanne has joined #ruby-lang
gix has joined #ruby-lang
mossplix has quit [Ping timeout: 252 seconds]
apeiros has quit [Remote host closed the connection]
srbaker has joined #ruby-lang
marcosvanetta has joined #ruby-lang
runlevel1 has quit [Remote host closed the connection]
flexd has quit [Ping timeout: 264 seconds]
outoftime has quit [Quit: Leaving]
hramrach has quit [Ping timeout: 276 seconds]
mossplix has joined #ruby-lang
krohrbaugh has joined #ruby-lang
Gaelan has joined #ruby-lang
cored has quit [Ping timeout: 276 seconds]
flexd has joined #ruby-lang
cored has joined #ruby-lang
cored has joined #ruby-lang
cored has quit [Changing host]
mistym has quit [Remote host closed the connection]
oneirophren has quit [Ping timeout: 256 seconds]
vlad_starkov has joined #ruby-lang
toretore has quit [Quit: Leaving]
lguardiola has quit [Ping timeout: 256 seconds]
vlad_starkov has quit [Ping timeout: 264 seconds]
agarie has joined #ruby-lang
<agarie> Hey guys, if someone wants to participate in Google Summer of Code 2013, SciRuby has some projects: https://github.com/SciRuby/sciruby/wiki/Google-Summer-of-Code-2013-Ideas
kogent has quit [Quit: kogent]
innohero has quit [Ping timeout: 245 seconds]
mossplix has quit [Ping timeout: 245 seconds]
innohero has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
diogogmt has quit [Quit: diogogmt]
kogent has joined #ruby-lang
erpuds has joined #ruby-lang
mossplix has joined #ruby-lang
wesside has quit [Quit: Computer has gone to sleep.]
spuk has joined #ruby-lang
andersbr has joined #ruby-lang
apeiros has joined #ruby-lang
Nisstyre-laptop has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 276 seconds]
lcdhoffman has joined #ruby-lang
andersbr has quit [Ping timeout: 276 seconds]
krohrbaugh has quit [Ping timeout: 256 seconds]
krohrbaugh has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
andersbr has joined #ruby-lang
jbsan has quit [Ping timeout: 256 seconds]
nkr has quit [Quit: Linkinus - http://linkinus.com]
jbsan has joined #ruby-lang
mjio has joined #ruby-lang
mbj has joined #ruby-lang
anonymuse has quit [Quit: Leaving...]
lguardiola has joined #ruby-lang
glebm has quit [Ping timeout: 240 seconds]
idkazuma has joined #ruby-lang
marr has quit [Ping timeout: 248 seconds]
marcosvanetta has quit [Remote host closed the connection]
kogent has quit [Quit: kogent]
wallerdev has quit [Quit: wallerdev]
Gaelan has joined #ruby-lang
benanne has quit [Quit: kbai]
scottschecter has joined #ruby-lang
tesseract has joined #ruby-lang
Gaelan has quit [Remote host closed the connection]
headius has quit [Quit: headius]
_slowhands has joined #ruby-lang
tylersmith has quit [Quit: tylersmith]
kain has quit [Quit: exit]
mbj has quit [Read error: No route to host]
CoverSlide has joined #ruby-lang
zanegray has joined #ruby-lang
zanegray has quit [Max SendQ exceeded]
yfeldblum has quit [Read error: Connection reset by peer]
pkrnj has joined #ruby-lang