<firefux>
gem update doesn't remove gems, it keeps the old ones
innohero has joined #ruby-lang
csexton has left #ruby-lang [#ruby-lang]
<zenspider>
theoros: ls -lt $(gem env gemdir)/gems
tenderlove has quit [Read error: Connection reset by peer]
<theoros>
zenspider: ah, of course :)
soypirate has joined #ruby-lang
davidbalber|away is now known as davidbalbert
toretore has quit [Quit: Leaving]
nXqd has quit [Ping timeout: 264 seconds]
swav has joined #ruby-lang
KA_ has joined #ruby-lang
Vektur has joined #ruby-lang
bradland has joined #ruby-lang
krohrbaugh has joined #ruby-lang
AntiTyping has joined #ruby-lang
BigFatFatty has left #ruby-lang [#ruby-lang]
kogent has quit [Quit: kogent]
davidbalbert is now known as davidbalber|away
<UziMonkey>
I need to test if an array representing a loop (the first element is also after the last element) has any consecutive elements. I've done (a + [a.first]).each_cons(2).any?{|n| n[0]==n[1]}
<UziMonkey>
but is there a better way?
<UziMonkey>
for example, %w{a b c} would be OK, %w{a b b} would not, but %w{a b a} would also not be OK since the first and last are also adjacent
postmodern has joined #ruby-lang
torrieri has joined #ruby-lang
<manveru>
?
<manveru>
loopy = a[0] == a[-1]
<joevandyk>
when's ruby 2.0 coming out?
<drbrain>
joevandyk: February 26 IIRC
<joevandyk>
drbrain: thanks. haven't really been following it. you know if it'll speed up the startup time of large projects that use bundler?
<drbrain>
it's faster, but I don't know if anyone has performed such a benchmarks
jonahR has joined #ruby-lang
idkazuma has quit [Remote host closed the connection]
idkazuma has joined #ruby-lang
<joevandyk>
drbrain: great. doing `bundle exec ruby -e "puts 1"` takes about 4 seconds to run for me
<joevandyk>
on 1.9.3
<joevandyk>
so hoping that improves
jtoy has joined #ruby-lang
<joevandyk>
on a project with 81 gems
<manveru>
joevandyk: that is the fault of bundler then :P
<joevandyk>
manveru: i thought it was mostly ruby's require being slow
<judofyr>
whitequark: judge for yourself, but it seems to me that they've focused on hard part first
<whitequark>
judofyr: again; the hard part is compatibility
<judofyr>
whitequark: (performance-wise)
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<whitequark>
judofyr: performance? yeah, let's be like mongodb. the data goes into devnull but it's fast!
<whitequark>
correctness > performance. always.
<apeiros_>
yorickpeterse: that's what I actually did with ruby on my NAS :)
<apeiros_>
took it ~20s
<judofyr>
I know you shouldn't judge an implementation from benchmark, but you judge it from *nothing at all*
<yorickpeterse>
apeiros_: that's like the worst fucking benchmark you'll ever find
<judofyr>
I'd say it shows potential
<whitequark>
judofyr: I judge it from lack of compatibility
<whitequark>
every single ruby implementation did show these "promising benchmarks" early on
<yorickpeterse>
"Oh shit, The Lunix takes 15 seconds to boot. It must be slow as balls in everything!"
<apeiros_>
yorickpeterse: if your intent is to find the coldstart time? no. but feel free to show a better.
<judofyr>
whitequark: the question remains if the lacking compatibility will affect performance
<whitequark>
judofyr: the history shows that it will
<yorickpeterse>
apeiros_: I think somebody on the HN thread also mentioned it: comparing cold start is fairly useless in Ruby land
<whitequark>
all of them then either died or matured and got slower.
<judofyr>
well, after looking at the code it seems that they've thought about quite a lot
<apeiros_>
yorickpeterse: no it isn't. you're drawing wild conclusions.
<yorickpeterse>
Since most applications are long running ones the startup time matters very little (assuming it's within reasonable limits)
<apeiros_>
yorickpeterse: and if there's something worse than bad benchmarks then it's people drawing wild conclusions.
<judofyr>
but sure, continue hating
<yorickpeterse>
Having said that, Topaz looks cool from a "Lets write it!" perspective
<yorickpeterse>
I mean I probably would've done something similar if I had the time
<whitequark>
hating, lol
<judofyr>
apieros: that is true. but just because HN writes crappy benchmark doesn't make Topaz slow :)
<yorickpeterse>
However, I wouldn't sell performance of my language implementation if it (most likely) doesn't run a large portion of existing code (yet)
<whitequark>
as if I wasn't familiar firsthand with this performance-related quirk of immature implementations, writing two of them myself.
<judofyr>
whitequark: and what makes you think the makers of Topaz aren't aware of that too?
<whitequark>
judofyr: the fact that they published benchmarks before publishing near-100% rubyspec compat
<judofyr>
whitequark: 100% rubyspec compat is a lot of "implement a lot of boring methods" that won't necessarily affect performance.
<judofyr>
note: *necessarily*
<yorickpeterse>
A fast car is no fun if it can't drive on 80% of today's roads
<yorickpeterse>
or it if it randomly breaks and you die
<whitequark>
judofyr: again; in practice, they do. ask headius or dbussnik or whoever
* apeiros_
thinks go-carts are fun, even if their application is limited
<yorickpeterse>
What I'd like to see is Topaz supporting threads
<apeiros_>
same for F1 cars
<yorickpeterse>
We need more Ruby implementations with actual threads
<yorickpeterse>
So that hopefully Dear Leader one day blesses us with a non existing GIL
<whitequark>
sigh
<yorickpeterse>
Ok, unrelated Ruby trivia:
<yorickpeterse>
Daemon kit is called "daemon-kit" on RubyGems, what would the filename be for the corresponding require call?
<yorickpeterse>
daemonkit? Nope
<yorickpeterse>
daemon-kit? Nope
<yorickpeterse>
Fucking daemon_kit
<whitequark>
yorickpeterse: the only reason GIL remains in MRI (and will remain till the end of the days) is that MRI code is by no measure threadsafe
<judofyr>
yorickpeterse: man, I wish we did as Perl
<yorickpeterse>
judofyr: oh god yes
<judofyr>
whitequark: and because matz care about single-thread performance
<apeiros_>
yorickpeterse: and I assume they don't even document that fact - it's a pet peeve of mine too
<yorickpeterse>
apeiros_: I had to look in the repo for it
<whitequark>
yorickpeterse: and the amount of work required to make it threadsafe is enormous and no one probably would ever pull it off
nyuszika7h has joined #ruby-lang
<yorickpeterse>
whitequark: I know, but still
<judofyr>
yorickpeterse: 3 different name to refer to the same thing: gem install foo; require 'foo/bar'; Foo::Bar.new
<whitequark>
judofyr: well, it doesn't matter *anymore*
<yorickpeterse>
judofyr: there's a better one
<whitequark>
back when ruby was designed, SMP wasn't commonplace
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
<yorickpeterse>
RMagic => `require RMagick`, constant defined is Magick
<yorickpeterse>
srsly
<judofyr>
yorickpeterse: yeah, but I think even the "regular" one is annoying
x0F_ is now known as x0F
* apeiros_
would love if the convention was: require 'Foo/Bar'; Foo::Bar
<apeiros_>
I see no point in lowercasing all
<yorickpeterse>
apeiros_: that's sort of what people should be doing but it would be `require 'foo/bar'`
<yorickpeterse>
but alas people are cunts
kain has joined #ruby-lang
<apeiros_>
foo/bar is the current convention
<apeiros_>
sadly, so many don't even follow current convention
<apeiros_>
rails didn't make it better by deviating from FooBar -> foobar to foo_bar
<yorickpeterse>
At least we don't have FooBar.rb
<yorickpeterse>
(fuck I hate capitalized source code names)
<apeiros_>
whether there have been other projects which used that before rails too is relatively irrelevant
<judofyr>
I'm mostly disappointed in you guys because you're like "meh, another VM? who cares?" I love it because it means that the PyPy-guys will start working on optimizing Ruby too
<judofyr>
more people == better
<whitequark>
the efforts are disjoint
<whitequark>
it's not like no one knows the concepts required to optimize ruby
<apeiros_>
I'm not "meh, another VM". but "more people == better" has another side to it: more people == more fragmentation, which is not necessarily better
<whitequark>
it's more like applying these concepts to existing implementations requires quite a big amount of work
<whitequark>
so they're just duplicating it because their VM is cooler than our VM, etc
<judofyr>
I'd say they are more "joint" now. improvements to RPython are going to help both Topaz and PyPy
<yorickpeterse>
judofyr: I like them doing something about it, I however would rather see them improve jruby or rbx
<yorickpeterse>
More doesn't equal better
<skade>
no, they are duplicating because they need more test cases for PyPy
kgrz has quit [Quit: Computer has gone to sleep.]
<apeiros_>
I do find it interesting with regards to "more competition"
<judofyr>
skade: that's not *just* the reason why they're doing it, but yes
<whitequark>
judofyr: rpython is not a silver bullet. they did not invent something fundamentally better than insides of JVM/RBX
<skade>
judofyr yes, but it was one of the main motivations thats mostly overlooked
<yorickpeterse>
if say, brian was now suddenly "Holy shit this is so much better than Rbx, we need to vastly improve Rbx!" then yes, it would be good for competition
<whitequark>
judofyr: it's more or less a way to write efficient code if you have failed to learn C++
<judofyr>
yorickpeterse: dbussink is actually going to look into why Topaz does it so much better on the video demo :)
<yorickpeterse>
Does what better?
<whitequark>
judofyr: Maxine VM, next-gen JVM, is doing the same thing
<judofyr>
*perform better
<yorickpeterse>
Performance isn't very relevant for me until it actually does what it is supposed to
<yorickpeterse>
But opinions seem to differ, which is fine
kain has quit [Ping timeout: 256 seconds]
<whitequark>
at this point I remove myself from this pointless conversation
<judofyr>
:)
<dbussink>
yorickpeterse: we want to improve rbx regardless of any other impl ;)
<yorickpeterse>
It's a bit like me saying "ZOMG,ruby-lint is so much faster than X" while I'm pretty sure it doesn't run on 80% of today's code
<judofyr>
yorickpeterse: then you just wait :)
<yorickpeterse>
dbussink: I have no doubts about that :)
<dbussink>
yorickpeterse: and there are plenty of opportunities, but they aren't all trivial ;)
dustint has joined #ruby-lang
<yorickpeterse>
dbussink: yeah, you people need to add C extensions for speed
* yorickpeterse
runs
<dbussink>
yorickpeterse: moar C extensions :P
<whitequark>
dbussink: what I'd really, really like to see is embedding rbx in other software
<whitequark>
maybe with some kind of reverse-FFI
<yorickpeterse>
Lua?
<judofyr>
mruby *ducks*
<dbussink>
whitequark: yeah, it actually shouldn't be terribly hard to do, rbx doesn't have global state etc.
<whitequark>
yorickpeterse: I don't want some cut-down bullshit, I want full power of Ruby
<dbussink>
too much to do :p
<whitequark>
dbussink: I see
jtoy has joined #ruby-lang
<dbussink>
judofyr: looked at some of the type checks, one thing is basically that string methods like *, << etc. all do type coercion on their arguments
<dbussink>
if it responds to to_str etc.
<judofyr>
dbussink: in Topaz or rbx?
<dbussink>
judofyr: well, that's the ruby semantics
<dbussink>
topaz doesn't do that (yet)
* whitequark
giggles
<ddd>
err? << isn't String specific or did I miss something
<yorickpeterse>
I know this was written by an intern but ugh
<judofyr>
yorickpeterse: I find it fascinating that code can be well-indented and formatted, and still feel so wrong. e.g. newline after the raise Foo. using .match instead of =~. not using {} in regexp. not using a constant for the regexp
<apeiros_>
I find the lack of anchors the most disturbing
<apeiros_>
the rest I learned to live with
<apeiros_>
(even if I dislike it too)
<yorickpeterse>
judofyr: I don't care about that when it comes to interns, especially with this guy since he came in as a total scrub
<apeiros_>
got a point in "not a constant"
<yorickpeterse>
(he improved *a lot*)
<yorickpeterse>
It's the regexp that pisses me off
<yorickpeterse>
and the fact that it's used to begin with
methods has joined #ruby-lang
scampbell has joined #ruby-lang
methods has left #ruby-lang [#ruby-lang]
kain has quit [Ping timeout: 248 seconds]
<yorickpeterse>
And it doesn't even work
Rarrikins has quit [Ping timeout: 252 seconds]
<yorickpeterse>
Oh wait, it actually validates against "10-10-2013 - 11-10-2013"
<yorickpeterse>
what the fuck
Rarrikins has joined #ruby-lang
<judofyr>
well, it's a date range, right?
<yorickpeterse>
there's so much wrong with it
mytrile has quit [Remote host closed the connection]
ruby-lang778 has quit [Ping timeout: 245 seconds]
<dbussink>
yorickpeterse: is that a month or a day ;)
carloslopes has quit [Remote host closed the connection]
adambeynon has joined #ruby-lang
krz has quit [Quit: krz]
dustint has quit [Remote host closed the connection]
<yorickpeterse>
heh
<yorickpeterse>
I'll have none of your US date formats
dustint has joined #ruby-lang
<yorickpeterse>
But yeah, there are better ways to validate ranges
<apeiros_>
US dates, one of the odd places which use middle-endian
<Mon_Ouie>
Are there uses of middle-endian that aren't odd?
<apeiros_>
o0
<apeiros_>
that wasn't the intended assertion of my phrase :)
gnufied has quit [Quit: Leaving.]
<Mon_Ouie>
I know that :p
<apeiros_>
haven't seen a good use of middle-endian
<yorickpeterse>
I propose half-assed-endian
<yorickpeterse>
2012-28-12
jperry2 has joined #ruby-lang
<dbussink>
yorickpeterse: your? you're calling me a yankee? ;)
<apeiros_>
I propose reverse-nonsense-endian: 21-1220-82
<yorickpeterse>
dbussink: haha
<yorickpeterse>
apeiros_: I propose we all use Unix timestamps
jbsan has quit [Quit: jbsan]
<yorickpeterse>
and negative ones for everything before 01-01-1970
* apeiros_
saw that coming
<yorickpeterse>
"What's the time? Oh, 1360247523"
<bougyman>
NO. ebeats.
<bougyman>
it's 605.787 everywhere right now
<bougyman>
time zones be damned
<yorickpeterse>
"When did the Roman empire collapse? Oh, on -123817329823791237982173892372378923213123"
security has joined #ruby-lang
megha has quit [Ping timeout: 255 seconds]
kain has joined #ruby-lang
<jaska>
planck time units since big bang
<apeiros_>
jaska: and scientific notation is prohibited
<apeiros_>
letter heads will be huge ^^
<jaska>
just hope you dont have to use unary.
ryanv-raptor has joined #ruby-lang
<jaska>
but atleast you wont have to use decimals.
jtoy has joined #ruby-lang
Bearproof has joined #ruby-lang
jtoy_ has joined #ruby-lang
jtoy has quit [Ping timeout: 252 seconds]
jtoy_ is now known as jtoy
dhruvasagar has joined #ruby-lang
dhruvasa1ar has joined #ruby-lang
sailias has joined #ruby-lang
<yorickpeterse>
heh, the discussion about symbols vs strings rages on on the mailing list
<yorickpeterse>
I should get some popcorn
Bearproof has left #ruby-lang [#ruby-lang]
Rarrikins has quit [Ping timeout: 256 seconds]
Rarrikins_n has joined #ruby-lang
cupakromer has quit []
gix has quit [Ping timeout: 260 seconds]
mistym has quit [Remote host closed the connection]
carloslopes has joined #ruby-lang
<ryanv-raptor>
I've been meaning to ask, since I'm rather new around the community, is it usual for the thought provoking intelligent discussion to take place here and the mailing list to leave a lot to be desired?
<yorickpeterse>
not really
<yorickpeterse>
Usually it's the other way around
<ryanv-raptor>
Not that every post on the mailing list is bad
<ryanv-raptor>
it's just that I've seen quite a bit of "write code for me" going on on there lately
<yorickpeterse>
However with mailing lists the discussions tend to get rather big
<yorickpeterse>
oh, that's always the case
<ryanv-raptor>
ah, good to know
gix has joined #ruby-lang
davidbalber|away is now known as davidbalbert
wallerdev has joined #ruby-lang
stardiviner has joined #ruby-lang
vlad_starkov has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
security is now known as megha
blacktulip has joined #ruby-lang
21WAAHJLR has joined #ruby-lang
tomzx_mac has quit [Read error: Operation timed out]
sailias has quit [Quit: Leaving.]
bzb has joined #ruby-lang
judofyr has quit [Ping timeout: 264 seconds]
<whitequark>
yorickpeterse: what, again?!
<whitequark>
I remember at least three
<whitequark>
and matz once said that he'd remove symbols in favor of strings, if he'd be doing ruby from the ground up
<whitequark>
which would be a pity
<yorickpeterse>
whitequark: the one about symbols vs strings
<whitequark>
yorickpeterse: yeah yeah, I remember at least three such discussions on ML
<whitequark>
dating back to 2003
<yorickpeterse>
The guy keeps on making issues about wanting to replace Hash and everything and comes up with really annoying counter arguments
<yorickpeterse>
Basically "Ruby is already slow, who cares if it's slower" and "Lets completely change how Hash works. Having to change a lot of code is not my problem"
<whitequark>
he's arguing in favor of change now?
<whitequark>
lol
<yorickpeterse>
if blade wasn't so shit I'd link it in here
<yorickpeterse>
But I can't even search properly for it
judofyr has joined #ruby-lang
* whitequark
just wrote a bastard child of PEG and LALR
<whitequark>
it has the syntax of PEG, but enforces it to be LALR(n)
<whitequark>
ie has linear space and time requirements
<judofyr>
LOLR
<yorickpeterse>
LULZR(N)
<whitequark>
have I arrived at a branch of 4chan?
<whitequark>
meh.
<yorickpeterse>
Call it quark(n)
<whitequark>
yorickpeterse: it is actually just LALR(n), but it doesn't require you to write a separate lexer
gnufied has joined #ruby-lang
<whitequark>
it is also a part of my secret weekend-project
<yorickpeterse>
Go write me a proper Ruby parser already (yeah yeah, I know you're working on it)
methods has joined #ruby-lang
dous_ has quit [Remote host closed the connection]
<apeiros_>
there have been more, I don't really remember them by heart
<judofyr>
yorickpeterse: "The way your database tables are layed out will ultimately affect your views." you are aware of that the whole idea the relational model was to separate the physical and logical data structure? :)
<yorickpeterse>
judofyr: You're missing the point, but I suppose that means I failed to explain it
<judofyr>
:)
OddMeat has joined #ruby-lang
<judofyr>
yorickpeterse: I experimented with making Symbol a subclass of String
<yorickpeterse>
What I'm saying is that if you have field X you're going to display field X at some point in your view, thus it affects it. Also the structure and data can affect your views
<yorickpeterse>
Maybe views aren't the best example though
<judofyr>
but there's a lot of String-methods that assumes that "self" is actually a string, so I had to add lots of `self = StringValue(self)` :/
<Uranio>
how could I strip ALL the special characters from a string
<judofyr>
Uranio: what's a "special characters"
<Mon_Ouie>
You need to define "special" first. Non-ascii? Not alpha numerical?
MartynKeigher has quit [Excess Flood]
bobbywilson0 has joined #ruby-lang
<Uranio>
Mon_Ouie & judofyr for exaple Lázaro Martínez
<Uranio>
L?zaro Mart?nez
<Uranio>
would be great
<judofyr>
Uranio: you can use .gsub(/\W/, '')
<Uranio>
:D really is so easy?
<Uranio>
let me check
rins has joined #ruby-lang
apeiros_ has quit [Remote host closed the connection]
<judofyr>
that will remove all chars except from A-Z, a-z, 0-9 and _
<judofyr>
Uranio: for custom: .gsub(/[^A-Za-z0-9_\-\.]/, '')
<judofyr>
that is everything else than A-Z, a-z, 0-9, _, -, .
<judofyr>
:)
nyuszika7h has quit [Quit: Here we are, going far to save all that we love - If we give all we've got, we will make it through - Here we are, like a star shining bright on your world - Today, make evil go away!]
<Uranio>
nop... that don't work.. the chaos is put an HTML with spcial characters in the attach of an email
<Uranio>
using mike mail gem
<Uranio>
and there is an error like this:
<Uranio>
/usr/local/lib/ruby/gems/1.9.1/gems/mail-2.5.3/lib/mail/fields/unstructured_field.rb:149:in `encode!': "\xF3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
<Uranio>
I tryed EVERYTHING in internet
MartynKeigher has joined #ruby-lang
<judofyr>
Uranio: you're passing in binary strings to something that expects UTF-8 strings
<Uranio>
yep.. how to don't do that
<Uranio>
I took a stream from Net:HTTP
tdy has quit [Ping timeout: 260 seconds]
kith has joined #ruby-lang
<judofyr>
Uranio: then you should just .force_encoding("UTF-8") if you know that it's UTF-8
imajes has quit [Excess Flood]
<Uranio>
judofyr: god... but don't work as supossed would be work
imajes has joined #ruby-lang
<Uranio>
better would be supress al the characters
solars has quit [Ping timeout: 245 seconds]
nyuszika7h has joined #ruby-lang
<darix>
Uranio: but you would actually destroy the content?
<Uranio>
darix: I don't care about the content as long happen this: Lázaro L?azaro
<Uranio>
or Lzaro
agarcia has quit [Quit: Konversation terminated!]
rodj has quit [Quit: Page closed]
<judofyr>
whitequark: heh. headius wrote that blog post (blog.headius.com/2012/10/so-you-want-to-optimize-ruby.html) after an email thread with Alex (who wrote Topaz)
io_syl has joined #ruby-lang
<darix>
Uranio: if you grab stuff from http ... read the encoding from the http/html header
<darix>
and force the ruby strings to that encoding
rodj has joined #ruby-lang
jonahR has joined #ruby-lang
<darix>
if not pick a proper default and enforce strings to that
<darix>
then either you or the mail gem can reencode to utf8
vlad_starkov has joined #ruby-lang
<darix>
that would be a more sane approach than just stripping everything out
tdy has joined #ruby-lang
<Uranio>
darix: I tried things like that before
<Uranio>
encodings with rescue taked from gem like cinch
<Uranio>
and nothing work
<Uranio>
encode is not the way I guest
<Uranio>
unless read the encoding from the http/html header
<Uranio>
could work
<darix>
did you really use the encoding that was given to you by http/html ?
<Uranio>
darix: :-/ nop.. I dont¶ know hot to get taht
<Uranio>
darix: :-/ nop.. I don't know hot to get that
<Uranio>
checking now...
<darix>
http: Content-Type header
<Uranio>
never tried because all from Net:HTTP come as ASCII-8BIT
<judofyr>
darix: I've always wondered why net/http doesn't do it for you
<darix>
html meta header either charset or contenttype
io_syl has quit [Ping timeout: 246 seconds]
<Uranio>
darix: yeahm, but how to took a hader
<darix>
Uranio: http look at the response object. html. parse the stuff you get from net/http with nokogiri?
<Uranio>
nokogiri! :D next life meybe, I never get compiled that
<darix>
judofyr: i wouldnt it expect from net/http. but from higher level libs like mechanize i would expect charset handling
<Uranio>
un debian
<Uranio>
in*
chrisnicola has joined #ruby-lang
<darix>
Uranio: i am sure debian has a package for hpricot or nokogiri
<darix>
either will work
<whitequark>
judofyr: I'm not surprised :)
<Uranio>
darix: I'm using ruby compiled from source
vlad_starkov has quit [Ping timeout: 256 seconds]
<judofyr>
whitequark: so Alex has used that exact list when he built Topaz ;)
<Uranio>
and hpricot draft crazy when get a encoding weird
<Uranio>
just like mail
<judofyr>
Uranio: if you're only going to use this on one page, you might as .force_encoding(…) to the right encoding
<darix>
Uranio: so install libxslt-dev and libxml2-dev (dont know exact package names) and install nokogiri?
nXqd has quit [Ping timeout: 244 seconds]
<Uranio>
darix: yeah man.. I read the cuide, anyway it fail to me
<Uranio>
%s/cuide/guide/g
<darix>
failed how?
<Uranio>
darix: let me try to check the HTML header during the response againsta the server
<joevandyk>
where I'm trying to access a root-level constant from inside another module
<vbatts>
zzak: \?/
marr has joined #ruby-lang
<joevandyk>
and it seems that all of a sudden I have to prefix the root-level constant with ::ConstantName
<joevandyk>
(with the '::')
<joevandyk>
when do I need to write ::CONSTANT?
skade has joined #ruby-lang
<kith>
injekt: i installed dbd-pg now it works... which is weird because the other machine i was running my code on doesnt have that but pg only
<kith>
pg (0.12.2)
benanne has joined #ruby-lang
krohrbaugh1 has quit [Quit: Leaving.]
<heftig>
joevandyk: you need to use ::CONSTANT when a) there's another CONSTANT in your scope, but that's the wrong one or b) you're in the scope of a BasicObject
<heftig>
(since BasicObject does not inherit from Object)
<heftig>
i can't reproduce it with a simple: require 'net/http'; module Foo; class Bar; def a; Net::HTTP; end; end; end; Foo::Bar.new.a
pbjorklund has joined #ruby-lang
imajes has quit [Excess Flood]
imajes has joined #ruby-lang
carloslopes has quit [Remote host closed the connection]
<pbjorklund>
I have an array of arrays. like [["abc", nil, nil, "bca"], ["bac", "foo", nil, nil]] that I can search like csv.inject([]) { |sum,el| sum.push el if el.grep(/foo/i) != [] ; sum } to get the offending arrays. Whats a more proper way to do this? Coulnd't find an Array.include? that took a regex
<bougyman>
.grep
<bougyman>
maybe.
<pbjorklund>
Well, thats what im using, sort of. Just couldn't figure out how to make it work properly with an array of arrays..
tenderlove has quit [Remote host closed the connection]