<andrewvos>
rue: What don't you get? I didn't exactly paste science in there
artOfWar has joined #ruby-lang
macmartine has joined #ruby-lang
gix has joined #ruby-lang
savage- has joined #ruby-lang
chendo has joined #ruby-lang
igotnolegs has joined #ruby-lang
andrewhl has joined #ruby-lang
robwilliamsuk has joined #ruby-lang
gokul has joined #ruby-lang
frznsktr has joined #ruby-lang
andrewhl has joined #ruby-lang
<frznsktr>
hello, something terrible happened in irb.(on Ubuntu). Tab completion didn't work!!!!!! I hit the tab button after "[]=col" and it just did a big space. please help
<andrewvos>
frznsktr: Just use pry.
<frznsktr>
andrewvos: srry I'm a noob what's that
<andrewvos>
Search for "pry" irb replacement or something
<rue>
I'm not sure what you expect []=col to expand to, but there could be a readline issue, I suppose
<frznsktr>
rue: it is supposed to expand to []=collect. its my test
<seanstickle>
Why would that expand to that?
jtoy has joined #ruby-lang
<frznsktr>
after that i tryed to double tab from "42." but still no prevail
curtism has joined #ruby-lang
jimmy has joined #ruby-lang
brownies has joined #ruby-lang
artOfWar has joined #ruby-lang
andkerosine has quit [#ruby-lang]
kith_ has joined #ruby-lang
<frznsktr>
I learned what pry was and i can't use it. I really need to what's wrong with tab
andrewhl has joined #ruby-lang
MistyM has joined #ruby-lang
whatasunnyday has joined #ruby-lang
manhunter has joined #ruby-lang
<manhunter>
hi, is ruby functional language or procedural language?
<manhunter>
anyone there?
artOfWar has joined #ruby-lang
pogopolice has joined #ruby-lang
havenn has joined #ruby-lang
<spuk>
oo language
<manhunter>
is ruby a procedural language?
manhunter has quit ["WeeChat 0.3.6"]
havenn has joined #ruby-lang
<jtoy>
does running GC.start often actually help to reduce memory usage?
rdeshpande has joined #ruby-lang
havenn_ has joined #ruby-lang
fireglow has joined #ruby-lang
oddmunds has joined #ruby-lang
crankharder has joined #ruby-lang
dvorak has joined #ruby-lang
havenn has joined #ruby-lang
acts_as_david has joined #ruby-lang
heppy has joined #ruby-lang
acts_as_david has quit [#ruby-lang]
banisterfiend has joined #ruby-lang
<banisterfiend>
hi
srbartlett has joined #ruby-lang
tomzx has joined #ruby-lang
<banisterfiend>
anyone here use ruby-debug?
dhruvasagar has joined #ruby-lang
davejacobs has joined #ruby-lang
dfr|mac has joined #ruby-lang
davejacobs has quit [#ruby-lang]
Tref has joined #ruby-lang
andrewhl has joined #ruby-lang
<josh9>
i noticed something interesting - if i define a variable inside a block, it's not available outside of the block, but the block itself doesn't create new scope, so if i have a variable that is defined before the block, and the block use the same var name, it will use the same var.
headius has joined #ruby-lang
<banisterfiend>
josh9: Yeah
<banisterfiend>
josh9: are you in 1.9?
Roujo has joined #ruby-lang
brownies- has joined #ruby-lang
<heftig>
1.9 shadows variables instead of reusing them
brownies has joined #ruby-lang
<banisterfiend>
heftig: i think he's talking about normal variables not |x| variables
<banisterfiend>
but i could be wrong
<heftig>
right
artOfWar has joined #ruby-lang
rippa has joined #ruby-lang
x0F_ has joined #ruby-lang
looopy has joined #ruby-lang
looopy has joined #ruby-lang
<brownies>
'evening
<brownies>
i have an ActiveRecord object, and i set up a straightforward method called (let's say) unicorn_data that looks at all of the unicorns the object contains, and returns a hash that contains the type and the number of each one
<brownies>
so, you know, unicorns["blue"] = 4, and so on
looopy has joined #ruby-lang
<brownies>
the problem is that this is being calculated everytime i call the method, which might happen multiple times in rendering a single template
<brownies>
what's the idiomatic way to cache this result the first time it's derived?
<brownies>
it seems an ivar isn't quite right, because (1) i want to restrict access to the actual stored value -- i.e. it should only be accessible through this method (2) i'd like to pass true or false (defaults to false) to recalculate the hash
RenatoSilva has joined #ruby-lang
gianlucadv has joined #ruby-lang
<rippa>
brownies: ivar is not accessible outside of object
<brownies>
rippa: yea, heh, just read that. made it simple to implement my solution. =P
<rippa>
well, apart from stuff ilke #instance_variable_get
<brownies>
rippa: thanks
Pikkachu has quit [#ruby-lang]
Pikkachu has joined #ruby-lang
<josh9>
heftig: i tested on 1.9 and 1.8
Pikkachu has quit [#ruby-lang]
skryking has joined #ruby-lang
macmartine has joined #ruby-lang
thone_ has joined #ruby-lang
looopy has joined #ruby-lang
MistyM has joined #ruby-lang
headius has joined #ruby-lang
wallerdev has joined #ruby-lang
kernel_ducky has joined #ruby-lang
duckinator has joined #ruby-lang
duckinator has joined #ruby-lang
outoftime_ has joined #ruby-lang
Heimidal has joined #ruby-lang
naz has joined #ruby-lang
uniqanomaly_ has joined #ruby-lang
krz has joined #ruby-lang
skryking has joined #ruby-lang
setmeaway has joined #ruby-lang
mytrile has joined #ruby-lang
dominikh has joined #ruby-lang
tenderlove has joined #ruby-lang
mytrile has joined #ruby-lang
mytrile_ has joined #ruby-lang
postmodern has joined #ruby-lang
wallerdev has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine>
Thoughts on putting single-statement methods on one line with semicolons?
<rippa>
what?
<rippa>
oh
<rippa>
nothing wrong with it
<andkerosine>
Do you know if it's frowned upon in the general community?
<rippa>
no idea
<andkerosine>
Hm.
<andkerosine>
I just don't like the look of it. 15 lines for four methods?
<andkerosine>
All of which are single-statement convenience methods.
<rippa>
why 15 then?
<andkerosine>
Well, one line for the def, one for the statement, one for the end.
<andkerosine>
* 4 = 12, plus the blank line between?
<rippa>
oh, you mean method definitions then
<andkerosine>
Mm-hmm.
<rippa>
try browsing code of some popular projects
<rippa>
and see how it's done there
chendo has joined #ruby-lang
<andkerosine>
Yep, makes sense.
andkerosine has quit [#ruby-lang]
<rue>
andrewvos: It's fine, but it really needs to be a simple expression
<brownies>
hm
<brownies>
what's the deal with accessing instance methods from a class method?
<brownies>
is it possible?
mytrile has joined #ruby-lang
Dotan has joined #ruby-lang
ryanf has joined #ruby-lang
<rue>
obj.instance_method ?
<rue>
If you don't have an instance, you can't use them…
solars has joined #ruby-lang
Dotan__ has joined #ruby-lang
adambeynon has joined #ruby-lang
eban has joined #ruby-lang
csprite has joined #ruby-lang
Dotan has joined #ruby-lang
cirwin has joined #ruby-lang
Xzyx987X_ has joined #ruby-lang
Dotan__ has joined #ruby-lang
Dotan_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
Defusal_ has joined #ruby-lang
chendo has joined #ruby-lang
csprite has quit [#ruby-lang]
virunga has joined #ruby-lang
rob_ has joined #ruby-lang
<rob_>
hi
yxhuvud has joined #ruby-lang
<rob_>
i want to use Net:SSH to call a remote script from my program but i'd like to pass the script a hash of data, is there a recommended way to do this?
artOfWar has joined #ruby-lang
artOfWar has joined #ruby-lang
apeiros_ has joined #ruby-lang
daglees has joined #ruby-lang
ged has joined #ruby-lang
flebel has joined #ruby-lang
brownies has joined #ruby-lang
brownies has joined #ruby-lang
robotmay has joined #ruby-lang
My_Hearing has joined #ruby-lang
QaDeS has joined #ruby-lang
niklasb has joined #ruby-lang
lateau_ has joined #ruby-lang
seanstickle has joined #ruby-lang
tekin has joined #ruby-lang
yeltzooo has joined #ruby-lang
vdrab has joined #ruby-lang
conceal_rs has joined #ruby-lang
tbuehlmann has joined #ruby-lang
jamw has joined #ruby-lang
benanne has joined #ruby-lang
dreinull has joined #ruby-lang
m3nd3s has joined #ruby-lang
havenn has joined #ruby-lang
pbjorklund has joined #ruby-lang
fayimora_ has joined #ruby-lang
robwilliamsuk has joined #ruby-lang
Dreamer3 has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
mytrile has joined #ruby-lang
codewrangler has joined #ruby-lang
toretore has joined #ruby-lang
dragonnkh has joined #ruby-lang
dragonkh has joined #ruby-lang
<andrewvos>
rue: What needs to be a simple expression? So lost
twelvechairs has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine>
Best practices for including a default configuration file with a gem?
<andkerosine>
I'd rather not jump through the hoops of having to find it somewhere in the gem's install directory.
<andkerosine>
My idea is to fetch it once from a static page on the Internet, say a Github gist whose content's I could never change, thus maintaining trust.
<andrewvos>
andkerosine: That sounds terribl
<andrewvos>
e
<andkerosine>
Why, exactly?
<andrewvos>
andkerosine: Just put a copy in the gem root directory
<andrewvos>
Then read that in
<andrewvos>
And also read in a file from ~/.gemname
<andkerosine>
Can it not be vastly different across systems?
<andrewvos>
Well he gist idea is terrible for lots of reasons. One of them is if you ever change the layout of the gist then you break all other versions of them gem that used the previous format.
<andkerosine>
Mm, good point.
<andrewvos>
Also, there's the security issue
<andkerosine>
But, for instance, my gems go in my .rvm folder.
<andkerosine>
That isn't the case for all users.
<andrewvos>
andkerosine: Doesn't matter
<andrewvos>
andkerosine: User relative paths
<andkerosine>
Environment variable?
<manveru>
Gem.path
<andkerosine>
Bless your beautiful soul.
<apeiros_>
Gem.datadir
<manveru>
what's that?
<manveru>
oh
<manveru>
that doesn't seem to work here
<apeiros_>
you need to pass it the gem nae
<apeiros_>
*name
<manveru>
yeah
<apeiros_>
and the gem must be loaded/required
<manveru>
oh
<manveru>
:P
<apeiros_>
maybe activation is sufficient, never tried.
<apeiros_>
(since that'd need the `gem` method, which I avoid)
<andkerosine>
Where does #datadir pull from?
<manveru>
but you don't avoid datadir? :)
<apeiros_>
I do
stephenp has joined #ruby-lang
<apeiros_>
but I use it (with safeguards) as fallback
<apeiros_>
exactly for the purpose of having things like default configs etc.
<manveru>
hm
<apeiros_>
I prefer that over having it in code
<manveru>
docs say they wanna deprecate it
<apeiros_>
oh, when did that happen? and what should replace it?
* apeiros_
hates deprecation notes without a hint on what to use instead…
rippa has joined #ruby-lang
<apeiros_>
hm, 1.8.15 docs don't mark it as deprecated…
<manveru>
that's the only place i needed config so far
<manveru>
matti: oi
<apeiros_>
mhm
<manveru>
if i was even more anal, i'd use $XDG_CONFIG_DIR or something
<manveru>
err, $XDG_CONFIG_HOME
<rob_>
hi peeps
<manveru>
if debuntu people wanna screw with my package they can go ahead
<rob_>
im trying to pass a hash into my program as an argument, is there a good way to do this or do i need to just do it as a string and then eval() it?
<manveru>
rob_: pass from where?
<rob_>
the command line
<manveru>
containing what data?
<rob_>
a hash in the format { :file => 'somefile', :md5 => 'asdfq3r32q' }
<rue>
corundum, with regard to bot functionality, is about as useful as one of our cats
<corundum>
okay
<andrewvos>
corundum: Did he just eval that? :|
<apeiros_>
corundum: cats?
<corundum>
beats me
<rue>
“Kitty! Come here!” *icy stare* -That's nice, I'll stay here
Dotan has joined #ruby-lang
igotnolegs has joined #ruby-lang
<andrewvos>
haha
Defusal has joined #ruby-lang
Dotan has joined #ruby-lang
workmad3 has joined #ruby-lang
zmack has joined #ruby-lang
burgestrand has joined #ruby-lang
bblockz has joined #ruby-lang
Dotan_ has joined #ruby-lang
rindolf has joined #ruby-lang
d3vic3 has joined #ruby-lang
<andrewvos>
Umm, there was an app that let you do push notifications to your iphone or whatever when you were running s cript... Something like this:
<andrewvos>
do some bash stuff; notify
dberg has quit ["ERC Version 5.3 (IRC client for Emacs)"]
<andrewvos>
do some bash stuff; notify "This thing is done"
<andrewvos>
And you would get a notification on your iphone... Can anyone remember what it was??
artOfWar has joined #ruby-lang
<frznsktr>
can someone help me with dwemthy's array on why's (poignant guid. I try to do require 'dwemthy' but then this shows up http://pastie.org/3415988 . please help
<andrewvos>
frznsktr: `gem install dwemthy`
<andrewvos>
(Just a guess)
<andrewvos>
Run that in your terminal
<andrewvos>
Without the backticks
<frznsktr>
andrewvos: so when you write a ruby library you have to install it with rubygems
<andrewvos>
When you consume a ruby gem you have to install it's code
<erikh>
eh
<erikh>
frznsktr: you wrote this yourself?
<frznsktr>
no
<erikh>
so where is the library?
<frznsktr>
I had problems with 'Why's poignant guide' it's a book. actually it's a classic ruby guide. one of the things it taught was to write that library
<frznsktr>
so no _Why wrote the library
<erikh>
ok, so you wrote it into a file and saved it
<erikh>
right?
<frznsktr>
yes
<erikh>
ok -- where did you save it in relation to your other script that performs the require?
<erikh>
is it in the same directory?
<frznsktr>
I saved it in my home folder.
<erikh>
and the other script?
<frznsktr>
and preformed that script in irb
<erikh>
ah
<erikh>
ok, cd to your home dir and do this
<erikh>
irb -I.
<erikh>
that's a capital 'i'
<erikh>
1.9 -- which was released after that book was written -- no longer injects the current directory into the path that require uses to search for files
lordofthedance has joined #ruby-lang
<erikh>
anyhow, do that and I imagine you'll have less trouble.
<rue>
Or $LOAD_PATH << "."
y3llow has joined #ruby-lang
s0ber has joined #ruby-lang
<jondot_>
is there any twitter bootstrap documentation generator? i'd like to use something like that for a new gem
steeljav has joined #ruby-lang
whatasunnyday has joined #ruby-lang
chimkan_ has joined #ruby-lang
RomyRomy has joined #ruby-lang
tenderlove has joined #ruby-lang
duckinator has joined #ruby-lang
<rue>
You want to generate docs *for* TB, or want some kind of a template for the purpose?
artOfWar has joined #ruby-lang
CaptainCibai has joined #ruby-lang
s0ber has joined #ruby-lang
<S1kx>
what should I use nowadays for precise numbers, or more accurately: precise division? I see ruby-decimal but it seems like it hasnt been updated in long
lsegal has joined #ruby-lang
<whitequark>
bigdecimal?
<S1kx>
awesome, thanks
mytrile has joined #ruby-lang
QaDeS_ has joined #ruby-lang
MistyM has joined #ruby-lang
slaytanic has joined #ruby-lang
andrewhl has joined #ruby-lang
srbartlett has joined #ruby-lang
<manveru>
rational?
adambeynon has joined #ruby-lang
<shevy>
boobs?
<theconartist>
chapter 2 of sicp
<andrewvos>
shevy is only slightly smarter than corundum
<andrewvos>
bwahaha sorry just joking shevy
<shevy>
until the day when corundum and I will rise to power and ENSLAVE ALL OF YOU!!!
<shevy>
though I dont like corundum, I'll need something better
anthony has joined #ruby-lang
<countskm>
/quit
<whitequark>
shevy: do you reply "boobs?" to everything?
<whitequark>
and I know that you'll try say "boobs?" in reply to that question, yes. don't even bother.
<andrewvos>
As a rule
countskm has joined #ruby-lang
<shevy>
whitequark I'd have a lot to reply but I don't think it'll be on topic enough. When I go off-topic, I need to return to on-topic again
<shevy>
x = String.new
mytrile has joined #ruby-lang
tenderlove has joined #ruby-lang
anthony has joined #ruby-lang
<frznsktr>
erikh: it still brings up the same problem even after I do what you say
<unsymbol>
do you guys know of any nice nlp gems?
<unsymbol>
or does anyone have any specific experience of doing nlp in ruby?
<theconartist>
frznsktr: did you include the period? that wasn't punctuation on his sentence