<zenspider>
sweet. wrote some code to temporally visualize my projects in omnifocus and I was able to reschedule them on a prime schedule and spread them out optimally
zmack joined #ruby-lang
<andrewvos>
Banistertab: Enjoyed it more than antichrist. That movie fucked me up a bit no doubt.
<Banistertab>
Andrewvos finished it already?
<andrewvos>
Banistertab: yup
banister`sleep joined #ruby-lang
<andrewvos>
Lars von Trier movies just all of a sudden twist on you.
tjgillies joined #ruby-lang
<Banistertab>
I loved the enormous planet looming
<andrewvos>
Yeah. The technicalities of it got me.
<Banistertab>
And lol @ glass of wine while listening to beethovens ninth
<andrewvos>
Banistertab: I missed that part! I heard what Dunst said afterwards.
<andrewvos>
Wondered what she had said
<Banistertab>
Also when she said only life in universe was on earth
<slyphon>
that's what she said
* slyphon
ducks
<Banistertab>
And tha
<andrewvos>
Yeah that was interesting.
<andrewvos>
I think she meant life to her personally
<Banistertab>
Well it just kicked the eyes out of cats
<zenspider>
omnifocus-github 1.3.0 released
<mksm>
hmmm, net/http doesn't set the encoding on the response's body string.
<andrewvos>
Banistertab: Watch antichrist.
<slyphon>
hrm
* slyphon
notices '#' in vimscript function names
<andrewvos>
Banistertab: I don't get what you mean about cats?
samshull joined #ruby-lang
Banistergalaxy joined #ruby-lang
<Banistergalaxy>
andrewvos: just being poetic
<Banistergalaxy>
Bish
flip_digits joined #ruby-lang
towski joined #ruby-lang
Banistertab joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
oddmunds joined #ruby-lang
banister`sleep joined #ruby-lang
resetexistence joined #ruby-lang
echoprinter left #ruby-lang
[2]maarten joined #ruby-lang
jeek_ joined #ruby-lang
diegoviola left #ruby-lang
Sapientzzzz joined #ruby-lang
artOfWar joined #ruby-lang
AndChat| joined #ruby-lang
robbyoconnor joined #ruby-lang
banister`sleep joined #ruby-lang
Banistertab joined #ruby-lang
wyhaines joined #ruby-lang
banister_ joined #ruby-lang
AndChat| joined #ruby-lang
banister`sleep joined #ruby-lang
ThatDudeGuy_ joined #ruby-lang
nuclearsandwich joined #ruby-lang
curtism joined #ruby-lang
ryanf joined #ruby-lang
samshull joined #ruby-lang
procelina joined #ruby-lang
towski joined #ruby-lang
<procelina>
anyone know of something like kyoto cabinet only smaller and in ruby? it doesn't have to be fast or have more features than just the basic get and put...
<procelina>
all i need is to use a file as a hashtable
x0F_ joined #ruby-lang
banister`sleep joined #ruby-lang
<mksm>
procelina, redis is pretty simple
naz joined #ruby-lang
<ryanf>
mksm: I think procelina is asking about something that can be embedded in a program
<ryanf>
I don't know the answer though
<procelina>
yeah, it really should be embedded, i can probably use redis until i find something better tho
curtism joined #ruby-lang
<ryanf>
what about just using sqlite3?
<ryanf>
if it doesn't have to be fast, you could just make one table and use it as a k/v store
<ryanf>
depending on your definition of "doesn't have to be fast" I guesss
<procelina>
uhm, i'm making a prototype
<procelina>
so it really means "has to be fast later"
<procelina>
but also has to be in c later
<ryanf>
haha
<ryanf>
well I guess if your semantics are just get and put
<ryanf>
there is not exactly a high barrier for migrating to something else later
<procelina>
yeah
<procelina>
i think redis or sqlite is fine for now
<ryanf>
actually i think you can use kyoto cabinet from ruby
<procelina>
it's a massive install
<ryanf>
ah
<procelina>
i use it on my server and it took like 4 hours to compile
<ryanf>
haha
<ryanf>
wow
<procelina>
well, my server's ancient
<procelina>
haha
<procelina>
it's probably faster on this machine
<procelina>
but still
meth left #ruby-lang
macmartine joined #ruby-lang
takaokouji joined #ruby-lang
krz joined #ruby-lang
<mksm>
use a Hash and Marshal :o
<procelina>
lol, then i have to load entire dictionary from disk every time i want to look something up. >_<
RomyEatsDrupal joined #ruby-lang
<mksm>
:D
curtism joined #ruby-lang
krz joined #ruby-lang
joooooo joined #ruby-lang
ryanf_ joined #ruby-lang
hunterman joined #ruby-lang
hunterman left #ruby-lang
marcostoledo joined #ruby-lang
macmartine joined #ruby-lang
daviscabral joined #ruby-lang
<shevy>
where is the embedded ruby!
daviscabral_ joined #ruby-lang
<shevy>
lua must be crushed
jxie joined #ruby-lang
daviscabral_ joined #ruby-lang
daviscabral left #ruby-lang
tomzx joined #ruby-lang
ryanf joined #ruby-lang
andersen joined #ruby-lang
steph021 joined #ruby-lang
steph021 joined #ruby-lang
andersen joined #ruby-lang
jxie joined #ruby-lang
andersen joined #ruby-lang
<heftig>
shevy: in libruby
SuperTaz joined #ruby-lang
andersen joined #ruby-lang
andersen joined #ruby-lang
macmartine joined #ruby-lang
jeek_ joined #ruby-lang
ujihisa joined #ruby-lang
macmartine joined #ruby-lang
ivorybishop joined #ruby-lang
srbaker joined #ruby-lang
ivorybishop joined #ruby-lang
gnufied joined #ruby-lang
macmartine joined #ruby-lang
dfr|mac joined #ruby-lang
ryanf_ joined #ruby-lang
curtism joined #ruby-lang
RomyEatsDrupal joined #ruby-lang
macmartine_ joined #ruby-lang
artOfWar joined #ruby-lang
RomD joined #ruby-lang
towski joined #ruby-lang
wyhaines joined #ruby-lang
Austin__ left #ruby-lang
amerine joined #ruby-lang
oddmunds joined #ruby-lang
macmartine joined #ruby-lang
meth joined #ruby-lang
<meth>
is it possible to pass a callback down to c using ffi ?
brianpWins joined #ruby-lang
macmartine joined #ruby-lang
sqbell joined #ruby-lang
meth left #ruby-lang
vesan joined #ruby-lang
tris joined #ruby-lang
rippa joined #ruby-lang
sirfilip1 joined #ruby-lang
RomD joined #ruby-lang
tris joined #ruby-lang
tomzx joined #ruby-lang
dragonkh joined #ruby-lang
<whitequark>
shevy, heftig: libruby sucks as embedding engine. i.e. it mucks with stack a _lot_ and does not work with pthreads
<ttilley>
sorry, didn't see the newline in the paste
<telotism>
ttilley: :D
<telotism>
In the end, we're all just rats
<andrewvos>
mmmm reheated pizzza
<telotism>
pizza hut?
<telotism>
rdoc-data = no-go
<andman>
telotism: error? paste the first two lines
<telotism>
"not recognized as an internal or external command"
<Newbs>
any experts on nested routes here?
<telotism>
do i need to be in a special place in the console to access it?
<telotism>
sec
<rue>
Newbs: Presumably #rubyonrails routes?
<telotism>
c:\documents and settings\logan\desktop>rdoc-data --install
<telotism>
'rdoc-data' is not recognized as an internal or external command,
<telotism>
operable program or batch file.
<andman>
needs to be in your path
<telotism>
sorry, in my path?
<Newbs>
yeah rue
<andrewvos>
telotism: Piccante
Manhose_ joined #ruby-lang
<telotism>
andrewvos: gorgonzola
<telotism>
:)
<andman>
telotism: the list of directories in which the console will look for the program you're trying to run
<telotism>
I'm a REAL newby here
<telotism>
so, andman, do I need to type something special in the console to get there?
livinded joined #ruby-lang
<telotism>
I'm sorry for dragging you down the rookie hole with me
<telotism>
it's cool
<telotism>
thank you for helping
<andman>
haha
<andman>
no worries
<telotism>
I'll keep giving it what I got :)
Nisstyre joined #ruby-lang
<andman>
you could either go to the directory where rdoc-data resides, or put that directory in the system's path variable (google for that)
<telotism>
andman: thanks man :)
<ttilley>
telotism: if ruby itself is in your path but rdoc-data isn't, that's weird.
looopy joined #ruby-lang
<ttilley>
telotism: can you ruby -S rdoc-data --install ?
<telotism>
c:\documents and settings\logan\desktop>ruby -S rdoc-data --install
<telotism>
ruby: No such file or directory -- rdoc-data (LoadError)
<Mon_Ouie>
That's not weird. I don't have a rdoc-data binary either
<ttilley>
telotism: ruby for windows has a menu item that starts a shell with ruby added to the path. use that and you should also be good with rdoc-data. and gem. and anything else living in that bin directory.
<ttilley>
telotism: don't ask for details though, because i don't use windows. avoid it like the plague. =]
<ttilley>
telotism: it seems that people have the most success with jruby on windows though. less dicking around with C extensions. a java+jruby equivalent is almost always available, and jruby is more compatible with non-windows ruby than windows ruby is.
<telotism>
andman, that did something
<telotism>
c:\documents and settings\logan\desktop>ruby -S rdoc-data --install
<telotism>
ruby: No such file or directory -- rdoc-data (LoadError)
<telotism>
sorry
<telotism>
sec
<telotism>
Generating RI format into C:/Documents and Settings/Logan/.rdoc...
<telotism>
Files: 16
<telotism>
Classes: 1 (1 undocumented)
<telotism>
Modules: 0 (0 undocumented)
<telotism>
Constants: 0 (0 undocumented)
<telotism>
Attributes: 0 (0 undocumented)
<telotism>
Methods: 1 (1 undocumented)
<telotism>
Total: 2 (2 undocumented)
<telotism>
i think it's searching the desktop
Minalien joined #ruby-lang
solars joined #ruby-lang
Pip joined #ruby-lang
<telotism>
oh! sec
<yorickpeterse>
Please don't paste code in IRC
<yorickpeterse>
Use pastie.org or gist.github.com or similar services
<telotism>
yorickpeterse: :( sorry, ok
<telotism>
my first time
<telotism>
and last i guess
<telotism>
very sorry
<andman>
unless it's < 4 lines sez topic
<telotism>
oh shite
<telotism>
it's right there at the top!
<andrewvos>
You don't have to apologise calm down :)
<yorickpeterse>
:)
<telotism>
well, i think you were right, andman
<telotism>
i just forgot to go into the ruby folder
<telotism>
it's installing a butt-load of stuff now
<telotism>
using the rdoc --all --ri
jensn_ joined #ruby-lang
<andman>
yeah, might take a while :)
Jake232 joined #ruby-lang
resetexistence joined #ruby-lang
dejongge joined #ruby-lang
zmack joined #ruby-lang
<telotism>
is this what it's supposed to look like?
<erikh>
you need a semicolon between sum += a and the puts statement
<echoprinter>
erikh: ah....
<echoprinter>
damn
<Mon_Ouie>
And you're trying to call the method a with puts(sum) (i.e. nil) as an argument
<erikh>
two statements.
<echoprinter>
I need to read more.
<erikh>
shit happens. have fun
<echoprinter>
:)
<erikh>
anyone know of a canned solution for pidof that's also portabel?
<erikh>
that's not ps aux | grep ...
<erikh>
something in C
robbinnn joined #ruby-lang
<robbinnn>
hi
<erikh>
pidof doesn't seem to be doable outside of kernel interfaces, just wondering if anyone's seen a proper portable version out there
<robbinnn>
i need to upload a image in a database and view images in the sites? did you have a tutoriel
<erikh>
try #ror or railscasts.org
kmeehl joined #ruby-lang
<masterkorp>
what's a cool, simple mail library for ruby ? :p
<erikh>
pony or mail depending on your definition of simple
<masterkorp>
erikh: well, what's the diference ? can you give me the link for both ?
<erikh>
no, you can go to rubygems.org and search for them
<erikh>
I'm not your personal google butler
<masterkorp>
erikh: sorry
<telotism>
google butler :D
<echoprinter>
Why would the 1st program give me what I want but the 2nd using %w{} as an array give me an error? http://www.pastie.org/2889496
curtism joined #ruby-lang
samshull joined #ruby-lang
<shevy>
echoprinter %w makes strings
scottschecter joined #ruby-lang
<Mon_Ouie>
Because you're trying to add a string to an integer. %w-style arrays are for array of strings
<shevy>
change to sum+=a.to_i
<Mon_Ouie>
%w[… …] to […, …]
<shevy>
echoprinter sum = 0; <-- also kill this ; please, it is visually annoying
<echoprinter>
I tell ya, these books just don't go into this.
<echoprinter>
thank you though, this helps.
<erikh>
wait
<erikh>
a semicolon is visually annoying? do you organize your socks by length and color?
<shevy>
all my socks are black and the same size
<shevy>
I am not looking at socks much though, unlike code :-)
<echoprinter>
not adding a semicolon earlier caused my 30 minutes of hell...just figured I'd add now until I learn the language better.
<shevy>
echoprinter less is more!
<echoprinter>
:)
<shevy>
hmm
<shevy>
why does Array not have #to_i ?
RomD joined #ruby-lang
<shevy>
aww
<Mon_Ouie>
Why does Hash not have #to_io?
<shevy>
what do you do with to_io ?
<Mon_Ouie>
Convert my Hash into an IO object
<shevy>
never seen to_io
<deryl>
how would you convert an array to an integer?
<shevy>
yeah
<shevy>
problem is that it would become one integer, not a list of integers
<Mon_Ouie>
We have #map already
<shevy>
well .map(&:to_i) isn't much longer than .to_i
resetexistence joined #ruby-lang
havenn joined #ruby-lang
Jake232 joined #ruby-lang
qpingu joined #ruby-lang
<rue>
erikh: I only *have* socks of a length
<rue>
It's barbaric to have different socks.
<erikh>
well then give me two handed axes
<echoprinter>
And if I wanted a large array, not just a few element, like 1-1000?
<erikh>
ideally you should use a range
<erikh>
but this code will work
<erikh>
(1..1000).to_a
<echoprinter>
1..1000?
<echoprinter>
I'll look up range.
<erikh>
yes, that's a Range object (ri Range)
<erikh>
that's coerced to an array with #to_a
<erikh>
you can check if an item is in the Range object
<erikh>
(a Range object is just a tuple of first, last)
<erikh>
they're significantly lighter in a lot of use cases
<erikh>
if you need to mutate the array, use an array instead.
<echoprinter>
Using a tuple is fine...works on first try...first time today that's happened. thanks.
<erikh>
enjoy
<erikh>
do you have a book to read? there are a few free ones on the intertubes
<erikh>
like gratis free, not pirated free.
<manveru>
erikh: anything by doctorow?
<erikh>
heh.
malev joined #ruby-lang
<shevy>
hmm
<shevy>
is it bad to use plenty of small methods and plenty of aliases to those methods?
Carnage\ joined #ruby-lang
<rue>
Indubitably yes
<shevy>
why!
<shevy>
I love aliases :(
<rue>
Because of?
<shevy>
aww I can't use that without a reason
artOfWar joined #ruby-lang
<yorickpeterse>
Writing decent method names is too mainstream
<masterkorp>
time to play with some ruby on rails
<shevy>
oh project-internal the method names all seem to make sense, but I just realized I want a ".absolute_position = " method :(
<gentz>
Where can I get the ruby documentation in the old format?
<rue>
gentz: Old RDoc HTML output format?
<gentz>
rue: yeah
<rue>
I think you can find the old format files somewhere. Is there a reason you want that, in particular?
queequeg1 joined #ruby-lang
mpatel joined #ruby-lang
<gentz>
rue: yeah. i think they're much more readable
thone_ joined #ruby-lang
<rue>
You've tried darkfish, hanna and sdoc?
<gentz>
rue: no. those look good though. i'll try them. thanks!
melter joined #ruby-lang
<mpatel>
anyone know of a good resource that will help me understand how before, after, and around filters are constructed in ActiveModel? I'd really like to understand the code that implements these filters so I can implement similar functionality in a non-rails app that i am building. I don't mind requiring ActiveController libraries, but first I'd like to implement this functionality on my own so I can understand it.
<mpatel>
i've googled around and found various references. but nothing really comprehensive. i suspect i will pour through them and piece together the implementation.
<manveru>
mpatel: it's called aspect-oriented programming
Newbs joined #ruby-lang
<mpatel>
ahhh. yes. i've encountered the term before.
flip_digits joined #ruby-lang
<manveru>
there are few ways to pull that off in ruby
<shevy>
manveru at first I wondered how you found out about my aliases when I saw that ... :-)
samshull joined #ruby-lang
infid joined #ruby-lang
<Radar>
How can I customize the markup that RDoc uses for RDoc::ClassModule#description?
<Radar>
drbrain: would you be able to help out on ^?
<TTilus>
mpatel: aren't the filter chains in activesupport?
<TTilus>
i might just be plain wrong again...
<drbrain>
Radar: a) use --markup
<drbrain>
b) use the :markup: directive on the comment
looopy joined #ruby-lang
<mpatel>
TTilus: yes they are. i just want to understand how they are implemented.
<drbrain>
Radar: note that currently only RDoc, TomDoc and rd format documentation are built-in to RDoc
<TTilus>
mpatel: read the source, luke
<mpatel>
mostly for educational purposes. then i can go to including them in my app.
<drbrain>
I'm working on markdown in my free time, so it may not be another month or so
<TTilus>
mpatel: its not that many lines of code
<mpatel>
TTilus: yep. that's what'll do.
<Radar>
drbrain: Yup, I've been reading the source. I'm just attempting to parse the Rails source and so adding :markup: to things isn't going to be (easily) possible I think.
<Radar>
drbrain: I don't understand what I do with the --markup option still. Is there not a way to add new markups?
<drbrain>
there is...
slyphon joined #ruby-lang
workmad3 joined #ruby-lang
<drbrain>
Radar: I don't have it documented yet, but it's easy
<drbrain>
well, "easy"
<andrewvos>
I really didn't expect OWS and it's offshoots to last this long.
echoprinter left #ruby-lang
<drbrain>
you write a parser that consumes text and emits an RDoc::Markup::Document tree
<drbrain>
then you add your parser to RDoc::Text::MARKUP_FORMAT
steeljav joined #ruby-lang
<drbrain>
RDoc::Text#parse looks up the markup based on the name and calls #parse on the returned parser
<drbrain>
for all the existing parsers parse is class method on the Parser implementation
<drbrain>
… the easy part is adding the parser
<drbrain>
the not-as-easy part is writing a parser that emits the proper tree
<Radar>
All of that is required just to change how description is output?
<Radar>
Seems a bit excessive, no?
<drbrain>
Radar: can you describe your broader problem then?
<drbrain>
Radar: maybe you don't want to change the parser
<drbrain>
Radar: if you want to create a new format for comments it needs to output as HTML, plain text and other formats to work for HTML, ri output, or PDF generation (someone has built such a thing)
<drbrain>
so yes, it's a lot of work, but no more than necessary for all the formats that RDoc can output
<Radar>
drbrain: http://api.rubyonrails.org sucks. It's like the same guys who dev'd Java got together and used their "design abilities" to design documentation.
<Radar>
But I need a way of indexing the docs, which is what I want to use RDoc for. I need separate HTML files for each class, module and method. Then I also need a separate JS file which acts as an index for these things.
<drbrain>
so you're not editing the text of comments?
<Radar>
No, that would be too large a task
<drbrain>
ok, then you do not want to write a new parser
<yawnyawn>
Radar and drbrain have u guys dealt with nested resources?
<drbrain>
you're certainly on the right track
<drbrain>
yawnyawn: I haven't, did you try #ror?
<Radar>
yawnyawn: please ask in #rubyonrails
<yawnyawn>
ok
<yawnyawn>
thanks guys
<drbrain>
Radar: JsonIndex should do what you need for searching
<drbrain>
it's a slightly improved version of sdoc's search
<drbrain>
(it adds the ability to type a class name like activerecord::base and get a hit)
<drbrain>
you should be able to reuse the JS that it provides
Pip joined #ruby-lang
<Radar>
Right, that sounds good.
Pip joined #ruby-lang
tomzx joined #ruby-lang
<drbrain>
unfortunately I don't think I got around to documenting how to do that ☹
saLOUt joined #ruby-lang
Pip joined #ruby-lang
judofyr joined #ruby-lang
<drbrain>
Radar: to proceed I would copy darkfish, rip out all the wrapper stuff you don't need (sidebars, footer) get that to work, then add back method lists or whatever other extra navigational info you want
<Radar>
ok, I'll try that
<Radar>
thanks again for your help
<drbrain>
let me poke around to see if there's a better way to do fix_links
Pip joined #ruby-lang
Pip joined #ruby-lang
<drbrain>
hrm, I don't think there is ☹
Pip joined #ruby-lang
<drbrain>
it's too tied up with how #path works across all the CodeObject subclasses
<Radar>
alright, no worries
<drbrain>
which probably means I need to pull that out of the CodeObjects and stick it in a module somewhere
<rue>
I'm kind of the opinion to not do too much work on it
<rue>
Keeping it maintained and transitioning away would probably be better in the end. But that's usually my preference.
echoprinter joined #ruby-lang
postmodern joined #ruby-lang
Manhose joined #ruby-lang
echoprinter left #ruby-lang
<infid>
is there a diff between map and each?
<andrewvos>
infid: Yup
<andrewvos>
infid: Map returns a list of what each block returns
<infid>
it's supposed to go hand and hand with map in functional programming you always see map-reduce together
<shevy>
5..10).reduce(:+) vs (5..10).inject {|sum, n| sum + n }
<shevy>
hmmmm
<shevy>
it's shorter, so that is a plus
<infid>
inject is just an alias
<andrewvos>
yarp
<burgestrand>
reduce/inject is useful when you have a list of values and want to reduce it to one value
<any-key>
reduce is what it's named everywhere else
<shevy>
but why the name "reduce"? When I read reduce I think of "reducing something"
<burgestrand>
(but yes, you can also create lists if you want)
<lianj>
shevy: inject(:+) works too..
<infid>
haskell calls it fold instead of reduce
<burgestrand>
shevy: you reduce a list of values to a single one
<burgestrand>
sum of values, product of values, etc
<shevy>
oh cool
<shevy>
.inject :+
<shevy>
that is almost readable now :)
<burgestrand>
But not always, you could use it to reverse an array for example :)
robotmay joined #ruby-lang
<shevy>
fold ... reduce ... inject ...
<mpatel>
wow. that's the first Array I've seen with 3 boobs!
<lianj>
6
pxjorge joined #ruby-lang
macmartine joined #ruby-lang
<shevy>
lol
<shevy>
don't amazons have like 3 boobs
<andrewvos>
shevy: Nice, but have you considered? ["b", "o", "o", "b", "s"].inject :+
<shevy>
that does not work
<shevy>
oh
<andrewvos>
shevy: I beg to differ.
<shevy>
odd. works when I use ()
<shevy>
you are confusing my IRB andrewvos :(
<shevy>
let's test in pry ...
<andrewvos>
shevy: alias irb=pry
<shevy>
hah! works in pry
<lianj>
magic called recursion ;)
<shevy>
andrewvos in a few years I'll have changed to pry, in a few decades to 1.9.x
<shevy>
but that is really the first example I can think of where irb fails hmm
<andrewvos>
shevy: Stop being so stubborn.
<yorickpeterse>
ugh, 1.8
<shevy>
I am slow, not stubborn. If things would work as they do, I would have changed, but I have no solution for using UTF-8 for my yaml files, retaining german umlauts in non-comments and still use my current editor.
<andrewvos>
shevy: It doesn't work for me in irb either :|
<shevy>
yeah!
<shevy>
pry > irb finally in valid ruby code again
<shevy>
hmm afk for a while, need to cook
<andrewvos>
banister`sleep: Weird
<andrewvos>
?
<infid>
does pry support all the plugins that irb does
<yorickpeterse>
I doubt it
<andrewvos>
infid: Which plugins?
<infid>
wirble, awesome print, what_methods, etc
<infid>
i had issue with some of them when i tried it
<andrewvos>
infid: I think you'll find you what need those anymore
<andrewvos>
what=won't
<lianj>
shevy: can you show an example for your yaml issue? works fine here, dont make up excuses :P
<andrewvos>
lianj: Haha that was the first thing I tried.
Bwild joined #ruby-lang
<banister`sleep>
infid: pry has its own awesome print plugin, it doesnt support wirble but it has wirble-like features by default, and i dont know what what-methods is :)
<banister`sleep>
infid: it's a very different implementatino to irb, so gems that monkey-patch irb's internals likely wont work
<andrewvos>
banister`sleep: This works in pry but not irb: ["b", "o", "o", "b", "s"].inject :+