<schlecht>
Wasn't zenspider meant to write a book?
<andrewvos>
I certainly hope not ;)
<andrewvos>
hehe just playing
wmoxam has joined #ruby-lang
mark_locklear has joined #ruby-lang
<zenspider>
schlecht: I had a contract with addison weseley back in 2001... but I doubt that's what you're referring to
<zenspider>
schlecht: did you have something else in mind?
<schlecht>
It was from some time back, I don't remember who the publisher was.
<schlecht>
Bbiaw.
<injekt>
hmmm
asdfreqw has joined #ruby-lang
uglybandersnatch has joined #ruby-lang
ttilley has joined #ruby-lang
<uglybandersnatch>
hi all. wondering if you can help with some serious segfaulting i am getting when trying to install gems and use ruby-debug. here is some example output: http://pastie.org/3377465
<uglybandersnatch>
i am using rvm and have tried moving between ruby-1.9.2-p180, ruby-1.9.2-p290, ruby-1.9.3-p0 and ruby-head and i get the same problems on all of them.
MistyM has joined #ruby-lang
<zenspider>
haha
<zenspider>
it's callcc from yard
<zenspider>
uglybandersnatch: remove yard
<uglybandersnatch>
ok i'll try that
<Tasser>
achievement: parse a website with a CSV parser
srbartle_ has joined #ruby-lang
<uglybandersnatch>
zenspider: that worked to fix the first error, but i still can't use ruby-debug without it segfaulting. here is what happens when it hits a debugger statement within my rails app: http://pastie.org/3377535
<zenspider>
uglybandersnatch: suck. sorry... I don't use ruby-debug. I debug via tests.
<drbrain>
uglybandersnatch: how did you build ruby?
<zenspider>
I also don't really use rvm... you might want to take that out of the equation tho
<drbrain>
with llvm-gcc?
Luxx_ has joined #ruby-lang
<drbrain>
ah, rvm? that should use real-gcc, not llvm-gcc
<uglybandersnatch>
i built it --with-gcc=clang, as it wouldn't compile otherwise. i am on mac
<drbrain>
uglybandersnatch: just to check, what does ruby -rrbconfig -e 'p RbConfig::CONFIG["CC"]' say?
<uglybandersnatch>
"gcc"
<drbrain>
that's probably why you're crashing
<userbard>
uglybandersnatch: Do you need the documentation? Seems the gem installed.
<drbrain>
does gcc -v say: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
<uglybandersnatch>
drbrain: gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
<drbrain>
if you built --with-gcc=clang and it worked, you should see "clang" instead of "gcc"
<drbrain>
uglybandersnatch: you'll need to rebuild without using llvm-gcc ("gcc")
<uglybandersnatch>
drbrain: yeah, sorry that might have just been when i tried it with ruby-head
S2kx has joined #ruby-lang
<uglybandersnatch>
drbrain: ok thanks. my gcc might have been replaced by xcode 4.
tomzx has joined #ruby-lang
chimkan_ has joined #ruby-lang
dubellz has joined #ruby-lang
<drbrain>
uglybandersnatch: if you installed Xcode 4 or 4.1 you'll have gcc-4.2
vesan has joined #ruby-lang
<drbrain>
/usr/bin/gcc-4.2
phazenine has joined #ruby-lang
<phazenine>
anyone know what characters are not used as often with php and objective c? like ruby rarely uses ;
<zenspider>
∞
<rue>
≠
Stalkr_ has joined #ruby-lang
<phazenine>
mmm how bout a character that is on the keyboard =P
<MistyM>
<zenspider>
those are both on my keyboard
<zenspider>
¡™£¢∞§¶•ª
<MistyM>
I can totally see a conditional statement based on ¡value!
<drbrain>
how about —
<zenspider>
maybe the question could be improved
<MistyM>
- is used in ObjC.
<MistyM>
Oh, wrong dash width. :b
<rue>
drbrain: I've been using def n–uh
djcercone has joined #ruby-lang
<MistyM>
uglybandersnatch: In OS X, `gcc` has been a symlink to smth for ages now. It used to point to gcc-4.2, now it points to llvm-gcc-4.2.
<phazenine>
okay, how bout this, i am being tasked to parse php and objective-c code, but the managers want to be able to load it up into excel, for html i am using the "]" as the delimiter
djcercone has quit [#ruby-lang]
<phazenine>
any suggestions?
<drbrain>
phazenine: CGI.htmlescape
<drbrain>
wait, excel? can't you just set the data type?
<drbrain>
wait, excel? I don't think I want to know what you're doing
<phazenine>
lol
<rue>
Ooh, lag
<rue>
O wait, just ffmpeg at 380% CPU :/
Heimidal has joined #ruby-lang
erpuds has joined #ruby-lang
kurko_ has joined #ruby-lang
yadav has joined #ruby-lang
gix has joined #ruby-lang
jtoy has joined #ruby-lang
Stalkr_ has joined #ruby-lang
_bryanp has joined #ruby-lang
macmartine has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
SuperTaz_work has joined #ruby-lang
igotnolegs has joined #ruby-lang
andkerosine has joined #ruby-lang
neoesque has joined #ruby-lang
waazzuup has joined #ruby-lang
postmodern_ has joined #ruby-lang
Tref has joined #ruby-lang
<Tref>
guys need some ruby regex help
<Tref>
I don't even know how i would search for something like this
<Tref>
regex is so cryptic to me, i don't get it :)
AndChat| has joined #ruby-lang
<Tref>
lianj: you are the man
<Tref>
I mean I don't know you personally, but in this situation you are the man to me; no homo
<Tref>
that was the LAST piece to my puzzle
takaokouji has joined #ruby-lang
wmoxam_ has joined #ruby-lang
MistyM has joined #ruby-lang
Stalkr_ has joined #ruby-lang
gnufied has joined #ruby-lang
wmoxam has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
jasiek has joined #ruby-lang
denysonique__ has joined #ruby-lang
tla_ has joined #ruby-lang
gentz has joined #ruby-lang
wmoxam has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
wmoxam_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
<gouthamvel>
[ActiveModel Help] https://gist.github.com/1823066 I have uninitialized constant TagNote::Tag error when trying to access TagNote.new.tag. How can I resolve this?
cloud-brownies has joined #ruby-lang
wmoxam has joined #ruby-lang
postmodern has joined #ruby-lang
elephants has joined #ruby-lang
<drbrain>
gouthamvel: Try #ror
<theconartist>
(in combination with not modifying the color of your text)
<drbrain>
oh wow, LimeChat saved me from that evil?
<drbrain>
AWESOME
<gouthamvel>
hey thanks guys
wmoxam has joined #ruby-lang
headius has joined #ruby-lang
wallerdev has joined #ruby-lang
<wallerdev>
drbrain: nice work on the mechanize release
<drbrain>
wallerdev: is there a :P in there somewhere?
<wallerdev>
nah i love mechanize
<wallerdev>
also i screw up releases in my software all the time
<drbrain>
ah, good, since I messed up the first one
<wallerdev>
:)
<drbrain>
it's ok, you can make one (only one) joke at my expense :)
MistyM has joined #ruby-lang
<wallerdev>
have you always been a maintainer of it?
<wallerdev>
i know when i first started using it i used it with hpricot which seems to have kinda died with _why
<drbrain>
no, knu and I are the third set
<wallerdev>
cool
dfr|mac has joined #ruby-lang
<wallerdev>
i was going to port mechanize to .NET at one point but ended up just giving up on .NET and moving to ruby instead
<wallerdev>
haha
<srbaker>
good move
dv310p3r has joined #ruby-lang
<wallerdev>
but now I'm back to doing .NET as my day job -_-
looopy has joined #ruby-lang
<drbrain>
once upon a time I used mechanize + Win32OLE (to IE and Outlook) + vim to automate the un-automatable
<drbrain>
actually, maybe not mechanize
<wallerdev>
sounds like a mess
<wallerdev>
haha
<drbrain>
it was a mess
<drbrain>
but it saved me time waiting on the slowest website ever
<wallerdev>
i <3 automation
rivaler has joined #ruby-lang
<drbrain>
four servers couldn't return requests faster than once every five to ten seconds
<wallerdev>
haha
<drbrain>
and the daily average load was under one request per second
<wallerdev>
were they powered by microsoft access databases
<drbrain>
but that's what you get from an all-microsoft shop
gouthamvel has quit [#ruby-lang]
<wallerdev>
anyone have experience with CMS systems with ruby/rails?
<wallerdev>
I'm probably gonna go with refinerycms
<cloud-brownies>
CMS? rails g scaffold ?
<wallerdev>
well i need rich text editors for editing everything
<wallerdev>
and the ability for users to add pages and things like that
<wallerdev>
upload images and files and the usual stuff
twittard has joined #ruby-lang
wyhaines has joined #ruby-lang
<wallerdev>
locomotive looks interesting
HW42_ has joined #ruby-lang
tdubz has joined #ruby-lang
andkerosine has quit [#ruby-lang]
sideshownz has joined #ruby-lang
macmartine has joined #ruby-lang
rippa has joined #ruby-lang
chimkan_ has joined #ruby-lang
krz has joined #ruby-lang
savage- has joined #ruby-lang
<jtoy>
do you guys test out end to end of your system even if its crossing multiple apps/dameons/etc ?
gokul has joined #ruby-lang
<wallerdev>
isnt that the customer's job?
<jtoy>
haha, partially
bojicas has joined #ruby-lang
<jtoy>
some parts that should happen don't seem to always happen
<jtoy>
its becoming a huge pain to train everything
<jtoy>
trce
<drbrain>
jtoy: at work we have a complete QA environment with everyone's QA code in it
<drbrain>
so it's end-to-end across multiple services
<drbrain>
so both dedicated QA people and regular users find bugs
<jtoy>
drbrain: do you guys write "integration" tests for the environment?
<jtoy>
or mostly QA people find the bugs?
<drbrain>
for a single app, yes, a few
Aaaarg has joined #ruby-lang
<drbrain>
(depending upon the app)
<drbrain>
NewRelic finds most of the bugs
<drbrain>
due to our volume (50,000+ RPM) it's difficult for QA to find anything but bugs that should have been caught by proper unit tests
<drbrain>
so it's usually weird user queries that find bugs
<jtoy>
probably my app is more complex then need be, but I want to test out someone hitting the web app, job gets sent, job processor processes it, data shows up in the db, then shows up in our index engine, I'm contemplating writing tests , but doesn't sound like a good solution
<drbrain>
QA usually finds bugs that pass between services
andrewhl has joined #ruby-lang
<drbrain>
jtoy: with that many parts I would use instrumentation to discover bugs
<jtoy>
yeah, seems like it might be easier, although hard to automate humans
<drbrain>
NewRelic etc.
<jtoy>
drbrain: yeah, I do have new relic, but just for performance measurement
<drbrain>
with so many moving parts a test is not necessarily going to tell you "here is the bug" like a unit test would
<jtoy>
drbrain: you use rpm for bugs too? most of our stuff is not a web app
<drbrain>
jtoy: NewRelic can track web, background job, Solr, etc.
<drbrain>
jtoy: they've got the exception reports so we scan those for top errors
<drbrain>
then go fix the bug
<jtoy>
drbrain: cool, ill have to see if it integrates well with event machine
<drbrain>
you can add custom reporting
<drbrain>
we've got a separate set of metrics through LWES
<drbrain>
which is a multicast log stream
<jtoy>
cool, never heard of LWES
<drbrain>
we don't leverage it well enough
<drbrain>
it's got structured logging
<drbrain>
so we can log things like "my service made 5 sub requests and here were each of the request URIs, response codes and response times"
kp666 has joined #ruby-lang
dkannan has joined #ruby-lang
nuclearsandwich has joined #ruby-lang
kp666 has joined #ruby-lang
gnufied has joined #ruby-lang
kitallis has joined #ruby-lang
Axsuul has joined #ruby-lang
MistyM has joined #ruby-lang
ilyam has joined #ruby-lang
comboy has joined #ruby-lang
tommyblue has joined #ruby-lang
jasiek has joined #ruby-lang
aef has joined #ruby-lang
valeri_ufo has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
vereteran has joined #ruby-lang
a3li has joined #ruby-lang
tasiu has joined #ruby-lang
khaase has joined #ruby-lang
darix has joined #ruby-lang
darix has joined #ruby-lang
abuiles has joined #ruby-lang
[dmp] has joined #ruby-lang
[dmp] has joined #ruby-lang
timbleck has joined #ruby-lang
soahccc has joined #ruby-lang
jMCg has joined #ruby-lang
jwollert has joined #ruby-lang
cloud-brownies has joined #ruby-lang
_rane has joined #ruby-lang
ryanf has joined #ruby-lang
sideshownz has joined #ruby-lang
necromancer has joined #ruby-lang
meise has joined #ruby-lang
senthil has joined #ruby-lang
charper has joined #ruby-lang
mccraig has joined #ruby-lang
Muz has joined #ruby-lang
simon_weber has joined #ruby-lang
cldwalker has joined #ruby-lang
akahn has joined #ruby-lang
chimkan has joined #ruby-lang
pvh has joined #ruby-lang
ramonmaruko has joined #ruby-lang
macmartine has joined #ruby-lang
ramonmaruko has joined #ruby-lang
lake1 has joined #ruby-lang
lake has joined #ruby-lang
JohnBat26 has joined #ruby-lang
mrb_bk has joined #ruby-lang
denysonique__ has joined #ruby-lang
jxie has joined #ruby-lang
JohnBat26 has joined #ruby-lang
topaz has joined #ruby-lang
nemesit has joined #ruby-lang
<erikh>
hmm
<erikh>
anyone mind doing a short code review of what I already have? it's incomplete, I'm mostly just wondering if I can get some feedback on what I have
<erikh>
it's a 0mq messaging and event servicing system at this point -- I have more planned for it but I'm still building out messaging components.
<erikh>
I really need some people with a brain for concurrency to look at it and provide useful feedback on structure.
TheInkyVoid has joined #ruby-lang
<erikh>
it's not particularly big but there are a lot of parts.
<erikh>
anyhow -- if you have any comments, that would be awesome.
<cloud-brownies>
i do not have a brain for concurrency
<cloud-brownies>
but i do have a brain!
ryez has joined #ruby-lang
<erikh>
heh
ramonmaruko has joined #ruby-lang
fragmachine has joined #ruby-lang
ramonmaruko has joined #ruby-lang
savage- has joined #ruby-lang
h4y4shi has joined #ruby-lang
yango has joined #ruby-lang
<senthil>
what's that concept called when you define a constant to something and use the constant to refer to that something?
<burgestrand>
using constants?
<senthil>
symbolic constants i think is what I was looking for
Harzilein has joined #ruby-lang
<burgestrand>
that’s a new one
* burgestrand
googles
<senthil>
i just looked it up in C prog lang book
patant has joined #ruby-lang
dc5ala has joined #ruby-lang
<burgestrand>
Symbolic constants in C look closer to what we call symbols
<burgestrand>
Would have to read a bit more but that’s my initial conclusion
<senthil>
you might be right, i'm jus learning c
<drbrain>
erikh: what's up with concurrency?
<burgestrand>
senthil: alright, looks like it can be just about any kind of value that you define with the preprocessor in C, as far as Ruby goes I don’t think you’ll find a true similarity
Slackwise_ has joined #ruby-lang
<senthil>
burgestrand: i was just looking to see if there was a fancy name for doing that
<drbrain>
so you want to run ^^ from your Rakefile?
<drbrain>
oh, I should read it, hold on
<cloud-brownies>
within the rake task db:dev:prepare i want to call another file full of ruby code
<drbrain>
cloud-brownies: does `ruby ../something/something/../dummy_data.rb` generate the data you want in your DB?
<cloud-brownies>
yes drbrain
<cloud-brownies>
and the code is at the "root level" (?) of that file
<drbrain>
then I think this should work
<cloud-brownies>
well, so i'm asking how i set the path to that file properly
<drbrain>
we call it "top level"
<cloud-brownies>
i.e. which "path" do rake tasks run in?
<cloud-brownies>
what is the pwd from the perspective of the running task? to put it another way
<drbrain>
the easy way is require_relative 'relative/path/to/dummy_data'
<drbrain>
that will be relative to the file the db:dev:prepare task is defined in
<drbrain>
the pwd can be anything, depending on what tasks prior to this one do
twittard has joined #ruby-lang
<h4y4shi>
Is there a module in Ruby?
<drbrain>
for the first task invoked, IIRC, rake changes pwd to the directory of the Rakefile
<drbrain>
but it doesn't keep it there
<drbrain>
h4y4shi: for OpenGL? there's ruby-opengl, but it doesn't work in modern ruby, so use my repository
Slackwise_ has joined #ruby-lang
<cloud-brownies>
drbrain: it worked! thanks!
<drbrain>
cloud-brownies: great!
<h4y4shi>
I mean. For example. There is def command, class command, and do commands. Is there a command called module?
Xzyx987X has joined #ruby-lang
<drbrain>
h4y4shi: yes
<drbrain>
a Class is a type of Module
<h4y4shi>
is it available in the basic ruby or do I have to install something?
<drbrain>
it's available in basic ruby
<h4y4shi>
thanks =D
<drbrain>
h4y4shi: you may wish to follow a ruby tutorial
<drbrain>
perhaps this one
<drbrain>
corundum: learn to program?
<corundum>
A good Ruby tutorial for newbies to programming: http://pine.fm/LearnToProgram/. NOTE: For linux installation section (in Chapter 0), the filename presented is just a example.
<drbrain>
h4y4shi: ^^
Axsuul has joined #ruby-lang
<drbrain>
bed time
<h4y4shi>
good
<h4y4shi>
night
<h4y4shi>
I will follow you on github
nemesit has joined #ruby-lang
solars has joined #ruby-lang
zmack has joined #ruby-lang
frangiz has joined #ruby-lang
|Vargas| has joined #ruby-lang
|Vargas| has joined #ruby-lang
cyri_ has joined #ruby-lang
<fragmachine>
is there a way to output a jpeg file from ruby?
<fragmachine>
for example if I have a bunch of text can I turn it into an image?
<theconartist>
where are you having trouble
<fragmachine>
I don;t know where to start
<theconartist>
look for a program or library that does that, then you can figure out how to interface with it in ruby
<fragmachine>
yea there are a bunch of gems but they all seem to be for doing things with exsisting images. I found a 'convert' command for my man, but it's broken for some reason
<shevy>
I think the first has the advantage that you can remove the module at a later time again
<shevy>
but it's a bit too verbose for my taste
<shevy>
I'd wish there would be a way to easily denote how much core classes can be modified. and how to easily revert to how they were before the modification happened
<whitequark>
traits
slimfit has joined #ruby-lang
andrewhl has joined #ruby-lang
mccraig has joined #ruby-lang
masterkorp has joined #ruby-lang
_bryanp has joined #ruby-lang
mrb_bk has joined #ruby-lang
akahn has joined #ruby-lang
abuiles has joined #ruby-lang
vereteran has joined #ruby-lang
wyhaines has joined #ruby-lang
rippa has joined #ruby-lang
SkramX has joined #ruby-lang
enebo has joined #ruby-lang
Spooner has joined #ruby-lang
fayimora has joined #ruby-lang
Jay_Levitt has joined #ruby-lang
tbuehlmann has joined #ruby-lang
roha has joined #ruby-lang
Indian has joined #ruby-lang
mark_locklear has joined #ruby-lang
mark_ has joined #ruby-lang
outoftime has joined #ruby-lang
Silex has joined #ruby-lang
<rue>
Abilities
<andrewvos>
Powers
<injekt>
bleghhh
<andrewvos>
Combo BREAKER
<shevy>
lol
darkf has joined #ruby-lang
<andrewvos>
rofl
chendo_ has joined #ruby-lang
sinuc has joined #ruby-lang
sinuc has joined #ruby-lang
<optikalmouse>
do you *need* the return in a ruby method?
<optikalmouse>
isn't the value of the last evaluated statement in the method returned?
<andrewvos>
no
zvrba has joined #ruby-lang
<andrewvos>
yes
erpuds has joined #ruby-lang
DEac- has joined #ruby-lang
<optikalmouse>
wow
<optikalmouse>
so some idiot programmer was placing returns all over the code.
y3llow_ has joined #ruby-lang
<andrewvos>
optikalmouse: It could have been you :)
<optikalmouse>
andrewvos: I haven't had a coffee yet so <insert insult here> and I'm the newb who JUST started at this new job sooo it would be impossible for me to have done that ;)
<andrewvos>
hehehe
whitequark has joined #ruby-lang
stderr- has joined #ruby-lang
zzak has joined #ruby-lang
deadbea7 has joined #ruby-lang
maxx- has joined #ruby-lang
href has joined #ruby-lang
xsdg has joined #ruby-lang
adgar has joined #ruby-lang
mksm has joined #ruby-lang
Eising has joined #ruby-lang
raggi has joined #ruby-lang
flebel has joined #ruby-lang
cyndis has joined #ruby-lang
tobiasvl has joined #ruby-lang
yibe has joined #ruby-lang
yellow5 has joined #ruby-lang
shyouhei has joined #ruby-lang
robbrit has joined #ruby-lang
banderson623 has joined #ruby-lang
banderson623 has joined #ruby-lang
dju has joined #ruby-lang
slimfit has joined #ruby-lang
macmartine has joined #ruby-lang
<shevy>
hmm
<shevy>
can you show parts of the code optikalmouse
headius has joined #ruby-lang
Sailias has joined #ruby-lang
Spooner has joined #ruby-lang
havenn has joined #ruby-lang
roha has joined #ruby-lang
meise has joined #ruby-lang
<andrewvos>
haha
Heimidal has joined #ruby-lang
Harzilein has joined #ruby-lang
meise has joined #ruby-lang
_rane has joined #ruby-lang
darkf has joined #ruby-lang
amerine has joined #ruby-lang
indstry has joined #ruby-lang
lake has joined #ruby-lang
scampbell has joined #ruby-lang
<shevy>
:(
<shevy>
I wanted to see the multiple returns!
NARKOZ has joined #ruby-lang
niklasb has joined #ruby-lang
anjen has joined #ruby-lang
abuiles has joined #ruby-lang
malev_ has joined #ruby-lang
wmoxam has joined #ruby-lang
wwalker has joined #ruby-lang
lordofthedance has joined #ruby-lang
<wwalker>
I can't change it, but my employer does design docs in MS Office Word. Has anyone else suffering this pain found a way to import rdoc into a word doc?
<Tasser>
is there an append mode for files?
<outoftime>
Tasser: 'a'
<Tasser>
thanks
necromancer has joined #ruby-lang
<shevy>
yeah or 'a+'
<outoftime>
depends on whether you did a good job or a *really* good job.
<necromancer>
does anyone here use Airbrake for a non-Rails app? i'm getting a LoadError even when i add gem 'i18n' to my Gemfile, and it's throwing the error in my .gemspec where i'm not even declaring airbrake as a dependency...
malev has joined #ruby-lang
fvollero has joined #ruby-lang
<whitequark>
necromancer: I do
<whitequark>
but it just works
daglees has joined #ruby-lang
daglees has joined #ruby-lang
slyphon has joined #ruby-lang
<necromancer>
whitequark: ugh
<necromancer>
this ONLY happens on the production sevrer
<necromancer>
what the fuc
SkramX has joined #ruby-lang
butchanton has joined #ruby-lang
rayners has joined #ruby-lang
kyrylo has joined #ruby-lang
kyrylo has joined #ruby-lang
<optikalmouse>
does ruby not come with a debugging tool?
havenn has joined #ruby-lang
<shevy>
ruby_debug
<shevy>
but I never used it
<shevy>
you can set "breakpoints" and do other fancy stuff with it
<shevy>
like kill sheep and such
Cope has joined #ruby-lang
<whitequark>
necromancer: bundle exec ?
solars has joined #ruby-lang
havenn has joined #ruby-lang
<optikalmouse>
ruby-debug is a gem
<optikalmouse>
but there's ruby_debug?
<optikalmouse>
wtf :S
<Spooner>
optikalmouse: pry can be useful as a debugger too (not sure if the full debugging support is released yet).
<Spooner>
And I can't find a ruby_debug; only ruby-debug.
<kain>
pry is awesome but I still haven't found a way, if any, to step in code
<kain>
just breakpoint and go from there
<Spooner>
I know Banistergalaxy was talking about implementing that, but it was recent. I only really use it as an irb replacement though, so I am not sure.
<Spooner>
kain: pry_debug definitely looks like it steps.?
<andkerosine>
Could reverse!.slice(0,2).reverse! not be replaced with [-3..-1]?
<shevy>
hmm
andrewhl has joined #ruby-lang
<shevy>
indeed
<andkerosine>
Magic.
<manveru>
tail -2 file.txt
<shevy>
non ruby!!!
<manveru>
neither is your < file.txt
<shevy>
that's just data
<manveru>
that's your shell
<shevy>
my shell is written in ruby!!!!!!!!Infinity!!!!
<manveru>
if you have a shell, you have tail
<shevy>
of course
<shevy>
written in ruby too :)
<andkerosine>
If you have a tail, you have a coccyx.
* shevy
cuddles manveru
<shevy>
a what?
<shevy>
is that like a bird?
<outoftime>
andkerosine: don't you have either one or the other?
<andkerosine>
That's a cloaca.
<shevy>
lol
Axsuul has joined #ruby-lang
<drbrain>
shevy: ARGF
<andkerosine>
drbrain: Right you are.
simon_weber has joined #ruby-lang
<drbrain>
ARGF is much better than ruby foo.rb < some_file.txt
pvh has joined #ruby-lang
simon_weber has joined #ruby-lang
twittard has joined #ruby-lang
at5l has joined #ruby-lang
<manveru>
still sucks performancewise
conceal_rs has joined #ruby-lang
<manveru>
but it wouldn't be as much fun and consice to write it performant
<manveru>
and everybody has SSDs and gigs of ram nowadays anyway
jstemmer has joined #ruby-lang
<indstry>
drbrain: Hey that worked! thanks
lake has joined #ruby-lang
mrsolo has joined #ruby-lang
divoxx has joined #ruby-lang
<andkerosine>
Optimal approach to selectively defining methods depending on which class included the module?
<manveru>
don't :)
LanceHaig has joined #ruby-lang
<andkerosine>
Well, I'd like all my actions to go in one module. It smacks of overkill to define PostActions, CommentActions, SubredditActions, etc.
<andkerosine>
A simple if seems like it'd suffice, but is that generally frowned upon?
<outoftime>
andkerosine: encapsulate the concept that varies
scampbell has joined #ruby-lang
<outoftime>
andkerosine: or in ruby, sometimes replace "encapsulate" with "write a mixin for" or something : )
<drbrain>
andkerosine: or superclass
Carnage\ has joined #ruby-lang
<drbrain>
if you're doing it right, there should only be a few lines
matti has joined #ruby-lang
havenn has joined #ruby-lang
<outoftime>
andkerosine: I'm wondering why, if you want different behavior for each class, you don't just... write the different behaviors in each class?
<andkerosine>
Because they share so many common methods.
<andkerosine>
I absolutely hate seeing almost identical code.
Sailias has joined #ruby-lang
<outoftime>
andkerosine: right, so extract/encapsulate the concept that varies. write a method in each class that does the part that's different, and then call that method from the mixin
kurko_ has joined #ruby-lang
KimT has joined #ruby-lang
<outoftime>
andkerosine: an example would be the Enumerable mixin -- every class that inherits it has its own implementation of #each, and then Enumerable takes care of all the common functionality from there.
<andkerosine>
Mm-hmm. That is essentially what I'm doing.
<drbrain>
outoftime: andkerosine: in this case, a superclass would be a better fit than a module
<outoftime>
no arguments there, i'm only half aware of the actual use case : )
<drbrain>
Danzer: also, use File.open with a block
<shevy>
Danzer you should check your indent levels
sinuc has joined #ruby-lang
<drbrain>
Danzer: if you're using ruby 1.9 you don't need to require 'rubygems'
<shevy>
if you have trouble checking the indent, you can always change from do/end to use {}
<drbrain>
File.open(STORE_WHERE, 'w+') do |f| … end
<drbrain>
no need for f.close
<drbrain>
Danzer: when you run this, what happens?
<shevy>
In the code you did there, "f = File.open(STORE_WHERE, 'w+')", you do not use "do" nor "{" but the next line you indented as if you would have used either, you see that?
<shevy>
lianj always has to pack things into one line :(
<drbrain>
Danzer: … what is printed on the console after running it?
<lianj>
shevy: hehe
<drbrain>
shevy: for IRC, sure
erics has joined #ruby-lang
Skif_home has joined #ruby-lang
dejongge has joined #ruby-lang
Jake232 has joined #ruby-lang
lalarou has quit [#ruby-lang]
CoverSlide has joined #ruby-lang
twittard has joined #ruby-lang
twittard has joined #ruby-lang
ilyam has joined #ruby-lang
qpingu has joined #ruby-lang
tomzx has joined #ruby-lang
macmartine has joined #ruby-lang
Carnage\ has joined #ruby-lang
havenn has joined #ruby-lang
cyri_ has joined #ruby-lang
niklasb has joined #ruby-lang
<jbwiv>
what's the appropriate way to eval a file into the current scope? so, for example, read a file on erb, have that file be executed, and then be able to inspect the top level vars from its scope after completion?
<jbwiv>
that should be irb, not erb
<rippa>
eval it
<robbrit>
jbwiv: require?
<rippa>
eval(File.read('file.rb'))
<rippa>
robbrit: he needs locals
<jbwiv>
rippa, I tried that, but it seems top-level vars are inspectable
<robbrit>
ah damn
<jbwiv>
that way
<rippa>
are not inspectable?
<jbwiv>
rippa: do not remain in scope
<rippa>
hmm
<jbwiv>
for example, my file does "tables = {}"
<jbwiv>
outside of any blocks
<rippa>
try supplying current binding
phazenine has joined #ruby-lang
<jbwiv>
but after eval, I get an undefined local variable error when referencing tables
<rippa>
binding.eval(etc
<jbwiv>
rippa, yes...tried that as well
<rippa>
I seem to remember it helped somehow
<rippa>
oh well
Indian has joined #ruby-lang
<jbwiv>
I know I've made this work in the past...just have to remember how
brianpWins has joined #ruby-lang
<burgestrand>
jbwiv: I believe it’ll work differently in 1.8.7 vs 1.9
fayimora_ has joined #ruby-lang
<burgestrand>
jbwiv: they changed something related to bindings and local variables between those versions, don’t remember exactly what
<jbwiv>
burgestrand, this is 1.9. I'll bet when I tried it in the past it was 1.8
voker57_ has joined #ruby-lang
<phazenine>
can someone explain why this is selecting everything \p{^Han}|\p{^Katakana}|\p{^Hiragana} as compared to it not selecting one language with this: \p{^Han}|\p{Katakana}|\p{Hiragana}
nark-1 has joined #ruby-lang
<manveru>
phazenine: everything of what?
<phazenine>
i'm using rubular and using this as an example: ひらがな or ヒラガナ end start 士通
<phazenine>
if you use \p{^Han} it selects everything except Han
<phazenine>
but the moment you do \p{^Han}|\p{^Hirgana} everything gets selected
<phazenine>
i know i'm most likely doing something wrong, but I'd like to know what it is
<rippa>
かたかな
<wwalker>
phazenine: yes. because everything is either "not Han" or "not Hiragana"
<TTilus>
phazenine: well, ain't everyting either not hiragana or not han?
erpuds has joined #ruby-lang
<andkerosine>
Curly braces in a Regexp?
freedrul1 has quit [#ruby-lang]
<wwalker>
phazenine: more simply: /[^A]/ selects everything except A, /[^B]/ selects everything except B , so /[^A]|[^B]/ by definition selects anything
<burgestrand>
andrewhl: yes, unicode character classes you specify with \p{character class}
<burgestrand>
… .
<andkerosine>
Ah, good stuff.
<burgestrand>
andrewhl: not you, sorry, go away.
<andrewhl>
lol
<burgestrand>
andkerosine: :)
<andkerosine>
Odd that you had him in your clipboard?
<andrewhl>
tab completion
<burgestrand>
andkerosine: not clipboard, just sloppy tab completion
<andkerosine>
Second guess.
<andkerosine>
Also, TIL.
<phazenine>
wwalker: why is that?
<andkerosine>
?!
<andkerosine>
Everything in the world is either "not a dog" or "not a cat".
<wwalker>
because C matches [^A] and matches [^B]. B matches [^A]
<wwalker>
phazenine: maybe you are not understanding clearly that "|" means OR
sideshownz has joined #ruby-lang
<wwalker>
phazenine: can you tell me anything that is not " (not hiragan) OR (not han) "
<wwalker>
hiragana
<andkerosine>
Cinnabons, for they are not of this world.
<phazenine>
i understand that | is OR, i just thought if you did /[^A]|[^B]/ it would pull C if the string was "ABABAACABAB"
<phazenine>
but i understand tho
<rippa>
that should be
<rippa>
[^AB]
fayimora has joined #ruby-lang
curtism has joined #ruby-lang
<jbwiv>
burgestrand, rippa: according to "Programming Ruby 1.9", "Local variables assigned within an eval are available after the eval only if they were defined at the outer scope before the eval executed. In this way, eval has the same scoping rules as blocks."
<jbwiv>
so definitely different in 1.9, and unfortunate/fortunate at the same time :-/
<rippa>
define all possible variable names beforehand
<burgestrand>
jbwiv: I’m wondering if you can walk around this using local_variables and defining a hash before eval.
<burgestrand>
Might have an idea. Back in a minute.
<andkerosine>
That does seem like it'd work.
dv310p3r has joined #ruby-lang
<rippa>
( ゚∀゚)アハハ八八ノヽノヽノヽノ \ / \/ \
<jbwiv>
burgestrand, ok, cool
<outoftime>
amazing that the local variables aren't retained even when a binding is explicitly passed
ilyam has joined #ruby-lang
<burgestrand>
Yeah, works, cool!
<Guest49791>
so is there no way to do [^AB] with \p{stuff}?
<andkerosine>
Pastie is really slow to apply syntax highlighting...
<burgestrand>
jbwiv: I think so too :d
LanceHaig has joined #ruby-lang
<jbwiv>
burgestrand, what specifically does this do? "eval <<-SOURCE, nil, __FILE__, __LINE__"? I understand heredocs, but what's with the extra args?
<burgestrand>
jbwiv: the second argument is the binding it’s to be run in, but as for __FILE__ and __LINE__ they are magical in that they evaluate to the file and line they’re written in; if an error occurs in the eval’d code it will have the correct file and line in the backtrace
<burgestrand>
or, at least a more helpful line and file in the backtrace
Skif has joined #ruby-lang
erics has joined #ruby-lang
lsegal has joined #ruby-lang
<jbwiv>
burgestrand, ah, ok. thanks very much. wonder why they didn't build something like eval! in...or even evileval! :-)
<outoftime>
andkerosine: hastebin.com
<andkerosine>
Solarized is gross.
<outoftime>
andkerosine: well that settles that.
<andkerosine>
I think Gist is beautiful.
<outoftime>
Gist is really good at what it's designed for, which is not to replicate the functionality of pastebin/pastie/hastebin.
<andkerosine>
The... immediacy?
<outoftime>
transience, more like it. Gist is good for things that are meant to be permanent -- shared and collaborated upon.
<outoftime>
in my humble opinion, of course.
<outoftime>
it's not good for dropping a random stacktrace or code snippet that you need to exist on the internet for the next 45 seconds
<andkerosine>
Mm, fair enough. But it can still pretty much double as a throwaway.
<burgestrand>
jbwiv: also, in addition, they also set the __FILE__ if used within the evaled code :)
<outoftime>
it's pretty slow for that.
<andkerosine>
Slow... HTTP-wise?
<andkerosine>
Or just getting the code in there?
Jake232 has joined #ruby-lang
<outoftime>
yeah, like, response times are slow compared to purpose-built paste bins.
postmodern has joined #ruby-lang
<outoftime>
and it keeps track of your gist history as a user, which is great for the lasting-collaborating use case, but annoying for the paste-and-forget use case.
<andkerosine>
Another fair point, but proper tools largely do away with that.
<andkerosine>
I use a SublimeText2 plugin, so I just highlight the gist, Ctrl-Alt-G, and then there's a link in my clipboard. ^_^
<andkerosine>
Not doing it from "the Web" means it always comes out anonymous, which I very much prefer.
<outoftime>
that does take care of that problem.
benanne has joined #ruby-lang
<andkerosine>
Bad practice to use #index in place of #include? when they're synonymous for my purposes?
jimc| has joined #ruby-lang
<outoftime>
andkerosine: it is asking a question you don't need to know the answer to...
Heimidal has joined #ruby-lang
petercooper has joined #ruby-lang
<outoftime>
andkerosine: also, e.g. Set#index has no meaning, whereas Set#include? does. so you're more polymorphism-friendly if you're asking the question you need answered.
srbaker has joined #ruby-lang
futurechimp has joined #ruby-lang
jmeeuwen has joined #ruby-lang
jimc| has joined #ruby-lang
jimc| has quit [#ruby-lang]
<jbwiv>
this "@belongs_to = @has_one = @has_many = {}" sets those three instance vars to all point at the same hash. Is there a clean shortcut syntax to instantiate a set of variable to the same type of object, but different instances?
roha has joined #ruby-lang
<andkerosine>
Hash.new?
Austin__ has joined #ruby-lang
Austin__ has quit [#ruby-lang]
<andkerosine>
Nah, you'll have to iterate, I'm afraid.
<andkerosine>
Or do it in parallel, which is sometimes ugly, but no so much when the right side is just {}, {}, {}.
<jbwiv>
andkerosine, heh.... a=b=c={},{},{} sets them all to point to an array of three hashes
<jbwiv>
sheesh, nm
<jbwiv>
a,b,c={},{},{}
<andkerosine>
Cha. : )
<jbwiv>
;)
<andkerosine>
; P
<jbwiv>
thx
jbwiv has quit ["Ex-Chat"]
<andkerosine>
Sure thing.
jbwiv has joined #ruby-lang
savage- has joined #ruby-lang
<hagabaka>
(a,b,c) = Array.new(3) {{}}
<andkerosine>
Yuck.
havenn has joined #ruby-lang
<matled>
I have a chain of methods called on a collection (map, reject, map, sort_by). I'm not sure what is more readable, either using a variable and calling map!, reject!, map!, sort_by on it or just calling one method after the other with the blocks in between
<andkerosine>
Chain them, but with each chain method on its own line, starting with the dot.
<hagabaka>
why do you need to map twice, plus sorb_by?
<hagabaka>
*sort_by
dustacio has joined #ruby-lang
<matled>
hagabaka: well, I call .entries on a pathname object, first I map them to strings with force_encoding "binary", then reject %w(. ..), then map them to the objects I actually want to have, and finally sort them the way I want them
chimkan_ has joined #ruby-lang
<matled>
I didn't know that the dot may be at the start of the line
<hagabaka>
couldn't you convert them to strings inside reject block?
<matled>
I thought ruby would end the statement if a new line occured and wouldn't allow a method call
<matled>
hagabaka: reject does not map the objects
<matled>
hagabaka: so I'd have to do the .to_s.force_encoding twice
<hagabaka>
you can do anything you want in the reject block
<matled>
hagabaka: I know, but the return value of the reject block is a subset of the original collection
<matled>
I cannot replace the objects as I can do with #map
<hagabaka>
instead of objects.map {convert...}.reject, object {bad stuff}, objects.reject {convert, bad converted_stuff}
<andkerosine>
rvm --default use 1.8.7 is not being remembered...
<matled>
hagabaka: but I want to have the converted objects later on
eggman2001 has joined #ruby-lang
<hagabaka>
ok then, but I just thought it was unlikely that you would need to go through such a convoluted process
CoverSlide has joined #ruby-lang
<hagabaka>
what are you actually trying to do if you don't mind answering?
robbrit has quit [#ruby-lang]
<matled>
it's a method to return all directories/files within a given directory recursively
<eggman2001>
hello, if my nokogiri::xml::element has the html <option value="20">foo</option>, does anyone know how I can pull out the "20"?
<hagabaka>
like Dir['**
<hagabaka>
']?
<matled>
one problem is that ruby 1.9 encoding is really annoying. the strings returned by #entries may be flagged as UTF-8 but filenames just may be in any encoding, so I have to use force_encoding all the time
<hagabaka>
**/*
<manveru>
matled: that depends on the locale
andkerosine has quit [#ruby-lang]
malev_ has joined #ruby-lang
<matled>
irb(main):007:0> path.entries.map { |e| path + e }
<matled>
ArgumentError: invalid byte sequence in UTF-8
<matled>
this is what annoys me
<matled>
as this is not intended to be used as a library I could just do Encoding.default_external = "binary", but I hesitated from doing that as it feels a bit unclean
slimfit has joined #ruby-lang
<matled>
it is just so hard to get it right if you're working with the filesystem, environment or the arguments
ilyam has joined #ruby-lang
andkerosine has joined #ruby-lang
<andkerosine>
Is it still important to support <1.9?
<matled>
no
<andkerosine>
Really?
<matled>
yes
<andkerosine>
Excellent.
<matled>
oh, you just joined, I thought your question was related to my question :)
<matled>
I'd say it depends on what your target audience is
<andkerosine>
It's a wrapper for the reddit API.
<andkerosine>
It's pretty standard stuff, but I hate :x =>, when x: is an option.
<erikh>
uh
<erikh>
let's put it this way
<erikh>
most of the big boy libraries still support 1.8
<andkerosine>
I really ought to have been able to put that together. : /
<andkerosine>
I guess inheriting from Struct is so magical that my judgment got a bit clouded.
KimT has joined #ruby-lang
joast has joined #ruby-lang
Skif has joined #ruby-lang
Stalkr_ has joined #ruby-lang
lordofthedance has joined #ruby-lang
Heimidal has joined #ruby-lang
divoxx has joined #ruby-lang
<necromancer>
anybody ever get this? /usr/local/rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require': cannot load such file -- airbrake (LoadError)
<necromancer>
it happens on my production server but not development server
<necromancer>
using AIrbrake without rails
<drbrain>
necromancer: did you install airbrake on your server?
<necromancer>
drbrain: yes, it's in my Gemfile
<necromancer>
which has been executed using `bundle install`
erpuds has joined #ruby-lang
<necromancer>
" Installing airbrake (3.0.9)"
<shevy>
hmm is there an "international" symbol for the action "view source" of a webpage? Right now I just display that text... wonder if an icon would be better
Taranis has joined #ruby-lang
<drbrain>
necromancer: sounds like a bundler problem then, try #bundler?
HW42 has joined #ruby-lang
<drbrain>
necromancer: if `gem list` shows airbrake and `gem which airbrake` shows an airbrake.rb and `ruby -rairbrake -e0` works, you can confirm it's a bundler issue
<drbrain>
also, be sure that `gem env` matches /usr/local/rvm/rubies/ruby-1.9.3-p0
schlecht has joined #ruby-lang
zenspider has joined #ruby-lang
<zenspider>
what'd I miss?
h4y4shi has joined #ruby-lang
schlecht has joined #ruby-lang
<drbrain>
nothing
Nisstyre has joined #ruby-lang
<zenspider>
heh
<andkerosine>
shevy: Why not Zoidberg?
<andkerosine>
necromancer: Is your production environment 1.8?
SuperTaz_work has joined #ruby-lang
<shevy>
andkerosine Zoidberg?
<andkerosine>
Sorry, disregard.
<andkerosine>
Um... an HTML tag or two usually get the message across pretty well.
KimT has quit [#ruby-lang]
<necromancer>
drbrain: it is a bundler issue. i am installing with --deployment now
<njp>
gem install eventmachine.gemspec ERROR: Could not find a valid gem 'eventmachine.gemspec' (>= 0) in any repository ERROR: Possible alternatives: eventmachine-websocket, eventmachine-vnc, eventmachine-redis, eventmachine, event_machine_flush
<lianj>
gem install eventmachine-0.12.10.gem
<drbrain>
njp: you can't install a gemspec
<lianj>
gems, how do they work
<njp>
Ahhh, got it.
<njp>
Thanks
<drbrain>
njp: please, look at your output
AlHafoudh has joined #ruby-lang
<njp>
That output doesn't say "you need to install the versioned .gem file" to me
<njp>
Maybe if you've been through this process enough you recognize it, but it's not terribly obvious.
<njp>
But, I do genuinely appreciate the help
<drbrain>
njp: .gemspec and .gem are two different types of files
<lianj>
what did you change? (curious)
<drbrain>
njp: also, `gem install` by default tries local files matching the name then remote files
<njp>
lianj: I'm working on a fix for a bug that we're seeing in a complicated TCP-based system.
<njp>
I don't have enough time to go into it in detail, but we were seeing some unusual TCP behaviour with a root cause in close_on_exec for socket file descriptors
kurko_ has joined #ruby-lang
<lianj>
i would suggest doing it locally first, without reinstalling all the time
<lianj>
preferably in the git repo of eventmachine
<njp>
That's certainly what I'd like to do.
twittard_ has joined #ruby-lang
<njp>
What's the right way of doing that?
<erikh>
njp: is there a rakefile in the repo?
Spooner has joined #ruby-lang
<njp>
Yeah.
<erikh>
rake -T
<erikh>
is there a 'gem' or 'install_gem' target?
<erikh>
or something similar
<njp>
there's a 'gem' target
<erikh>
ok -- you can probably use that to build your gem
<erikh>
so, like so: rake gem && gem install pkg/eventmachine-blabla.gem
<erikh>
it's not *great* but it's probably simpler than what you're doing.
<erikh>
also there's #eventmachine, which has some of the brightest hackers ruby has to offer in it
<njp>
Yeah, I did try this, in a git checkout
H2H has joined #ruby-lang
<njp>
and got stuff like this:
<njp>
rake gem --trace rake aborted! no such file to load -- lib/em/version /home/nick/Work/ruby/install/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /home/nick/Work/ruby/install/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' /home/nick/Work/ruby/gem_src/eventmachine.git_checkout/Rakefile:123:in `block in <top (required)>'