apeiros changed the topic of #ruby-lang to: Nick registration required to talk || Ruby 2.0.0-p195: http://ruby-lang.org (Ruby 1.9.3-p429) || Paste >3 lines of text on http://gist.github.com
jkubecki has quit [Ping timeout: 264 seconds]
bzalasky has joined #ruby-lang
havenwood has joined #ruby-lang
thiagobo_ has joined #ruby-lang
jerrytgarcia has joined #ruby-lang
bcardarella_ has left #ruby-lang [#ruby-lang]
jerrytgarcia has quit [Client Quit]
sepp2k1 has quit [Quit: Leaving.]
bcardarella has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 256 seconds]
smook1 has quit [Ping timeout: 255 seconds]
mdedetrich has joined #ruby-lang
hogeo has joined #ruby-lang
danielchao has joined #ruby-lang
thiagobo_ has quit [Ping timeout: 245 seconds]
justinmburrous has quit [Ping timeout: 264 seconds]
bzalasky has joined #ruby-lang
kstuart has quit [Ping timeout: 240 seconds]
toretore has quit [Quit: Leaving]
thiagoborges has joined #ruby-lang
krz has joined #ruby-lang
ykk` has joined #ruby-lang
vlad_starkov has joined #ruby-lang
Mawk has quit [Quit: Mawk]
danielchao has quit [Remote host closed the connection]
vlad_starkov has quit [Ping timeout: 240 seconds]
lcdhoffman has quit [Quit: lcdhoffman]
glebm has quit [Ping timeout: 264 seconds]
Weems has joined #ruby-lang
retro|cz has quit [Ping timeout: 248 seconds]
jkubecki has joined #ruby-lang
retro|cz has joined #ruby-lang
smook1 has joined #ruby-lang
jkubecki has quit [Ping timeout: 245 seconds]
havenwood has quit [Remote host closed the connection]
bzalasky has quit [Remote host closed the connection]
dhruvasagar has joined #ruby-lang
bzalasky has joined #ruby-lang
lcashdol has joined #ruby-lang
glebm has joined #ruby-lang
jonahR has quit [Quit: jonahR]
Nisstyre-laptop has joined #ruby-lang
ykk` has quit [Quit: ykk`]
Asher has joined #ruby-lang
retro|cz has quit [Ping timeout: 248 seconds]
bzalasky has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
dingus_khan has joined #ruby-lang
<dingus_khan>
is there a way to inherit just a single method from a superclass in place?
LinkedoT has joined #ruby-lang
bzalasky has joined #ruby-lang
Spaceghost|work has joined #ruby-lang
retro|cz has quit [Ping timeout: 276 seconds]
bzalasky has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
pipework has quit [Ping timeout: 264 seconds]
bzalasky has joined #ruby-lang
matthewalr has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
<matthewalr>
Hello, is anyone familiar with a ruby IDE that does inilne evaluation using the #=> after a line of code?
robbyoconnor has joined #ruby-lang
retro|cz has quit [Ping timeout: 245 seconds]
Domon has joined #ruby-lang
thiagoborges has quit [Read error: Connection reset by peer]
r0bby_ has quit [Ping timeout: 248 seconds]
retro|cz has joined #ruby-lang
mdedetrich has quit [Quit: Computer has gone to sleep.]
vlad_starkov has joined #ruby-lang
jacktrick has quit [Quit: Leaving]
vlad_starkov has quit [Ping timeout: 248 seconds]
ykk` has joined #ruby-lang
ykk` has quit [Client Quit]
Spaceghost|work has quit [Remote host closed the connection]
bzalasky has joined #ruby-lang
mdedetrich has joined #ruby-lang
dhgreene has joined #ruby-lang
jonahR has joined #ruby-lang
guns has quit [Ping timeout: 248 seconds]
jonahR has quit [Ping timeout: 245 seconds]
machuga is now known as machuga|away
retro|cz has quit [Ping timeout: 252 seconds]
retro|cz has joined #ruby-lang
jonahR has joined #ruby-lang
dingus_khan has quit [Remote host closed the connection]
retro|cz has quit [Ping timeout: 264 seconds]
MouseTheLuckyDog has quit [Read error: Operation timed out]
mdedetrich has quit [Quit: Computer has gone to sleep.]
synthetix has joined #ruby-lang
guns has joined #ruby-lang
dingus_khan has joined #ruby-lang
Raynes is now known as skrillex
skrillex is now known as Raynes
mdedetrich has joined #ruby-lang
bzalasky has quit [Remote host closed the connection]
synthetix_ has joined #ruby-lang
MouseTheLuckyDog has joined #ruby-lang
justinmburrous has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
justinmburrous has joined #ruby-lang
dingus_khan has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 248 seconds]
retro|cz has joined #ruby-lang
synthetix has quit [Remote host closed the connection]
notak has quit [Quit: notak]
lcashdol has quit [Quit: Leaving.]
mdedetrich has quit [Quit: Computer has gone to sleep.]
thebastl has quit [Remote host closed the connection]
jonahR has quit [Quit: jonahR]
tomzx_mac has quit [Ping timeout: 255 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
tonni has quit [Remote host closed the connection]
sush24 has quit [Ping timeout: 246 seconds]
guns has quit [Quit: guns]
smook1 has quit [Ping timeout: 255 seconds]
face has joined #ruby-lang
lguardiola has quit [Remote host closed the connection]
sush24 has joined #ruby-lang
workmad3 has joined #ruby-lang
Nisstyre has quit [Quit: Leaving]
justinmburrous has quit [Remote host closed the connection]
chana has joined #ruby-lang
dr_bob has joined #ruby-lang
tylersmith has joined #ruby-lang
pygmael has joined #ruby-lang
pygmael has quit [Excess Flood]
pygmael has joined #ruby-lang
thebastl has joined #ruby-lang
therod has joined #ruby-lang
dingus_khan has joined #ruby-lang
tonni has joined #ruby-lang
tylersmith has quit [Ping timeout: 245 seconds]
vmoravec has joined #ruby-lang
mbj has joined #ruby-lang
robbyoconnor has quit [Read error: Connection reset by peer]
dhgreene has quit [Quit: dhgreene]
vlad_starkov has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 245 seconds]
solars has joined #ruby-lang
retro|cz has joined #ruby-lang
chana has quit [Quit: chana]
tonni has quit [Ping timeout: 264 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
tonni has joined #ruby-lang
GeissT_ has quit [Ping timeout: 255 seconds]
ffio_ has joined #ruby-lang
apeiros has joined #ruby-lang
ffio has quit [Ping timeout: 248 seconds]
JohnBat26 has joined #ruby-lang
cofin has quit [Quit: cofin]
enaqx has joined #ruby-lang
sush24 has quit [Quit: This computer has gone to sleep]
roadkith has joined #ruby-lang
hogeo has joined #ruby-lang
barttenbrinke has joined #ruby-lang
<dingus_khan>
I'm trying to sleep by a second or two between puts'ing each line of a heredoc--best way to do that?
hogeo has quit [Remote host closed the connection]
<apeiros>
sleep 1
barttenbrinke has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
Weems has quit [Ping timeout: 252 seconds]
hogeo has joined #ruby-lang
dagobah has joined #ruby-lang
postmodern has joined #ruby-lang
<dingus_khan>
right, but is there a way to get each line of a heredoc individually? I'm trying to use recursion to print out each line of a big block of text with a slight delay
<dingus_khan>
I can't find anything on heredocs in the ruby docs or anything useful through googling
Mon_Ouie has quit [Ping timeout: 264 seconds]
<canton7>
dingus_khan, split it on newlines - it's just a string, use string methods on it
Richie has joined #ruby-lang
Asher1 has joined #ruby-lang
<dingus_khan>
SWEET, thank you canton7, I totally didn't realize that! man that makes things easier, lol
Asher1 has quit [Client Quit]
Asher has quit [Ping timeout: 248 seconds]
Mon_Ouie has joined #ruby-lang
Asher has joined #ruby-lang
<canton7>
"well in ruby we have many kinds of strings. double-quoted, single-quoted, heredoc, %q, %Q... They each have their own methods"
<canton7>
man that would be a nightmare
<apeiros>
dingus_khan: a heredoc is just a string
<apeiros>
blupp, noticed canton7 already said that
<dingus_khan>
hah, no kidding--I'm just happy it's a string at this point, lol
<dingus_khan>
thanks apeiros!
<apeiros>
*sniff* my docs are still broken
* apeiros
tries regenerating them
wallerdev has quit [Quit: wallerdev]
Richie has quit []
arocco has joined #ruby-lang
retro|cz has quit [Ping timeout: 240 seconds]
solars has quit [Ping timeout: 255 seconds]
retro|cz has joined #ruby-lang
tylersmith has joined #ruby-lang
io_syl_ has quit [Quit: Computer has gone to sleep.]
poga_ has quit [Ping timeout: 245 seconds]
adambeynon has joined #ruby-lang
<dingus_khan>
man this is proving very tricky... any ideas on how to get an individual line to print out after a delay like that?
dwainfaithfull has joined #ruby-lang
tylersmith has quit [Ping timeout: 245 seconds]
<apeiros>
errr…
notak has quit [Ping timeout: 248 seconds]
<apeiros>
String#each_line
<apeiros>
or #lines
<apeiros>
you should try to look at the core API once in a while…
<dingus_khan>
lines... hmmm... I want to do it with recursion, though. and yeah, I'm on the docs page now, but I'm coming up blank at the moment
<apeiros>
"look there's a nail! but I want to drive it in using my screwdriver!"
tbuehlmann has quit [Remote host closed the connection]
<apeiros>
wtf? recursion? why are you intentionally impeding yourself?
sush24 has joined #ruby-lang
<dingus_khan>
lol, because I'm a masochist like that?
<apeiros>
well… then you deserve no help and should be left suffering - that's what you want after all :-p
<dingus_khan>
I just want to know if it can be done
<apeiros>
of course it can be done
<dingus_khan>
lol, touche! :P
ia___ has quit [Quit: ia___]
<dingus_khan>
right, now I just gotta figure out how in the next few minutes before I pass out from exhaustion, lol
bzalasky has quit [Remote host closed the connection]
bougyman has quit [Quit: Lost terminal]
bougyman has joined #ruby-lang
poga has joined #ruby-lang
dhruvasagar has joined #ruby-lang
retro|cz has quit [Ping timeout: 245 seconds]
retro|cz has joined #ruby-lang
tonni has quit [Remote host closed the connection]
ikrima has joined #ruby-lang
schaerli has joined #ruby-lang
retro|cz has quit [Ping timeout: 245 seconds]
<yorickpeterse>
morning
bastilian has joined #ruby-lang
<dingus_khan>
morning! welp, I give up, g'night!
dingus_khan has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
jinie_ is now known as jinie
ikrima has quit [Quit: Computer has gone to sleep.]
judofyr has joined #ruby-lang
swav has quit [Remote host closed the connection]
<judofyr>
HEY RUBBY
<yorickpeterse>
HAI
barttenbrinke has joined #ruby-lang
tonni has joined #ruby-lang
<judofyr>
HAI YORICK
retro|cz has quit [Ping timeout: 264 seconds]
solars has joined #ruby-lang
<apeiros>
HAI FRY!
barttenbrinke has quit [Remote host closed the connection]
retro|cz has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 240 seconds]
<yorickpeterse>
Hm thread question: in a Sinatra request I want to spawn a thread that uses some data from `params`, could this lead to potential race conditions?
<yorickpeterse>
As in, where Sinatra clears the hash before the thread is done
<zzak>
hi
therod has quit [Quit: Leaving...]
ikrima has joined #ruby-lang
<zzak>
apeiros: whats the prollem?
<judofyr>
yorickpeterse: I don't think so
<apeiros>
zzak: time. always. why?
<yorickpeterse>
note that the thread is not joined though
dhruvasagar has joined #ruby-lang
<yorickpeterse>
so the rest doesn't wait for it
<zzak>
apeiros: somethin about docs being broken
<apeiros>
zzak: oh, yeah… second…
<apeiros>
$ ri String
<apeiros>
/Users/memyselfandi/.rvm/gems/ruby-2.0.0-p195@tracker/gems/rdoc-3.12.2/lib/rdoc/ri/store.rb:196:in `load': instance of RDoc::Context::Section needs to have method `marshal_load' (TypeError)
<zzak>
why are you using rdoc 3.12 on ruby 2.0?
<apeiros>
I updated rdoc and reran `rvm docs generate`
<zzak>
2.0 comes with rdoc 4
<apeiros>
it says I have rdoc 4.0.1
<zzak>
its because 3.x doesnt know about ruby 2.0
<apeiros>
interesting
<judofyr>
yorickpeterse: I'm pretty sure that params comes from @request.params
<zzak>
then why is it using 3.12
<judofyr>
yorickpeterse: and it per-request
<apeiros>
ri says it's 3.12.2… wtf
<judofyr>
s/it/is/
<zzak>
apeiros: what does gem list say?
<apeiros>
it says I have 3 versions. I uninstalled all and reinstall rdoc… lets see…
<yorickpeterse>
judofyr: well yeah, but said thread might still be running when the request is done
<yorickpeterse>
thus the data might be removed, though I'm not sure if that would actually happen
<apeiros>
(I had 4.0.1, 4.0 and 3.12.2)
<zzak>
apeiros: weird
<apeiros>
ok, problem resolved
<apeiros>
but why would it prefer the old version?
<zzak>
2.0.0-p195 should have rdoc 4.0.1 default
<zzak>
gems bug maybe, if you can repro
<judofyr>
yorickpeterse: as long as it has a reference it shouldn't be GC'ed
<zzak>
apeiros: open a ticket if you can repro
<yorickpeterse>
hmmm
<apeiros>
lets see what happens if I explicitly reinstall 3.12.2
<zzak>
could be an rvm bug too
<apeiros>
possible
<apeiros>
yupp, bug reappears if I install 3.12.2
gnufied has joined #ruby-lang
<zzak>
what command are you using?
<apeiros>
`ri String`
<zzak>
can you try it without rvm?
<apeiros>
which resolves to `/Users/memyselfandi/.rvm/gems/ruby-2.0.0-p195@tracker/bin/ri`
<apeiros>
hm, how?
<zzak>
actually
<zzak>
this seems like a rvm bug, because i have 3.x installed on trunk
<yorick-devops>
whitequark: meh, I just realized this Macbook doesn't have enough USB ports for a dongle
<yorick-devops>
it does have one of those PCM-something-I-can-never-remember-the-name-of slots
<injekt>
mine has a special kind of slot
poga has quit [Remote host closed the connection]
<apeiros>
PCMCIA
<apeiros>
but that's long gone
<yorick-devops>
a....dongle...gate?
<yorick-devops>
*badum tsh*
* yorick-devops
runs
tonni has quit [Read error: Connection reset by peer]
<apeiros>
yorick-devops: didn't some python conf have a dongle gate? :)
swav_ has quit [Ping timeout: 248 seconds]
tonni has joined #ruby-lang
<yorick-devops>
Every morning I wake up wondering if I can make a joke even more bad than the previous one, I never fail to amaze myself
<yorick-devops>
not sure what's worse, that or me sitting here with a grin on my face because of it
swav has joined #ruby-lang
yorick-devops is now known as yorickpeterse
barttenbrinke has joined #ruby-lang
toretore has joined #ruby-lang
Domon has quit [Remote host closed the connection]
<yorickpeterse>
so what's the standard these days for shipping a Gem including a Rack app in turns of starting it? Right now I'm basically tapping into Rack::Server but that requires some extra work to make it work when the config.ru is somewhere other than $PWD
<yorickpeterse>
I don't want to redefine every option such as --port and such, and "Vegas" looks meh
<hackeron>
hey, I'm trying to force encoding to UTF-8 replacing any invalid bytes, I'm doing: whois = whois.encode!('UTF-8', 'UTF-8', :invalid => :replace); -- but whois.scan(/role:\s+(.+)/i) still throws ArgumentError: invalid byte sequence in UTF-8 -- why? - how do I get rid of these invalid bytes?
LinkedoT has quit [Ping timeout: 255 seconds]
<judofyr>
hackeron: I believe that is a no-op if it's already UTF-8
<hackeron>
judofyr: hmm, how do I force it?
LinkedoT has joined #ruby-lang
zomgbie has quit [Read error: Connection reset by peer]
vlad_starkov has quit [Remote host closed the connection]
vlad_starkov has joined #ruby-lang
thebastl_ has joined #ruby-lang
mbj has quit [Read error: Connection reset by peer]
jinie_ is now known as jinie
jinie is now known as jinie_
thebastl has quit [Ping timeout: 264 seconds]
poga has joined #ruby-lang
poga has quit [Remote host closed the connection]
vlad_sta_ has joined #ruby-lang
poga has joined #ruby-lang
vlad_starkov has quit [Ping timeout: 264 seconds]
<whitequark>
yorickpeterse: enjoy your apple experience
sepp2k has quit [Quit: Leaving.]
<hackeron>
apeiros: well, I'm getting the whois information from https://github.com/weppos/whois and then storing it in the database which is all UTF-8, so I don't really care about the details, just when I look for strings in the whois data, it keeps throwing this error I was trying to get rid of :P
vlad_sta_ has quit [Read error: Connection reset by peer]
hogeo has quit [Remote host closed the connection]
<hackeron>
apeiros: it is very rare and caused by someone access this page from some IP with bizare whois information: http://monitor.zanview.com/
ldnunes has joined #ruby-lang
tylersmith has joined #ruby-lang
thebastl_ has quit [Remote host closed the connection]
thebastl has joined #ruby-lang
thebastl has quit [Remote host closed the connection]
thebastl has joined #ruby-lang
shinnya has joined #ruby-lang
tylersmith has quit [Ping timeout: 246 seconds]
<apeiros>
hackeron: in other words "bla bla bla, I don't care if my data is utterly broken, I prefer having no clue etc. etc. etc.", the usual.
<yorickpeterse>
whitequark: IT JUST WORKS
<yorickpeterse>
but yeah, I'd rather have an ugly Thinkpad over the apple crap
<apeiros>
sorry if that's rough, but it's frustrating how many coders stay willfully ignorant
<gnufied>
apeiros: so encoding.equal can return UTF-8 even when underlying encoding could be UTF-16 ?
<gnufied>
just looking at your method
<apeiros>
gnufied: what?
<apeiros>
no, encoding.equal?(Encoding::UTF_8) is only true if your encoding is indeed utf8
<gnufied>
dumb question then, why encode to UTF-16 before again encoding to UTF-8?
<apeiros>
because otherwise it won't apply your options
<apeiros>
if you call encode('utf-8') on a utf-8 encoded string, ruby won't do anything.
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
nkr has joined #ruby-lang
roadkith has quit [Quit: Leaving...]
benlovell has joined #ruby-lang
nathanstitt has joined #ruby-lang
hogeo has joined #ruby-lang
tomzx_mac has joined #ruby-lang
justinmburrous has joined #ruby-lang
hogeo has quit [Remote host closed the connection]
<hackeron>
apeiros: precisely, heh - except it's not really my data but yeh :P
GeissT_ has joined #ruby-lang
<hackeron>
apeiros: I prefer to stay willingly ignorant about the sillicon and about how ethernet is encapsulated and machine languagely and all those other things happening when I type .force_encoding(... - you have to pick your level abstraction and what to go to lower levels with :)
<yorickpeterse>
I...wow
<yorickpeterse>
that's a pretty broken comparisment
Mawk has joined #ruby-lang
GeissT has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby-lang
GeissT_ has quit [Quit: MillBroChat AdIRC User]
GeissT has joined #ruby-lang
GeissT has quit [Client Quit]
fsvehla has quit [Quit: fsvehla]
enaqx has quit [Remote host closed the connection]
enaqx has joined #ruby-lang
krz has quit [Quit: krz]
<hackeron>
yorickpeterse: this is the app where I got the encoding error from parsing whois returned by the ruby whois library: It was written by me, from scratch, including the opencv code, rabbitmq, openvpn, custom dns and all the other bits required to make it get video from multiple locations reliably over an intermittent connection: http://monitor.zanview.com/ -- you can appreciate how little my concern is for the broken whois data
<yorickpeterse>
broken whois data isn't what I was referring to, but not caring about encoding was
<yorickpeterse>
The whois "format" in general is pretty broken anyway
lguardiola has joined #ruby-lang
justinmburrous has quit [Remote host closed the connection]
<hackeron>
yorickpeterse: I know some things about encoding, from having to deal with pelcod and other serial protocols, but I havent' got round to going too in depth, but even if I did, I'd still want just 1 liner to "get rid of all this shit from my string" :P
<apeiros>
hackeron: simple: str.replace("")
<apeiros>
there. all shit is gone from your string.
<yorickpeterse>
well yeah, that's understandable. Sadly when it comes to encoding bollocks that tends to be pretty hard
MasterNayru_ has quit [Remote host closed the connection]
<hackeron>
apeiros: that's all the good shit gone too :) - I just want the "invalid" stuff stripped and I don't really care what it is
<apeiros>
meh, encodings are not hard to understand. I'm inclined to agree that rubys toolset for dealing with it is far from good, though.
<apeiros>
hackeron: you'd do well to figure why there's invalid stuff there in the first place
<kalleth>
10 Jun 13:26:52 - info: compiled in NaNms
<kalleth>
hash javascript
<apeiros>
there is a chance that your source data is invalid to start with, then stripping it is sane. but there's a good chance that you just fail to acknowledge the source encoding.
<hackeron>
apeiros: to be honest, in this instance, I really don't care, lol - I could file a bug to ruby's whois library but this is like not even 1% of the app's functionality, it's just a cool factor, look some times it can identify what the ISP is by whois'ing your IP - I really dont' care if there's any invalid data there, I just don't want it throwing an exception
<apeiros>
then don't use utf-8.
<hackeron>
apeiros: I don't ruby's whois does
<apeiros>
treat it as binary data. since it's opaque to you anyway.
<hackeron>
apeiros: I'm just working with what it gives me
<apeiros>
and, got an example where the data is invalid?
<hackeron>
hang on
<hackeron>
I think it was the whois for this IP 200.195.144.210 - let me double check
x0f has joined #ruby-lang
thiagoborges has joined #ruby-lang
tomkadwill has joined #ruby-lang
<apeiros>
Whois.whois(blupp).to_s gives me a binary string, not utf-8
fbernier has joined #ruby-lang
dr_bob has quit [Quit: Leaving.]
<apeiros>
(and all my defaults are set to utf-8, so that's not it)
<hackeron>
yes, it's for IP 200.195.144.210
<hackeron>
apeiros: maybe mongoid converts it to utf-8 when storing in the database?
<hackeron>
apeiros: so how would you turn that binary into valid utf-8?
<apeiros>
you can't. you could as well ask me how to turn a jpeg into valid utf-8.
<hackeron>
ok, so what do you suggest other than the above?
<apeiros>
as I said, treat it as binary all the way then, if you don't want to add encoding-sniffing (all you can do with binary data is guess anyway)
x0f has quit [Ping timeout: 246 seconds]
<hackeron>
what would work better than taking whatever is in the database (utf-8) and doing .force_encoding('BINARY').encode!('UTF-8', invalid: :replace, undef: :replace)?
<hackeron>
how do you add encoding-sniffing?
therealnoop has quit [Ping timeout: 264 seconds]
dhgreene has joined #ruby-lang
tdy has quit [Read error: Connection reset by peer]
sush24 has joined #ruby-lang
tdy has joined #ruby-lang
<apeiros>
non-trivial. there are a couple of encoding guessing gems around, but I found them to be rather unreliable and wrote something for my use-case. but that is not applicable to yours.
carloslopes has joined #ruby-lang
<apeiros>
in your case, the proper source encoding would be iso-8859-1
<hackeron>
yeh, guessing encoding isn't easy :(
<apeiros>
or windows-1252
<hackeron>
yeh, for that whois result, but they are all different
<apeiros>
correct. which is why sniffing/guessing is difficult.
<hackeron>
and for me it's acceptible to lose the characters it can't recognise or even the whole thing as long as it works most of the time, which it does :)
<apeiros>
a cheap and probably successful way would probably be to force encode utf-8, check for validity
<apeiros>
if invalid, force encode to win-1252, encode utf-8
yalue has joined #ruby-lang
<apeiros>
if that fails, force encode to utf-8 and scrub the invalid chars (as shown above)
tylersmith has joined #ruby-lang
<hackeron>
apeiros: erm, is there an easy 1 liner to do all this? :P
AynGhandi has joined #ruby-lang
<apeiros>
no. this is ~6 lines
<hackeron>
is there a library that does this and maybe some other helpful tests to try to guess encoding?
arocco_ has joined #ruby-lang
<apeiros>
as said, there are a couple, but I found them rather unreliable.
<hackeron>
:(
<hackeron>
wonder what browsers do, they must have some pretty advanced encoding guessing going on
<apeiros>
but my use-case involved only 3 encodings: utf-8, win1252 and macroman
x0f has joined #ruby-lang
<hackeron>
yeh, mine involve who knows what :)
<apeiros>
well, one of the gems I tried implemented mozillas guessing algorithm
mistym has joined #ruby-lang
mistym has joined #ruby-lang
arocco has quit [Ping timeout: 246 seconds]
<apeiros>
which misguessed most of my test-cases
krames has joined #ruby-lang
<hackeron>
oh, heh - which gem is that?
<apeiros>
uff, don't remember. it's about a year ago and since I didn't end up using it…
gja has quit [Quit: This computer has gone to sleep]
<yorickpeterse>
TIL Ruby doesn't like symbolic links for require calls
enaqx has joined #ruby-lang
<gnufied>
it doesn't follow them?
<yorickpeterse>
Well I'm not sure if it was Ruby itself or Bundler. Either way, I had some local bundler configs pointing to a symlink (I moved some stuff around)
<yorickpeterse>
apparently that causes files to be loaded twice
jsullivandigs has quit [Ping timeout: 246 seconds]
<crankharder>
judofyr: that doesn't match them both or the last one?
thebastl_ has quit [Remote host closed the connection]
<crankharder>
bgant: i'm not 100% sure the last paren is at the end of the line :/
rikai_ has joined #ruby-lang
<bgant>
crankharder: hmm… split on spaces and capture the last entry?
AynGhandi has quit [Quit: Nettalk6 - www.ntalk.de]
tomkadwill has joined #ruby-lang
<apeiros>
crankharder: scan
<apeiros>
match only matches once
<apeiros>
scan is for multiple matches
thebastl has quit [Ping timeout: 240 seconds]
<apeiros>
or change your regex if it's always exactly 2 matches
_ffio_ has joined #ruby-lang
<apeiros>
e.g. /\((.*?)\).*?\((.*?)\)/
ffio_ has quit [Ping timeout: 245 seconds]
<gnufied>
ugh
rikai has quit [Ping timeout: 260 seconds]
<crankharder>
yea, one of those ought to work, ty
jacktrick has joined #ruby-lang
zmike123 has joined #ruby-lang
barttenbrinke has quit [Remote host closed the connection]
bastilian has quit [Quit: Leaving...]
thiagoborges has quit [Remote host closed the connection]
gnufied has quit [Quit: Leaving.]
bzalasky has joined #ruby-lang
<injekt>
khaase: ping
schaerli has quit [Remote host closed the connection]
dhruvasagar has quit [Ping timeout: 276 seconds]
<injekt>
anyone else here work on travis?
skade has quit [Quit: Computer has gone to sleep.]
<henrikhodne>
injekt: I do.
<henrikhodne>
injekt: How can I help you?
stef_204 has joined #ruby-lang
<Aloysius1>
Hello! I made a gem a while back and pushed it to a colleague who is trying to use it but is getting the "cannot load" for the version.rb file. I remember having the same problem, and that it was an easy fix, but I don't remember what it was. Anyone have this issue?
tomkadwill has quit [Remote host closed the connection]
scampbell_ has joined #ruby-lang
<injekt>
henrikhodne: I'm having issues installing Nokogiri on JRuby on travis but literally no-where else, any chance you're able to literally run a gem install to see a backtrace? I'm on nokogiri core and trying to fix this
<headius>
hmm, JRuby 1.7.3? Has travis not been updated yet?
<henrikhodne>
headius: We're working on that this week.
benlovell has quit [Ping timeout: 264 seconds]
<headius>
I don't see any specific fixes for this in psych in 1.7.4, so it may not help...but it could be something peripheral, like encoding fixes in IO (there were many in 1.7.4)
<headius>
henrikhodne: what's LANG set to on the travis instances?
<henrikhodne>
headius: en_US.UTF-8
<headius>
should be fine...hrmph
bzalasky has quit [Remote host closed the connection]
Aloysius1 has quit [Read error: Connection reset by peer]
<henrikhodne>
Trying this on 1.7.4 to see what happens.
Aloysius1 has joined #ruby-lang
<henrikhodne>
headius: Yeah, it works fine on 1.7.4.
<headius>
ok, good
<headius>
FIXED!
<injekt>
Cool, would you guys mind weighing in on that thread?
thebastl has quit [Remote host closed the connection]
forrest has quit [Ping timeout: 240 seconds]
cofin has joined #ruby-lang
forrest has joined #ruby-lang
workmad3 has quit [Ping timeout: 276 seconds]
snk_ is now known as snk
headius has quit [Quit: headius]
Squarepy has joined #ruby-lang
Rizzle has quit [Read error: Connection reset by peer]
smook1 has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby-lang
lcashdol has quit [Read error: Connection reset by peer]
lcashdol1 has joined #ruby-lang
postmodern has joined #ruby-lang
scampbell_ has joined #ruby-lang
smook1 has joined #ruby-lang
krohrbaugh has joined #ruby-lang
gnufied has joined #ruby-lang
zachlatta has joined #ruby-lang
teleological has joined #ruby-lang
pr0ton has joined #ruby-lang
mistym has joined #ruby-lang
mistym has joined #ruby-lang
mistym has quit [Changing host]
<yorickpeterse>
you know what I hate (completely unrelated to ruby)?
<yorickpeterse>
Websites that style scrollbars like OS X-that-newest-mountain-cougar-version
zomgbie has joined #ruby-lang
awkisopen has joined #ruby-lang
Caius has joined #ruby-lang
dwainfaithfull has joined #ruby-lang
intellitech has joined #ruby-lang
Spaceghost|cloud has joined #ruby-lang
wycats_ has joined #ruby-lang
ndrst_ has joined #ruby-lang
mfn_ has joined #ruby-lang
Caius has quit [Changing host]
Caius has joined #ruby-lang
awkisopen has quit [Changing host]
awkisopen has joined #ruby-lang
synthetix has joined #ruby-lang
<whitequark>
>websites that style scrollbars
marr has joined #ruby-lang
<whitequark>
or
<whitequark>
>websites.
<yorickpeterse>
you're just old
apeiros has joined #ruby-lang
teleological has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 252 seconds]
nazty has quit [Ping timeout: 245 seconds]
pr0ton has quit [Ping timeout: 256 seconds]
bgant has quit [Ping timeout: 276 seconds]
<Aloysius1>
OK, I just basically don't understand how gems are loaded. I've got two apps using the same gem. One is a rails app. The other is a plain ruby script. The rails app has the gem referenced in the Gemfile, and that's all that is needed to use the features of the gem. To get the plain script to be able to use the features, I had to use the Gemfile and then add a require to the script which had to point to the path where the mqhelper code is. The latter
<Aloysius1>
does not seem right.
GarethAdams has joined #ruby-lang
<apeiros>
The latter is the standard
<lianj>
require 'bundler/setup'
Criztian has quit [Remote host closed the connection]
<Aloysius1>
apeiros: So Rails does some behind-the-scenes stuff to make it not necessary.
gnufied has quit [Quit: Leaving.]
<Aloysius1>
lianj: And "bundler/setup" is that stuff?
henrikhodne has joined #ruby-lang
<lianj>
the behind-the-scenes
<whitequark>
yorickpeterse: well, web applications. I don't hate websites.
supaiku has quit [Read error: Connection reset by peer]
justinmburrous has joined #ruby-lang
synthetix has quit [Remote host closed the connection]
lcashdol1 has quit [Read error: Connection reset by peer]
sush24 has quit [Quit: This computer has gone to sleep]
lcashdol has joined #ruby-lang
<Aloysius1>
Thanks!
teleological has joined #ruby-lang
teleological has quit [Read error: Connection reset by peer]
teleological has joined #ruby-lang
adambeynon has joined #ruby-lang
thiagoborges has joined #ruby-lang
dhruvasagar has quit [Ping timeout: 248 seconds]
chana has joined #ruby-lang
MaddinXx_ has quit [Remote host closed the connection]
<eam>
$" gives me the names of modules loaded -- how can I get the full path to the loaded file?
<eam>
eg in perl %INC will show "Foo/Bar.pm" => "/full/path/to/Foo/Bar.pm"
<eam>
can I get that in ruby?
zomgbie has quit [Read error: Connection reset by peer]
thebastl has joined #ruby-lang
robbyoconnor has joined #ruby-lang
henrikhodne has quit [Quit: Goodbye.]
runeb has joined #ruby-lang
sush24 has joined #ruby-lang
beiter has joined #ruby-lang
henrikhodne has joined #ruby-lang
saarinen has quit [Quit: saarinen]
DarkBushido has joined #ruby-lang
pr0ton has joined #ruby-lang
sush24 has quit [Ping timeout: 260 seconds]
dwainfaithfull has quit [Quit: dwainfaithfull]
runeb has quit [Remote host closed the connection]
runeb has joined #ruby-lang
zmike123 has quit [Quit: Выходжу]
arocco_ has quit [Remote host closed the connection]
dwainfaithfull has joined #ruby-lang
Weems has joined #ruby-lang
<darix>
eam: $LOADED_FEATURES
<darix>
oh that is just an alias
<eam>
darix: yeah that's $", but it's only the names not the paths
<eam>
in Perl, the equiv thing is a Hash of the names => paths
<eam>
ruby just seems to have an array of names but no paths?
<darix>
eam: maybe poke at the rubygems code
swav_ has joined #ruby-lang
<eam>
trying to figure out *which* file is loaded by a require, in the case of ambiguity with multiple options in $:
<darix>
gem which 'etc.so'
<darix>
eam: uhm search path order?
swav has quit [Ping timeout: 256 seconds]
<darix>
$LOAD_PATH
<darix>
as a start
<eam>
that won't tell me what's happened in the past -- only will predict what might happen given current state
pr0ton has quit [Ping timeout: 255 seconds]
<eam>
that's a bit different
<darix>
eam: well. if you start tracking it from the beginning
tbuehlmann has quit [Remote host closed the connection]
<darix>
anyway
<darix>
later
pr0ton has joined #ruby-lang
pipework has quit [Remote host closed the connection]
heftig has quit [Ping timeout: 240 seconds]
<apeiros>
eam: are you using 1.8?
<apeiros>
because 1.9 has absolute paths in $LOADED_FEATURES
<eam>
ah, yes I am
<eam>
excellent
<apeiros>
in that case: upgrade :-p
<eam>
I wish :)
DrIDK has joined #ruby-lang
<apeiros>
you can get the full path by searching $LOAD_PATH for the files
<yxhuvud>
redhat derivate? :)
<eam>
yxhuvud: indeed, among other older platforms
<eam>
apeiros: yeah, the thing I want it for, though, is to tell which module was loaded (assuming $: may change, cwd may change, etc)
<DrIDK>
Hello..I m a newbe... Is there a magic way to convert a String "Voiture" to the class name and create an instance ?