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/
snip_it has joined #ruby
i8degrees has joined #ruby
taipres has joined #ruby
jergason has joined #ruby
csavola has joined #ruby
baroquebobcat has joined #ruby
jensn has joined #ruby
Illiux has joined #ruby
clockwize has joined #ruby
Squarepy has joined #ruby
pu22l3r has joined #ruby
colossal7 has joined #ruby
jaywastaken has joined #ruby
hadees has joined #ruby
QKO has joined #ruby
tommyvyo has joined #ruby
kennym has joined #ruby
<kennym> hi, can you tell me what this construct is called like: #{ }
<cespare> kennym: string interpolation
<apeiros_> kennym: interpolation sequence
<kennym> thank you guys
BigFatFatty has quit [#ruby]
colint has joined #ruby
mifadir has joined #ruby
Seisatsu has joined #ruby
zulax has joined #ruby
nvez_ has joined #ruby
justinmcp has joined #ruby
josefig has joined #ruby
colossal7 has joined #ruby
fielding has joined #ruby
waxjar has joined #ruby
fielding has quit [#ruby]
Faris has joined #ruby
justfielding has joined #ruby
Asher has joined #ruby
aaronlevy has joined #ruby
<denom> can I put requires statements into rake files?
hooper_ has joined #ruby
Dangr_ has joined #ruby
sarmiena_ has joined #ruby
matthias3 has joined #ruby
<sarmiena_> I'm getting a bit of trouble on line 18 of this github project
<sarmiena_> ruby 1.9.2 is complaining of an invalid multibyte sequence for \xff
<sarmiena_> i'm not an expert on byte sequences or character encoding, can someone shed some light on this issue
<sarmiena_> ?
badjo has joined #ruby
<denom> sarmiena_, where is the project?
<sarmiena_> oh crap haha
<sarmiena_> denom
<denom> sarmiena_, what are these, invalid utif bytes that nee dto e stripped?
<denom> oh man, I see what you are doing now
<sarmiena_> denom: yeah. i'm allowing for users to add css to their sites. i want to make sure they aren't adding dangerous stuff
<sarmiena_> apparently you don't like the solution :X
<sarmiena_> haha
<denom> how is line 18 be giving you problems?
colossal7 has joined #ruby
<aaronlevy> How can I convert the contents of a file to a json string? foo = JSON.dump(File.read(path)) gives error "only generation of json objects or arrays allowd" (wrapping in "" gives same error, and wrapping in [] doesn't escape newlines.
<sarmiena_> denom: invalid multibyte sequence
<apeiros_> aaronlevy: did you read the error you get?
<apeiros_> I mean it totally tells you what's wrong with what you try.
<sarmiena_> so if i go into irb and type /\xff/ alone, it complains about invalid multibyte sequence
<aaronlevy> apeiros_: If you are familiar with ruby maybe. I'm not (this is a minor change to a chef script)
<apeiros_> sarmiena_: /\xff/n
<apeiros_> aaronlevy: only generation of json objects or arrays allowd
<apeiros_> that's totally NOT ruby specific
<apeiros_> it's plain english
<sarmiena_> apeiros_: what is \xff exactly? and why did it need that trailing n?
<apeiros_> in json, the root *must* be an object or an array
<apeiros_> sarmiena_: \xff is a byte with ordinal value 255
<apeiros_> and that byte alone is not valid in utf-8
<denom> aaronlevy what do you mean the newlines are not escaped?
<apeiros_> and since your file is treated as utf-8 (probably due to an `# encoding: utf-8` comment), your literals default to utf-8 too
<aaronlevy> still has "\n" rather than "\\n"
<sarmiena_> apeiros_: hmm. so line 18 on https://github.com/courtenay/css_file_sanitize/blob/master/lib/css_sanitize.rb should read ...
<denom> aaronlevy I guess I'm wondering why that matters?
zeshoem has joined #ruby
<denom> (maybe I dont understand)
<sarmiena_> sadf
<sarmiena_> it won't let me type it
<sarmiena_> haha
<sarmiena_> apeiros_: /\x7f-\xff]/n
<sarmiena_> so that's what it should be?
savage-_ has joined #ruby
<denom> sarmiena_, this is a character range in regex?
<sarmiena_> yes
<sarmiena_> it appears to be
<sarmiena_> from x7f to xff
<apeiros_> sarmiena_: sry, got interrupted - the n-flag in the regex tells ruby to treat the literal as binary
<sarmiena_> ohhhhhh
<apeiros_> I don't know how line 18 should read. I'm watching tv, so I won't bother, sry.
<sarmiena_> apeiros_: that's cool. thanks
Hornswoggles has joined #ruby
dagnachewa has joined #ruby
i8igmac has joined #ruby
colossal7 has joined #ruby
aaronlevy has quit ["Leaving"]
BunsAndGutter has joined #ruby
marknyc has joined #ruby
jxpx777 has joined #ruby
colossal7 has joined #ruby
eywu has joined #ruby
CannedCorn has joined #ruby
tvw has joined #ruby
sdwrage has joined #ruby
samsonjs_ has joined #ruby
niklasb has joined #ruby
colint has joined #ruby
pu22l3r has joined #ruby
orospakr has joined #ruby
wroathe has joined #ruby
evantravers has joined #ruby
sjang has quit [#ruby]
Hornswoggles has quit ["Leaving"]
ZenBalance has joined #ruby
<ZenBalance> When scraping a website with Nokogiri and grabbing all the <a> tags, what is the syntax to grab the name of the link (i.e. what shows up in the browser?) I seem to be able to grab the id and href values but not that inner html
TomJ has joined #ruby
cbuxton has joined #ruby
pu22l3r has joined #ruby
BunsAndGutter has joined #ruby
cloke_ has joined #ruby
banisterfiend has joined #ruby
noname has joined #ruby
jaywastaken has joined #ruby
pac1 has joined #ruby
thecreators has joined #ruby
wilmoore has joined #ruby
pu22l3r has joined #ruby
Seisatsu has joined #ruby
sizz has joined #ruby
samsonjs has joined #ruby
stephenjudkins has joined #ruby
cbuxton has joined #ruby
Keva161 has joined #ruby
zulax has joined #ruby
lewix has joined #ruby
wilmoore has joined #ruby
CacheMoney has joined #ruby
Jay_Levitt has joined #ruby
colossal7 has joined #ruby
skrewler has joined #ruby
phantomfake has joined #ruby
stephenjudkins has joined #ruby
yakko has joined #ruby
sorin has joined #ruby
skrewler has quit [#ruby]
colossal7 has joined #ruby
milkpost_ has joined #ruby
baniseterfiend` has joined #ruby
maletor has joined #ruby
dandrinkard has joined #ruby
sizz has joined #ruby
cantbecool has joined #ruby
fayimora has joined #ruby
stephenjudkins has joined #ruby
snip_it has joined #ruby
sizz has joined #ruby
justfielding has joined #ruby
fayimora has joined #ruby
cobragoat has joined #ruby
<cespare> Is there a convienent way to zip a single element with every element of some enumerable?
<cespare> i.e. better than this: list1.zip(['a'] * list1.length)
<baniseterfiend`> cespare: yes
<baniseterfiend`> cespare: list1.zip(['a'].cycle)
<cespare> baniseterfiend`: ah, that's a very slick method. Thanks!
peindt has joined #ruby
fayimora has joined #ruby
waxjar has joined #ruby
Guest36615 has joined #ruby
samit has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
phantomfake has joined #ruby
orospakr has joined #ruby
pu22l3r has joined #ruby
yakko has joined #ruby
samit has quit [#ruby]
phantomfake has joined #ruby
clockradio has joined #ruby
albemuth has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
<David_Miller> How can I checksum a string (any one-way hash function will do) and get an integer?
<David_Miller> digest/md5 gives me strings
jgrevich has joined #ruby
jgrevich has joined #ruby
<banisterfiend> David_Miller: wouldn't it be a particularly shit hash function if it's only 32 bit?
phantomfakeBNC has joined #ruby
adamkittelson has joined #ruby
<cespare> David_Miller: I believe #length meets your criteria ;P
jobicoppola has joined #ruby
<cespare> well, not strictly "integer"
<samuelkadolph> "a".hash
Rishi has joined #ruby
<David_Miller> I just want to evenly and randomly distribute given strings randomly from 1-60
<David_Miller> so I don't need that many bits
<David_Miller> .hash will work, thanks
statonjr has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
_phantomfake has joined #ruby
s_h_r has joined #ruby
milkpost_ has joined #ruby
Seisatsu has joined #ruby
hmans has joined #ruby
Araxia_ has joined #ruby
fayimora_ has joined #ruby
milkpost_ has joined #ruby
anekos_ has joined #ruby
wroathe has joined #ruby
Illiux has joined #ruby
fragmachine has joined #ruby
hooper_ has joined #ruby
<thomasfedb> fragmachine, what?
<fragmachine> I want to gsub | + - all at once
<fragmachine> it only picks up the first match though
<thomasfedb> fragmachine, ah. /[\|+-]/ should wok
<thomasfedb> *work
<cespare> fragmachine: escape the + as well
Illiux has joined #ruby
<cespare> and do what thomasfedb said
<fragmachine> thanks that works perfect
<fragmachine> does putting things in brackets make regex read them all?
<thomasfedb> fragmachine, it means "any of"
<fragmachine> awesome
<fragmachine> I was doing massive chains of gsubs before haha
<cespare> fragmachine: look up "character classes"
<fragmachine> ok cool
munx has joined #ruby
fayimora has joined #ruby
nyrb has joined #ruby
<David_Miller> I found out that String.hash is not dependable across systems
<David_Miller> but I can get an md5 digest and then use String.hex to get an integer
matthias_ has joined #ruby
p0y has joined #ruby
milkpost_ has joined #ruby
kuzushi has joined #ruby
tk__ has joined #ruby
jaywastaken has joined #ruby
jbw_ has joined #ruby
jergason has joined #ruby
orospakr has joined #ruby
rinu has joined #ruby
twock has joined #ruby
eywu has joined #ruby
wilmoore has joined #ruby
sdwrage has joined #ruby
cmdlrn has joined #ruby
i8igmac has joined #ruby
_|christian|_ has joined #ruby
friskd has joined #ruby
jaywastaken has joined #ruby
epochwolf has joined #ruby
munx has joined #ruby
Azure has joined #ruby
pu22l3r has joined #ruby
p0y has joined #ruby
dandrinkard has joined #ruby
apok has joined #ruby
<friskd> how do i check what version of a gem i have
<thomasfedb> friskd, `gem list --local` should print the versions
bluecatze has joined #ruby
<bluecatze> can i add keys to a hash after it has been initialized
<banisterfiend> bluecatze: yes and no
ozzloy has joined #ruby
<bluecatze> I'm trying to loop through a text file and use some of the lines as keys then other lines as values to those keys
<banisterfiend> bluecatze: yes you can
<banisterfiend> bluecatze: h = {}
<banisterfiend> bluecatze: h[:hello] = "yo"
gokul has joined #ruby
<bluecatze> so I have to assign the key with a value, I can't just assign the key by itself? Just to clarify
notbrent has joined #ruby
droptone has quit [#ruby]
akem has joined #ruby
brainopia has joined #ruby
<thomasfedb> bluecatze, that is correct.
cmdlrn has quit ["Leaving"]
cjs226 has joined #ruby
<bluecatze> thank you. one last question, if I wanted to use a local variable as a key, how would I do that, I'm using hash[:key] = "value" to assign
chaitanya has joined #ruby
<bluecatze> for example if my local variable is hash[:unique_id] = "vale" it assigns the string "unique_id" as the key instead of the local variable
odinswand has joined #ruby
<bluecatze> I did just hash[local_variable] = "value" and nothing gets assigned
<thomasfedb> bluecatze, either: 1) no you didn't, or 2) yes it did
<bluecatze> ok ill try messing with it more
opin_ has joined #ruby
<bluecatze> yeah it was about scope, thanks for pointing that out
xaxxon has joined #ruby
nerdy has joined #ruby
rinu has joined #ruby
chaitanya has joined #ruby
savage- has joined #ruby
moeSeth has joined #ruby
rinu has joined #ruby
fayimora has joined #ruby
ZenBalance has joined #ruby
wilmoore has joined #ruby
sdwrage has joined #ruby
kenperkins has joined #ruby
sdferfx has joined #ruby
<friskd> Hey guys, i'm looking for a good html parser that will allow me to pass it the html of page. Extract out all the text and just leave me w/ an html tree.
<friskd> So that i can write out the html tree to a file.
<thomasfedb> nokogiri
<RubyPanther> friskd: Hpricot works well for that, too
<RubyPanther> Hpricot is very fast at dealing with (potentially ill-formed) HTML
<friskd> i'm trying to find what funciton call i would use to just get the html tree
TomJ has joined #ruby
TomJ has joined #ruby
MrCheetoDust has joined #ruby
MrCheetoDust has joined #ruby
<thomasfedb> friskd, it will be a bit more complex than that.
chaitanya has joined #ruby
<friskd> thomasfedb:
<friskd> ?
acrussell has joined #ruby
<acrussell> I a trying to build a gem but it is not finding some native libs I have installed. I can link against tese libs without a problem when I try to compile and link a C program as a test. I tried messing around with ENV variables but witjout any luck http://www.pastie.org/3359238
<acrussell> how do I get ruby to find these libs ?
<RubyPanther> friskd: ruby -r hpricot -r open-uri -e 'puts Hpricot(open("http://slashdot.org/").read).inner_text' | less
<RubyPanther> Hpricot tastes great, _and_ is less filling!
<RubyPanther> I love 5 year old C extensions that happily compile and work with new versions of Ruby... that is good clean code!
banisterfiend has joined #ruby
ryanf__ has joined #ruby
<friskd> RubyPanther: that is is great!
gianlucadv has joined #ruby
<RubyPanther> I think it is the opposite of what you asked, but that one is probably also trivial
<friskd> o. wait.
<friskd> yea. i need the html structure
<friskd> not the text
chimkan_ has joined #ruby
Jarred has joined #ruby
<sdferfx> Does nokogiri or hpricot allow us to build a tree of DOM objects? We don't want innerhtml necessarily, we want something like Python's etree allows where we can export the structure of the document. See http://lxml.de/tutorial.html#the-element-class .
<thomasfedb> sdferfx, yes.
<thomasfedb> sdferfx, though you will need to traverse the tree
<sdferfx> thomasfedb, in which library, nokogiri or hpricot or both?
zaydana has joined #ruby
<thomasfedb> sdferfx, either
<Jarred> Hi all. I'm trying to parse values within an XML document by its XPath using Nokogiri. Nokogiri is just returning an empty array for the given XPath. The XPath is correct -- I used Firedebug to get it. Here's the XPaths and the XML document --> https://gist.github.com/bf2f78b63718e469222c. What am I doing wrong?
banisterfiend has joined #ruby
Jarred1 has joined #ruby
<Jarred1> Sorry, my computer crashed.
chaitanya has joined #ruby
banister_ has joined #ruby
sjang1 has joined #ruby
<ZenBalance> Jarred1: I am working with nokogiri right now as well
<ZenBalance> Jarred1: have you checked your cookies?
<ZenBalance> Jarred1: Some websites require that you pass a cookie as well when opening the url in order to get the correct string
<ZenBalance> In my case, I've realized that some ID's just don't seem to work so I broke it down and worked around them
emiltin has joined #ruby
TheTFEF has joined #ruby
TheTFEF has joined #ruby
stephenjudkins has joined #ruby
bintut has joined #ruby
ceej has joined #ruby
jaywastaken_ has joined #ruby
<ceej> evening. is it possible to open a file read it into a variable and also get it's last modified date in one File.open block?
<rippa> ceej: File#mtime
<ceej> rippa: can I do that inside of a File.open block though?
<RubyPanther> ceej: ruby -e 'File.open("/proc/cpuinfo","r") {|f| puts f.mtime }'
<rippa> ceej: File.open(file) {|f| [f.mtime, f.read]}
<ceej> ah ty :)
<ceej> you've made my late night :)
kmurph79 has joined #ruby
prtksxna has joined #ruby
thone has joined #ruby
baroquebobcat has joined #ruby
<ZenBalance> Does anyone have any resource to point me to on how to throttle a scraper?
JohnBat26 has joined #ruby
Morkel has joined #ruby
gokul has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
aetaric has joined #ruby
mrmist has joined #ruby
mikepack has joined #ruby
dinduks_ has joined #ruby
robbyoconnor has joined #ruby
y3llow_ has joined #ruby
vraa has joined #ruby
bier_ has joined #ruby
Seisatsu has joined #ruby
sizz_ has joined #ruby
justinmcp has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
November has joined #ruby
yekta has joined #ruby
looopy has joined #ruby
bgupta has joined #ruby
tobym has joined #ruby
stephenjudkins has joined #ruby
zeeshoem has joined #ruby
stayarrr has joined #ruby
n3m has joined #ruby
moeSeth has joined #ruby
patricksroberts has joined #ruby
alindeman has joined #ruby
Synthead has joined #ruby
ben_alman has joined #ruby
CacheMoney1 has joined #ruby
pkondzior has joined #ruby
denysonique__ has joined #ruby
mike has joined #ruby
nemesit has joined #ruby
jaywastaken has joined #ruby
Mekkis_ has joined #ruby
ph^ has joined #ruby
LowKey has joined #ruby
SirFunk has joined #ruby
ElderFain has joined #ruby
examancer has joined #ruby
Seppman has joined #ruby
denysonique__ has joined #ruby
mrmist has joined #ruby
ernad has joined #ruby
libertyprime has joined #ruby
ernad has joined #ruby
y3llow_ has joined #ruby
nick_h has joined #ruby
dinduks__ has joined #ruby
bjensen has joined #ruby
sizz has joined #ruby
Soliah has joined #ruby
dpiwowar1ki has joined #ruby
_LowKey has joined #ruby
twock_ has joined #ruby
November has joined #ruby
n3m has joined #ruby
looopy has joined #ruby
yekta has joined #ruby
denysonique__ has joined #ruby
jaywastaken has joined #ruby
Synthead has joined #ruby
azureye has joined #ruby
emmanuelux has joined #ruby
Karmaon has joined #ruby
iocor has joined #ruby
maletor has joined #ruby
Sliker has joined #ruby
November has joined #ruby
nd_____ has joined #ruby
looopy has joined #ruby
adman65 has joined #ruby
marcin_m has joined #ruby
frontendloader has joined #ruby
Mekkis has joined #ruby
tobym has joined #ruby
Evixion has joined #ruby
conntrack has joined #ruby
Karmaon has joined #ruby
alindeman has joined #ruby
November has joined #ruby
conntrack has joined #ruby
Sliker has joined #ruby
sterNiX has joined #ruby
conntrack has joined #ruby
randym has joined #ruby
csherin has joined #ruby
conntrack has joined #ruby
nemesit has joined #ruby
apeiros_ has joined #ruby
vdemedes has joined #ruby
<vdemedes> Hello!
<vdemedes> Could you please point me to pleasure-to-work-with gem for sending GET/POST requests?
conntrack has joined #ruby
ePirat has joined #ruby
jbw_ has joined #ruby
DDAZZA has joined #ruby
Dave has joined #ruby
Dave has quit [#ruby]
pstuteville has joined #ruby
pstuteville has joined #ruby
Sliker has joined #ruby
codespectator has joined #ruby
shevy has joined #ruby
technikhil has joined #ruby
DDAZZA has joined #ruby
alem0lars has joined #ruby
<alem0lars> i need to create an expression parser. I toke a look at parslet, treetop, citrus getting started. Which one do you suggest me?
iocor has joined #ruby
iocor has joined #ruby
<alem0lars> Expressions that I need to parse aren't very complex, so I don't need a full featured PEG
lorian has joined #ruby
Oprichnik has joined #ruby
pstuteville has joined #ruby
thats_my_hat has joined #ruby
mxweas_ has joined #ruby
<thomasfedb> alem0lars, treetop is quite good. i haven't user the others
charles_____ has joined #ruby
<alem0lars> thomasfedb: Is there a more in depth documentation than in the documentation page of the official site?
i8igmac_ has joined #ruby
<thomasfedb> alem0lars, not really.
<alem0lars> thomasfedb: ah ok. thanks
thats_my_hat has joined #ruby
<thomasfedb> alem0lars, sorry I couldn't be of more help/
mk03 has joined #ruby
<alem0lars> thomasfedb: thanks anyways
thats_my_hat has joined #ruby
<banister_> thomasfedb: do u wanna try a multiplayer irb session?
<thomasfedb> banister_, um... ok i guess
<thomasfedb> banister_, how do we pick the winner?
<banister_> thomasfedb: well, you can try to distance my irb instance
<banister_> if i stop talking then you know youve won
<thomasfedb> hmm
<thomasfedb> so. how do we go about this?
TomJ has joined #ruby
TomJ has joined #ruby
<banister_> thomasfedb: are you on 1.9.3 and on *nix ?
i8igmac has joined #ruby
i8igmac_ has joined #ruby
thats_my_hat has joined #ruby
<thomasfedb> yep
* thomasfedb changes ruby version
<banister_> thomasfedb: ok, just type: gem install pry-remote-em
<banister_> then once that is complete
<banister_> thomasfedb: i gave u l/p in PM
<thomasfedb> hokay
davidpk has joined #ruby
<banister_> let me know when u join
thats_my_hat has joined #ruby
dinduks has joined #ruby
dnordstrom has joined #ruby
johanhsfy has joined #ruby
dinduks_ has joined #ruby
<thomasfedb> banister_, is rubygems.org under high load or is it just me?
berserkr has joined #ruby
<banister_> thomasfedb: yeah it seems screwy for me too
heldopslippers has joined #ruby
<banister_> thomasfedb: bad timing :(
<banister_> thomasfedb: ah well, we can give it a go another day
snearch has joined #ruby
thats_my_hat has joined #ruby
samuel02 has joined #ruby
<thomasfedb> banister_, pest.
clyfe has joined #ruby
<clyfe> rubygems is down :(
<banister_> thomasfedb: ?
<clyfe> what can we do ?
<banister_> clyfe: time for pr0n i guess
<thomasfedb> clyfe, eat noodles and rant.
vdemedes has joined #ruby
clockwize has joined #ruby
<vdemedes> Hello
<vdemedes> Could you please help me to solve this problem, related to inner classes http://drp.so/d49b74
<vdemedes> I created quick code snippet to demonstrate what I want
<banister_> vdemedes: you cant access it
<banister_> vdemedes: ruby doesnt really have inner classes
Mon_Ouie has joined #ruby
<banister_> Mon_Ouie: wb monny ;)
<vdemedes> banister_: But how do libraries do that? For example, Twitter::Search.new, it needs access to tokens
<vdemedes> how does it implement that?
<banister_> vdemedes: what tokens?
<vdemedes> banister_: oAuth tokens
<banister_> vdemedes: well it's obviously not working the way you think it is, so read the source
<vdemedes> so, that B class is fully separate from A, right?
<banister_> i have no idea what it's doing, but it's def. not accessing ivars from the outer class
<banister_> vdemedes: yes
<vdemedes> banister_: ok, thank you!
telling has joined #ruby
telling has joined #ruby
cek has joined #ruby
<cek> hey, wazap with rackpace / rubygems.org?
clockwize has joined #ruby
<fragmachine> can you use ruby for quick calculations on the command line without irb?
<fragmachine> like "ruby puts "hello world""
<xea_> ruby -e "puts 'hello world'
<fragmachine> awesome
<xea_> indeed :)
<apeiros_> or `ruby`, hit enter, type code, hit ctrl-d
<fragmachine> haha that's awesome too!
dinduks__ has joined #ruby
slicksik has joined #ruby
destructure has joined #ruby
<fred> apeiros_: fragmachine: 'irb'.
<apeiros_> fred: 'fragmachine: "…without irb?"'
<fred> oh, I'm blind, sorry.
Kambus has joined #ruby
AxonetBE has joined #ruby
thats_my_hat has joined #ruby
thats_my_hat has joined #ruby
dennda has quit ["Thanks"]
ChampS666 has joined #ruby
thats_my_hat has joined #ruby
jaywastaken has joined #ruby
looopy has joined #ruby
yxhuvud has joined #ruby
trivol has joined #ruby
rushed has quit [#ruby]
jamw has joined #ruby
bluOxigen has joined #ruby
tuxaddicted has joined #ruby
thats_my_hat has joined #ruby
thats_my_hat has joined #ruby
eykosioux has joined #ruby
mengu has joined #ruby
eykosioux has quit [#ruby]
mengu_ has joined #ruby
mengu_ has joined #ruby
thats_my_hat has joined #ruby
ikaros has joined #ruby
nari has joined #ruby
ohcibi has joined #ruby
thats_my_hat has joined #ruby
thats_my_hat has joined #ruby
<shevy> right said fred
<shevy> I'm too sexy for my ...
thats_my_hat has joined #ruby
hubub has joined #ruby
thats_my_hat has joined #ruby
iocor has joined #ruby
hubub has joined #ruby
hubub has joined #ruby
hubub has joined #ruby
AxonetBE has joined #ruby
pac1 has joined #ruby
sayakb has joined #ruby
iocor has joined #ruby
pac1 has joined #ruby
davidpk has joined #ruby
p0y has joined #ruby
IAD has joined #ruby
fayimora has joined #ruby
relix has joined #ruby
sterNiX has joined #ruby
p0y has joined #ruby
Sliker has joined #ruby
overclucker has joined #ruby
Morkel has joined #ruby
rushed has joined #ruby
rootapex has joined #ruby
burgestrand has joined #ruby
<overclucker> i'm getting 'undefined local variable or method `exitstatus' for main:Object (NameError)' after these lines in my script: 'output = IO.popen('xset -q') { |pipe| pipe.gets }; $?.exitstatus' is this a correct way of getting return status?
sorin has joined #ruby
iocor has joined #ruby
fallenstorm has joined #ruby
<fallenstorm> what func makes from number 123 string "000000123" fixed length filled with default value?
MrGando has joined #ruby
codespectator has joined #ruby
alem0lars has joined #ruby
<apeiros_> fallenstorm: sprintf, to_s+ljust, maybe others
<overclucker> "%08d" % integer
<cek> rjust
jobicoppola has joined #ruby
laen_ has joined #ruby
banseljaj has joined #ruby
<fallenstorm> apeiros_ tnx
danslo has joined #ruby
waxjar has joined #ruby
daglees has joined #ruby
UidX has joined #ruby
chimkan has joined #ruby
<UidX> how do i make "rakefile" things?
<UidX> "Gemfile" and "Rakefile" ?
Sliker has joined #ruby
<banister_> UidX: Gemfile, Rakefile, Thorfile, .gemspec, .rspec, .travis.yml, .irbrc, there's too much to learn!
<UidX> im totally new to ruby and i made an rb file for my siriproxy plugin.. and it seems that it requires that rakefile, gemspec and gemfile
canton7 has joined #ruby
Indian has joined #ruby
Alcohol has joined #ruby
`brendan has joined #ruby
<`brendan> morning all
<Alcohol> Please vote http://missdv.ru/vote/566/
statonjr has joined #ruby
burgestrand1 has joined #ruby
cableray has joined #ruby
<shevy> hmm
<shevy> as great as ruby is
<shevy> something I'd wish there'd be a better language
Skaag has joined #ruby
looopy has joined #ruby
trivol has joined #ruby
<apeiros_> shevy: create one
Ownatik has joined #ruby
pu22l3r has joined #ruby
<shevy> apeiros_ yeah I often want to, but the problem is that it takes so much effort and time. I don't think I have that available anymore :(
<apeiros_> :)
Rishi_ has joined #ruby
mengu has joined #ruby
snearch has joined #ruby
_|christian|_ has joined #ruby
csherin has joined #ruby
<UidX> can you guys access github right now?
<banister_> UidX: no
S1kx has joined #ruby
nemesit has joined #ruby
visof has joined #ruby
<visof> hello
<visof> is there random selection function for a list?
Nss has joined #ruby
fr0gprince_mac has joined #ruby
chimkan has joined #ruby
<banister_> visof: sample
<banister_> visof: [1,2,3,4,5.sample
<banister_> visof: [1,2,3,4,5].sample
S2kx has joined #ruby
dnjaramba has joined #ruby
jbpros has joined #ruby
<shevy> visof also array.shuffle.first could work in case .sample would not
dnjaramba has joined #ruby
vladyn has joined #ruby
dnjaramba has joined #ruby
kirun has joined #ruby
timonv has joined #ruby
user__ has joined #ruby
dagnachewa has joined #ruby
tomb has joined #ruby
medik has joined #ruby
nyrb has joined #ruby
Sliker has joined #ruby
overclucker has quit [#ruby]
zulax has joined #ruby
zastaph has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
dagnachewa has joined #ruby
dnjaramba has joined #ruby
p0y_ has joined #ruby
niklasb has joined #ruby
bbttxu_ has joined #ruby
emocakes has joined #ruby
zulax has joined #ruby
dnjaramba has joined #ruby
justfiel1ing has joined #ruby
dinduks__ has joined #ruby
dyer has joined #ruby
dyer has joined #ruby
Skaag_ has joined #ruby
p0y has joined #ruby
dnjaramba has joined #ruby
akem has joined #ruby
Sliker has joined #ruby
p0y_ has joined #ruby
<linduxed> so i started using rbenv yesterday, and it seems like the gems aren't working
<linduxed> or well no
jwmann has joined #ruby
<linduxed> not that they're not working, they do if i do bundle exec something
<linduxed> but i can't just type cucumber
<linduxed> or something like that
<linduxed> is there some command i need to run to make those commads appear?
<shevy> ^^^ another example why people shouldn't use rbenv or RVM ;)
<shevy> they add a layer of complexity over a given problem
dnjaramba has joined #ruby
<linduxed> shevy: probably, but then again it's far easier than combating the different versions that ruby projects have
andrew_au has joined #ruby
<linduxed> i'm only starting out with ruby really, but the projects i'm already in contact with span over three different versions
<linduxed> and then you tell me that i shouldn't use rbenv or RVM...
<linduxed> sorry but i have no idea how to do it otherwise
<shevy> linduxed oh, I don't specifically so to not use them
<shevy> I mean if they solve a problem, it's great
<shevy> what you should do is try to give a better problem description. "it seems like the gems aren't working" you should follow up on that, and also upload the result of "gem env" somewhere
anjonas has joined #ruby
<shevy> for comparison, this is my "gem env" result linduxed http://pastie.org/3361251
<anjonas> hi guys
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo_ has joined #ruby
bluenemo_ has joined #ruby
<andrew_au> Hi, I used ruby on rails ages ago but completely forgotten it all, I was wondering if anyone can say if a small script is in just ruby or needs rails?
waxjar has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
<anjonas> im having trouble with using the split method
<anjonas> week_meny.push(node.text.match(/Mån(.*)/).split('•'))
<anjonas> i get the error block in get_meny': undefined method `split' for nil:NilClass (NoMethodError)
codespec_ has joined #ruby
andrew_au has quit [#ruby]
Sliker has joined #ruby
<shevy> anjonas you try to apply the .split method on a nil object
<shevy> whatever week_meny.push(node.text.match(/Mån(.*)/) results, must be nil, so that is where your error is
dnjaramba has joined #ruby
iocor has joined #ruby
<linduxed> shevy: in that case my question would be the following
Skaag has joined #ruby
JohnBat26 has joined #ruby
<linduxed> i've used rbenv to install ruby 1.9.2-p290. along with it came rubygems 1.8.10 and most likely some other stuff. when i run "bundle show cucumber" (cucumber being one of the gems i've installed with bundle install) then it shows me that it' installed it in /usr/lib/ruby/gems/1.9.1/gems/cucumber-1.1.4
<linduxed> however when i run "gem list " i only get rdoc, rake and minitest
<linduxed> i guess this is due to it being a 1.9.1 gem
<linduxed> but i'm not quite sure
<shevy> can't you switch rbenv versions context?
<linduxed> yes i can, let me test
<shevy> I myself install ruby into /Programs/Ruby/VERSION_HERE and just change a symlink to use another version
<linduxed> hmmm
<linduxed> can't switch
<linduxed> when i run "rbenv versions" i only have one
raingrove has joined #ruby
richo has joined #ruby
richo has joined #ruby
<shevy> I dont use either, but with rvm you can switch like so:
<shevy> rvm --default use 1.9.3
<shevy> you have to find out where gem stored your gems too
<shevy> for me here, all gems reside under /usr/lib/ruby/gems/1.8/cache/
<linduxed> yeah i know, i used to type "rvm use someversion"
<richo> is there a teardown equivalent to #intitialize ?
<shevy> but btw, since gem are just tarballed .gem files, you could locate them and install them even by managing the dependency on your own
<shevy> gem install --ignore-dependencies *.gem
<shevy> once you found out where your gems are that is ;)
<shevy> richo what means "teardown"?
<linduxed> shevy: post-test actions
<shevy> hmm
<richo> teardown is the wrong word maybe, in python we use __init__() for when an object is created, and __del__ for when the object reaches refcount 0 and is gc'd
dyer has joined #ruby
<shevy> I dont think ruby has anything like __del__
<richo> technically though I may be looking for an atexit(3) hook though
<richo> *shrug*, I shall deal with this later then
<richo> :D
<shevy> atexit can be a problem, I think it is tied down to a specific file, not an object
<shevy> I could be wrong though
<richo> well, the reason I may be looking for atexit is because I'd need the object to test that it's the last instance of it's metaclass
<richo> which probably means I'm better off just binding the action to interpreter exit and leaving it as an open bug
opin has joined #ruby
<richo> in theory, it should fire it's exit action twice if you create an object, hose it, create another one andt hen quit
<richo> but that's an edge case I can leave for now
<shevy> hmm
<shevy> there are some hooks ... like #included ... perhaps there may be another hook for your use case
<richo> it's ok, I'll fix all the core behavior and fix the silly little things lik eputting the users terminal back together later
<linduxed> gaaah
<linduxed> now when i run "bundle exec cucumber" on another computer, i get the following http://paste.pocoo.org/show/549317/
<linduxed> it looks like it's version related, but i'm not sure
<linduxed> what's weird is that the computer on which i wrote the code has the same rbenv setup and the same ruby version installed
<shevy> I think you use an old rubygems version
rippa has joined #ruby
beilabs_ has joined #ruby
<Rishi_> hey guys, does pygments.rb wrap code automatically?
SeanTAllen has joined #ruby
<Rishi_> I tried passing :nowrap => false and there seems to be no effect
Keva161 has joined #ruby
Asher has joined #ruby
eldariof has joined #ruby
jwmann has joined #ruby
statonjr has joined #ruby
mztriz has joined #ruby
berserkr has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
ZachBeta has joined #ruby
dnjaramba has joined #ruby
jwmann has joined #ruby
ZachBeta has joined #ruby
chimkan_ has joined #ruby
jxpx777_ has joined #ruby
dnjaramba has joined #ruby
kmurph79 has joined #ruby
td123 has joined #ruby
hubub has joined #ruby
waxjar has joined #ruby
ZachBeta has joined #ruby
denom has joined #ruby
AxonetBE has joined #ruby
dnjaramba has joined #ruby
davidboy has joined #ruby
methodfree has joined #ruby
beilabs_ has joined #ruby
<methoddk> ahh
mcmarto has joined #ruby
methoddk has joined #ruby
nemesit has joined #ruby
<linduxed> ok wtf is going on...
<linduxed> bundler is not in the list when i do "gem list"
<linduxed> but i can do bundler
<linduxed> ....
<linduxed> "bundle" i mean
<linduxed> hmmm, bundle is in /usr/bin/bundle
<linduxed> ooooh
<linduxed> now i get it
<linduxed> it's my residual system install
<linduxed> from my package manager
td123 has joined #ruby
CannedCorn has joined #ruby
gokul has joined #ruby
wroathe has joined #ruby
philips has joined #ruby
td123 has joined #ruby
<wroathe> So... why? 99.remainder(2) == 1 99.modulo(2) == 1 99 % 2 == 1 99.remainder(2).eql? 1
<wroathe> There are like 15 different ways you can do that expression in ruby
<rippa> why not
Jackneill has joined #ruby
<wroathe> I would argue adding those methods for readability is basically solving a non-existant problem.
kevinbond has joined #ruby
<wroathe> If you can't read 99 % 2 == 1 then you maybe shouldn't be programming.
<rippa> don't like - don't use
<wroathe> I get that :P I'm just wondering why the core team thought that was necessary.
<canton7> wroathe, there is a difference.... 99 % -2 == -1, 99.remainder(-2) == 1
<wroathe> But % and modulo are canonical?
<canton7> wroathe, similarly, -99 % 2 == 1, -99.remainder(2) == -1
davidcelis has joined #ruby
dnjaramba has joined #ruby
lewix has joined #ruby
mztriz_ has joined #ruby
dnjaramba has joined #ruby
<linduxed> ok so ruby version hell time
<linduxed> i've got rbenv installed
fallen has joined #ruby
<linduxed> lots of gems there, all working fine
<linduxed> same with RVM some time ago, although i don't use it anymore
<linduxed> however
<linduxed> some time ago i instlled ruby with my package manager
<linduxed> needed it to install RVM i think, don't remember
samsonjs has joined #ruby
<linduxed> the point is that this package manager tied ruby was still around
<linduxed> RVM seems to override it, but rbenv doesn't
<linduxed> or at least so it seems
<linduxed> because apparently when i did bundle install inside a rails director9y, directory it asked me for a password and it installed the gems into /usr/lib/ruby/.....
<linduxed> now i've uninstalled the package manager ruby, so it now works fine as it should with rbenv
jtrudeau has joined #ruby
Sliker has joined #ruby
<linduxed> but those gems, the /usr/bin/bundle command and most likely some other stuff are still around, untracked by neither the package mangear nor rbenv/rvm
jxpx777 has joined #ruby
<linduxed> so my question is, how do i figure out what to remove to clean up?
yoklov has joined #ruby
yoklov has quit [#ruby]
yoklov has joined #ruby
danslo has joined #ruby
gioele has joined #ruby
wroathe has joined #ruby
<gioele> It seems that webrick does not ignore the glob patterns passed in `:NondisclosureName`. Is there something that I am doing wrong?
ZachBeta has joined #ruby
sobering has joined #ruby
gokulnath has joined #ruby
oddraisin has joined #ruby
sdwrage has joined #ruby
richo has quit [#ruby]
<gioele> the code is at http://pastie.org/3361756 from line 47 to 53. `p config` confirms me that the :NondisclosureName has been set to an array of strings, just like I thought, although webrick does not honors it
philcrissman_ has joined #ruby
nyrb has joined #ruby
DDAZZA has joined #ruby
colossal7 has joined #ruby
CannedCorn has joined #ruby
s_h_r has joined #ruby
moshee has joined #ruby
s_h_r has quit [#ruby]
_obiJuan has joined #ruby
chimkan_ has joined #ruby
ZachBeta has joined #ruby
majnun has joined #ruby
ZachBeta has joined #ruby
mcmarto has joined #ruby
jwmann has joined #ruby
Sailias has joined #ruby
CannedCorn has joined #ruby
daniel_hinojosa has joined #ruby
kevinbond has joined #ruby
ikaros has joined #ruby
Sliker has joined #ruby
brainopia has joined #ruby
Mchl has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
mikepack has joined #ruby
emocakes has joined #ruby
peindt has joined #ruby
richo has joined #ruby
<richo> Is there a syntax to tell ruby to continue testing criteria in a case when block?
nemesit has joined #ruby
rflorianobr has joined #ruby
akiress has joined #ruby
burgestrand has joined #ruby
kurko_ has joined #ruby
gokulnath__ has joined #ruby
ZachBeta has joined #ruby
gokulnath has joined #ruby
Sliker has joined #ruby
AxonetBE has joined #ruby
cjs226 has joined #ruby
trivol has joined #ruby
waxjar has joined #ruby
LowKey has joined #ruby
<shevy> richo how do you mean
<shevy> multiple when conditions to be true at the same time?
<richo> Wait, I'll make a gist
<richo> yeah, pretty much
ZachBeta has joined #ruby
<shevy> hmm I dont think so.
<richo> it's ok, I'll just unwrap it a bit
looopy has joined #ruby
araujo has joined #ruby
rootapex has joined #ruby
plato has joined #ruby
<plato> hi guys, could anyone help me figure out why the hell i have a syntax error in this code? http://codepad.org/AeKh7uAK
sdwrage has joined #ruby
<plato> line 72
<plato> syntax error, unexpected '\n', expecting tCOLON2 or '[' or '.'
<plato> when i require 'pastebin'
ZachBeta has joined #ruby
gokulnath has joined #ruby
adeponte has joined #ruby
zastaph has joined #ruby
ZachBeta has joined #ruby
mdel has joined #ruby
<Mon_Ouie> *imported['json_data']['metakey'].each_pair do |imp_subkey, imp_subvalue|
<Mon_Ouie> There should be no "*" there
dyer has joined #ruby
<plato> what is the * doing
csherin has joined #ruby
<plato> and it seemed to fail without the *
<plato> awesome that worked
maletor has joined #ruby
yakko has joined #ruby
<gioele> is there a problem with rubygems.org? I pushed two versions of my gem but "gem install servedir" fails to install it. It says «ERROR: Could not find a valid gem 'servedir' (>= 0) in any repository»
<plato> it DOES fail without the * in a prior line, reconstructed=new(*imported['json_data']['datakey'])
<plato> what does the * do
<gioele> plato: make ruby use the elements of an array as a series of parameters to a function
peindt has joined #ruby
<gioele> plato: `x = [a, b, c]; fn(*x)` is equivalent to `fn(a,b,c)`
lewix has joined #ruby
<plato> that seems odd then
<plato> because reconstructed=new(*imported['json_data']['datakey']) should pass exactly one parameter
<plato> im surprised it doesn't correctly import when i remove that *
dinduks has joined #ruby
kmurph79 has joined #ruby
<plato> nvm it does. stupid error on my part
<plato> thanks gioele
<plato> so when i convert my Hypercard to json and back, i'm calling Hypercard.new() to build a new one
<plato> b=a.to_json; c=JSON.parse(b)
<plato> now a==c evaluates to false although they both contain the same information. the IDs are different. how do I override the == operator?
<plato> class Hypercard; def ==; #mycode; end; end
<plato> ?
<plato> or is it a class method
yekta has joined #ruby
<gioele> plato: class Hypercard; def ==(other); yourcode; end; end
<gioele> plato: it is an instance method, not class
<richo> is rubygems toast? I've pushed a few gems but none of the new versions are being seen by gem(1)
<gioele> richo: I have the same problem
<richo> Cool, not just me then. It shows up on the site. I couldn't even push gems earlier so hopefully it comes good soon
vrsparta has joined #ruby
alindeman has joined #ruby
Keva161 has joined #ruby
SeanTAllen has joined #ruby
yxhuvud has joined #ruby
nd_____ has joined #ruby
thorncp has joined #ruby
rgs_ has joined #ruby
Nanuq has joined #ruby
any-key has joined #ruby
mahlon_ has joined #ruby
Indian has joined #ruby
nyrb has joined #ruby
adeponte has joined #ruby
<plato> thanks again gioele
<gioele> plato: np
colossal7 has joined #ruby
richo has quit [#ruby]
<moshee> anybody got a link to some documentation for the VIM module for extensions in ruby?
<moshee> nvm, found it
<shevy> gioele usually I think it takes a while before it is available ... but today the site seems to have some lag or something
maletor has joined #ruby
akiress has joined #ruby
ZachBeta has joined #ruby
phux has joined #ruby
tk_ has joined #ruby
Asher has joined #ruby
Sivart has joined #ruby
mikepack has joined #ruby
banseljaj has joined #ruby
<banseljaj> Hi. is there a gem or library that can read XML data dumps?
josefig has joined #ruby
<gioele> banseljaj: Nokogiri can read XML
<gioele> banseljaj: what do you mean with "data dump"?
<banseljaj> gioele: and convert it into obects?
<banseljaj> I have a whole dictionary dumped as an xml file
kurko_ has joined #ruby
dagnachewa has joined #ruby
gokulnath has joined #ruby
niklasb has joined #ruby
peindt has joined #ruby
MetaCosm has joined #ruby
<dagnachewa> hello everyone
<yoklov> hm, can anybody help me make this better: http://pastebin.com/XH34Tefg ? i really hate the fact that i have that ``loop'' there
kurko_ has joined #ruby
samsonjs has joined #ruby
td123 has joined #ruby
csavola has joined #ruby
jgrevich has joined #ruby
ePirat has joined #ruby
ePirat has joined #ruby
<dagnachewa> I am reading the book begining ruby and in pry putx ?x gives me x instead of asci value of x
<dagnachewa> puts
<burgestrand> dagnachewa: it’s a change with 1.9 vs 1.8
<dagnachewa> burgestrand, what is the new way ?
<deryl> [4] pry(main)> puts ?x
<deryl> x
<burgestrand> dagnachewa: "x".ord
vraa has joined #ruby
<dagnachewa> burgestrand, ok
<shevy> yoklov: first iteratio, but this still sucks http://pastie.org/3362394 - you should break the components into methods
<shevy> yoklov I would throw away that code and assign the logic into methods
<dagnachewa> burgestrand, are there a place to find out uptodate ruby cahnges ?
<shevy> dagnachewa there are quite many changes. some websites have a few changes
<dagnachewa> x.ord
<dagnachewa> => 104
<dagnachewa> [9] pry(main)> X.ord
<dagnachewa> NameError: uninitialized constant X
<shevy> where does X come from?
<burgestrand> dagnachewa: "x".ord, not x.ord
<dagnachewa> sorry
<shevy> dagnachewa, it's a method on string objects
<dagnachewa> yep
<dagnachewa> method on string objects indeed
<shevy> here are a few more changes http://blog.mostof.it/ruby-1-9-changes-cherry-picked/#.TzbG0dFYo38
<dagnachewa> shevy, am likeing it this ruby
<shevy> dagnachewa you used another programming language before?
<dagnachewa> shevy, I work in not related field in gov , I finished cs in college in 2003 and am starting slowly to restart coding
<shevy> yeah but ... my question wasn't quite answered :( I'll take it as a "no" though then
<shevy> ;P
<dagnachewa> shevy, Begining Ruby is a great book since it shows all the stuff required to make a great ruby app :)
<shevy> I never read it
<shevy> I used the older pickaxe and liked it. Didn't like the recent pickaxe too much, mostly because I already knew most of it
<dagnachewa> shevy, I did a little c++ pascal , and on my own afterward I did a little python
<shevy> ah ok
<dagnachewa> shevy, I did c too
n3m has joined #ruby
thecreators has joined #ruby
csavola has joined #ruby
colossal7 has joined #ruby
res_ has joined #ruby
danslo has joined #ruby
zakwilson_ has joined #ruby
colossal7_ has joined #ruby
Zolrath has joined #ruby
lewix has joined #ruby
sand has joined #ruby
yfeldblum has joined #ruby
snip_it has joined #ruby
vrsparta has quit [#ruby]
justfielding has joined #ruby
itstimetoleave has joined #ruby
sjang1 has joined #ruby
nemesit has joined #ruby
colint_ has joined #ruby
wyhaines_ has joined #ruby
josefig has joined #ruby
ZachBeta has joined #ruby
nkbuff has joined #ruby
kmurph79 has joined #ruby
dinduks has joined #ruby
dnjaramba has joined #ruby
`brendan has joined #ruby
matthias_ has joined #ruby
waxjar has joined #ruby
<chimkan_> hey every1
<chimkan_> I have a simple question
<chimkan_> from the following function
<chimkan_> class Car
<chimkan_> def color=(value)
<chimkan_> @color = value
<chimkan_> end
<chimkan_> the '= ' sign after def color= is for what?
<chimkan_> shouldn't the def color(value) works in the same way?
<Mon_Ouie> No, the = is part of the method name
<yfeldblum> my_car = Car.new ; my_car.color = "blue"
bbrandon has joined #ruby
<Mon_Ouie> It's called as above, not as my_car.color "blue"
rootapex has joined #ruby
<yfeldblum> when you write `my_car.color = "blue`, what happens is that ruby calls the method `color=` on the object `my_car`, passing the argument `"blue"`
Sliker has joined #ruby
otakutomo has joined #ruby
dnjaramba has joined #ruby
<chimkan_> i see
<chimkan_> 'cause in rails I could just write
<chimkan_> class Car
<chimkan_> def color(value)
<chimkan_> @color
<chimkan_> end
<chimkan_> c = Car.new
gianlucadv has joined #ruby
<chimkan_> c.color = "green"
<chimkan_> and that would work
<chimkan_> but now I can see things clearer
<Mon_Ouie> No, it wouldn't. The color= method would be undefined.
Faris has joined #ruby
<Mon_Ouie> And if you were to try my_car.color, you'd get an error because of a missing argument
azureye has joined #ruby
JohnBat26 has joined #ruby
<chimkan_> yes
<chimkan_> you guys are right, i was trying here in the irb
<chimkan_> and rails c
<chimkan_> i usually don't have to initialize classes
<chimkan_> 'cause everything is done from rails scaffolds and stuff
<chimkan_> :)
tensai_cirno has joined #ruby
fayimora has joined #ruby
hubub has joined #ruby
yakko has joined #ruby
zakwilson has joined #ruby
_srp has joined #ruby
dnjaramba has joined #ruby
nowthatsamatt has joined #ruby
n3m has joined #ruby
nemesit has joined #ruby
hubub_ has joined #ruby
CannedCorn has joined #ruby
clyfe_ has joined #ruby
Dreamer3 has joined #ruby
dnjaramba has joined #ruby
gmwils has joined #ruby
MoMo__ has joined #ruby
kurko_ has joined #ruby
vizzord_ has joined #ruby
mdel_ has joined #ruby
Keva161 has joined #ruby
DDAZZA has joined #ruby
charlenopires has joined #ruby
s14 has joined #ruby
itstimetoleave has quit [#ruby]
singingwolfboy has joined #ruby
<singingwolfboy> how does the "gem" command detect which gems have been installed? I'm asking because I'm trying to use Ruby through Macports, and "gem" isn't picking up the gems I've installed. Is there a way to tell it to rescan, or something?
Sliker has joined #ruby
flip_digits has joined #ruby
gh has joined #ruby
twock has joined #ruby
otakutomo has joined #ruby
pu22l3r has joined #ruby
mikepack has joined #ruby
snearch has joined #ruby
hkhalid has joined #ruby
<hkhalid> anyone here play ruby games?
i8igmac has joined #ruby
nowthatsamatt has quit [#ruby]
ryannielson has joined #ruby
popsch has joined #ruby
snip_it has joined #ruby
davidpk has joined #ruby
<RubyPanther> hkhalid: I played golf once with ruby clubs.
singingwolfboy has quit [#ruby]
<RubyPanther> You can only hope to beat Perl about 10% of the time.
<RubyPanther> but if 100 people play, Ruby might have the lowest average score
alphabitcity has joined #ruby
bluenemo has joined #ruby
dnjaramba has joined #ruby
<alphabitcity> can someone point me to a simple gem that wraps an API? preferably using httparty .. trying to learn to write a gem
iocor has joined #ruby
<burgestrand> alphabitcity: seen http://guides.rubygems.org/?
<alphabitcity> i have indeed
sdwrage has joined #ruby
otakutomo has joined #ruby
<alphabitcity> burgestrand: read through those, looking for something more specific (how to handle basic auth, web requests, etc) in a gem .. have looked through a bunch of gems that wrap apis and haven't found a really clean/basic solution
<burgestrand> I’m not sure how that’s specific to a gem though
TomJ has joined #ruby
TomJ has joined #ruby
<alphabitcity> burgestrand: perhaps .. i just figured there would be established patterns when writing a wrapper for an api
i8igmac has joined #ruby
<burgestrand> alphabitcity: I know of no specific good example, most api wrappers tend to stick to the target service when it comes to naming resources though
<burgestrand> alphabitcity: wrote one once, https://github.com/Burgestrand/Dimma/blob/master/lib/dimma.rb, not sure if it’ll help you and it’s an awfully simple wrapper that uses rest_client and not httparty
<hkhalid> good progrramingg?
<alphabitcity> burgestrand: will take a look, thanks!
<burgestrand> hkhalid: well, no, why would it?
otakutomo has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
PaciFisT has joined #ruby
Axsuul has joined #ruby
i8igmac has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
Axsuul has joined #ruby
sjang1 has joined #ruby
alphabitcity1 has joined #ruby
dnjaramba has joined #ruby
looopy has joined #ruby
flak has joined #ruby
otakutomo has joined #ruby
statonjr has joined #ruby
Jake232 has joined #ruby
milkpost has joined #ruby
BrianE has joined #ruby
wookiehangover has joined #ruby
nemesit has joined #ruby
fayimora_ has joined #ruby
dibri has joined #ruby
nyrb has joined #ruby
visof_ has joined #ruby
dnjaramba has joined #ruby
nyrb has joined #ruby
visof_ has joined #ruby
_obiJuan has joined #ruby
visof_ has joined #ruby
akem has joined #ruby
jaywastaken has joined #ruby
colossal7_ has joined #ruby
peindt has joined #ruby
jgrevich_ has joined #ruby
PingFloyd has joined #ruby
<PingFloyd> I am really liking this ruby
mrmist_ has joined #ruby
jgrevich has joined #ruby
thats_my_hat has joined #ruby
<shevy> PingFloyd good!
<shevy> remember to keep things simple whenever possible
<shevy> else it will bite you in the butt one day
pac1 has joined #ruby
davidlwatsonjr has joined #ruby
fielding_ has joined #ruby
danslo has joined #ruby
Jake232 has joined #ruby
ChampS666 has joined #ruby
chimkan___ has joined #ruby
dagnachewa has joined #ruby
AxonetBE has joined #ruby
jcromartie has joined #ruby
<shevy> burgestrand noone is talking on weekends on IRC ... :(
jcromartie has joined #ruby
fielding has joined #ruby
<fielding> hello
<shevy> hi
<davidlwatsonjr> hey
<fielding> ^.^
pingfloyd has joined #ruby
test has joined #ruby
rdesfo has joined #ruby
nerdy has joined #ruby
<nkbuff> Saturday night in Europe, what do you want ?:-)
<davidlwatsonjr> some drinks
nowthatsamatt_ has joined #ruby
vescestvo has joined #ruby
grouzen has joined #ruby
<vescestvo> hey all, I'm trying to install ruby via rvm. I'm running ubuntu 11.10 on linode. Neither "sudo apt-get install ruby1.9.1" or the commands via rvm work. The rvm install doesn't work because I can't seem to install curl.
<vescestvo> any ideas of a way around that? I've tried wget to download rvm and run it directly, but it doesn't work.
dzhulk has joined #ruby
InfiniteJest has joined #ruby
<burgestrand> vescestvo: why can’t you install curl?
<vescestvo> I don't know. I try "sudo apt-get install curl" but get "Package curl is not available, but is referred to by another package." and "E: Package 'curl' has no installation candidate"
<vescestvo> seems like a pretty basic thing to install, but I can't find any way around it :)
visof_ has joined #ruby
platzhirsch has joined #ruby
fayimora_ has joined #ruby
<dagnachewa> vescestvo, hello
<dagnachewa> vescestvo, rvm is a jewel marvoulous one once you set it right
<burgestrand> vescestvo: try to apt-get update
<burgestrand> vescestvo: can you install other packages?
<vescestvo> dagnachewa: seems to be a hidden gem at the moment ;)
<dagnachewa> vescestvo, http://beginrescueend.com/
nowthatsamatt has quit [#ruby]
<dagnachewa> vescestvo, I did not use my distro package manager I used command from the shell as stated on the install method
<dagnachewa> vescestvo, $ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
gen0cide_ has joined #ruby
<burgestrand> he needs to install curl, which he gets from his package manager
<vescestvo> burgestrand: I have done an update. It's a fresh linode instance of ubuntu 11.10 and I've installed a few other packages via apt
<burgestrand> my first guess would be that your sources for apt are borked
<vescestvo> dagnachewa: that command doesn't work since I don't have curl
kmurph79 has joined #ruby
<vescestvo> burgestrand: any suggestions of anything to check?
<dagnachewa> vescestvo, sorry try to install curl
<vescestvo> dagnachewa: that's what I've been trying to do
<dagnachewa> vescestvo, your using ubuntu ?
<burgestrand> vescestvo: not really, no, first time I’ve seen this problem, but I would check the /etc/apt/sources.list file and compare it against https://help.ubuntu.com/community/Repositories/CommandLine
<vescestvo> dagnachewa: yes, ubuntu 11.10
<burgestrand> vescestvo: does look like it should be there though: http://manpages.ubuntu.com/manpages/oneiric/man1/curl.1.html
liquid__ has joined #ruby
platzhirsch has quit [#ruby]
Leon_Nardella has joined #ruby
<dagnachewa> vescestvo, maybe this can help http://axonflux.com/curb-install-problems-on-ubunt
<vescestvo> burgestrand: thanks, I just looked at my sources.list and see that it only has one line. I think when I added another line, I use > instead of >>
platzhirsch has joined #ruby
<burgestrand> vescestvo: hehe
<vescestvo> now, to finger out how to get back to the default ;)
<vescestvo> finger = figure
<burgestrand> vescestvo: you have the default on the ubuntu repositories page I linked
<platzhirsch> Any advices for tutorials to learn Ruby (not the first language)?
<burgestrand> platzhirsch: you like books?
<platzhirsch> burgestrand: sure
<burgestrand> platzhirsch: ^
<burgestrand> platzhirsch: all online resources, I pretty much used only the "Programming Ruby" one in my beginning days, served me well as I was not new to programming
<platzhirsch> sweet, that's a nice collection
<burgestrand> keep in mind programming ruby is written back in the day of only 1.8, there is a new third edition which is written around ruby 1.9 that can be bought from pragmatic programmers (amongst others)
<burgestrand> differences 1.8 vs 1.9 ain’t that big, apart from the way encoding is handled (ruby 1.8 does not handle it at all, ruby 1.9 bundles encoding information which each string)
<burgestrand> so most of the time you can get away with learning either one
<platzhirsch> Quite big, 920 pages
<burgestrand> Yeah, it’s pretty much a reference with a light introduction
<vescestvo> burgestrand: those all look like different versions, not for oneiric. am I missing something obvious there?
looopy_ has joined #ruby
<burgestrand> vescestvo: thinking of https://help.ubuntu.com/community/Repositories/CommandLine, the first section "The Basics"
<burgestrand> oh, yeah, it’s for 8.04
<burgestrand> vescestvo: http://repogen.simplylinux.ch/ :D
<burgestrand> a bit overkill perhaps
<yoklov> Hrm, how can i decode escape sequences with inside strings? E.g. i have 'foo \"bar\"' and want 'foo "bar"',
<vescestvo> burgestrand: thanks, someone else just pointed me towards that. Not sure what all to check, but about to try it :)
<burgestrand> vescestvo: silly that it’s so hard to find the default sources.list online
doomviking has joined #ruby
<vescestvo> burgestrand: that's what I was thinking too
nyrb has joined #ruby
orospakr has joined #ruby
<burgestrand> platzhirsch: http://rubykoans.com/ also :)
<burgestrand> platzhirsch: can do it on the web as well: http://koans.heroku.com/
<dagnachewa> vescestvo, I am starting ruby and am practicing with a pdf book and pry , my screen is splitted in two half and am using tiling window manager called i3, my screen is split verticaly , left is my Begining Ruby book and the right is my pry
<burgestrand> platzhirsch: personally i get bored of the koans but some people like it
<dagnachewa> burgestrand, I am using Begining Ruby to start learning ruby
pingfloyd has quit [#ruby]
azureye has joined #ruby
phantomfakeBNC has joined #ruby
<platzhirsch> burgestrand: and there is this http://railsforzombies.org/
<burgestrand> platzhirsch: indeed, you asked for ruby though, not rails :)
<platzhirsch> oh right, I didn't see that
n8ji has joined #ruby
virunga has joined #ruby
<platzhirsch> well, actually, my plan is to write a web app, so I have a project in mind which motivates me to keep up, I just don't know, whether this way goes straight to RoR or if I learn Ruby this way, too
yakko_ has joined #ruby
statonjr has joined #ruby
<burgestrand> platzhirsch: going straight to RoR is a viable way, many people will tell you not to (it was how many of them started though, myself included)
<platzhirsch> that reminds me of my first project in JavaScript,.. I roughly knew the JavaScript syntax, I did the project completly in CoffeeScript with jQuery. Any JavaScript evangelist would hate me
Jay_Levitt has joined #ruby
<burgestrand> platzhirsch: just keep in mind you’ll probably want to rewrite all of your code when you’ve gotten far enough, and for good reason too; the idioms of the language takes time to learn, even if the syntax is easy :)
<burgestrand> but if you have good tests when you get to that point, you can do it in chunks instead of starting from scratch
platzhirsch has quit [#ruby]
<vescestvo> burgestrand: finally generated a sources.list from your http://repogen.simplylinux.ch/generate.php link and it worked. curl installed, now on to ruby!
<vescestvo> burgestrand: thanks so much!
<burgestrand> vescestvo: you’re welcome, now don’t forget RVM :)
<vescestvo> burgestrand: you just mean to install using rvm, not apt?
<burgestrand> vescestvo: yes, don’t install ruby with apt, it’s a bad idea and leads to horrible amounts of pain and despair
<burgestrand> vescestvo: unfortunately, package managers suck when it comes to ruby
<vescestvo> burgestrand: I want to keep the amounts of pain and despair to a minimum ;)
danishkhan has joined #ruby
<burgestrand> vescestvo: it’s either rvm or rb-env, I’d go with rvm because it’s slightly friendlier to a newcomer as you get all you need in a single installation, rb-env is a more modular/minimalist approach
<dagnachewa> is there a way to clear pry without closing and starting it
<burgestrand> vescestvo: when you install it with those tools, you don’t need to overwrite your system installation (which is bad, your system needs it sometimes), and you don’t need to use sudo :)
<dagnachewa> vescestvo, you installed curl ?
<burgestrand> to clarify: it is bad to overwrite system installation of ruby
xplorer00 has joined #ruby
<vescestvo> burgestrand: oh, so I was going to follow the instructions that had used bash and curl to install rvm. Is there a difference between that and using apt to get ruby-rvm?
<vescestvo> dagnachewa: yes
<Nowaker> how to make cleanly such an array: ['s', 's', 's', 's'] with given N of 's' elements?
<burgestrand> Nowaker: 's' * size
<dagnachewa> burgestrand, I was scrolling up and saw that you said going straight to RoR what do you mean ?\
<Nowaker> burgestrand: thx
<burgestrand> Nowaker: no, wait :P
<Nowaker> ['s'] * size
<burgestrand> Nowaker: yes
<Nowaker> this is how I even read it
<Nowaker> :D
<burgestrand> dagnachewa: it’s not uncommon for people to learn Ruby on Rails and Ruby at the same time
<dagnachewa> ok
<burgestrand> vescestvo: not sure, I’ve always installed it through the bash-one-liner from the RVM website even on ubuntu servers :P
AxonetBE has joined #ruby
<vescestvo> burgestrand: cool, I'll stick with that
<vescestvo> burgestrand: was going to use the instructions at https://rvm.beginrescueend.com/
<burgestrand> vescestvo: sounds good :)
Keva161 has joined #ruby
<dagnachewa> burgestrand, in my opinion ruby make you comfortable from start :)
<dagnachewa> is there a way to clear pry ?
tvw has joined #ruby
xplorer00 has quit [#ruby]
<virunga> Ruby rock! Shame about the slowness
<virunga> *rocks
tvw has joined #ruby
<dagnachewa> virunga, you think ruby slowness will imrpove with new relases ?
<dagnachewa> virunga, as ruby 1.9 is 30 % faster than 1.8
<virunga> dagnachewa, unfortunaly i'm not following the developing of ruby in this times
<virunga> i'll use it in future but not right now
<virunga> i stop it
elitheeli has joined #ruby
<virunga> is there anyone from south africa here?
<elitheeli> Has anyone used Ruby to create a small wrapper around a program that expects stuff from STDIN and prints to STDOUT
<elitheeli> ?
<dagnachewa> virunga, I was just starting ruby :(
<elitheeli> Basically, it popens some interpreter and then loops and the plan was to use read_nonblock to ferry stuff back and forth but I'm having some issues making it behave
<dagnachewa> virunga, what tool are you using for your project ?
peindt has joined #ruby
<virunga> dagnachewa, aptana
<dagnachewa> virunga, ruby is slow versus other scripting languages ?
<virunga> dagnachewa, i think now ruby is as fast as python more or less
<virunga> but u should check online
<virunga> dagnachewa, you stoped to use ruby?
<dagnachewa> nope
vescestvo has joined #ruby
rowanu has joined #ruby
<virunga> dagnachewa, sorry for the question but are you english mother language?
<virunga> my curiosity
<vescestvo> so, I installed rvm and ruby per those instructions. gem command not found now ;)
<dagnachewa> virunga, am french speaker montreal canada
<burgestrand> vescestvo: don’t forget to ˜rvm use €
<burgestrand> vescestvo: for example, “rvm use 1.9.3”
<vescestvo> burgestrand: oh, so I do that each time I want to use ruby?
<burgestrand> vescestvo: you can do “rvm use 1.9.3 --default” and it will use that by default :)
<vescestvo> burgestrand: perfect, thanks!
<peindt> dagnachewa, hello from a fellow montrealer.
<dagnachewa> peindt, comment vas tu
<vescestvo> heh, now maybe I can use sass and compass finally ;)
<virunga> dagnachewa, so you should know english good anyway. Doesn't "i was doing something..." implies that you were interrupted?
<peindt> dagnachewa, tres bien, merci. Et vous?
<dagnachewa> peindt, ca vas
popsch has joined #ruby
<dagnachewa> virunga, i was doing something ?
<vescestvo> or not, geez…the rabbit hole is deep in ruby land
<virunga> dagnachewa, i mean the past continuous tense
<virunga> was a generic sentence
<dagnachewa> virunga, I am realy poor in english I am french speaker
<virunga> ok
<virunga> thank you anyway
<dagnachewa> virunga, altough I listen movies and music in english I consider my self efficient in english ... grammar is another thing :)
i8degrees has joined #ruby
<virunga> dagnachewa, :)
<virunga> dagnachewa, what's the first language in Canada?
<dagnachewa> peindt, what do you do for living ?
<dagnachewa> virunga, english outside of province of quebec, in quebec french
snip_it has joined #ruby
<virunga> dagnachewa, wow...
<virunga> what do canadians think about immigration?
randym has joined #ruby
<dagnachewa> it
trend has joined #ruby
<peindt> virunga, English is Canada's first language. There is a province, however, called Quebec, which has french roots. It's a bilingual province in my opinion, but I don't know that many quebec-specific patriots would agree. dagnachewa and I live here.
<peindt> dagnachewa: I'm studying to be an english major but I work as a web developer for a living. How about you?
<vescestvo> so, now any gem command I run gives me something like "ERROR: Loading command: update (LoadError)
<vescestvo> cannot load such file -- zlib
<vescestvo> ERROR: While executing gem ... (NameError)
<vescestvo> uninitialized constant Gem::Commands::UpdateCommand"
<vescestvo> any ideas?
<dagnachewa> virunga, immigration in canada know days you have better chance if your invester immigrant and I find it somehow fair because we seeing more and more people not recpecting the values of the country , I wish we get rid of street gangs by shipping them back
<dagnachewa> peindt, I am a pencil shover "Pousseux de cryons"
rdesfo has quit [#ruby]
<dagnachewa> peindt, autrement dit fonctionnaire
orospakr has joined #ruby
<dagnachewa> alright back to ruby programming later
odinswand has joined #ruby
<virunga> dagnachewa, are you going ?
<virunga> bye
genexp has joined #ruby
peroyvind has joined #ruby
<peroyvind> ahoi
colossal7 has joined #ruby
<peroyvind> moved to ruby 1.9 and trying to fix a script for it..
<peroyvind> header = YAML::load(file_data)
<peroyvind> body = header.instance_variable_get :@ivars
denom has joined #ruby
<dagnachewa> virunga,
<peroyvind> apparently psych no longer has such an attribute as "ivars", what would be the equivalent?
<dagnachewa> virunga, where are you from ?
<peindt> dagnachewa, donc fais-tu de la programmation pour le plaisir ou est-ce une exigence de travail
<virunga> dagnachewa, Italy.
<dagnachewa> peindt, j'ai finis dec en info en 2003 et je re apprends a programmer
<dagnachewa> peindt, j'ai pour 100 000 $ en livre programmation et science et finance :)
<dagnachewa> virunga, in quale proivincia si vive
<dagnachewa> virunga, sei un capo di capo di tuti ?
<virunga> dagnachewa, Lombardia, Lombardy.
<virunga> north Italy
<virunga> dagnachewa, do you mean "Il capo dei capi" :D
<virunga> that was Provenzano
<dagnachewa> virunga, :)
<peindt> dagnachewa: ah, je comprend alors. 100 000, c'est beacoup!
<virunga> not anymore anyway, he was arrested
<dagnachewa> virunga, Lombardi if am not wrong is prosperus
<dagnachewa> peindt, ce sont des livres j'ai telecharger
<virunga> dagnachewa, yes, more than south Italy for sure
rowanu has joined #ruby
<dagnachewa> peindt, tu utilise RoR a ton travail ?
<dagnachewa> virunga, Italy is in my list of places to visit but South ... :)
<dagnachewa> virunga, Amalfi Coast is Heavens !!!!!!!!!!!!!!!!!!!!!!!!
<dagnachewa> virunga, Capri is Heavens !!!!!!!!!!!!!!!!!!!!!!!!!!
<virunga> dagnachewa, yes, in south there are lots of beautiful places
<virunga> i see Canada as a very public welfare country (if that is right way to say it), is that true?
<shevy> treviso is the best town in italy
<dagnachewa> virunga, public welfare ?
<virunga> dagnachewa, public assistance? A assistanntionist country... i dont know the way to say it in english
<shevy> social security for everyone who is working
jaywastaken_ has joined #ruby
<virunga> shevy, not just that
<shevy> hey
<shevy> I made only one sentence! :)
<dagnachewa> virunga, ??? we have assistance like any modern world but we dont have 100 % assisted people
<shevy> I can't list aaaaaaall details in one sentence :D
gloomer has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
<shevy> dagnachewa modern like ... the USA? ;P
<peindt> dagnachewa: au fait, non. J'utilise ruby que pour quelques projets personel mais j'aimerai bien essayer RoR eventuellement. La plupart du temps je travaille en php.
<peindt> dagnachewa, et vous?
<dagnachewa> peindt, tu peux me tutoyer
<dagnachewa> peindt, tu est pigiste ou tu travaile pour une firme ?
<virunga> dagnachewa, so Canada looks like more like USA than France
<virunga> ?
<virunga> under this aspect
<dagnachewa> virunga, canada has medicare
<dagnachewa> virunga, we are definetly not like usa
waxjar has joined #ruby
<virunga> usa is a scary place
<virunga> brrrr
<dagnachewa> virunga, in the usa operation can cost 100 000 $ in canada the same operation is covered altough you may wait months is the operation is not urgent, wait may vary from months to years altough less than 2 years I think
<dagnachewa> is if
looopy has joined #ruby
<virunga> i see
supplysidejesus has joined #ruby
<peindt> dagnachewa, oui absolument. Je m'excuse. On s'habitu a vouvoyer a l'ecole et ca fait honetement longtemps que je n'ai pas utliser mon francais. Je suis plus anglophone.
pcz has joined #ruby
<pcz> hi
<supplysidejesus> how do i do conditional expressions like in python: X if X > 10 else nil
<peindt> dagnachewa, pigiste.
pu22l3r has joined #ruby
<shevy> supplysidejesus two ways. ternary operator
<shevy> or ...
ryanf has joined #ruby
<virunga> lol
<supplysidejesus> i don't really want to do a ternary operator
<virunga> i like so much
<shevy> a trick exists though - http://pastie.org/3363997
<shevy> to return early
<supplysidejesus> i don't like that
<pcz> how can I embed HTML in my RSS item description using Ruby's standard RSS stuff?
<shevy> actually I think you can use one line too supplysidejesus
<shevy> if x > 10 x else nil end
<shevy> but I have not tested that
<shevy> you may have to use a ; perhaps
<burgestrand> x if x > 10
<burgestrand> the expression returns nil if x <= 10
<supplysidejesus> ahh
colossal7 has joined #ruby
<pcz> as it seems, ruby escapes < to &lgt; and so on
<pcz> -g
emocakes has joined #ruby
<virunga> supplysidejesus, i found it out
<virunga> supplysidejesus, unless x < 10 then x else nil end
<virunga> better with if
<burgestrand> virunga: no need to tack that else on if it’s nil anyway
<burgestrand> virunga: x unless x < 10
<virunga> burgestrand, yes i read
<virunga> thanks