Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
tatsuya_o [tatsuya_o!~tatsuya_o@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
banisterfiend [banisterfiend!~baniseter@115.189.57.66] has joined #ruby
peterwald [peterwald!~peterwald@75-130-159-178.dhcp.spbg.sc.charter.com] has joined #ruby
`brendan [`brendan!~b@64-121-18-195.c3-0.upd-ubr1.trpr-upd.pa.cable.rcn.com] has joined #ruby
niko [niko!~niko@freenode/staff/ubuntu.member.niko] has joined #ruby
badabim_ [badabim_!~badabim@17.245.88.88] has joined #ruby
tomzx [tomzx!~tomzx@dsl-59-207.aei.ca] has joined #ruby
zalesz [zalesz!~zalesz@user-188-33-218-83.play-internet.pl] has joined #ruby
rpowell [rpowell!~rpowell@58.165.184.209] has joined #ruby
peterwal_ [peterwal_!~peterwald@75-130-159-178.dhcp.spbg.sc.charter.com] has joined #ruby
blaenk [blaenk!~blaenk@unaffiliated/blaenkdenum] has joined #ruby
wyhaines_ [wyhaines_!~wyhaines@65.39.118.15] has joined #ruby
sethetter [sethetter!~sethetter@ip98-186-171-21.ks.ks.cox.net] has quit [#ruby]
ontehfritz [ontehfritz!~ontehfrit@CPE0020a6543eed-CM0026f399f8dd.cpe.net.cable.rogers.com] has joined #ruby
phantasm66 [phantasm66!~phantasm6@146-115-132-39.c3-0.nwt-ubr1.sbo-nwt.ma.cable.rcn.com] has joined #ruby
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has joined #ruby
yfeldblum [yfeldblum!~Jay@c-68-34-107-252.hsd1.md.comcast.net] has joined #ruby
Nisstyre [Nisstyre!~yours@infocalypse-net.info] has joined #ruby
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby
randym [randym!~randym@113x33x226x118.ap113.ftth.ucom.ne.jp] has joined #ruby
chilversc [chilversc!~chris@about/csharp/regular/KeeperOfTheSoul] has joined #ruby
rgs_ [rgs_!~rgs@serendipity.sugarlabs.org] has joined #ruby
replore [replore!~replore@203.152.213.161.static.zoot.jp] has joined #ruby
Indian [Indian!~Indian@unaffiliated/londonmet050] has joined #ruby
j3r0m3 [j3r0m3!~j3r0m3@76-217-192-160.lightspeed.frokca.sbcglobal.net] has joined #ruby
apucacao [apucacao!~apucacao@thelevel.com] has joined #ruby
bwlang [bwlang!~anonymous@static-71-245-233-146.bstnma.fios.verizon.net] has joined #ruby
cyri__ [cyri__!~cyri_@jem75-1-87-88-118-80.dsl.sta.abo.bbox.fr] has joined #ruby
mr-green [mr-green!~mr-green@122.164.225.59] has joined #ruby
pootpoot [pootpoot!~pootpoot@38.108.250.130] has quit [#ruby]
dankest [dankest!~dankest@wsip-174-75-64-190.sb.sd.cox.net] has joined #ruby
btanaka [btanaka!~textual@17.245.91.3] has joined #ruby
bloopletech [bloopletech!~blooplete@115.128.15.181] has joined #ruby
stephenjudkins [stephenjudkins!~stephen@67.139.75.158] has joined #ruby
<bloopletech>
I'm having some issues with regexps in 1.9.3: my case boils down to "\xA0".gsub("\xA0", " ") raising a RegexpError: invalid multibyte character: /\xA0/
mmokrysz [mmokrysz!~mmokrysz@pdpc/supporter/student/mmokrysz] has quit [#ruby]
<bloopletech>
however "\xA0" on its own doesn't raise an exception
<bloopletech>
"\xA0".encoding is UTF-8, Encoding.default_internal and Encoding.default_external are all UTF-8
dv310p3r [dv310p3r!~dv310p3r@adsl-74-161-99-192.mia.bellsouth.net] has joined #ruby
<bloopletech>
And U+00A0 is a valid UTF-8 character
Skaag [Skaag!~skaag@107.57.135.101] has joined #ruby
wmoxam [wmoxam!~wmoxam@pdpc/supporter/active/wmoxam] has joined #ruby
mr-green [mr-green!~mr-green@122.164.225.59] has quit ["Leaving"]
wmoxam_ [wmoxam_!~wmoxam@75-119-252-238.dsl.teksavvy.com] has joined #ruby
dotnull [dotnull!~DotNull@173-31-158-182.client.mchsi.com] has joined #ruby
<bloopletech>
I can't really find any decent docs on regexes and encoding in 1.9.3 either
<banisterfiend>
bloopletech: google for james edward gray's docs on encoding
<bloopletech>
banisterfiend, I've read them mostly
<bloopletech>
wil have another scan
<banisterfiend>
ok
<bloopletech>
this is a 1.9.3 specific change, it works in 1.9.2, so I don't think his articles will help
<csmrfx>
did you try setting the string encoding first
<csmrfx>
oh ok
<bloopletech>
I'll double check that it works in 192
<bloopletech>
wait
<bloopletech>
bloody hell now it's failing in 1.9.2, but why did my spec pass in 1.9.2? need to check this out
crescendo [crescendo!~eric@unaffiliated/crescendo] has joined #ruby
flip_digits [flip_digits!~textual@c-76-122-14-228.hsd1.fl.comcast.net] has joined #ruby
IrishGringo [IrishGringo!~chatzilla@c-71-229-99-200.hsd1.fl.comcast.net] has joined #ruby
<bloopletech>
OK I'll try to solve my actual problem. I have an ostensibly UTF-8 encoded string, containing the byte hex sequence A0. I need to change all instances of the sequence to an ordinary space
<bloopletech>
(space being hex 20)
<ged>
bloopletech: "\u00A0".gsub("\u00A0", ' ')
<bloopletech>
ged the string I'm processing is "\xA0"
<bloopletech>
I think there may be a difference between the two escapes
<bloopletech>
"\xA0".valid_encoding? => false
<bloopletech>
isn't the vm supposed to throw an error if you try to make an invalid sequence in a string?
sdwrage [sdwrage!~sdwrage@cpe-184-57-123-50.columbus.res.rr.com] has joined #ruby
<bloopletech>
I'm confused ;)
<bloopletech>
right, I'm pretty sure now that nokogiri is force_encoding or somesuch, so I'm being handed a string that is utf-8 encoded but contains invalid byte sequences
<bloopletech>
so I probably need to force it to ascii-8bit, remove the byte sequences, then transcode it back to utf-8
<mksm>
bloopletech, String#encode
<mksm>
it has some options to replace/remove invalid chars
dhodgkin [dhodgkin!~dhodgkin@cpe-76-179-199-112.maine.res.rr.com] has joined #ruby
<ged>
\u00A0 will definitely give you a UTF-8 non-breaking space.
<bloopletech>
all: thanks
<rjbs>
It's a custom Vim on Solaris. Right now, though, Vim isn't in the equation. I'm trying to compile the helper which I'll later use with Vim.
_whitelogger1 [_whitelogger1!~whitelogg@kaunan.whitequark.org] has joined #ruby
_whitelogger1 [_whitelogger1!~whitelogg@kaunan.whitequark.org] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
sarkis [sarkis!~sarkis@unaffiliated/sako] has joined #ruby
apeiros_ [apeiros_!~apeiros@77-58-115-24.dclient.hispeed.ch] has joined #ruby
thRoUS [thRoUS!KenCoar@nat/redhat/x-ssqezxkaaiekjvft] has joined #ruby
Jake232 [Jake232!~textual@5e049611.bb.sky.com] has joined #ruby
bier [bier!~bier@p57999BC6.dip.t-dialin.net] has joined #ruby
davidcelis [davidcelis!~david@70-89-180-6-smc-or.hfc.comcastbusiness.net] has joined #ruby
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
<Zal>
I read one tutorial that recommends a 2-space indent. My editor (vim --usually pretty smart) wants to use 4 space indent by default. Which is more common?
<csavola>
Zal: 2 for ruby
<Zal>
cool, thanks
<Zal>
guess I still have some startup configuration leftover for python
nonotza [nonotza!~nonotza@66.246.94.130] has joined #ruby
nowthatsamatt [nowthatsamatt!~nowthatsa@rrcs-71-43-23-18.se.biz.rr.com] has joined #ruby
p0y_ [p0y_!~p0y@121.96.188.176] has joined #ruby
dondani [dondani!5aa4472d@gateway/web/freenode/ip.90.164.71.45] has joined #ruby
<dondani>
what options are there for generating documentation from ruby code?
<dondani>
the github guys say rdoc sucks
badabim [badabim!~badabim@17.245.88.88] has joined #ruby
<dondani>
I've been trying their tomdoc format, but it's ignoring half of my methods
<dondani>
don't know why
zerdman [zerdman!~zerdman@71.255.123.66] has quit [#ruby]
cbuxton [cbuxton!~Adium@nat/partnerpedia/x-gqxqmiwmevgqjegg] has joined #ruby
btanaka [btanaka!~textual@17.245.91.3] has joined #ruby
leehambley [leehambley!~leehamble@pd956c64f.dip0.t-ipconnect.de] has joined #ruby
<shevy>
dondani, I think there is also YARD
<leehambley>
I know "i'm doing it wrong" - but I have to parse this file in Ruby, it's about 1.6Gb total, so manual work, and getting replacement input is out of the question…
<kW>
apeiros_: well, I have a file "lib/tasks/rspec.rake" in a rails-2.3 app, but I've upgraded to rspec-2 (i suppose this file is from rspec-1), and when executing rake (without rspec-1 installed), there are exceptions "cannot load such file -- spec/rake/spectask", so I though I just disable the whole file
<kW>
without deleting it at this point in time
<apeiros_>
kW: you can outcomment the section
<apeiros_>
or use __END__
<kW>
well, I like "if false" more :-)
<apeiros_>
beginner: you have an array there. you probably want s.entities.urls[0] first
raluxgaza [raluxgaza!~raluxgaza@host-78-146-236-164.as13285.net] has joined #ruby
thone [thone!~thone@e179080081.adsl.alicedsl.de] has joined #ruby
<apeiros_>
kW: outcommenting is quite more telling, though. but I'd leave a comment explaining the situation anyway.
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
Evixion [Evixion!Evixion@67.235.65.134] has joined #ruby
<beginner>
apeiros_: Ohh :|. Thanks for the help :)
<apeiros_>
beginner: s.entities.urls.class # <-- use .class to figure what you've got
<mattp_>
I think mkmf uses globals, so in extconf.rb you can append your custom include dir to $CPPFLAGS
<beginner>
apeiros_: yes. got it :)
<Mon_Ouie>
Literal if false in code looks like a bug or something someone forgot to remove from a debugging session
dannybtran [dannybtran!~digisyndi@gige.bur.digisynd.com] has joined #ruby
<seejohnrun>
randy: not losing it, just have a bunch of contacts that are totally blank (except for photo and name)
<rjbs>
mattp_: poking around with it.
tar_ [tar_!~tar@d118-75-81-132.try.wideopenwest.com] has joined #ruby
wilmoore [wilmoore!~wilmoore@70-89-165-49-ISTS-co.hfc.comcastbusiness.net] has joined #ruby
Jrz [Jrz!~jrz@d152222.upc-d.chello.nl] has joined #ruby
Optimis [Optimis!~Optimis@cpe-98-149-171-51.socal.res.rr.com] has joined #ruby
thRoUS [thRoUS!KenCoar@nat/redhat/x-owxkpxexiackdekp] has joined #ruby
nate_h [nate_h!~husimon@c73-208.rim.net] has joined #ruby
<rjbs>
mattp_: It was much stupider...
tomhsx [tomhsx!~tomhsx@c-76-109-169-195.hsd1.fl.comcast.net] has joined #ruby
<rjbs>
mattp_: the extconf.rb only reported "ruby.h" missing, but what it meant to say was "cc not in $PATH"
tomhsx [tomhsx!~tomhsx@c-76-109-169-195.hsd1.fl.comcast.net] has quit [#ruby]
Dangr_ [Dangr_!~sseellff@mail.theatomgroup.com] has joined #ruby
<Na_Klar>
How can I find out the error code (number) of e.g. Errno::EWOULDBLOCK. I resuce the exeption with resuce => detail. But cannot figure out how to get detail to the errno
<rjbs>
mattp_: Once I catted mkmf.log and tried running its test by hand (because its output was not logged), I got the useful error of "wtf is gcc?"
Araxia [Araxia!~Araxia@173-164-68-213-Oregon.hfc.comcastbusiness.net] has joined #ruby
<kW>
Hello! Is there any standard way to determine the amount of physical RAM of the machine the Ruby VM is running on?
<apeiros_>
Na_Klar: ruby ain't C, Errno::EWOULDBLOCK is not a number but a class
<apeiros_>
so detail.class would be Errno::EWOULDBLOCK
<glacius>
hi guys is there a way when copying a file to a location to create the top level directories on the target location
<apeiros_>
you can limit your rescue to specific classes too.
<mattp_>
rjbs: haha oh. well problem solved atleast
<zaarg>
i can't find this ruby app i read about a while ago. it lets you select a piece of ruby in any app and execute the interpreter on it which will then replace the selected text with the result
<zaarg>
i think is was an os x app
<Na_Klar>
apeiros_, okay ... then how can I determine the class e.g. in a switch statement, without parsing the class name as a string?
<rjbs>
mattp_: Yup, thanks for the help. :)
<apeiros_>
Na_Klar: best way, do it in the rescue statement directly as you're supposed to :-p
<Na_Klar>
apeiros_ yeah .. that might be wise .. since resuce also can do "else" :P
<apeiros_>
Na_Klar: begin …code… rescue ClassA, ClassB; …handle ClassA and ClassB…; rescue ClassC; …handle C… end
<apeiros_>
Na_Klar: else means "if no exception occurred"
<Na_Klar>
oh
<Na_Klar>
k
<Zal>
Quick code review of a single function anyone? The function works, but is it idiosyncratic? Suggestions? http://pastie.org/3016656
<Na_Klar>
apeiros_ so what would be the syntax for "all other classes"?
<apeiros_>
if you mean "all other exceptions", leave out the exception class (that'll cause it to use the default, which is StandardError)
<apeiros_>
you *can* use Exception itself. but you really shouldn't unless you know *precisely* what you do (and - no offense intended - you don't seem to be there right now)
<Na_Klar>
apeiros_ can I rescue standarderror? And will a e.g. block error be a standarderror when I do not resuce it?
jonathanwallace [jonathanwallace!~jonathanw@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
<apeiros_>
Na_Klar: rescue Foo means rescue all exceptions that are an instance of Foo or an instance of any descendant of Foo
<davidcelis>
Zal: What are you even trying to do?
rjbs [rjbs!~rjbs@cancer.codesimply.com] has quit [#ruby]
<apeiros_>
since almost all exceptions are supposed to inherit from StandardError, it should rescue all exceptions.
<apeiros_>
(almost all)
<Zal>
davidcelis, score a dice game (ruby koan exercise). The scoring is correct, just wondering about my ruby
<davidcelis>
Zal: It looks like spaghetti code. Do you really need all of those conditionals?
eldariof [eldariof!~CLD@81.200.24.247] has joined #ruby
<Na_Klar>
apeiros_ yea I see that. I actually just want to recv from a socket nonblocking. I have to rescue EWOULDBLOCK but want to "ignore" all other socker-related errors. ... it's just that
<Zal>
davidcelis, not sure. I can't think of way to group it better, but maybe there's a cleaner way to write the conditionals?
<davidcelis>
Zal: which koan?
<Zal>
davidcelis, I'll add the instructions
<davidcelis>
thanks. brb
<apeiros_>
examples of exceptions that are NOT rescued by StandardError: Interrupt (raised when you do ctrl-c), NoMemoryError, SyntaxError
<apeiros_>
Na_Klar: then only `rescue Errno::EWOULDBLOCK`
<Na_Klar>
^^ resuing interrupt would be kind of mean :?
<apeiros_>
there's times where it's meaningful. but yes, you normally don't want to rescue Interrupt with a catch-all.
<Na_Klar>
apairos_ yea, ruby also extends that with IO::WaitReadable for this purpose
<apeiros_>
Na_Klar: you know you can tab-complete nicknames in most irc clients?
flexd [flexd!~flexd@dev.flexd.net] has joined #ruby
<apeiros_>
Na_Klar: then I don't see your problem :)
<apeiros_>
or is it solved?
<Na_Klar>
well ..
SegFaultAX|work [SegFaultAX|work!~mkbernard@173.228.45.162] has joined #ruby
<Na_Klar>
tab
<Na_Klar>
problem sovled. thanks for the tab hint apeiros_
<apeiros_>
;-)
jay_zawrotny [jay_zawrotny!~Jay@12.139.190.186] has joined #ruby
azbarcea__ [azbarcea__!~quassel@79.114.115.37] has joined #ruby
p1d [p1d!~p1d@ns1.vonaffenfels.de] has joined #ruby
<davidcelis>
Zal: what gets passed to this method?
<davidcelis>
An array of Fixnums?
<failshell>
anyone around who used stream with sinatra and views/templates? i would need some help
<Zal>
davidcelis, a list of die rolls, like [1,2,2,4,5]
<Zal>
yes
ascarter [ascarter!~ascarter@67-42-84-171.tukw.qwest.net] has joined #ruby
<Zal>
(sorry, I'm still trying to stop speaking in Python)
adeponte [adeponte!~adeponte@67.110.253.162.ptr.us.xo.net] has joined #ruby
<davidcelis>
So, given the instructions, this is actually OK
<davidcelis>
There are some things that could be done differently
<davidcelis>
Are you familiar with the ternary operator, Zal?
<Zal>
davidcelis, yes, though I'm not used to using it much
eignerchris [eignerchris!~eignerchr@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
<Zal>
I'll see what I can do with it
Hellojere [Hellojere!~Hellojere@89.7.90.160] has joined #ruby
ne0_ [ne0_!~ne0_@192.Red-88-15-70.dynamicIP.rima-tde.net] has joined #ruby
<ne0_>
hello peoples
<ne0_>
how can I find the "\xCC" character in bash shell?
<xissburg>
huh
raythecat [raythecat!~raythecat@adsl-108-81-52-145.dsl.sndg02.sbcglobal.net] has joined #ruby
amerine [amerine!~mturner@208-100-137-147.bendbroadband.com] has joined #ruby
<ne0_>
I have a problem in rails when running assets:precompile that says ""\xCC" from ASCII-8BIT to UTF-8"
<ne0_>
the trace doesn't show more
<ne0_>
in #rubyonrails don't know
<ne0_>
i need to find that character
<ne0_>
but i don't know how
<shevy>
always those encoding problems
pestouille [pestouille!~adrien@pth77-2-78-225-108-217.fbx.proxad.net] has joined #ruby
<ne0_>
I will really appreciate if somebody gives me a hit about that
<ne0_>
just want to find that character
<ne0_>
remove it and deploy?. :(
ghanima [ghanima!~ghanima@alexander.nat.trb.com] has joined #ruby
<Zal>
Is there a way to write the ternary operator using "if" and "else" instead of "?" and ":" ?
<tommylommykins>
if a then b else c ?
<tommylommykins>
Ruby is expression based, so you can take the value of it
<JonnieCache>
you need an end
<Na_Klar>
ne0_ CC is hex for 204, and it is actually just a part of a utf-8 char. e.g. U+0300 would be \xcc\x80 in literal
<JonnieCache>
if a then b else c end
<Zal>
ah, I see. I can do it one line, but still need end.
thatryan [thatryan!~thatryan@c-24-4-167-46.hsd1.ca.comcast.net] has quit ["Linkinus - http://linkinus.com"]
<Zal>
Thanks, I think I'll stick with ? and :
<JonnieCache>
yeah its probably to keep the grammar simpler
<Zal>
<nod>
* tommylommykins
has never particularly been a fan of : ?
<tommylommykins>
especially since ruby does it with "if" "then" "end" syntax
<JonnieCache>
ruby has the occasional compromise like that to stop the grammar getting any more insane than it already is
<Zal>
tommylommykins, you like if/else/end ?
<tommylommykins>
Indeed
<Zal>
ok
<ne0_>
Na_Klar, im getting "\xCC" from ASCII-8BIT to UTF-8
quest88 [quest88!~quest88@12.181.53.99] has joined #ruby
j3r0m3 [j3r0m3!~j3r0m3@76-218-204-151.lightspeed.sntcca.sbcglobal.net] has joined #ruby
<ne0_>
isn't a way to know where this character is?
<Zal>
well, I'll look at both ways. I generally English words to punctuation myself.
<Na_Klar>
ne0_ what does "from ascii to utf" mean? are you converting it?
<JonnieCache>
Zal: in that case, beware that while ruby has `and`, `or` as well as `&&` `||` they arent the same
<Zal>
JonnieCache, understood, thanks
<Zal>
still not getting it right: "mult = 1000 if die == 1 else 100 * die end" is what I'm trying. What's wrong?
<JonnieCache>
so dont get tempted to use the english ones everywhere without understanding it, they have different prescedence and can cause nasty bugs
<Zal>
JonnieCache, gotcha, thanks
<davidcelis>
Zal: Don't do if-else statements in one line
<davidcelis>
That is what the ternary is for
<Zal>
davidcelis, ok, fine then! :-)
<Zal>
the ternary version works fine
<tommylommykins>
mult = if die == 1 then 1000 else 100 * die end
adamkittelson [adamkittelson!~adamkitte@50.0.132.2] has joined #ruby
<JonnieCache>
yeah he's right, nobody does that and just because you can do it, doesnt mean you should
* tommylommykins
likes it D:
<JonnieCache>
thats an important thing to learn in ruby. it will let you do a *lot* of things you shouldnt really do
<davidcelis>
tommylommykins: That is arguably worse than... die == 1 ? 1000 : 100
<ne0_>
Na_Klar: nope it's the commnd "rake assets:precompile" which precompile my assets and the assets of the plugins
<rippa>
I invented new paradigm
stayarrr [stayarrr!~olivererx@dslb-178-009-059-241.pools.arcor-ip.net] has joined #ruby
<rippa>
do <stuff> or else
* tommylommykins
personally disagrees :P
<ne0_>
it can't precompile them because in some place there is that character
<burgestrand>
ne0_: \xCC by itself ain’t valid UTF-8
<ne0_>
and I can't trace it
<Zal>
tommylommykins, I see where I went wrong with it. Thanks
<ne0_>
exactly
<JonnieCache>
rippa: lol so youre just threatening the interpreter now?
<ne0_>
I'm trying to found that character
<rippa>
yep
<Na_Klar>
ne0_ \xCC is neither a UTF-8 char nor an ASCII char ...
<rippa>
just he try not doing what I want
<ne0_>
ok so how can I find it?
<Zal>
tommylommykins, not used to "if" providing a return value. Kinda neat.
<Na_Klar>
ne0_ you will not find it probably.
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<ne0_>
........
<JonnieCache>
rippa: reminds me of INTERCAL with its `PLEASE` statements
<ne0_>
so hasn't solution?
<tommylommykins>
Zal: Yeah. It's part of the everything-is-an-expression style inherited from functiional programming :)
<JonnieCache>
Zal: in ruby everything provides a return value. everything is an expression. (well, almost everything)
<burgestrand>
Read all files as UTF-8 and check if they have a valid encoding, it’ll return false for the bad file
<Na_Klar>
ne0_ it looks like a multibyte char which got cutted and therefore ends as a char zombie
<burgestrand>
Either that or remove one file at a time and see when it stops breaking
<tommylommykins>
"puts if bar then 1 else 2" is is a very lispy way of writing ruby
<burgestrand>
Na_Klar: it could be any valid character from an ISO-8559-X character set, which would be quite common too
luckyruby [luckyruby!~luckyruby@125-187.96-97.tampabay.res.rr.com] has joined #ruby
<burgestrand>
trying to read that as UTF8 would error in the same way
<ne0_>
the question is
<Na_Klar>
burgestrand, as I read there are only ascii and utf-8 involved. but otherwise you are right
<ne0_>
is any way to know where is that error being called or something that allows me to continue my work?
<JonnieCache>
ne0_: go into the folder where the file is, and run `file -I *`
<burgestrand>
Na_Klar: ASCII-8BIT, ruby’s equivalent of BINARY, so probably something assuming UTF-8 but it’s not :)
<JonnieCache>
that will attempt to display the encoding of all files, and hopefully you will see an odd one out
jonathanwallace [jonathanwallace!~jonathanw@99-11-165-168.lightspeed.tukrga.sbcglobal.net] has joined #ruby
closedbracket [closedbracket!~closedbra@smtp.goodmortgage.com] has joined #ruby
<Na_Klar>
burgestrand, yea since ascii itself is usually 7bit ;-)
dexcs [dexcs!~dexcs@HSI-KBW-109-193-252-135.hsi7.kabel-badenwuerttemberg.de] has joined #ruby
kenichi [kenichi!~kenichi@c-24-20-239-11.hsd1.or.comcast.net] has joined #ruby
Russell^^ [Russell^^!~Russell^^@88.97.51.87] has joined #ruby
mrsolo [mrsolo!~mrsolo@64.125.181.73] has joined #ruby
jgarvey [jgarvey!~jgarvey@cpe-174-097-248-211.nc.res.rr.com] has joined #ruby
<Na_Klar>
so 0xCC would be "╠" but that is not \xCC at all ..
<ne0_>
JonnieCache I don't know whats the problematic file
<ne0_>
JonnieCache how how can I display the encoding of all files?
dankest [dankest!~dankest@ip68-108-246-82.sb.sd.cox.net] has joined #ruby
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
voodoofish430 [voodoofish430!~mtorres@NAT5.pas.idealab.com] has joined #ruby
codefriar [codefriar!~codefriar@ip-200.it.rdu.bandwidth.com] has joined #ruby
<codefriar>
is there a way to tell gem to compile native extensions statically ?
apok [apok!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
jay_zawrotny [jay_zawrotny!~Jay@12.139.190.186] has joined #ruby
dhodgkin [dhodgkin!~dhodgkin@cpe-76-179-199-112.maine.res.rr.com] has joined #ruby
looopy [looopy!~looopy@pool-141-156-47-88.washdc.btas.verizon.net] has joined #ruby
looopy_ [looopy_!~looopy@c-68-34-92-100.hsd1.md.comcast.net] has joined #ruby
nanoyak [nanoyak!~nanoyak@50-0-164-69.dsl.dynamic.sonic.net] has joined #ruby
mostlygeek [mostlygeek!~mostlygee@li323-34.members.linode.com] has joined #ruby
<mostlygeek>
what does this mean in ruby: someVar ||= begin ... end
Amirh [Amirh!~amir@2.181.28.193] has joined #ruby
<codefriar>
mostlygeek: it's an assignment operation where somevar, if it has a value is returned, else, it's set equal to the return value of that block
vipaca [vipaca!~vipaca@unaffiliated/vipaca] has joined #ruby
xpot [xpot!~xpot@166-70-100-198.ip.xmission.com] has joined #ruby
<apeiros_>
if it has a value +other than nil/false
Cervajz [Cervajz!~Cervajz@93.99.93.150] has joined #ruby
Cervajz [Cervajz!~Cervajz@opensuse/member/Cervajz] has joined #ruby
<mostlygeek>
oh, so if it doesn't have a value, assign it to the return of the code block
<vipaca>
Any pointers on setting up a private npm registry?
skinnymuch [skinnymuch!~skinnymuc@static-173-61-113-6.cmdnnj.fios.verizon.net] has joined #ruby
zamolxis [zamolxis!5c5497eb@gateway/web/freenode/ip.92.84.151.235] has joined #ruby
libertyprime [libertyprime!~libertypr@122-59-8-223.jetstream.xtra.co.nz] has joined #ruby
<zamolxis>
Can anyone tell me how I can make the option parser not throw out errors when some arguments are not passed to a certain switch? At least print out a message. Thanks!
austinbv [austinbv!~austinbv@rrcs-24-73-203-202.se.biz.rr.com] has joined #ruby
havenn [havenn!~skipper@pool-72-67-31-69.lsanca.fios.verizon.net] has joined #ruby
<Blackhold>
shadoi: it tells me to install lots of packages
<Blackhold>
should not run with mod_ruby?
<shadoi>
It's just a pain in the ass for anything other than a simple script, if you use any frameworks or do anything at all that runs a server, mod_ruby becomes a massive hassle
moted [moted!~ryan@c-98-246-106-150.hsd1.or.comcast.net] has joined #ruby
<shadoi>
btw, there maybe a package for passenger on your distro/OS
<shadoi>
it wants you to install a bunch of stuff just so it can compile it.
<Blackhold>
shadoi: I'm on debian
ephemerian [ephemerian!~ian@82-71-51-229.dsl.in-addr.zen.co.uk] has joined #ruby
<Blackhold>
there's a package for apache
<shadoi>
definitely something in sid for passenger, not sure about stable
jergason [jergason!~jergason@208.97.56.66] has joined #ruby
Zanacross [Zanacross!~Serenity@adsl-87-102-126-62.karoo.KCOM.COM] has joined #ruby
<shadoi>
ubuntu 11.04 has libapache2-mod-passenger
moted [moted!~ryan@c-98-246-106-150.hsd1.or.comcast.net] has joined #ruby
Skaag [Skaag!~skaag@static-155-212-109-50.nj.onecommunications.net] has joined #ruby
winux [winux!winux@174-28-233-179.albq.qwest.net] has joined #ruby
<Blackhold>
wait phone
xhubert [xhubert!~alex@213-21-78-58.customer.t3.se] has joined #ruby
rpowell [rpowell!~rpowell@CPE-60-229-137-64.lns4.ken.bigpond.net.au] has joined #ruby
enroxorz [enroxorz!~enroxorz@65-117-22-130.dia.static.qwest.net] has joined #ruby
enroxorz [enroxorz!~enroxorz@unaffiliated/enroxorz] has joined #ruby
<Blackhold>
shadoi: it tells to install build-essential
<Blackhold>
why to install this package?
<austinbv>
is there an array method to remove duplicates
<apeiros_>
.uniq
<Blackhold>
sorry if I feel you stupid
<shadoi>
Blackhold: to compile the module.
<austinbv>
ah duh
<Blackhold>
I'm trying to understand why
<shadoi>
Blackhold: so that the module is correct for the exact build of apache you have.
omry_ [omry_!~omry@DSL212-235-83-63.bb.netvision.net.il] has joined #ruby
<Blackhold>
ok, so then to install passenger module I download it uncompiled
<Blackhold>
and then ruby compiles it
<shadoi>
or use a debian package if there is one for your version.
<Blackhold>
sorry, I'm not familiar on ruby
<shadoi>
try: apt-cache search passenger
<Blackhold>
the apache mod
<Blackhold>
que documentation
<Blackhold>
and other stuff simutrans
iocor [iocor!~textual@87.194.167.19] has joined #ruby
iocor [iocor!~textual@unaffiliated/iocor] has joined #ruby
<shadoi>
no comprende
RoUS [RoUS!KenCoar@apache/committer/coar] has joined #ruby
Guest14952 [Guest14952!~KenCoar@dsl093-240-159.ral1.dsl.speakeasy.net] has joined #ruby
<Blackhold>
well...
<Blackhold>
I think I have no more option to install that
<Blackhold>
thanks shadoi
<DeeJayTwo>
what does it means when I see blah[:name] ?
<shadoi>
it's a hash, :name is a key in the hash
<shadoi>
it's a symbol
<DeeJayTwo>
ok
<DeeJayTwo>
So I don't need to double quote it...
<shadoi>
nope
<DeeJayTwo>
thanks
<apeiros_>
most likely, doesn't have to be a hash
Blackhold [Blackhold!~Blackhold@33.Red-213-98-143.staticIP.rima-tde.net] has quit [#ruby]
LittleBill902_ [LittleBill902_!smith@c-71-197-103-184.hsd1.ca.comcast.net] has joined #ruby
<shadoi>
only 93.25% of the time I suppose.
Kazii [Kazii!~Kazii@unaffiliated/kazii] has joined #ruby
j3r0m3 [j3r0m3!~j3r0m3@50-0-128-33.dsl.dynamic.sonic.net] has joined #ruby
apok_ [apok_!~apok@c-107-3-149-167.hsd1.ca.comcast.net] has joined #ruby
manizzle [manizzle!~manizzle@dsl081-053-082.sfo1.dsl.speakeasy.net] has joined #ruby
headius [headius!~headius@71-210-151-185.mpls.qwest.net] has joined #ruby
ilyam [ilyam!~ilyam@eng.nat.mtv.ooyala.com] has joined #ruby
azbarcea_____ [azbarcea_____!~quassel@79.118.7.231] has joined #ruby
crexx [crexx!aod@078088239019.lubin.vectranet.pl] has joined #ruby
amacgregor [amacgregor!~amacgrego@CPE00222dcb0a53-CM00222dcb0a4f.cpe.net.cable.rogers.com] has joined #ruby
Helius [Helius!~Adium@93-35-226-112.ip57.fastwebnet.it] has joined #ruby
eerdogan [eerdogan!~eerdogan@user-12ld1jv.cable.mindspring.com] has joined #ruby
<kuzushi>
anyone know of good places to look for ruby work-- specifically ruby security engineering work?
<Zal>
craigslist?
<kuzushi>
I thought that craigslist was just a good place to get murdered for showing up for a job?
<Zal>
that too
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<Zal>
(bring your glock)
mengu [mengu!~mengu@78.184.201.123] has joined #ruby
ascarter [ascarter!~ascarter@67-42-84-171.tukw.qwest.net] has joined #ruby
mengu [mengu!~mengu@unaffiliated/mengu] has joined #ruby
Morkel [Morkel!~Morkel@xdsl-87-78-205-136.netcologne.de] has joined #ruby
KarlHungus [KarlHungus!~relax@unaffiliated/adj] has joined #ruby
kes [kes!bc862c04@gateway/web/freenode/ip.188.134.44.4] has joined #ruby
<KarlHungus>
is this an appropriate forum to discuss gems and the ~> operator?
<kes>
is it possible to use syntax like that: ::FileUtils.cp "file/#{filename}.ini", "~/dir/dir2/#{new_filename}.ini" ?
<kes>
i'm getting error that dst file don't exist
fridim_ [fridim_!~fridim@2a01:e35:2ece:f2d0:223:4eff:fe6c:c754] has joined #ruby
<KarlHungus>
why does tilt 1.3.3 not meet the dependency restrictions in sprockets when they are listed as tilt (!= 1.3.0, ~> 1.1)
<KarlHungus>
my understanding of this operator (from the sources) is that the above comparison is equivilant to ( ( v != 1.3.0 ) && ( v >= 1.1 && v < 2.0 ) )
tommyvyo [tommyvyo!~tommyvyo@38.123.129.115] has joined #ruby
benlangfeld [benlangfeld!~ben@host109-148-248-117.range109-148.btcentralplus.com] has joined #ruby
benlangfeld [benlangfeld!~ben@unaffiliated/benlangfeld] has joined #ruby
Lord-Harlot [Lord-Harlot!~Serenity@adsl-87-102-126-62.karoo.KCOM.COM] has joined #ruby
<kes>
KarlHungus: because 1.3.3 != 1.3.0 i think
<KarlHungus>
kes: clearly 1.3.3 != 1.3.0. therefore the test should return true and accept 1.3.3 as a valid dependency
tar_ [tar_!~tar@d118-75-81-132.try.wideopenwest.com] has joined #ruby
wyhaines [wyhaines!~wyhaines@65.39.118.15] has joined #ruby
ujkanovic [ujkanovic!~Ser@78.157.22.14] has joined #ruby
stkowski [stkowski!~stkowski@ns25.8x8.com] has joined #ruby
<Harzilein>
hmm
<Harzilein>
what can i do when stuff depends on "Ruby/DL"?
jay_zawrotny [jay_zawrotny!~Jay@c-68-43-28-43.hsd1.mi.comcast.net] has joined #ruby
QaDeS [QaDeS!~mklaus@frbg-4d029531.pool.mediaWays.net] has joined #ruby
yekta_ [yekta_!~yekta@r74-192-21-77.bcstcmta01.clsttx.tl.dh.suddenlink.net] has joined #ruby
tobym [tobym!~tobym@pool-173-56-80-136.nycmny.fios.verizon.net] has joined #ruby
luxurymode [luxurymode!~luxurymod@rrcs-184-75-21-18.nyc.biz.rr.com] has joined #ruby
<aces1up>
hey guys, found this code online, does it seem thread safe to you? Its just a basic thread pool that reuses threads for work. http://burgestrand.se/code/ruby-thread-pool/
BrianE [BrianE!~brian@46.208.45.23] has joined #ruby
<shadoi>
god I hate that style of documentation.
rbanffy [rbanffy!~rbanffy@187.31.77.7] has joined #ruby
<shadoi>
aces1up: looks fine to me, Queue was created specifically to do this.
<kenichi>
v4n_: from what i can tell, that mysql statement returns the number of seconds into a day that the given time is a.
quest88 [quest88!~quest88@12.181.53.99] has joined #ruby
<v4n_>
kenichi, Brozilla yep, I've just figured out that it returns the number of seconds of a day. e.g. any day at 1am => 3600
<v4n_>
now I have to make this in Ruby
Spockz` [Spockz`!~Spockz@21pc198.sshunet.nl] has joined #ruby
<kenichi>
v4n_: if you're given a Time objec in variable `time`, you could do something really simple like `time.hour*60 + time.sec`
<kenichi>
oops
<Brozilla>
*3600 instead of 60, right?
<kenichi>
i mean something like `time.hour*3600 + time.min*60 + time.sec`
<kenichi>
or something
<v4n_>
kenichi, yep I see
<v4n_>
good point ;)
Greed [Greed!47fbe588@gateway/web/freenode/ip.71.251.229.136] has quit [#ruby]
workmad3 [workmad3!~workmad3@cpc1-bagu10-2-0-cust81.1-3.cable.virginmedia.com] has joined #ruby
<Zal>
Working on koans. My DiceSet class fails this test when running "ruby <testrunner>", but the same test works fine in irb. Why?