ChanServ changed the topic of #ruby-lang to: Ruby 1.9.3-p125: http://ruby-lang.org | Paste >3 lines of text on http://pastie.org or use a gist
ViperMaul has joined #ruby-lang
datanoise has joined #ruby-lang
replore has joined #ruby-lang
havenn has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
Giddeon has joined #ruby-lang
srbaker has joined #ruby-lang
andrewhl has joined #ruby-lang
kvs has joined #ruby-lang
shevy has joined #ruby-lang
diegoviola has joined #ruby-lang
Psyche^ has joined #ruby-lang
moxiemk1 has joined #ruby-lang
VegetableSpoon has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
ryanf has joined #ruby-lang
rdavila has joined #ruby-lang
tonesfrommars has joined #ruby-lang
batmanian has joined #ruby-lang
rdavila has joined #ruby-lang
wallerdev has joined #ruby-lang
batmanian has joined #ruby-lang
ttilley has joined #ruby-lang
singpolyma has joined #ruby-lang
bryno has joined #ruby-lang
flebel has joined #ruby-lang
workmad3 has joined #ruby-lang
wardrop_ has joined #ruby-lang
seanstickle has joined #ruby-lang
publicvoid_ has joined #ruby-lang
woollyams has joined #ruby-lang
woollyams has joined #ruby-lang
gix- has joined #ruby-lang
knu has joined #ruby-lang
tomzx_ has joined #ruby-lang
burgestrand1 has joined #ruby-lang
cantonic has joined #ruby-lang
sora_h_ has joined #ruby-lang
any-key_ has joined #ruby-lang
seanstickle_ has joined #ruby-lang
machine5 has joined #ruby-lang
FACEFOX-DOT-COM has joined #ruby-lang
woollyams has joined #ruby-lang
FACEFOX has joined #ruby-lang
machine1 has joined #ruby-lang
savage- has joined #ruby-lang
wallerdev has joined #ruby-lang
drumond19 has joined #ruby-lang
drumond19 has joined #ruby-lang
drumond19 has joined #ruby-lang
rdavila has joined #ruby-lang
dr0id has joined #ruby-lang
woollyams has joined #ruby-lang
seoaqua has joined #ruby-lang
<seoaqua> pls help me get rid of 'encoding error : input conversion failed due to input error, bytes 0x84 0xC2 0x27 0x20'
<seoaqua> this seems to be a warning ,instead an error or an exception
savage- has joined #ruby-lang
ryanf has joined #ruby-lang
chimkan_ has joined #ruby-lang
VladGh has joined #ruby-lang
freedrull has joined #ruby-lang
yeltzooo7 has joined #ruby-lang
sj26 has joined #ruby-lang
tdmackey has joined #ruby-lang
mitchty has joined #ruby-lang
cdnz has joined #ruby-lang
<shevy> seoaqua Encoding will forever suck
<erikh> that's not an answer
<erikh> I mean, I agree with you, but that doesn't really help him
rdavila has joined #ruby-lang
FACEFOX-DOT-COM has joined #ruby-lang
FACEFOX-DOT-COM has joined #ruby-lang
<shevy> true
bglusman has joined #ruby-lang
ViperMaul has joined #ruby-lang
rippa has joined #ruby-lang
<seoaqua> i hate warnings, i cant trace back with that msg
rue_XIV has joined #ruby-lang
jmeeuwen_ has joined #ruby-lang
corundum has joined #ruby-lang
jkyle has joined #ruby-lang
wwalker_ has joined #ruby-lang
FACEFOX has joined #ruby-lang
zerokarm1left has joined #ruby-lang
jkyle_ has joined #ruby-lang
vereteran has joined #ruby-lang
tris has joined #ruby-lang
machine1 has joined #ruby-lang
gsav has joined #ruby-lang
EvilJStoker_ has joined #ruby-lang
FACEFOX-DOT-COM has joined #ruby-lang
replore has joined #ruby-lang
naquad has joined #ruby-lang
FACEFOX has joined #ruby-lang
EvilJStoker_ has joined #ruby-lang
Oloryn_lt1 has joined #ruby-lang
jordan` has joined #ruby-lang
FastJack has joined #ruby-lang
JackNorris has joined #ruby-lang
publicvoid_ has joined #ruby-lang
hrnt_ has joined #ruby-lang
yellow5 has joined #ruby-lang
Guest58702 has joined #ruby-lang
cronin101 has joined #ruby-lang
jbsan has joined #ruby-lang
yorickpeterse has joined #ruby-lang
melter has joined #ruby-lang
tla has joined #ruby-lang
whitequark has joined #ruby-lang
drbrain has joined #ruby-lang
owen1 has joined #ruby-lang
segy has joined #ruby-lang
lucas has joined #ruby-lang
shyouhei_ has joined #ruby-lang
dju has joined #ruby-lang
lzhz has joined #ruby-lang
mitchty has joined #ruby-lang
corundum has joined #ruby-lang
woollyams has joined #ruby-lang
turbolih1s has joined #ruby-lang
tomb_ has joined #ruby-lang
turboladen has joined #ruby-lang
Taranis has joined #ruby-lang
ahs3- has joined #ruby-lang
ramonmaruko has joined #ruby-lang
FACEFOX has joined #ruby-lang
gouthamvel has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
machine1 has joined #ruby-lang
Bwild has joined #ruby-lang
michael_mbp has joined #ruby-lang
kyrylo has joined #ruby-lang
tamsuiboy has joined #ruby-lang
yxhuvud has joined #ruby-lang
heftig has joined #ruby-lang
ryanf has joined #ruby-lang
andrewhl has joined #ruby-lang
solars has joined #ruby-lang
ryanf has joined #ruby-lang
fvollero has joined #ruby-lang
x0F_ has joined #ruby-lang
JohnBat26 has joined #ruby-lang
zmack has joined #ruby-lang
yxhuvud has joined #ruby-lang
michael_mbp has joined #ruby-lang
workmad3 has joined #ruby-lang
WillMarshall has joined #ruby-lang
Axsuul has joined #ruby-lang
<WillMarshall> Hey! What would be a clean way to merge two arrays that look like this? https://gist.github.com/2469135
<bnagy> ary1.compact + ary2.compact
<bnagy> or just (ary1 + ary2).compact, as you like
<WillMarshall> bnagy: If the nils weren't sequential like that?
<bnagy> or [ary1,ary2].map(&:compact).flatten
<WillMarshall> bnagy: Imagine I needed to preserve order, but the nils were scattered around
<bnagy> why wouldn't order be preserved?
<bnagy> ohhh I see what you mean, if it were like a 2d array
<bnagy> ary1.zip(ary2).compact
<bnagy> probably need a flatten first .flatten.compact
<bnagy> didn't try that out
<bnagy> undefined for [nil,1,nil] and [nil,2,nil] - what order should that be?
<bnagy> with zip it will be 1,2 I think
<WillMarshall> bnagy: Right, with the example you give
<WillMarshall> I'd expect [nil, 2, nil]
<WillMarshall> But there'll never be overlap
<WillMarshall> Imagine...
<WillMarshall> [nil, 1, nil, 2]
<WillMarshall> and [4, nil, 5, nil]
<bnagy> [nil,1,nil].zip([nil,2,nil]).flatten.compact => [1, 2]
<WillMarshall> I'd expect to get [4, 1, 5, 2]
<bnagy> zip flatten compact should work for you
<WillMarshall> Got it!
<WillMarshall> Thanks :)
dc5ala has joined #ruby-lang
francisfish has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
kitallis has joined #ruby-lang
srbaker has joined #ruby-lang
francisfish has joined #ruby-lang
<rippa> a.zip(b).map {|x,y| x ? x : y}
roha has joined #ruby-lang
rzys has joined #ruby-lang
dubellz has joined #ruby-lang
solars has joined #ruby-lang
dubellz has joined #ruby-lang
ryez has joined #ruby-lang
|Vargas| has joined #ruby-lang
dubellz has joined #ruby-lang
z3r00ld has joined #ruby-lang
michael_mbp has joined #ruby-lang
mangohuice has joined #ruby-lang
jxie has joined #ruby-lang
wardrop has joined #ruby-lang
slaytanic has joined #ruby-lang
mangohuice has joined #ruby-lang
toretore has joined #ruby-lang
slaytanic has joined #ruby-lang
ryez has joined #ruby-lang
jondot has joined #ruby-lang
replore has joined #ruby-lang
QaDeS has joined #ruby-lang
Fullmoon has joined #ruby-lang
banister has joined #ruby-lang
michael_mbp has joined #ruby-lang
gouthamvel has joined #ruby-lang
brianpWins has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
rushed has quit [#ruby-lang]
wardrop has joined #ruby-lang
tekin_ has joined #ruby-lang
slaytanic has joined #ruby-lang
workmad3_ has joined #ruby-lang
wardrop has joined #ruby-lang
judofyr has joined #ruby-lang
WillMarshall has joined #ruby-lang
Banistergalaxy has joined #ruby-lang
zmack has joined #ruby-lang
jbsan has joined #ruby-lang
futurechimp has joined #ruby-lang
<bnagy> rippa: you will be punished in the next life
<rippa> for what?
<bnagy> that's a HORRIBLE solution :)
<bnagy> like, there's a perfectly readable method that exists just to strip nil, and you use a ternary instead :>
<bnagy> wait, and it doesn't actually work
<shevy> down with nil!
<shevy> stop the tyranny!
<bnagy> phew I was wondering what side effect weirdness was going on :S
vmoravec has joined #ruby-lang
<dr0id> do you believe in after life ?
<anildigital_work> Somehow from my Rails app
<anildigital_work> client = Mysql2::Client.new(:host => "localhost", :username => "root", :password => "sekret", :database => "information_schema")
<bnagy> no, that's why I use buddhist examples
<anildigital_work> first time it runs..
<anildigital_work> second time it hangs for unlimited time without error.
<dr0id> thanks for your password anildigital_work
<shevy> dr0id of course not, it's a human invention
solars has joined #ruby-lang
<judofyr> dr0id: but it's SEKRET!
<dr0id> :D
<bnagy> because 'next life you will be a pig' is inherently funnier than 'you will go to hell'
<shevy> does that word even exist?
<shevy> bnagy I wanna be a sloth
<dr0id> sup pigs :P
<bnagy> I'm pretty sure it's spelled 'sekrit' with an I
<shevy> hi masterpig dr0id
* dr0id punches shevy
<shevy> reminds me of the book The Animal Farm
<bnagy> ok gtg
<dr0id> in the nose ...
<dr0id> :P
<shevy> I think the books were the communists, but I already forgot
<shevy> pigs
jondot has joined #ruby-lang
jondot has joined #ruby-lang
heftig has joined #ruby-lang
kitallis has joined #ruby-lang
tekin has joined #ruby-lang
z3r00ld has joined #ruby-lang
z3r00ld has quit [#ruby-lang]
gouthamvel has joined #ruby-lang
woollyams has joined #ruby-lang
gouthamvel has quit [#ruby-lang]
kitallis has joined #ruby-lang
<erikh> gonna have to rethink this whole thing, again, to work on celluloid
<erikh> not a bad thing; just time-consuming.
<judofyr> erikh: what'd you think about celluloid?
<erikh> I like it
<erikh> I just implemented my own concurrency system for this project with 0mq before celluloid was released
<erikh> it's not as clean by a longshot, but it did work
<erikh> this way I get to outsource that work.
<erikh> damnit I think rubygems.org is down again
<erikh> nm
seoaqua has joined #ruby-lang
justinmcp has joined #ruby-lang
olesu has joined #ruby-lang
jondot has joined #ruby-lang
<andrewvos> judofyr: What theme is that on twitter?
<andrewvos> judofyr: The vim theme I mean
<erikh> looks like vividchalk
<andrewvos> erikh: Hmm will give it a try thanks. Been using solarized since it came out :/
wardrop has joined #ruby-lang
<judofyr> andrewvos: molokai I think
solars has joined #ruby-lang
<erikh> if you use macvim twilight is nice
* judofyr uses vim in the terminal
<andrewvos> judofyr: Yeah it is I foudn it in your github :)
* judofyr has dehipstered himself
<judofyr> I think…
<andrewvos> MacVim is for losers :)
<erikh> feh.
<andrewvos> (just trolling)
<andrewvos> erikh: Wow that is quite nice
<erikh> yeah I like it a lot.
<judofyr> tmux is for winners \o/
<Patterner> feh is not a editor.
<shevy> emacs is the best OS.
<andrewvos> alias feh=vim
* judofyr contemplates writing a new editor: feh
<erikh> feh is a graphics display tool
<erikh> but feh is also yiddish
<erikh> so, yeah.
<judofyr> feh
<erikh> have some tmux
<judofyr> tmux + vimux is pretty cool
<erikh> dunno. never liked vim in the terminal
<erikh> unless i'm remote that is
<judofyr> erikh: I don't see any difference here really
<judofyr> I can just type <Leader>r and it runs the test in another window!
<erikh> aye
<erikh> I saw.
<erikh> I use conqueterm for that.
<judofyr> stalkers
<judofyr> can't I write anything on the internet without you guys reading it? :(
<erikh> not really
<erikh> I follow injekt as well
<judofyr> well, how do you handle Norwegian then?
<erikh> ha
<judofyr> I thought so
cantonic has joined #ruby-lang
<judofyr> maybe I should write all my Ruby code with Norwegian variables and comments
<shevy> yeah
<shevy> skapelsen
wardrop has joined #ruby-lang
<judofyr> :)
<tobiasvl> just with ae, oe and aa? :)
<shevy> they dont have
<shevy> I know the danes have some odd ae ~AE@ae ... character
<tobiasvl> æ ø å
<tobiasvl> same as the danes, yeah
Namenone has joined #ruby-lang
<tobiasvl> æÆ øØ åÅ
<jaska> same shit, different char
<Nameone> Hey!
<shevy> one day all the umlauts will die
<heftig> ßẞ
Sailias has joined #ruby-lang
<Nameone> Ruby newbie here!
<Tasser> shevy, http://wals.info/feature/2A?s=20&z1=3000&z3=2999&z2=2998&tg_format=map&v1=c00d&v2=cfff&v3=cd00 they seem to have a bunch of vocals up there :-)
<Nameone> Ive got a question, i want a hash where i can search either values or keys
<manveru> shevy: ä ü and ö you mean?
<Nameone> is this possible?
<jaska>
<Tasser> Nameone, you can invert a hash, but I assume you want a double-sided hash - might be somewhere in activesupport, but the ruby stdlib kinda sux for extensive data types, most is covered via hash and array
<Nameone> Tasser: Thanks! Im trying to make a hash full of country codes, country abbreviations and dialling codes
<Nameone> would you recommend 3 different hashes?
<Tasser> Nameone, I'm pretty sure there's a gem that does that ;-)
<Nameone> does what?;o
<shevy> manveru I cant read any of these :(
<shevy> I can read jaska just fine though
<judofyr> Nameone: you can also do {:a => 1}.key(1)
<shevy> I should start to learn finnish
<judofyr> Nameone: but it's not as fast
<manveru> shevy: that's because you're not using unicode :)
<Nameone> Cheers! ill check the gem out!
<Nameone> wonder if it has all three data sets in there
<Tasser> Nameone, probably not, but you can recycle their source :-)
<Nameone> Tasser: true! Thanks
<shevy> I like that Nameone seems so excited
<judofyr> shevy: now you make sounds like we're never happy in here :(
<shevy> normal happy
francisfish has joined #ruby-lang
<shevy> but not the excited! happy!
<shevy> cheers! let's kiss!
<Nameone> Haha, thanks for the mockery .
mattyoho has joined #ruby-lang
olesu has joined #ruby-lang
seanstickle has joined #ruby-lang
kvirani has joined #ruby-lang
<erikh> hash = { 1 => "one", 2 => "two" }; Hash[hash.values.zip(hash.keys)]
<erikh> be warned you're going to have issues with that.
Foxmaster has joined #ruby-lang
tjadc has joined #ruby-lang
<manveru> erikh: you mean hash.invert ?
<rippa> inverted moongoats
<erikh> manveru: didn't know about that one.
<judofyr> TEL
<erikh> ha
<manveru> also values/zip/keys is worse than Hash[hash.map{|k,v| [v,k] }]
leopard_me has joined #ruby-lang
<judofyr> but zip is so awesome!
<Nameone> N00b question, downloaded a gem, how do i go about running it?
<judofyr> Nameone: just run "gem install gem-name"
<Nameone> ok cool, I'm wanting to edit the gem a little
<Nameone> theres no way to run the commands through irb ?
<judofyr> Nameone: "gem unpack name.gem"
<Nameone> thanks
<andrewvos> Damn vimux is quite nice
<andrewvos> SO much easier
hahuang65 has joined #ruby-lang
<andrewvos> I don't wat to know the bloody names of my session/etc like in tslime
<judofyr> andrewvos: I have <Leader>r mapped to RunLastTmuxCommand (or whatever it is)
<judofyr> andrewvos: and I'm using this: https://github.com/pgr0ss/vimux-ruby-test
<judofyr> andrewvos: so I just type: RunRubyFocusedTest
<judofyr> then <Leader>r to iterate
<andrewvos> judofyr: I manually map my commands when I need them.
<andrewvos> judofyr: I don't have the luxury of working in one language :)
<judofyr> andrewvos: that's the nice thing: my mapping <Leader>r to RunLastTmuxCommand, it doesn't matter what language
<andrewvos> Hmm true
<judofyr> andrewvos: you just need to set it up once :call RunTmuxWhateverItIs("…")
<andrewvos> Oh ok I get it!
<andrewvos> Amazing
<andrewvos> Excellent
<judofyr> andrewvos: it's truly an awesome workflow
Sailias has joined #ruby-lang
<andrewvos> judofyr: Thanks!
<andrewvos> judofyr: Very cool
roha has joined #ruby-lang
rzys has joined #ruby-lang
<Nameone> http://pastebin.com/reaGKNfU - anyone know why I'm getting that error?
Hakon|mbp has joined #ruby-lang
<andrewvos> Nameone: You need to install a gem?
<yorickpeterse> Nameone: paste the code in a pastebin as well, but this gives you a hint: "`require': cannot load such file -- iso_country_codes (LoadError)"
tbuehlmann has joined #ruby-lang
<yorickpeterse> It means it can't load the file, which can mean 1. it's a non installed gem 2. it's a non found file
<Nameone> damn n00b brain
<Nameone> you were correct, i forgot to do gem install
<Nameone> i did the git clone first for the source
<Nameone> #!/usr/bin/env ruby
<Nameone> require 'iso_country_codes'
<Nameone> code = IsoCountryCodes.find('au')
<Nameone> print code
<Nameone> if i run that .rb file in terminal, it should print no?
<yorickpeterse> If the gem actually works, yes
rzys has joined #ruby-lang
roha has joined #ruby-lang
<Harzilein> Nameone: maybe use print, otherwise your shell prompt might overwrite it
<yorickpeterse> Harzilein: "print code" he is :)
<Harzilein> uhm
<Harzilein> i mean
<Harzilein> "maybe use puts instead of print"
<yorickpeterse> Ah yeah, that would be correct :)
<Nameone> got it working cheers
<Nameone> if i want to use a gem which is on my local machine
<Nameone> do i do a require'/directory/gem'?
<Harzilein> Nameone: no
<judofyr> Nameone: do $LOAD_PATH << 'directory/gem/lib'
<judofyr> Nameone: then you can require as usual
<Nameone> judofyr: gem 'ruby-mysql', :path => "vendor/static_gems/ruby-mysql-2.9.3"
<Nameone> should work too?
<yorickpeterse> That is if you use bundler
<judofyr> Nameone: in Gmefile, yes
<shevy> ewwww bundler
<yorickpeterse> Lets not discuss that, might as well discuss Vim + Emacs and the whole load :)
<judofyr> VIM!
<shevy> EMACS!
<judofyr> Emacs sux lol
Foxmaster has joined #ruby-lang
<judofyr> lolsux*
<shevy> I think both suck
<Nameone> aha
mssola has joined #ruby-lang
datanoise has joined #ruby-lang
jtoy has joined #ruby-lang
Fullmoon has joined #ruby-lang
jperry has joined #ruby-lang
heftig has joined #ruby-lang
francisfish has joined #ruby-lang
wardrop has joined #ruby-lang
<Nameone> Woo finally getting the hang of it!
<judofyr> Nameone: \o/
jobicoppola has joined #ruby-lang
<Nameone> Much appreciated for the help guys!
gd_ has joined #ruby-lang
<gd_> hi all.
mistym has joined #ruby-lang
<gd_> I'm using rack to implement a simple mock service which recieves a lot requests/s. Now I'm facing that my windows system is running out of sockets cause they are all in TIME_WAIT state. Even if i just do def call; return Rack::Response.new.finish; end
<gd_> Is there a way to get around this?
<gd_> Not by tuning my systems socket layer but my code...
tomzx has joined #ruby-lang
<heftig> the client isn't closing the socket
<Nameone> gsub is being a little annoying with the + character I'm trying to replace, any idea why?
<gd_> heftig: http = Net::HTTP.new(@host, @port); res = http.request_post(path, body, {'Content-Type' => "'application/soap+xml'"} )
<Nameone> cc2 = country_code.gsub(/+/, 'replaced ')
<Nameone> target of repeat operator is not specified: /+/
<gd_> heftig: i thought it is closed right after the method call?!
<heftig> apparently not.
<gd_> :)
<judofyr> gd_: use the block form to automatically close
<judofyr> "Net::HTTP::start immediately creates a connection to an HTTP server which is kept open for the duration of the block."
<judofyr> "If you wish to re-use a connection across multiple HTTP requests without automatically closing it you can use ::new instead of ::start. request will automatically open a connection to the server if one is not currently open. You can manually close the connection with finish."
<gd_> judofyr: :) thnx a lot
wardrop has joined #ruby-lang
<Nameone> or am i doing it completely wrong
loggerbot711321 has joined #ruby-lang
<judofyr> Nameone: /+/ doesn't make sense. /a+/ matches any number of "a". e.g. "a", "aa", "aaa", "aaaa"
<judofyr> Nameone: if you want a plus, you must escape it
<Nameone> escape it?
<Nameone> if the input has a plus, i want it removed
<Nameone> i was using an if statement before, but it seems to long winded
machine1 has joined #ruby-lang
<Nameone> thought it would be possible with gsub?
<tobiasvl> do you know what escaping is
<Nameone> no :( (still a n00b)
<tobiasvl> \+
<judofyr> Nameone: simply place a \ in front of it as tobiasvl said :)
<tobiasvl> the reason it says "target of repeat operator is not specified: /+/" is that + is a special character in that context
<tobiasvl> so you need to tell ruby that you actually mean a literal plus sign
<judofyr> Nameone: in this case, you can also just use a string: .gsub("+", "")
<tobiasvl> yeah, that's probably easier
<Nameone> hmm
<Nameone> http://pastebin.com/bYu1tHYa - I've got that currently, should work no
<tobiasvl> correcting myself: + is a special character when it's placed between two slashes (when it's inside a regular expression)
<tobiasvl> Nameone: hehe, no
<Nameone> =[ (feel stupid)
<tobiasvl> you just need "" or // around the +
<tobiasvl> not both
<tobiasvl> and you just need the \ if you're using the slashes
<tobiasvl> so either "+" or /\+/
<Nameone> correct! Thanks for taht
<Nameone> that
<tobiasvl> np
<Nameone> someone was saying to put it in an if statement, is it worth doing?
<Nameone> 'if + is found using gsub, do this'
<tobiasvl> well, that depends
<judofyr> Nameone: if you use .gsub it will always return a copy and you can't really figure out if it matched or not
<tobiasvl> do you want to do anything in particular if + is found?
<Nameone> basically, if a user inputs +449384567 as a telephone number
<Nameone> i want it to get rid of the +
mstratman has joined #ruby-lang
<Nameone> and then use that variable in another part of my code
jtoy has joined #ruby-lang
<judofyr> Nameone: so if input is: "Hello +123 world +456", you want to convert it to "Hello 123 world 456" and store [123, 456] ?
<Nameone> They will only be inputting numbers, but along those lines yes
<heftig> + is a valid part of a telephone number, you shouldn't strip that
<Nameone> the way the numbers are stored are without the +
<heftig> nonsense
<heftig> telephone numbers are not decimal numbers
<Nameone> so are strings no?
<Nameone> (excuse my stupidity)
<heftig> telephone numbers are strings with certain formatting, which is location-dependent
<tobiasvl> yeah, telephone numbers are strings
<Tasser> right, the american way to describe phone numbers with letters :-)
<tobiasvl> hehe
<tobiasvl> well, that's not really relevant
<tobiasvl> strings can consist solely of numbers, no problem
<tobiasvl> you wouldn't add two phone numbers, would you
nofxxxx has joined #ruby-lang
<Nameone> true
wardrop has joined #ruby-lang
grin has joined #ruby-lang
<Tasser> one cultural thing from america that would even be worth importing
<Nameone> haha
Slackwise has joined #ruby-lang
<Nameone> http://pastebin.com/4FasfgnY - would it be simple to change this so i could pass numbers instead of country codes?
<Nameone> eg isocountrycodes.find(44)
<Nameone> which would find the country
bglusman has joined #ruby-lang
<tobiasvl> aha, thats's why you asked about reversing a hash earlier?
dv310p3r has joined #ruby-lang
<Nameone> yeah
<Nameone> find the best way to do ti =[
<Nameone> all new to me ruby
<judofyr> Nameone: have you tried isocountrycodes.find(44) ?
<tobiasvl> i think it already supports it?
<tobiasvl> yeah
<tobiasvl> i'm reading the documentation now
<tobiasvl> hehe
<Nameone> yay
<Nameone> it did work
mistym has joined #ruby-lang
<Nameone> however it returned the bahamas
<Nameone> instead of the uk
<Nameone> bahamas = 044
<Nameone> oh wait hold on
<judofyr> Nameone: I don't think it's the telephone prefix
<Nameone> yeah,i just figured
grin has joined #ruby-lang
<Nameone> i edited the first entry for telephone not the rest
<Nameone> if i add my own variable in the rb file for telephone numbers
<Nameone> should be simple to parse?
<Nameone> or will i need to recode the whole thing
sandbags has joined #ruby-lang
hynkle has joined #ruby-lang
<Nameone> guess i might swell go through and add all the calling codes =[
<tobiasvl> there might even be a gem for it though
<tobiasvl> you should research that before doing all the tedious work yourself
<tobiasvl> ah, there's a YAML file in that first link, you can just serialize that
<Nameone> hmm, thing is the gem already comes with its own .rb file which has all of the data
<Nameone> for each country on it
<Nameone> including abbreviations etc
imajes has joined #ruby-lang