<slyphon>
gotta go see what's wrong w/ my 3 year old
<slyphon>
(won't go to bed, dammit)
<zenspider>
slyphon: it's THREE... that's what is wrong
<hzlocky_>
slyphon: nice code, but I want BogusValue to works absolutely like TrueClass(or FalseClass or NilClass)
<zenspider>
hzlocky_: what you want to do is nonsensical
<zenspider>
you want conf[k1] to return true and conf[k1][k2] to return true
<hzlocky_>
yep
<zenspider>
but the latter depends on the former to return something that will accept the #[] method
<zenspider>
and that just ain't happening w/o you severely breaking stuff
<hzlocky_>
1-st phrase - yes
<zenspider>
now... if you accept conf[k1] to return something TRUTHY... that's another matter
<zenspider>
because truthy is much better and bigger than true
<zenspider>
you could do conf[k1, k2] instead
drumond19 has joined #ruby-lang
<hzlocky_>
thats looks ugly
<zenspider>
not my problem
<zenspider>
I'm telling you what your options are
macmartine has joined #ruby-lang
ryanf has joined #ruby-lang
gregf has joined #ruby-lang
<zenspider>
quick! someone write a parser for the output of ruby --dump parsetree
hackingoff has joined #ruby-lang
machine2 has joined #ruby-lang
<slyphon>
it's not ruby --load parsetree ?
<slyphon>
lame!
shevy has joined #ruby-lang
jolohaga has joined #ruby-lang
<zenspider>
you fuckers... fine. I'll write it myself
headius has joined #ruby-lang
jperry has joined #ruby-lang
headius has joined #ruby-lang
slimfit has joined #ruby-lang
<erikh>
ha
dhruvasagar has joined #ruby-lang
<zenspider>
it's actually rather nice. I've got it munging it into yaml
havenn has joined #ruby-lang
gnufied has joined #ruby-lang
<erikh>
cool
<erikh>
today has been official monthly procrastination day
<erikh>
hoping my brain will kick into gear later tonight.
senthil has joined #ruby-lang
robbyoconnor has joined #ruby-lang
headius has joined #ruby-lang
skipper has joined #ruby-lang
jtoy has joined #ruby-lang
setmeaway2 has joined #ruby-lang
t has joined #ruby-lang
andrewhl has joined #ruby-lang
gnufied has joined #ruby-lang
crudson has quit [#ruby-lang]
havenn has joined #ruby-lang
RORgasm has joined #ruby-lang
t_ has joined #ruby-lang
setmeaway has joined #ruby-lang
<Asher>
do rackup apps usually decide their root (for loading config/environment files, etc.) by way of the config.ru file?
shtirlic has joined #ruby-lang
neoesque has joined #ruby-lang
<erikh>
yes
<Asher>
cool thanks
jxie has joined #ruby-lang
tris has joined #ruby-lang
Joeysomo has joined #ruby-lang
hackingoff has joined #ruby-lang
RubyRedGirl has quit [#ruby-lang]
Defusal has joined #ruby-lang
Defusal has joined #ruby-lang
mistym has joined #ruby-lang
dhruvasagar has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Joeysomo has joined #ruby-lang
fukushima has joined #ruby-lang
slimfit has joined #ruby-lang
wycats_ has joined #ruby-lang
gix has joined #ruby-lang
Asher has joined #ruby-lang
<imperator>
erikh, why not submit before the feature freeze? or do you mean there's a freeze now?
spuk has joined #ruby-lang
<erikh>
I dunno. I talked to drbrain and he suggested I waited.
<Xzyx987X>
hmm... is there any way to get ruby to let me do this?: "def password==(password)"
jxie has joined #ruby-lang
<Xzyx987X>
I know I could create a new class to handle the "==" operator, but it really seems like a weird approach in this case
<erikh>
yeah, that's the only thing I can think of
jxie has joined #ruby-lang
<Xzyx987X>
:/ I guess I'll just have to create a new class just for the password hash then
<erikh>
you could create another method, "equals_hash" or some business
<erikh>
might be simpler than trying to work with operators.
<imperator>
drbrain, why wait?
headius has joined #ruby-lang
<Xzyx987X>
that's true I guess, but the inconsistency bugs me :P anyway, I'm not sure why we can't do "def object==(object)" in the first place. seems like a logical thing to have the ability to do
surfprimal has joined #ruby-lang
<bnagy>
it's not logical
<bnagy>
ifg I see password=='blah' I am expecting it to be a call to == on a password object
<bnagy>
not a method called 'password=='
<bnagy>
also, stylistically (and this is subjective) I don't like the idea of using == when you're not testing equality, I'd suggest validate, or hash_matches? or something - like erikh said above
gnufied1 has joined #ruby-lang
kashyapkmbc has joined #ruby-lang
zz_skinny_much has joined #ruby-lang
ericmuyser has joined #ruby-lang
dr0id has joined #ruby-lang
Fullmoon has joined #ruby-lang
jxie has joined #ruby-lang
RORgasm has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
slimfit has joined #ruby-lang
tonesfrommars has joined #ruby-lang
rohit has joined #ruby-lang
travisjeffery has joined #ruby-lang
paul0 has joined #ruby-lang
<postmodern>
working on adding man-pages to my project
<postmodern>
i noticed bundler runs groff and $PAGER/`lass -R` to render the man pages
<postmodern>
wondering why not simply do system("man","./man/foo.1")
<zenspider>
does anyone have ANY clue why ruby 1.9 has an AST difference between proc { |a| } and proc { |a,| } ???
deobald has joined #ruby-lang
imperator has quit ["Leaving"]
krazyj has joined #ruby-lang
<krazyj>
any users of RGeo in here?
chimkan has joined #ruby-lang
<postmodern>
zenspider, you know more about Ruby than I, but it seems "a," somehow results in a "nil" in the parse tree, otherwise it's a "null"
<zenspider>
yeah. I'm confused as to what the difference actually is... and why
bojicas has joined #ruby-lang
rohit has joined #ruby-lang
paul0 has joined #ruby-lang
brushbox1 has joined #ruby-lang
gnufied1 has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has joined #ruby-lang
gnufied1 has joined #ruby-lang
chimkan___ has joined #ruby-lang
harikt has joined #ruby-lang
harikt has quit [#ruby-lang]
chimkan____ has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
chimkan_ has joined #ruby-lang
chimkan_ has joined #ruby-lang
brianpWins has joined #ruby-lang
t has joined #ruby-lang
gnufied has joined #ruby-lang
macmartine has joined #ruby-lang
Asher has joined #ruby-lang
replore_ has joined #ruby-lang
yxhuvud has joined #ruby-lang
spuk has joined #ruby-lang
bryanl has joined #ruby-lang
JohnBat26 has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
mephux has joined #ruby-lang
gokul has joined #ruby-lang
gnufied1 has joined #ruby-lang
paul0 has joined #ruby-lang
RORgasm has joined #ruby-lang
boxmo has joined #ruby-lang
gnufied has joined #ruby-lang
kitallis has joined #ruby-lang
macmartine has joined #ruby-lang
dhruvasagar has joined #ruby-lang
<erikh>
bwahaha
<erikh>
# Ruby lexer adapted from irb.
<erikh>
#
<erikh>
# The internals are not documented because they are scary.
pygmael has joined #ruby-lang
x0F_ has joined #ruby-lang
ryanf has joined #ruby-lang
<zenspider>
erikh: what's that from?
<Asher>
zenspider - do you have any summary thoughts on ruby2c?
ttilley has joined #ruby-lang
mindsuck has joined #ruby-lang
workmad3 has joined #ruby-lang
slaytanic has joined #ruby-lang
gnufied has joined #ruby-lang
zmack has joined #ruby-lang
<zenspider>
Asher: yes
solars has joined #ruby-lang
<Asher>
please share? i'm starting to think about how i will be optimizing some things that will clearly be accelerated using C… also thinking about long-term maintenance as the ruby code changes
<Asher>
would ruby2c + a version managed editor for changing specific portions be a good foundation?
dc5ala has joined #ruby-lang
<TTilus>
zenspider: thats RDoc::RubyLex i think
IPGlider has joined #ruby-lang
<zenspider>
Asher: 'yes' was as summarized as I could get
<zenspider>
Asher: what are you working on?
<Asher>
i've been working for a while on a persistence layer and a view-based web framework - both are coming together now (about to start use in beta testing first production instances)
<zenspider>
and how would ruby2c help with that? I can't see a view-based web framework needing it at all... and a persisntence layer? what have you done to profile and test its scalability?
<erikh>
zenspider: rdoc
savage- has joined #ruby-lang
<erikh>
drbrain gave me a few tasks on it, so I've been reading the source.
<erikh>
I just thought the comment was hilarious
<Asher>
well i haven't investigated yet to see precisely where it will help most - i do plan to do that before attempting to do so… i was more just curious how effective ruby2c is at translating the ruby and whether there were places that i might run into issues
<Asher>
i've become pretty familiar with ruby C was just wondering how using ruby2c compares to writing by hand i guess
<zenspider>
there's just about no way that ruby2c will work for something like a persistence layer. stick to writing it yourself... AFTER you write it in pure ruby AND come across actual bottlenecks that have been thoroughly profiled and reworked until there's no more improvements to be made in ruby
<erikh>
you want something like a.methods.inject(a.class.ancestors) { |x, y| x - y.methods }
diegoviola has joined #ruby-lang
<erikh>
apeiros_: oh shit
<erikh>
you're right. I completely forgot about that.
<tobiasvl>
wow
<tobiasvl>
well then
<apeiros_>
tobiasvl: a.methods(false) will give you all methods defined only and only for a (methods on its singleton_class)
<tobiasvl>
ruby outdid us once again
<apeiros_>
and a.class.instance_methods(false) gives you all instance methods of a's class, without any inherited methods
<Mon_Ouie>
zcdny: So, you should convert those symbols to string (like map(&:to_s))
<tobiasvl>
apeiros_: thanks
<apeiros_>
I have __m in my irbrc, which is defined seperately for Object, Enumerable and ActiveRecord::Base
<apeiros_>
generic one is indeed .methods-Object.methods, the one for Enumerable is .methods-Enumerable.instance_methods-Object.methods, the one for AR::Base similarly as the one for Enumerable
olesu has joined #ruby-lang
judofyr has joined #ruby-lang
<Mon_Ouie>
Why Object.methods and not Object.instance_methods?
<apeiros_>
less to type
<apeiros_>
gets a couple of methods too much, so yeah, if I don't type it by hand, I should probably change it :)
<sheldonh>
(i'm trying to resolve a race condition on the build of ruby-ldap)
<bnagy>
apeiros_: my 0.02 - being short tempered and rude about this cross posting pet peeve of yours doesn't enhance the atmosphere of the channel
<bnagy>
at the very least you could remind people politely before calling them 'dicks'
<apeiros_>
bnagy: there's a difference between calling people dicks and calling their behavior dick-behavior.
<apeiros_>
bnagy: noted, I'll kick again instead.
<bnagy>
only a semantic one - not in the way people feel when you do it
<bnagy>
anyway, as I said, just my opinion
<apeiros_>
I disagree @ only semantic. as said, opinion noted. but I have enough of inconsiderate help leechers, so the most I'll do is a less emotional kick.
<apeiros_>
s/I have enough/I'm fed up/
<bnagy>
what to do? it's the internet. :)
meise has joined #ruby-lang
<apeiros_>
that's lame-ass. I've been in irc long enough to see that it matters what you do about how people behave.
<apeiros_>
if you rather put your head in the sand, fine. I won't.
<outoftime>
anyone know if there's a good ORM-agnostic standalone migrations framework out there?
optikalmouse has joined #ruby-lang
imajes has joined #ruby-lang
<rue>
Yeah, there's one
<rue>
It's called SQL
<optikalmouse>
rue: what was the question?
<apeiros_>
but that's not database-agnostic!
<optikalmouse>
apeiros_: yeah it is, SQL works on different SQL servers ;p
<apeiros_>
optikalmouse: 16:24 outoftime: anyone know if there's a good ORM-agnostic standalone migrations framework out there?
<apeiros_>
but sql is certainly the fastest, especially for data migrations…
<outoftime>
rue, optikalmouse I'm not talking about SQL
<outoftime>
rue, optikalmouse I'm talking about having a set of scripts and keeping track of which ones have already been run, and which ones haven't, and then running the ones that have
<Mon_Ouie>
If you were talking about anything, that'd mean you know the answer to your question
<outoftime>
Mon_Ouie: huh?
<outoftime>
oops, s/have$/haven't
<apeiros_>
outoftime: um, building something like that is like… 10 lines of code?
<outoftime>
apeiros_: sure is. still could be 10 lines I don't have to write : )
<apeiros_>
outoftime: integrating an abstracted framework probably takes just as many lines
ericmuyser has joined #ruby-lang
<outoftime>
apeiros_: could be
<apeiros_>
additionally, it takes time to understand the approach etc.
<outoftime>
apeiros_: OK, I'll just write it, and then the answer when future outoftimes have this question will be "yes" : )
<apeiros_>
hah
<rue>
Unless you're ibid
<apeiros_>
the future outoftimes then will say "naaah, that makes assumption X, which doesn't work for me!!!!" ;-p
<outoftime>
apeiros_: I was thinking swappable backends for storing the list of migrations you've run, and no other assumptions at all
<outoftime>
not like, trying to provide a bunch of abstractions around data definition statements a la AR migrations
<outoftime>
as rue pointed out, SQL is pretty great at SQL.
<apeiros_>
unless you use an almostSQL db…
<outoftime>
apeiros_: that happens to be precisely my use case
Radium has joined #ruby-lang
_cam has joined #ruby-lang
wallerdev has joined #ruby-lang
<optikalmouse>
outoftime: it's easiest to write your own SQL scripts if you want it to be ORM-agnostic. you don't need a "framework" for this.
<outoftime>
optikalmouse: again, I'm not looking for something to *perform* migrations. you're right, you can just write SQL scripts
<outoftime>
optikalmouse: just something to keep track of which migrations have been run and which haven't, and easily do things like rollback etc.
<outoftime>
optikalmouse: what actually goes in the migration would just be whatever ruby code you want.
<optikalmouse>
write some extra ruby code that writes down which migrations were run.
naz has joined #ruby-lang
<optikalmouse>
perhaps by appending to a file or inserting a row in a database listing the script name that was run and when.
<optikalmouse>
I don't know, maybe that would work, I haven't had a coffee yet.
<outoftime>
optikalmouse: right, that's what I have in mind, just a little library to take care of the details of that with swappable storage for the list of what's been run
<optikalmouse>
write it, you don't need a framework for that.
<outoftime>
"framework" is probably not the right word, but a little library to take care of the details would, I think, be a good contribution to the community
<outoftime>
and so I shall write it and make it available to the world.
jxie has joined #ruby-lang
<optikalmouse>
make it as simple as possible, but not simpler.
<outoftime>
optikalmouse: sound advice : )
* apeiros_
has the feeling that using transient objects is somehow a bad pattern…
<apeiros_>
e.g. in a DSL, where you accumulate state, then extract the completed state and drop the proxy
<apeiros_>
but I don't see any better way :-/
<outoftime>
apeiros_: in what context?
joshkraemer has joined #ruby-lang
<outoftime>
apeiros_: oh, I see. so an object that just exposes the DSL, which encapsulates the actual state of the DSL
<apeiros_>
correct
<outoftime>
apeiros_: i definitely think there are situations where that pattern is the best
kain_ has joined #ruby-lang
<rue>
I dunno if there's anything inherently bad about ith
<rue>
Except apparently causing me to make typos
16SAA0QJD has joined #ruby-lang
slyphon has joined #ruby-lang
judofyr has joined #ruby-lang
rippa has joined #ruby-lang
t has joined #ruby-lang
francisfish has joined #ruby-lang
malev has joined #ruby-lang
rdavila has joined #ruby-lang
futurechimp has joined #ruby-lang
bglusman has joined #ruby-lang
slimfit has joined #ruby-lang
esad has joined #ruby-lang
freenetw has joined #ruby-lang
workmad3 has joined #ruby-lang
jtoy has joined #ruby-lang
hynkle has joined #ruby-lang
febeling has joined #ruby-lang
crackity_jones has joined #ruby-lang
gregf has joined #ruby-lang
<wwalker>
is there a way to differentiate in a method between "@a has been set to nil" and "@a has never been set"?
<shevy>
wwalker without using an extra variable not, afaik
<wwalker>
thank you. I was messaing with instance_variable_defined?() yesterday and it didn't work as expected (probably me being exhausted...)
<judofyr>
well, defined? is funky syntax; I like to see when it ends
<judofyr>
wwalker: defined? does the same as instance_variable_defined? so it might not fix your problem
<bnagy>
I feel the same way about Fox News
andrewhl has joined #ruby-lang
<judofyr>
bnagy: defined? a + 2
<judofyr>
although that's a silly example
<shevy>
at least Fox News randomly adds "boobs" or "fuck" to their news. that is worth something
<judofyr>
puts(defined? a + "\n")
<judofyr>
doesn't work as expected
<bnagy>
wow, you're right
<judofyr>
(for certain values of "expect")
<bnagy>
all your examples of instances where parens are needed make mine where they are ugly and useless totally irrelevant!
b0ggs has joined #ruby-lang
<lianj>
a parens hater huh?
<bnagy>
it's like life is... somehow context sensitive. Weird
dajmon has joined #ruby-lang
<judofyr>
bnagy: I wasn't trying to prove you wrong.
JohnBat26 has joined #ruby-lang
<bnagy>
if only there were some kind of computer parser that could arbitrate
<judofyr>
yeah, yeah
<shevy>
I like parens
<shevy>
especially in lisp
<bnagy>
judofyr: it's ok, I'm just drunk and od'ed on imgur
joshkraemer has joined #ruby-lang
<shevy>
(so(cool(to(do(this
<bnagy>
I don't mean it
<judofyr>
defined?(defined?)
<shevy>
wat
<judofyr>
shevy: guess the result
<shevy>
true!
<rippa>
syntx error
<judofyr>
wrong :)
<judofyr>
rippa: correct ;)
<shevy>
what is a "syntx error"
<rippa>
it's like a syntax error
<rippa>
bt drunk
<shevy>
cool
<bnagy>
o/
<bnagy>
variables are not methods!!1!
<shevy>
hmm
<judofyr>
bnagy: what'd you mean?
<bnagy>
... but srsly I wish I knew why that's a syntax error :(
<shevy>
not even in lisp?
<judofyr>
bnagy: because defined? is syntax-thingie, not a method. it requires a "parameter" to the right
<judofyr>
it's the inner defined? that's a syntax error
<bnagy>
ahh
<judofyr>
kinda like writing defined?(def)
futurechimp has joined #ruby-lang
<judofyr>
shevy: ))))
<judofyr>
shevy: you need to close your parens!
<shevy>
man see
<shevy>
that is the part in lisp I dont like :(
<shevy>
I look into the future, I only want to open things, not close them
<judofyr>
I think some lisps had "superparens" which closed all the parens above
<shevy>
hehehe
<shevy>
that sounds like superparents
tbuehlmann has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
IPGlider has joined #ruby-lang
mark_locklear has joined #ruby-lang
mssola has joined #ruby-lang
apeiros_ has joined #ruby-lang
Indian has joined #ruby-lang
macmartine has joined #ruby-lang
pygmael has joined #ruby-lang
dfr|mac has joined #ruby-lang
dfr|mac_ has joined #ruby-lang
butchanton has joined #ruby-lang
futurechimp has joined #ruby-lang
kiddorails has joined #ruby-lang
dfr|mac has joined #ruby-lang
crudson has joined #ruby-lang
brianpWins has joined #ruby-lang
<andrewvos>
Yes. Hilarious.
yxhuvud has joined #ruby-lang
savage- has joined #ruby-lang
<andrewvos>
Hey ruby-lang. If I want to ssh into an ubuntu box and type commands as if I was actually typing them into a terminal when logged into the machine, how would I do this?
<andrewvos>
For example, if I ssh in to a box and run cucumber then I want firefox to open up on that actual box.
<apeiros_>
andrewvos: net/ssh
<andrewvos>
Open up on the display plugged into that box Imean
<andrewvos>
And I don't want to use vnc because the connection is too slow
<andrewvos>
Also, -X sucks
pemeon has joined #ruby-lang
shtirlic has joined #ruby-lang
<andrewvos>
apeiros_: That's just a gem right?
<apeiros_>
andrewvos: yes
<apeiros_>
but I'm not sure I really got your problem
<andrewvos>
Well, for example if I ssh in and run `firefox` I get "Error: no display specified"
<andrewvos>
apeiros_: ^
shtirlic_ has joined #ruby-lang
<apeiros_>
andrewvos: ah, I see. can't help with that.
solars has joined #ruby-lang
Sailias has joined #ruby-lang
kurko_ has joined #ruby-lang
<hagabaka>
DISPLAY=:0 firefox?
<hagabaka>
> andrewvos
<andrewvos>
hmmm
fgomez has joined #ruby-lang
olesu has joined #ruby-lang
<hagabaka>
you would need to do the same if you log in to a new console session (Ctrl+Alt+F1, not terminal) on that computer
<hagabaka>
...and run an X program in it
ironcamel has joined #ruby-lang
<erikh>
ssh -X host 'firefox'
ironcamel has quit [#ruby-lang]
fgomez has joined #ruby-lang
<erikh>
rush is the best band ever created
<apeiros_>
erikh: hm, he said -X sucked - didn't say why, though
ryanf has joined #ruby-lang
<erikh>
it's the interbutts! you don't need a reason.
ironcamel has joined #ruby-lang
<andrewvos>
apeiros_: Cause it's slow!!
dajmon has joined #ruby-lang
<andrewvos>
Right fuck this I'm going home! Thanks for the help xx
d3vic3 has joined #ruby-lang
flak has joined #ruby-lang
Austin__1 has joined #ruby-lang
<erikh>
andrewvos: x is slow period
Carnage\ has joined #ruby-lang
<erikh>
but, what you want is
<erikh>
xhost +
<erikh>
then export DISPLAY="my.ip.address:0"
<chris2>
erm
<chris2>
pleasz
<chris2>
xhost +<ipaddress>
<erikh>
heh
<erikh>
what's the fun in that?
<chris2>
hehe
<erikh>
no playing around with forking xmessage
<chris2>
no key sniffing
<erikh>
oh yeah.
<erikh>
don't you have to be focused in the remote client window for that to work though?
<erikh>
I don't know a lot about X, but it seems logical
<chris2>
no
<erikh>
interesting.
<chris2>
think xbindkeys
<erikh>
ah
savage- has joined #ruby-lang
dfr|mac has joined #ruby-lang
<jtoy>
what is a good way to match a url from a string? this is not working for me: "asdsa http:/asdasdsad.com asdasd".match(/[http://\S+]\s+/)
<apeiros_>
URI.extract
<jtoy>
apeiros_: nice, didn't know about that
<apeiros_>
read the docs, it accepts a schemes arg.
dfr|mac_ has joined #ruby-lang
dfr|mac__ has joined #ruby-lang
rdavila has joined #ruby-lang
dfr|mac has joined #ruby-lang
krz has joined #ruby-lang
<jtoy>
apeiros_: hmm, it accepts things like Specials: and week:
<erikh>
so does the URI specification
<apeiros_>
btw., your match wasn't working because you wrote http:/ instead of http:// in your string
<hagabaka>
it should be ( ) instead of [ ], and escape / inside
<apeiros_>
ah, should actually just drop [], and yes, escape / or use %r
outoftime has joined #ruby-lang
<apeiros_>
and probably drop the \s+ too
wycats_ has joined #ruby-lang
<Defusal>
im guessing theres no easy way to hook all modifier methods for a class, like Array#<< and Hash#[]=
olesu has joined #ruby-lang
* apeiros_
wonders what that's supposed to mean
<Mon_Ouie>
No, but maybe that means you shouldn't return an array or a hash, and instead your own object that wraps it
<Mon_Ouie>
(I'm assuming that means, doing something whenever a specific array or hash is modified)
kurko_ has joined #ruby-lang
morozovm has quit [#ruby-lang]
rippa has joined #ruby-lang
<Defusal>
Mon_Ouie, well i was just gonna modify the singleton class of the object being returned
<Defusal>
but it'll have to wait, i don't have time to handle every possible modifier method
<Defusal>
i could possibly make the wrapper proxy all method calls, and check if the objects data has changed before returning the result, though that would not be too efficient
deobald has joined #ruby-lang
<erikh>
man I am looking forward to TCO in ruby 2.0
<yxhuvud>
tco?
lsegal has joined #ruby-lang
<_cam>
tail call optimisation?
<erikh>
yxhuvud: yeah
<Mon_Ouie>
Defusal: That's why I'd recommend you create an object with a restricted interface so you can deal with modifications more easily
ryanf has joined #ruby-lang
<Defusal>
yeah
ridders24 has joined #ruby-lang
maja has joined #ruby-lang
maja has joined #ruby-lang
achiu has joined #ruby-lang
hagabaka has joined #ruby-lang
hagabaka has joined #ruby-lang
olesu has joined #ruby-lang
jacktrick has joined #ruby-lang
musl has joined #ruby-lang
fgomez has joined #ruby-lang
senthil has joined #ruby-lang
lsegal has joined #ruby-lang
_cam has joined #ruby-lang
workmad3 has joined #ruby-lang
nightlycoder has joined #ruby-lang
outoftime has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
nofxx has joined #ruby-lang
benanne has joined #ruby-lang
tjadc has joined #ruby-lang
boxmo has joined #ruby-lang
francisfish has joined #ruby-lang
dejongge has joined #ruby-lang
Skif has joined #ruby-lang
workmad3 has joined #ruby-lang
olesu has joined #ruby-lang
savage- has joined #ruby-lang
dajmon has joined #ruby-lang
vesan has joined #ruby-lang
<slyphon>
is there a thing to make an array 'circular'?
<rippa>
how?
<slyphon>
like you set the items [1,2,3]
<erikh>
like a circular linked list?
<slyphon>
and then call .next and it just returns 1,2,3,1,2,3,1,2,3
olesu has joined #ruby-lang
<rippa>
array.cycle
<slyphon>
yes! thank you!
<erikh>
whoa, neat.
febeling has joined #ruby-lang
rdavila has joined #ruby-lang
krzkrzkrz has joined #ruby-lang
mssola has joined #ruby-lang
kiddorails has quit [#ruby-lang]
<rue>
Enumerable is the best thing in the history of things
<andrewhl>
If I have a .txt file that consists basically of words like this: "ALLOW","ALMOST","ALONE","ALONG", how can I parse it into an array of just the words, minus the quotation marks? split(",") produces this: "\"ALLOW\"", "\"ALMOST\"", "\"ALONE\"", "\"ALONG\""
<dragonkh>
that was not a general statement - it was in reply to Kero !!
<Kero>
:)
<dragonkh>
jruby is nice - but I had a lot of issues getting rails to run on it - mostly around oracle driver support and other driver based things
rushed has joined #ruby-lang
<apeiros_>
ooooraaaacllleeee!
* apeiros_
needs the kahn-meme
* Kero
has some shiny new hardware up and running (Genesi Efika), and it's about time to install the ruby webservice. Watching to see how the ruby vs jruby discussion turns out and whether it applies to linux/arm ;)
* apeiros_
keeps repeating his new mantra… "only half a year, only half a year, …"
<headius>
our oracle driver isn't great...the oracle-enhanced adapter is more complete
<headius>
Kero: jruby works fine on arm
<headius>
I've only tested the (non-free) oracle JVM for ARM
<dragonkh>
I had to hack large parts of the oracle driver to get it working I remember
<headius>
freely downloadable though
<dragonkh>
and I was thinking - maybe noone uses oracle with rails on jruby hehehhe
VegetableSpoon has joined #ruby-lang
<Kero>
headius: it's a mess on debian x86, in the sense that `gem list` does not run (last time I tried). Have not tried on debian arm, yet
<slyphon>
array.to_enum.cycle FTW
<headius>
Kero: what's a mess?
* slyphon
waves to headius
<headius>
slyphon: hiya!
<Kero>
jruby -S gem list
<headius>
Kero: hmm, that oughta work fine
<headius>
I know debian's packages are way behind though
<headius>
for jrub
<headius>
y
<slyphon>
headius: hey, two quick questions: InvokeDynamic and maven integration
<headius>
our CI runs on debian (ubuntu, but yeah)
<headius>
slyphon: ok, what's the questions? :)
<slyphon>
there was some InDy blog post that showed the magic properties to adjust
<Kero>
yeah, guessed as much. the load on my server is very low, so I don't really care which ruby version I run.
<slyphon>
i can't find
<slyphon>
and the maven thing wound up...?
<headius>
properties for JRuby or JVM?
<slyphon>
yes?
outoftime has joined #ruby-lang
<slyphon>
either?
* slyphon
<-- ignorant/innocent
<headius>
these days you probably don't need to mess with either
<slyphon>
oh, cool
<headius>
get an OpenJDK 7u2 or higher and run JRuby master
<headius>
it will just use indy
* slyphon
chuckles at "these days"
* slyphon
blinks
<drbrain>
hrm, that's not right
<slyphon>
drbrain: uh, are you banning everyone?
<drbrain>
please hold on while I figure out how to use my IRC client again!
* slyphon
ducks and covers
<slyphon>
mwuahahahah!
<zenspider>
that's it
* apeiros_
op #ruby-lang
<apeiros_>
aaah
<apeiros_>
dang
<slyphon>
hahahah
<apeiros_>
slyphon deoped too soon
<slyphon>
OH NOES
<slyphon>
yay! we're all trying on our hats!
<slyphon>
god
<slyphon>
zenspider: what was the name of that fucking troll?
<slyphon>
you remember that
<zenspider>
which one?
* Kero
filters out FIN packets so his connections do not die
<slyphon>
back in the day, kid from alaska or some shit
<zenspider>
tsume aka dross aka some furry name
<slyphon>
hah!
<slyphon>
yes!
<Kero>
oh dear. memory lane.
<slyphon>
jeez
<slyphon>
i think that's why i got ops in the first place
<zenspider>
he trolled me a couple months ago...
<zenspider>
apparently he's a furry AND a security guard or somesuch
<slyphon>
wow!
dv310p3r has joined #ruby-lang
<slyphon>
that's awesome
<dajmon>
does he wear his tail to be intimidating, do you think
<dajmon>
and swing it around
michael_mbp has joined #ruby-lang
s0ber_ has joined #ruby-lang
y3llow_ has joined #ruby-lang
<michael_mbp>
hey thanks drbrain
<zenspider>
zenspider... saving the channel from drbrain...
<shevy>
there can only be one!
<michael_mbp>
right, so passing an object to a block, what mechanism implies that it needs to respond to call?
butchanton has joined #ruby-lang
<michael_mbp>
*correction, passing an object /instead/ of a block.
<slyphon>
through what syntax would you do that?
<apeiros_>
michael_mbp: you mean &some_obj? it uses to_proc
<apeiros_>
michael_mbp: I'm awesome just right now. I finally reinvented my stupid parser :)
<apeiros_>
and it even *works*
<michael_mbp>
so instead of ActiveSupport::Notifications.subscribe "process_action.action_controller" do |name, started, finished, unique_id, data|, if I were to do ActiveSupport::Notifications.subscribe("process_action.action_controller", FancyObject.new), it would expect FancyObject.new to respond to def call(name, started, finished, unique_id, data) ...
<listrophy>
krazyj: if so, then you should be calling the accessor in def generate
<krazyj>
ahh
<listrophy>
(for starters)
<krazyj>
listrophy: removing the attr_accessor line doesn't fix it
<listrophy>
krazyj: no, i mean on line 28, remove the '@'
<krazyj>
listrophy: it's an ivar
<krazyj>
line 43
elalande has joined #ruby-lang
<listrophy>
krazyj: yeah... so, it's kind of a style thing. I would claim that if you have an attr_accessor, you should almost always use the method, not the ivar
slyphon has joined #ruby-lang
<krazyj>
ah ok, i see what you mean
<krazyj>
in that case, it's only an attr_accessor for debugging purposes
<listrophy>
k. anyway, adhering to the style i described allows one to easily drop in things like memoization
<listrophy>
oh, i see it
* krazyj
needs to research memoization.. not familiar
<listrophy>
krazyj: on line 28
<zenspider>
I'd have to guess that @factory is nil, no?
<krazyj>
zenspider: yes. line 11
<listrophy>
krazyj: the expression to the right of 'until' is executed before the expression on the left
<krazyj>
listrophy: yeah, that's causing the error
<krazyj>
:|
<krazyj>
thought it was reverse
<zenspider>
you should remove bundler and thor from the equation
<krazyj>
ok, well thanks listrophy :)
<krazyj>
is there a syntax for evaluating the conditional after execution of the body?
<krazyj>
like do/while
<listrophy>
and until has lower precedence than assignment
<krazyj>
listrophy: what do you mean by that?
<listrophy>
krazyj: suffice it to say, if you split the line into three sections: before "=", between "=" and "until", and after "until", the third item is evaluated before the first two
<listrophy>
that is, "until" acts as the line's "first" hinge, not the "="
<listrophy>
and "until" is right-associative
<listrophy>
but perhaps that's a little too much jargon?
brushbox has joined #ruby-lang
<krazyj>
listrophy: no, i think i'm following
<krazyj>
until is executed first, then everything before until
<krazyj>
…until the conditional is achieved :P
<krazyj>
s/executed/evaluated
<listrophy>
hopefully i didn't bugger up the terminology, but you seem to be on the right track
<krazyj>
cool. thanks a bunch listrophy
<listrophy>
yup
<listrophy>
np
<krazyj>
that said… do you know off the top of your head what kind of 'different' control structures are found in ruby? i.e. not the usual if/while variants
<krazyj>
i've noticed until and unless
<listrophy>
"and", "or" are slightly different from "&&", "||"
<listrophy>
they act the same, but with different precedence
<listrophy>
krazyj: beyond that, i dunno. look up the reserved words list =)
<krazyj>
thanks :)
<listrophy>
heh, technically, lambdas can be abused as control structures =)
<drbrain>
listrophy: if you're only abusing lambdas you're not trying hard enough… return_bang uses callcc
<countskm>
does anyone here "corral" their modules under lib in a different way or just lay them out w/ the classes
<countskm>
corral=group sorry i know this is an international channel - actually unless u are from texas i dunno if you have heard that ;-)
<michael_mbp>
hi anyone know whom I can contact in #ruby to get unbanned for having (had) a terrible net connection and cycling/bouncing a lot ?
<zenspider>
michael_mbp: don't bother. #ruby is a waste of time
<michael_mbp>
ah
<michael_mbp>
been a while since I've been there to remember.
<listrophy>
michael_mbp: also, consider using a server + screen or tmux + irssi
<zenspider>
countskm: with classes/module mapping
<michael_mbp>
listrophy: yes, that's definitely on my todo
<michael_mbp>
I used to have an irssi setup ages ago
<countskm>
not familiar w/ that - can u elaborate a tad more?
<michael_mbp>
I've already got a personal linode VPS for serving rack apps.
<countskm>
funny i googled something before asking and ur quickref came up - coincidence or no? :-)
<countskm>
is that a github project?
boxmo has joined #ruby-lang
<countskm>
by default, i would just put the module in the same lib/ subdirectory - but something feels a little weird about having it w/ other things that get instantiated
<countskm>
maybe i am being to anal
<zenspider>
at this stage I have no idea what you're asking
<countskm>
i guess the module does get instantiated thru proxy of an object that includes it
<countskm>
k np
<countskm>
its just a namespace rather than a technical problem
<countskm>
like the quickref btw
<countskm>
"
<countskm>
"don't rescue Exception. EVER. or I will stab you." lol
fgomez has joined #ruby-lang
<countskm>
laughing w/ u btw
lsegal has joined #ruby-lang
slyphon has joined #ruby-lang
<krazyj>
what's the correct way to implement a constant for a whole implementation file? for example, line 5 is a constant used in line 6 and 21: http://screencast.com/t/mEBXsAyXr1
brushbox1 has joined #ruby-lang
<zenspider>
can you stop submitting screengrabs of text? it's really annoying
michael_mbp has joined #ruby-lang
<countskm>
se acabo
fayimora has joined #ruby-lang
esad has joined #ruby-lang
<andrewvos>
krazyj: That's ok I suppose. Or just move it up to class level and name it like a constant. LIKE_THIS
<krazyj>
andrewvos: thank you sir
<andrewvos>
krazyj: And listen to zenspider. He can come off a bit rude sometimes but is generally quite helpful ;)
<zenspider>
I shouldn't ever have to call finalize...
<zenspider>
the API should take care of everything for me
<krazyj>
you open a file by initializing an instance
<zenspider>
See File/IO.open as an example
<krazyj>
how am i supposed to know when you're done?
<erikh>
eof?
<erikh>
or a block (which was probably what zenspider was getting at)
<krazyj>
gotcha
kurko_ has joined #ruby-lang
michael_mbp has joined #ruby-lang
<krazyj>
should my first two tests in my test file be under `describe GeoPointFactory::Generator#generate do` since they operate test #generate?
<krazyj>
s/operate/only
<countskm>
whats the difference between a point and a geopoint (just for discussion)
<krazyj>
point can be any kind of coordinate system… x/y from -5,5 or, most usefully, a lat/lon on the earth
<krazyj>
lat/lons are the geographic coordinate system
<countskm>
cool
boxmo has joined #ruby-lang
<krazyj>
and geographic could suggest, to some degree, that it's a lat/lon and not a point within a projection
<krazyj>
basically, i wanted to make a factory for generating test data when using RGeo
<krazyj>
useful stuff… not points in the ocean
<countskm>
thats cool... anytime u truly have a need for a factory its cool
<countskm>
they can save countless lines of static code that shall later not be so static :-)
<krazyj>
yup
<krazyj>
and looking forward to developing with this too… i can load in a map of San Francisco and, as i'm building/debugging, walk around town and see live, changing test data