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/
nerdy joined #ruby
atmosx joined #ruby
yfeldblum joined #ruby
imsplitbit joined #ruby
<Avi`> apeiros_: just to close the loop on this, found an answer
<Avi`> :collection => closedItems, :as=> :relation
<Avi`> and it all just works
stepnem joined #ruby
bwlang joined #ruby
raincole joined #ruby
elevenarms joined #ruby
SegFaultAX|work joined #ruby
igotnolegs joined #ruby
austinbv joined #ruby
jamnew joined #ruby
tomzx joined #ruby
austinbv joined #ruby
ph^_ joined #ruby
fgro joined #ruby
<chiel> When using File.new('path', 'mode'), is there a mode that will create the folders required when attempting to open the file?
randym joined #ruby
<chiel> Or, perhaps a way to check if the directory structure exists if the filepath is set in a variable?
SegFaultAX|work joined #ruby
S1kx joined #ruby
S1kx joined #ruby
cafesofie joined #ruby
luckyruby joined #ruby
spyvspy joined #ruby
Natch| joined #ruby
perryh_ joined #ruby
macabre joined #ruby
fgro joined #ruby
<fgro> hi i have a filename i.e. "test.txt". I want to apply a method to the substring of the filename (everything before the do). For example, uppercase it => "TEST.txt". What is the best way to do?
headius joined #ruby
mikeycgto joined #ruby
mikeycgto joined #ruby
<SegFaultAX|work> What actually gets yielded into a block passed into Net::HTTP.get_response?
<SegFaultAX|work> The documentation is unclear, is it the HTTP object or the HTTPResponse object?
mikeric joined #ruby
arpegius joined #ruby
minijupe joined #ruby
pen joined #ruby
ryanf_ joined #ruby
warebec joined #ruby
badabim_ joined #ruby
ianbrandt joined #ruby
wmoxam joined #ruby
kuadrosx joined #ruby
ryanf joined #ruby
tobym joined #ruby
sdwrage joined #ruby
jetblack joined #ruby
youdonotexist joined #ruby
manizzle_ joined #ruby
dyer joined #ruby
notbrent joined #ruby
tayy joined #ruby
chrxn_ joined #ruby
stephenjudkins left #ruby
flip_digits joined #ruby
<aces1up> whats the idea called behine methods like active_record find_by_id where the method name describes the control processing inside the method?
dfamorato_ joined #ruby
nari joined #ruby
minijupe joined #ruby
dfamorat_ joined #ruby
Sailias joined #ruby
kawa_xxx joined #ruby
roaminghorse joined #ruby
supergiantrobot joined #ruby
<supergiantrobot> Hello, all.
<supergiantrobot> I am trying to build 1.9.3 on Mac OS X Lion
<supergiantrobot> But repeatedly get the same error.
sythe joined #ruby
Synthead joined #ruby
rickmasta joined #ruby
<Avi`> i have two arrays and i want to call a function (That takes in two single values and returns a true or false) with every iteration of those two arrays and if any of the results are true, exit
<Avi`> so i keep finding myself in some silly nested .each do
<Avi`> is there anything built in for this kind of instersection?
tshauck joined #ruby
fmariluis joined #ruby
<Avi`> i know there is .includes? but thats only on an array, and not the results of functions
strife25 joined #ruby
incluye joined #ruby
cooper joined #ruby
btanaka joined #ruby
Sailias joined #ruby
krz joined #ruby
jonathanrwallace joined #ruby
heoa_ joined #ruby
<heoa_> require 'flowdock' --- causes err "no such file to load 'flowdock'", https://www.flowdock.com/help/api_gem
<heoa_> any idea why?
<heoa_> http://pastebin.com/vX3Y8ywB <-- running it with my API token -key
<heoa_> $ sudo ruby gem install flowdock
<heoa_> and then running the code (with my token) ignites no 'flowdock' -file?!
sdwrage left #ruby
abstrusenick joined #ruby
dfamorato_ joined #ruby
tomhsx joined #ruby
macmartine joined #ruby
Cerales joined #ruby
mikeric joined #ruby
satyavvd joined #ruby
wyhaines joined #ruby
fmariluis left #ruby
ilyam joined #ruby
ghosTM55 joined #ruby
austinbv joined #ruby
strife25 joined #ruby
rickmasta joined #ruby
ethndbst joined #ruby
p0y joined #ruby
jonathan_ joined #ruby
wyhaines joined #ruby
acts_as_david joined #ruby
strife25 joined #ruby
r0bby joined #ruby
r0bby_ joined #ruby
dbgster joined #ruby
jonathanrwallace joined #ruby
jetblack joined #ruby
rpowell joined #ruby
wmoxam joined #ruby
zedUNDginger joined #ruby
JumpMast3r joined #ruby
ph00l1sh joined #ruby
tomzx_ joined #ruby
strife25 joined #ruby
shikamaru joined #ruby
CannedCorn joined #ruby
strife25 joined #ruby
manizzle joined #ruby
Samoi joined #ruby
Samoi joined #ruby
wyhaines_ joined #ruby
sdwrage joined #ruby
martisj joined #ruby
bwlang joined #ruby
bwlang joined #ruby
sdwrage joined #ruby
<RubyPanther> how many hours does it take to find the perfect emacs font?
<zedUNDginger> RubyPanther: i heard you can cut the time in half by uploading naked pictures of your girlfriend to imgur.com and linking them here
wilmoore joined #ruby
tobyo joined #ruby
momo- joined #ruby
mindCrime joined #ruby
x0F_ joined #ruby
CannedCo_ joined #ruby
briandoll joined #ruby
beseku joined #ruby
jeedey joined #ruby
blaenk joined #ruby
<blaenk> what is the way to get the index at which a regex was matched?
<blaenk> or indices
<blaenk> oh, string#index accepts a regex
<blaenk> ohh I get it :)
tomzx_ joined #ruby
Ruthenium joined #ruby
heoa joined #ruby
ABK joined #ruby
adeponte joined #ruby
<briandoll> love it when that happens :)
pdswan joined #ruby
nafis joined #ruby
nafis_ joined #ruby
pen joined #ruby
renanoronfle joined #ruby
BrokenCog joined #ruby
* nafis_ hello
pabloh joined #ruby
mctor joined #ruby
radic joined #ruby
chrxn_ joined #ruby
nafis joined #ruby
robbyoconnor joined #ruby
krz joined #ruby
<nafis> hellp
<shevy> lol
<shevy> best hellp message ever
ihji joined #ruby
ryanf joined #ruby
ethndbst joined #ruby
ethndbst joined #ruby
austinbv joined #ruby
milkpost_ joined #ruby
BrokenCog joined #ruby
liekzomg joined #ruby
airhorns joined #ruby
io_syl joined #ruby
daniel_hinojosa joined #ruby
<liekzomg> hi i'm having a problem with my ruby pausing on large scripts (a download script i've made but also gem installs). It stops doing anything until I press a key even though there's no user input required. (Ruby 1.9.3/Win7/rubyinstaller.org and powershell if that helps). Any ideas? Could it be powershell?
rupx joined #ruby
<rupx> In ruby 1.9.2, updation of a hash is giving me a run time error, but in ruby 1.8.7 is working. Could please tell me, is there wrong with ruby 1.9.2?
<ryanf> I think 1.9 might be stricter about changing a hash while you're iterating over it
luxurymode joined #ruby
<briandoll> liekzomg can you paste the script somewhere and tell us where it's pausing?
<rupx> def self.rehash(params = {}) return {} if params.blank? total_params = params params.each do |key,value| has = {} if value.kind_of?(Array) value.each do |hash| hash.each do |k,v| hsh.merge!({k.to_sym => v}) end end end total_params.merge!(hsh) if hsh.kind_of?(Hash) end total_params.delete_if{|key,value| value.kind_of?(
<rupx> in a iterative block if I update a hash, it through run time error
<aces1up> what state ment would i use if i want to see if a regex returns true on a string in 1 line?
raythecat joined #ruby
<rupx> if /Japan|Ruby/.match('Ruby') p "Its matched" else "Not at all" end
nachtwandler joined #ruby
<aces1up> (entity_value =~ Regexp.new(@search_string)) != nil
<aces1up> this seems to work, any gotchas i should look out for?
macmartine joined #ruby
<ryanf> you don't need != nil
<ryanf> it will be truthy if it matches and falsy if it doesn't
wookiehangover joined #ruby
<ryanf> but sure, that looks fine otherwise
<aces1up> i just didn't want obscure postion values munging other things.
pen joined #ruby
bluOxigen joined #ruby
DrShoggoth joined #ruby
<ryanf> oh yeah I guess that's fair. people would still usually use .nil? though
<ryanf> instead of == nil
<aces1up> ohh cool didn't know that was around.
<aces1up> will use that thanks.
jehoshua02 joined #ruby
<jehoshua02> I'm new to ruby... I'm installing redmine, which requires ruby, rails, rubygems, rack, rake, I18n, and mysql gem. I'm not sure in what order to install them, and whether to use apt-get or gem for each?
<ryanf> avoid apt-get to the maximum possible extent
<ryanf> use rvm to install ruby and then gem for everything else
<liekzomg> 2nded for rvm, ruby from apt-get does not play nice
mikeric joined #ruby
<jehoshua02> according to my experience so far, I would have to agree...
<jehoshua02> But I'm unfamiliar, so I wasn't sure.
zedUNDgi_ joined #ruby
sdwrage joined #ruby
<ryanf> also just install rails first
<ryanf> because everything else there except mysql will install automatically with rails
<ryanf> and rubygems installs with ruby
<jehoshua02> ryanf: pardon me for being tedious, but I am required to document the procedure, 1) install rvm, 2) install rails, 3) mysql gem, and that's it?
rkk joined #ruby
Eth4n joined #ruby
<ryanf> that should be it, yeah
<ryanf> uh
<ryanf> I guess 1.5 is "use rvm to install ruby"
Shrink joined #ruby
<jehoshua02> ryanf: 1) rvm, 2) ruby, 3) rails, 4) mysql...
<ryanf> sounds good
moshef joined #ruby
<liekzomg> just remember redmine needs specific versions for a bunch of stuff, like ruby 1.8 and rails 2.3.x
<liekzomg> there are guides for most OS on the redmine.org wiki
<ryanf> also it might be safer to install rvm system-wide instead of per-user, I've never tried to use it on a server
<ryanf> not sure how it's usually done exactly
sdwrage joined #ruby
badabim joined #ruby
stephenjudkins joined #ruby
kuadrosx joined #ruby
austinbv joined #ruby
jehoshua02 joined #ruby
<jehoshua02> ryanf: I'll need a) rails 2.3.11, b) RubyGems 1.3.7+ lower than 1.7.0, c) Rack 1.1.1, d) Rake 0.8.7, e) I18n 0.4.2.
<ryanf> the only thing that changes (probably) is
<jehoshua02> (You'd think that the requirements would have scared me away by now! :))
<ryanf> you might want to get rubygems 1.5.3
<ryanf> that's easy with rvm
<ryanf> after installing and switching to the ruby you want
<ryanf> you just do rvm rubygems 1.5.3
bluOxigen joined #ruby
gayasentinel joined #ruby
<rkk> how to parse a url including a chinese word?
<jehoshua02> ryanf: Ah, I see. So, basically, all versions are at my fingertips. That's genius.
<rkk> i always get a URI::InvalidURIError
<jehoshua02> Thanks ryanf.
<ryanf> rkk: you need to use the escaped versions of the characters
<ryanf> where are you getting the URL in the first place?
<rkk> manually generated
<ryanf> ah
<ryanf> try URI.parse(URI.encode(url)) I guess? maybe there is a better way, but parse doesn't accept urls that aren't valid
<ryanf> and valid urls have any non-ascii characters encoded
<rkk> let me try it
yxhuvud joined #ruby
<rkk> it works
<rkk> thank you ryanf :-)
hukl joined #ruby
bluOxigen joined #ruby
tonini joined #ruby
tonini joined #ruby
ihji joined #ruby
brauliobo joined #ruby
tonini left #ruby
tonini joined #ruby
tonini joined #ruby
satyavvd joined #ruby
rpowell joined #ruby
sdwrage joined #ruby
PhilK joined #ruby
satyavvd joined #ruby
brauliobo left #ruby
<blaenk> how would I find the string at the end of a string right after the last space? "asdfasd asdfasdf asdfadsfas needle" I want to extract 'needle'
<blaenk> oh I know :)
<blaenk> I think /\s(\w+)$/ might work, gonna try
<blaenk> perfect
<ryanf> yep that'll work
renanoronfle joined #ruby
<jehoshua02> ryanf: forgive me, so like this: rvm install ruby
hemanth joined #ruby
moondiamond joined #ruby
<ryanf> rvm install 1.8.7
<ryanf> it's all ruby :)
rpowell joined #ruby
djdb joined #ruby
emptyflask joined #ruby
kuadrosx joined #ruby
roaminghorse joined #ruby
esparkman joined #ruby
Amirh joined #ruby
stephenjudkins joined #ruby
bluOxigen joined #ruby
maletor joined #ruby
JohnBat26 joined #ruby
cableray joined #ruby
bluOxigen joined #ruby
bluOxigen joined #ruby
Shrink joined #ruby
stephenjudkins joined #ruby
<jehoshua02> ryanf: thanks. And then: rvm install rails 2.3.11
xpot joined #ruby
<ryanf> no
roaminghorse joined #ruby
<ryanf> gem install rails -v=2.3.11
mikeric joined #ruby
emmanuelux joined #ruby
airhorns joined #ruby
smgt joined #ruby
roaminghorse joined #ruby
bluOxigen joined #ruby
dankest joined #ruby
havenn joined #ruby
airstream66 joined #ruby
enikar joined #ruby
<jehoshua02> ryanf: so after using rvm to install ruby, switch rubygem version, then use gem to install everything else (with -v option).
<ryanf> you also need to follow the instructions rvm gives you when you install it
kuadrosx joined #ruby
<ryanf> about putting stuff in .profile or whatever
v4n_ joined #ruby
stoffus joined #ruby
krz joined #ruby
<jehoshua02> ryanf: I haven't run any commands yet. Documenting the process first. Here's what I got so far: https://gist.github.com/1414578
rippa joined #ruby
roaminghorse joined #ruby
<shevy> can you add to this gist that ryanf likes penguins please?
<jehoshua02> sure.
jay_zawrotny joined #ruby
<jehoshua02> shevy: can't guarantee it will make it into the final draft, but it's there.
workmad3 joined #ruby
<jehoshua02> What I need to do is take a VM snapshot, boot up and try these commands.
<jehoshua02> ryanf: thanks. You've been a huge help.
moshef joined #ruby
<aces1up> i have a problem, i think enumerable could help with, but have no idea what methods / combination to go about using.. here is the example.. http://pastebin.com/sYd3vVeB any help would be appreciated!
kuadrosx joined #ruby
perryh_ joined #ruby
<ryanf> aces1up: I'm unclear on exactly what needs to happen
<ryanf> can you post the methods you already have?
<aces1up> ryan sure
<aces1up> its not fully finished though one sec.
burgestrand joined #ruby
<ryanf> aces1up: fyi you can replace entity_to_array with just Array(entity_value)
zedUNDginger joined #ruby
fgro joined #ruby
stephenjudkins joined #ruby
<ryanf> oh wait
<ryanf> so you have like
<ryanf> an array of users, and you want to call .days on each user and .elements on each day, and then return an array of all the elements
pen joined #ruby
<ryanf> right?
<aces1up> yes one sec i will make a mod to the code to show ultimately what happening.. made a comment at the end
<ryanf> that seems pretty close to this random code I have lying around (which I didn't write)
heftig joined #ruby
<aces1up> nice :) weird you just had that lying around? cool, ok will check it out.
<aces1up> i had a recursive version before this, couldn't get it to work.. this looks good.
<ryanf> I don't love the syntax, you have to do like :meth1 => {:meth2 => {:meth3 => :meth4}}
<ryanf> I'd prefer just taking them as arguments
<ryanf> it'd probably simplify it a bit
<aces1up> well the search is loaded in via a yaml file, which if i could just edit a symbol in the file it would be easier for me.
ChampS_ joined #ruby
stephenjudkins left #ruby
raythecat joined #ruby
mafolz joined #ruby
robotmay joined #ruby
bugz^ joined #ruby
<ryanf> aces1up: this seems to work https://gist.github.com/1414750
<ryanf> had to switch the args around to make it work with varargs
<ryanf> and now it isn't meant as a core extension, unlike the other one, which is probably for the best
<ryanf> >> get_path("hello", :chars, :to_a, :upcase)
<ryanf> => ["H", "E", "L", "L", "O"]
heftig joined #ruby
<ryanf> the name also sucks, but I could never think of a decent one myself
rbanffy joined #ruby
io_syl joined #ruby
io_syl joined #ruby
zommi joined #ruby
jonathan___ joined #ruby
<jonathan___> Hello all
<jehoshua02> ryanf: bumpy road trying to get past "rvm install 1.8.7". First it complained about there being no valid C compiler, so I "apt-get install gcc", then I run "rvm install 1.8.7" again and get "patch -F 25 -p1 -N -f <"/home/projectadmin/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch" \n patching file lib/mkmf.rb \n Hunk #1 FAILED at 201..."
<ryanf> nice
<jonathan___> I've install rvm on my Ubuntu by using the package manager, then I did a rvm install 1.9.2 and a rvm use 1.9.2 --default but when I try to do a ruby -v it can't find ruby ...
<ryanf> right, you probably still need to add rvm's loading stuff to a .profile somewhere
<ryanf> I don't know, maybe apt does that itself, didn't know there was a package for it
<ryanf> did you restart your terminal?
<jonathan___> yes I restart the terminal
<jehoshua02> ryanf, jonathan: the rvm install dialog told me to add this line to .bashrc: [[ -s "/home/projectadmin/.rvm/scripts/rvm" ]] && source "/home/projectadmin/.rvm/scripts/rvm"
fridim_ joined #ruby
<jonathan___> How did you get an install dialog ??
Ch4rAzZz joined #ruby
voodoofish joined #ruby
<ryanf> presumably he just means the output of the installer?
<jehoshua02> I followed the install instructions on the rvm website.
<ryanf> yeah that is the line I was thinking of
<ryanf> that sounds good
<jonathan___> ok I will try to add these lines at the end of my .bash_rc
<ryanf> no underscore in bashrc
<jonathan___> yes ...
<jehoshua02> jonathan___: and only the first line.
<ryanf> however the fact that you installed rvm again with apt-get concerns me
<jonathan___> yes I know
<ryanf> becuase I have no idea what crazy thing that package might be trying to do
<ryanf> maybe it's fine though
trivol joined #ruby
<jonathan___> the second line is to install rvm from the source
<ryanf> oh ok that sounds pretty innocuous
<jehoshua02> That's why I run everything in a VM :) oops --> restore snapshot.
Zsadan joined #ruby
MrWynand joined #ruby
Morkel joined #ruby
<jonathan___> but I think I need to adapt it, there is no .rvm in my home folder
<jonathan___> rvm must be configured for all the users of the systems
<jehoshua02> jonathan__: I just followed this: https://rvm.beginrescueend.com/rvm/install/
<jonathan___> yes I read it
<jehoshua02> For Ubuntu Server 10.04 LTS, I needed this before hand: sudo apt-get install curl git-core subversion
pen joined #ruby
heldopslippers joined #ruby
<jehoshua02> On the crazy command that installs rvm I piped to less. There was some stuff in the install dialog that mentioned multi-user.
<jehoshua02> But I'm still having trouble with rvm install 1.8.7
<jonathan___> hum looks ok
<jonathan___> a ruby -v works now
iocor joined #ruby
<jehoshua02> ... I think I need "patch".
<jonathan___> I added this in my .bashrc
<jonathan___> [[ -s "/usr/share/ruby-rvm/scripts/rvm" ]] && source "/usr/share/ruby-rvm/scripts/rvm"
<jehoshua02> jonathan___: yep. That's what I got from the install dialog.
<jonathan___> jehoshua02, I needed just to adapt the paths
pi3r joined #ruby
<jehoshua02> Ah, oh, I see. Speed reading kicks my arse sometimes.
batlock666 joined #ruby
<jehoshua02> When I run "rvm install 1.8.7" I see an error about "patch -F 25 -p1 -N -f ....." but I don't know what to do about it.
<jonathan___> but I need to install ruby 1.8 to have the ruby by koans tutorial working well like before
<jonathan___> jehoshua02, sorry I can't help you
<jehoshua02> It seems to have gotten past configuring and now compiling.
<jehoshua02> ... installing.
<jonathan___> I will install the 1.8 on my machine and I will tell you what I'll get
otakutomo joined #ruby
<jehoshua02> Looks like everything installed fine except for that patch.
n8ji joined #ruby
manizzle joined #ruby
<jonathan___> I need to go out now, I'm sorry I can't help you more now
ikaros joined #ruby
<jehoshua02> jonathan___: it's alright. It's a chat room.
bosphorus joined #ruby
rpowell joined #ruby
dyjytyl joined #ruby
<dyjytyl> how would i take a ruby file and convert the code into strings with newline breaks like this: http://pastie.org/2948377
<ryanf> File.read("file.rb").gsub("\n", '\n') ?
trivol joined #ruby
Hellojere joined #ruby
p1d joined #ruby
<dyjytyl> oh File.read is about all i needed to do :) thanks ryanf
Ammar01 joined #ruby
zedUNDgi_ joined #ruby
jehoshua02 left #ruby
Axsuul joined #ruby
mxweas joined #ruby
abstrusenick joined #ruby
Seisatsu joined #ruby
dnjaramba joined #ruby
Pip joined #ruby
Pip joined #ruby
estoner joined #ruby
rjfranco joined #ruby
BiHi joined #ruby
mxweas_ joined #ruby
Mchl joined #ruby
luckyruby joined #ruby
iocor joined #ruby
xec joined #ruby
<aces1up> how would write a regex to detect at least thress dashes in a string?
<aces1up> dude-this-is-cool-you-know
<aces1up> -{3}
<aces1up> i have that but that wants them to be in a row.
<shevy> what
<shevy> hmmm
<rippa> -.*-.*-
<aces1up> the 3 needs to be variable
<rippa> "-.*"*var
<rippa> here you go
<shevy> the 3 needs to be pink
* shevy waits for rippa ...
<rippa> 3
<shevy> aces1up, you can use variables in regexes too /lala#{here_my_variables}/
<shevy> hmmm test
<aces1up> "-.*"{3}
<aces1up> :( no go
<shevy> testtesttesttesttesttest
<shevy> oh I found pink!
<shevy> what the
<zedUNDgi_> shevy: good morning shevrolet
<shevy> what is {3}
<rippa> aces1up: / #{"-.*"*3}/
<shevy> noone said that aces1up !
<shevy> there. what rippa said
chrxn__ joined #ruby
chrxn__ joined #ruby
<aces1up> rippa that not workin.
james_cotterill joined #ruby
<rippa> works here
<rippa> without a space after /
<shevy> aces1up you should pastie your code
<aces1up> i'm just using the ruby regex tester online
ikaros joined #ruby
<rippa> it wouldn't work
<rippa> because regex is generated from a string
<rippa> you need real ruby for that
My_Hearing joined #ruby
james_co_ joined #ruby
ephemerian joined #ruby
<shevy> aces1up you should really write a ruby script and test this ruby script and use pastie
chrxn_ joined #ruby
mikewintermute joined #ruby
<aces1up> rippa thanks ok works, but how would i do it if its more than 3 thats what i really want.
<aces1up> >= 3
nari joined #ruby
<rippa> aces1up: change 3 to something other
abstrusenick joined #ruby
<rippa> /#{-.**42}/
raythecat joined #ruby
fgro joined #ruby
beseku joined #ruby
probst joined #ruby
Adman65 joined #ruby
satyavvd joined #ruby
benja-M-_ joined #ruby
<shevy> aces1up assemble your variable before putting it into the // regex
ChampS_ joined #ruby
nari joined #ruby
Indian joined #ruby
cyri_ joined #ruby
adambeynon joined #ruby
clockwize joined #ruby
alup joined #ruby
tk_ joined #ruby
Amirh joined #ruby
vmatiyko joined #ruby
_debo joined #ruby
iocor joined #ruby
iocor joined #ruby
senny joined #ruby
roaminghorse joined #ruby
jbpros joined #ruby
sjltaylor joined #ruby
jbpros joined #ruby
ctp joined #ruby
ChampS_ joined #ruby
ctp joined #ruby
tvw joined #ruby
rkk joined #ruby
clockwize_ joined #ruby
moshef joined #ruby
pen joined #ruby
fixl joined #ruby
thone joined #ruby
Sliker joined #ruby
james_cotterill joined #ruby
james_cotterill joined #ruby
Azure|netbook joined #ruby
Squarepy joined #ruby
Squarepy joined #ruby
tatsuya_o joined #ruby
iocor joined #ruby
bwright joined #ruby
nari joined #ruby
fgro joined #ruby
robotmay joined #ruby
tomzx joined #ruby
Manhose joined #ruby
sepp2k joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
dazoakley joined #ruby
frogstarr78 joined #ruby
milkpost_ joined #ruby
Reikoku joined #ruby
dnjaramba joined #ruby
emmanuelux joined #ruby
dhruvasagar joined #ruby
iamjarvo joined #ruby
heftig joined #ruby
kawa_xxx joined #ruby
iocor joined #ruby
radic joined #ruby
dlitvak joined #ruby
<fgro> this is rails 3.0.1. Isn't something like Mode.find("174-somestring") supposed to call "to_i" on the parameter, resulting in Model.find(174)? Doesn't work for me...did something change on the api?
ikaros joined #ruby
<fgro> sorry wrong channel
jbpros joined #ruby
Guest81456 joined #ruby
Guedes joined #ruby
moshef left #ruby
clockwize_ joined #ruby
BrianE joined #ruby
p0y joined #ruby
Azure joined #ruby
Azure joined #ruby
clockwize joined #ruby
bwlang joined #ruby
zedUNDginger joined #ruby
Vendethiel joined #ruby
adelcampo joined #ruby
jbpros joined #ruby
dbgster joined #ruby
pen joined #ruby
<Brozilla> quick one: `class Release < OtherClass; [blabla]; end` == `Class Release; include OtherClass; [blabla]; end` right?
BiHi joined #ruby
pen_isident joined #ruby
otakutomo joined #ruby
Morkel joined #ruby
<dlitvak> Brozilla: no... its not the same... one is a mixin... the other one is inheritance
<dlitvak> can get simmilar results with either one...
<dlitvak> but the ARE NOT THE SAME
<dlitvak> s/the/they/
<Brozilla> mm, that's good to know, thanks :)
workmad3 joined #ruby
<dlitvak> the first one is inheritance
Cervajz_ joined #ruby
<dlitvak> second one is mixin
<dlitvak> with inheritance... you gain all the benefits from inheritance... like extending methods of the superclass
sandstrom joined #ruby
<dlitvak> in the second one... u can just use them or re write them
<zedUNDginger> fuck bono is a cock
DarkFoxDK joined #ruby
sandstrom joined #ruby
Samoi joined #ruby
mcginleyr1 joined #ruby
nari joined #ruby
yalue joined #ruby
RLa joined #ruby
Manhose_ joined #ruby
<Tachyon> Hi, is it possible to set a callback for assignment? I need a hash that would be immediately written to file when changed.
bjhaid joined #ruby
<bjhaid> hi, I am trying to connect to sqlserver, mysql and oracle, from ruby on cgywin, I have dbi gem installed, please what additional tools should i have installed, thanks
Barbaren joined #ruby
<RLa> you must install all those databases too?
<Barbaren> hello, I've got a quick question: anyone here know if there's some good utility out there for converting non ascii characters to their html-code equivalent? e.g. & to &amp; and ö to &ouml; ?
<bjhaid> i am not given assess to install them, i can only connect to them remotel
<Barbaren> i mean, ruby library or gem or whatever
<bjhaid> RLa: I can only connect to them remotely, I am off the client location
<RLa> you might need dbd-* packages
<bjhaid> dbd-* you mean drivers??
<RLa> i guess dbd stands for database driver
<RLa> yeah
dyer joined #ruby
BrianE joined #ruby
<bjhaid> RLa: can you please help out for links for database drivers for oracle and sqlserver?
jensn joined #ruby
<RLa> small googling will help
shevy joined #ruby
<RLa> connecting sql server seems bit harder
<bjhaid> Rla: i have been googling, keeps looking complex, active record has really made life easy but here, I am looking for connectors and everything, i have not done such before
probst joined #ruby
<RLa> there is odbc which you might or might not getting to work with sql server
<RLa> you would need dbd odbc and sql drivers for odbc itself
p0y joined #ruby
<bjhaid> Rla: can you help me with the links for that?
<RLa> no, i cannot
<RLa> last time i tried to use odbc i gave up
<bjhaid> well here I am helpless, i have to deliver to the client in a short while, should be an easy task, but connecting to the database is seeming difficult
<shevy> TIME IS RUNNING OUT FOR YOU!
<shevy> DEATH AWAITS YOU!
jbpros joined #ruby
probst joined #ruby
<RLa> welcome to accidental complexity hell
hukl joined #ruby
<JonnieCache> HAHAHA yeah welcome. try and enjoy yourself. we're all friends here.
clockwize_ joined #ruby
arpegius joined #ruby
zommi joined #ruby
<shevy> complexity is my enemy
<shevy> unfortunately, sometimes it seems to be my friend
<shevy> right now I am wondering about loading configuration option for any given project
benja-M-_ joined #ruby
<shevy> CONFIG.name_of_option_comes_here
<shevy> any ideas for a better way?
evantravers joined #ruby
poga joined #ruby
<RLa> what about making it configurable :)
wyhaines joined #ruby
Bela-Lugosi joined #ruby
nanderoo joined #ruby
cdepue joined #ruby
viuo_ joined #ruby
apeiros_ joined #ruby
<JonnieCache> does it need to be configurable from within the actual app itself?
Know1edge joined #ruby
sjltaylor joined #ruby
<shevy> hmmm good question
<shevy> JonnieCache, well, actually yeah
<shevy> users should be able to both add new config options at runtime, and modify existing ones
<JonnieCache> well you could do the EAV pattern in a database table, which is ugly but works
<shevy> what is EAV?
Dangr_ joined #ruby
<JonnieCache> entity-attribute-value
<JonnieCache> its a way of pretending your RDBMS is a key value store
<JonnieCache> its so ugly its an anti-pattern IMO but its better than installing redis just for a couple of dozen key/value pairs
<JonnieCache> or writing your own system to read/write yaml files or something
<shellox> JonnieCache: nop
<shellox> wget redis, extract, cd redis/src/;./redis-server
nerdy joined #ruby
<shellox> this isnt much work and takes just 2 mins
<shellox> if its on your testing machine
<shellox> w/o authentication and stuff, else you have to write a config file
<JonnieCache> yeah but then you have to set up process monitoring and stuff, its another process to manage in production. thats the real issue. it adds so much complexity to the environment
heoa joined #ruby
<JonnieCache> just for a couple of K/V pairs
skim1776 joined #ruby
<shellox> JonnieCache: i use it atm too for a sinatra app for session data stored on the server
skim1776 left #ruby
<shellox> JonnieCache: sure, you could also go with textfiles
<shellox> depends on the needs ;)
<JonnieCache> yeah then you have to write all your own shit to read/write the textfiles, eventually you run into locking problems and before you know it youve rewritten most of redis
<JonnieCache> whats needed is some sort of redislite similar to mysqlite that can live entirely in a library
<JonnieCache> *sqlite
<JonnieCache> so it can be self contained without an external process
<shellox> just googled it ;)
<shellox> im not sure if it's good
<JonnieCache> SWEET!
<JonnieCache> definitely gonna have to check that out
ramusara joined #ruby
becom33 joined #ruby
<becom33> whats a good way to ask (y/n) questions in ruby . do I have to write a method to identify yes and no ?
possibilities joined #ruby
<jensn> becom33: Yes.
Indian joined #ruby
<vauban> become: seems simple enough to just use gets, if, else.
<apeiros_> becom33: you can also use a library like highline
tommyvy__ joined #ruby
jbpros joined #ruby
dazoakley joined #ruby
stephans joined #ruby
yfeldblum joined #ruby
<becom33> http://pastebin.com/fnfvZvMS ok this loop puts the next value after the value right ? I want the value print over the 1st value . like stay screen with the intro method and and loopout keep looping on the privious value
linoj joined #ruby
<becom33> anyone ? Im sorry if you didnt underatnd the question plz tell m
<becom33> me *
crankycoder joined #ruby
<apeiros_> becom33: use \r to set the cursor back to the beginning of the line. use print instead of puts as not to emit the newline, use either $stdout.flush or $stdout.sync = true to disable the line buffering.
<becom33> apeiros_: I also need to know if their is better way to do a console designs
<clockwize> colleague just got me a cars 2 advent calendar :D shes awesome!
<apeiros_> becom33: that's too vague
Squarepy joined #ruby
<shevy> hmm
<shevy> becom33 he told you what to use!
Squarepy joined #ruby
sjltaylor joined #ruby
dv310p3r joined #ruby
<becom33> well you know stay screen on the console , but number and stuff changes without rolling down
<shevy> right. ASCII countdown
<becom33> yea somthing like that
<becom33> btw when I do def loopout(count)
<becom33> print "#{count} \r"
<becom33> end
<shevy> you just use stuff like print "\r" and STDOUT.flush (I don't know why I use STDOUT and not $stdout)
<becom33> sorry for the flood
<shevy> do you flush
<becom33> sorry forgot the flush
<shevy> first the flood, then the flush!
<becom33> he he well its not much a flood is it
<shevy> yeah I have seen bigger ones
max_ joined #ruby
<apeiros_> becom33: oh yeah, also, please don't use :: for method invocations
<apeiros_> I think you're the first to do it in the last 10 years. it looks ugly.
jtrudeau joined #ruby
<becom33> apeiros_: just a . then ?
<becom33> btw is it right to call the other method from inside of method just naming the other mothod name ?
Pip joined #ruby
<apeiros_> becom33: yes, just a dot
<apeiros_> and yes, unless it is fine to call a method just by its name
<becom33> ok :)
<apeiros_> errr, what's that 'unless' doing in there?
<becom33> still stuck with the flish
<apeiros_> and yes, it is fine to call a method just by its name
Sailias joined #ruby
<becom33> flush *
benlangfeld joined #ruby
<shevy> lol
<shevy> the flish!
<shevy> that must be a fish that is in a flush
LBRapid joined #ruby
<apeiros_> don't flush fishes that's mean
austinbv joined #ruby
Clooth joined #ruby
Zeks joined #ruby
jason joined #ruby
wyhaines joined #ruby
<Zeks> what is a god book to "get the feeling" of ruby. I do not intend to learn it fully as I do not have time but I want to be able to install and maintain ruby applications without the pain of guessing each time something goes different from the manual
<Zeks> ?
BrianE joined #ruby
<Zeks> or possibly a tutorial
ceej joined #ruby
negative joined #ruby
theRoUS joined #ruby
csavola joined #ruby
sbanwart joined #ruby
nari joined #ruby
bbttxu joined #ruby
bbttxu joined #ruby
bbttxu joined #ruby
Manhose_ joined #ruby
<shevy> Zeks it's hard to want to maintain other people's code
<shevy> Zeks the best would be for you to download ruby, start "irb", and then work through this tutorial here ONCE: http://pine.fm/LearnToProgram/?Chapter=00
<Zeks> shevy, I've run into countless "wtf?!" problems installing redmine and gitorious and it made me want to understand ruby *just a little bit more*
<Zeks> especially the latter >_<
<shevy> I don't know either but don't both provide easy means to install?
<shevy> Also, what kind of problems precisely
skim1776 joined #ruby
<Zeks> not understanding why something does not work. especially in the process of rake db:migrate or gem installations
<RLa> Zeks, too much of rails monkey patching? :)
<Zeks> yep
<skim1776> is there any GUI library for ruby which allows to create a cross-platform application?
<shevy> ah
<Zeks> since we have no one proficient with ruby the process was *painful* :)
<shevy> rake
<RLa> i think the best thing would be to have as best as possible debugger app
<shevy> I best avoid that :)
<shevy> skim1776, ruby-gnome works on windows and linux. no idea about mac
<RLa> skim1776, qt bindings
<skim1776> shevy, does the end user need to have a ruby interpreter to run it?
<Zeks> RLa, ?
<Zeks> explain pls)
<skim1776> I mean, if you build any program with ruby, does the end user need to install ruby interpreter for running the application?
<RLa> Zeks, graphical debugger which would allow to step through code and would show variables you have on objects
<shevy> skim1776 yeah
<shevy> skim1776 perhaps you want to use C or Java instead
<Zeks> RLa, for that I first need to at least know ruby program structure and a bit of language syntax )
* Zeks reading shevy's tut
<skim1776> shevy, anyway, Java needs jre
<shevy> and end users need JRE too!
<skim1776> shevy, that's what I mean
<skim1776> actually, is it possible to build GUI app which wouldn't require anything?
<skim1776> no, I guess it's impossible
<shevy> hardly skim1776
<shevy> you need to use something.
emptyflask joined #ruby
<moshee> you're gonna need something to draw pixels on the screen
<RLa> Zeks, using such debugger when learning to code is very helpful
<shevy> and you also wrote "cross-platform application"
<shevy> so it gets worse :D
<Zeks> RLa, thx
<moshee> shoes!
<skim1776> shevy, but it's possible to sew ruby installation within application installer for user not to mention what's being installed anyway, isn't it?
<RLa> sure
james_co_ joined #ruby
<shevy> not to mention
<shevy> if you are lucky and everything works!
<RLa> even if you use windows own tools to create gui apps, you need to distribute their crap too, visual c runtimes and whatever
<shevy> skim1776, here is something perhaps http://www.erikveen.dds.nl/rubyscript2exe/index.html
<shevy> "RubyScript2Exe transforms your Ruby application into a standalone, compressed Windows, Linux or Mac OS X (Darwin) executable. "
rippa joined #ruby
RomD joined #ruby
Synthead joined #ruby
albemuth joined #ruby
mkscrg joined #ruby
bier|tp joined #ruby
bier joined #ruby
alindeman joined #ruby
frem joined #ruby
<frem> Are there any good ostatus libraries around?
vitoravelino joined #ruby
vitoravelino joined #ruby
notbrent joined #ruby
iamjarvo joined #ruby
Clooth joined #ruby
yekta joined #ruby
jonathanrwallace joined #ruby
Ankhers joined #ruby
raythecat joined #ruby
ikaros joined #ruby
james_cotterill joined #ruby
Vendethiel joined #ruby
p0y joined #ruby
LiquidInsect joined #ruby
jwmann joined #ruby
Volodymyr-UA joined #ruby
bjhaid joined #ruby
jwmann joined #ruby
apok joined #ruby
<Volodymyr-UA> Hello guys :)
<Volodymyr-UA> Is anybody alive?
jwmann joined #ruby
axl_ joined #ruby
jwmann joined #ruby
radic joined #ruby
<shevy> Volodymyr-UA WE DIED FIVE YEARS AGO
<shevy> PLEASE AVOID STEPPING ON DEAD PEOPLE EVEN IF YOU CAN SEE THEM OK
dotnull joined #ruby
<apeiros_> is today 28 days later or something?
<apeiros_> why everybody keeps asking for alive people?
QaDeS joined #ruby
<shevy> hmmm
<shevy> perhaps some want for movies
<shevy> like resident evil, part 87906786
<shevy> also, zombie stories always sell a movie
<Zeks> zombie scores
strife25 joined #ruby
ceej joined #ruby
<becom33> looking for a good flush tut on ruby
mattonrails joined #ruby
<Volodymyr-UA> I need to have multithreaded application and limit number of threads for example to 10 . It's obvious to use semaphore like Mutex, but is only supports one one thread. So I need semaphore which can hundle any number of threads
jwmann joined #ruby
<Volodymyr-UA> any advices?
jwmann joined #ruby
rickmasta joined #ruby
<burgestrand> … mutex supports only one thread? What are you talking about?
ph00l1sh joined #ruby
<burgestrand> Oh, you must mean the semaphore count
<Volodymyr-UA> yeap
heftig joined #ruby
<Volodymyr-UA> I want to limit number of parallel threads to 10, but it supports only 1 thread
ldeveaux joined #ruby
ldeveaux left #ruby
<Volodymyr-UA> Because Python have Lock for 1 thread and Semaphore for multiple threads
<Volodymyr-UA> I want the same in Ruby :(
<burgestrand> I don’t think ruby has any counting semaphores; you could use a Queue to implement one yourself I guess
macmartine joined #ruby
pootpoot joined #ruby
JumpMast3r joined #ruby
<burgestrand> Or make one with Mutex/ConditionVariable, but still, it’s odd, maybe I’m wrong
poorlilrichboy joined #ruby
desmovalvo joined #ruby
fgro joined #ruby
radic joined #ruby
<burgestrand> Yeah, looks like it; no counting semaphore in ruby, only Mutex (lock), ConditionVariable and Queue/SizedQueue
<burgestrand> You’ll have to use those to make yourself a semaphore if you need one
Ankhers joined #ruby
<Zeks> "semaphore creation kit - have some fun on the road!"
kevinbond joined #ruby
<Volodymyr-UA> I found "Add Semaphore to Ruby" ticket and some simple counting semaphore implementation on another site, so I think it's a problem
excelsior joined #ruby
<Volodymyr-UA> that Ruby doesn't have such thing
bronsen joined #ruby
<burgestrand> Yeah, except nobody added any comments to that ticket for a year, you’re the first one I see asking for it :)
samxor joined #ruby
<JonnieCache> semaphores
<JonnieCache> im having flashbacks to compsci
bluOxigen joined #ruby
<JonnieCache> my advice: use a higher level concurrency paradigm and keep your sanity
revans joined #ruby
<Volodymyr-UA> :)
bluOxigen joined #ruby
<burgestrand> Haven’t tested it very well but it’s a start
booginga joined #ruby
<Volodymyr-UA> http://www.imasy.or.jp/~fukumoto/ruby/semaphore.rb there is also this implementation
alex__c2022 joined #ruby
Cervajz joined #ruby
austinbv joined #ruby
DrShoggoth joined #ruby
<burgestrand> Volodymyr-UA: won’t work on ruby 1.9.3, probably not 1.9.2 either
DrShoggoth joined #ruby
<burgestrand> Nope, not 1.9.2 either
<Volodymyr-UA> Ok, thanks
nachtwandler joined #ruby
ckrailo joined #ruby
<burgestrand> I wonder if mine works on 1.8.7…
<Volodymyr-UA> who knows :)
Know1edge1 joined #ruby
<Know1edge1> Any of you guys use hpricot?
<burgestrand> Yeah, mine works in 1.8.7 too!
<Know1edge1> am trying to search by doc/"a :not(:has(img))"
<Know1edge1> but getting errors
<burgestrand> (was not meant to you, Know1edge1 :p)
<Know1edge1> :D
<burgestrand> Volodymyr-UA: http://pastie.org/private/rlfjgsnalsy7tjgsvcfcca added synchronize method and aliases for inc/dec :)
dv310p3r joined #ruby
<Volodymyr-UA> burgestrand: great :)
Adman65 joined #ruby
<burgestrand> Volodymyr-UA: and now better example output: http://pastie.org/private/fxftewv8z3dxqvsziaf71a :D
<burgestrand> Sorry, I’ll stop bugging you now. :p
<booginga> hey all I'm looking around for a system resource monitor like nagious but written in ruby anyone know anything like that? can god monitor system resources or only processes?
cassarani joined #ruby
<cassarani> hi all
<cassarani> so, say I'm writing a pure-Ruby gem (i.e. no Rails), and I'm using RSpec for my tests, and I have no intention of using Cucumber
<cassarani> where should I put my high-level integration tests?
<cassarani> obviously if I was using Cucumber they'd end up in /features
<burgestrand> spec/whatever sounds like a good fit :)
<burgestrand> spec/integration
Rango joined #ruby
sdwrage joined #ruby
<cassarani> so how's this for a directory structure:
<shevy> ./
<shevy> ./pr0n
<cassarani> spec: [integration, gem_name: [cli, core, etc]]?
<shevy> ./todo
<cassarani> where gem_name is my gem name :P
<cassarani> i.e. I'd be mirroring the directory structure of /lib inside /spec/gem_name
<burgestrand> Yeah, sure, sounds good
<cassarani> ok thanks, just wanted to hear I wasn't making a glaringly stupid mistake
<burgestrand> As long as you don’t put it in spec/you_will_never_guess_what_is_in_here
<cassarani> indeed
<JonnieCache> we really need an rspec --init command
<burgestrand> spec/ or test/ is the usual standard locations anyway, personally I even use spec/features for cucumber specs even in rails nowadays :)
<JonnieCache> there's a ticket for it but its just been a debate for like 8 months or something
youdonotexist joined #ruby
austinbv joined #ruby
<cassarani> well JonnieCache, Rails users will just use rails generate rspec:install
<cassarani> so I can see why it wouldn't be a massive priority
<JonnieCache> yeah thats why theres been such a debate, they dont want to conflict with that
<cassarani> fair enough
<JonnieCache> i guess if youre writing your own gem you should be able to make your own spec directory structure
<JonnieCache> i always forget what to put in spec_helper.rb
RomD` joined #ruby
<cassarani> yeah well it's just convention over configuration isn't it?
<cassarani> it would be nice if everyone did the same thing, unless they had a reason not to
<csavola> cassarani: exactly
Know1edge2 joined #ruby
Icehawk78 joined #ruby
_lennart joined #ruby
Know1edge2 joined #ruby
<Icehawk78> What's the fastest way to return an array with each possible match on a string subbed?
<csavola> Icehawk78: substituted?
<cassarani> Icehawk78: as in - ary.map { |s| s.gsub(/foo/, "bar") }?
<Icehawk78> ie something like 'AAAAAA'.suball(/AA/, 'B') => ['BAAAA', 'ABAAA', 'AABAA', 'AAABA', 'AAAAB']
<cassarani> or am I misunderstanding your question?
<burgestrand> Oh, fun.
Know1edge1 joined #ruby
<Icehawk78> I know I could just iterate over the length of the string and call sub with the current index value, but that seems like it'd be longer than needed
rbanffy joined #ruby
Know1edge3 joined #ruby
<Icehawk78> I wasn't sure if there was something that would work better than doing that, though.
<burgestrand> It’s what I’d do, unless I can figure out a better way to do it…
jonathan_ joined #ruby
<burgestrand> Nope, got nothing.
zedUNDginger joined #ruby
<JonnieCache> i dont think there's any way to do it massively faster, it looks like one of those problems where youre going to have to touch all the data whatever you do
d3c joined #ruby
bosphorus joined #ruby
<burgestrand> Yeah, I was just thinking there might be another function to use that’s prettier!
<Icehawk78> I assume there's no way to have regexp return overlapping result groups, right?
<burgestrand> … sorry, I sinned, I meant method.
<d3c> I need to work in a temp dir in a class and make sure it's deleted when script is done no matter what happens. how may I do that?
<burgestrand> d3c: Tmpdir, ruby has it
<Icehawk78> Something like 'AAAAAA' ~= /AA/, but that'd give all indices, rather than just the first (or last, for rindex)
<burgestrand> … for some reason all the ruby stdlib documentation has started sucking lately
wyhaines joined #ruby
<burgestrand> Well, we have scan that returns all matches, which in turn you can map for all indices… :p
kuadrosx joined #ruby
radic joined #ruby
* apeiros_ loves: class String; def match_all(regex); scan(regex).map { $~ }; end
<apeiros_> + end
<d3c> burgestrand: so in order to have it removed, I'd need to do Dir.mktempdir { |dir| ... } ?
<Icehawk78> burgestrand: scan doesn't return overlapping matches, though, does it?
<burgestrand> Icehawk78: nope
<burgestrand> Icehawk78: it’ll match as much as possible, and for the next run it’ll continue where the previous match ended
<Icehawk78> That's what I thought
<Icehawk78> Huh, sub won't let me give it a starting index, either
h4mz1d joined #ruby
johnduhart joined #ruby
fermo joined #ruby
<d3c> I'm having some strange issues where tar will set a completely wrong user and group when extracting an archive via system. won't system calls run with the same user and group that ruby does?
Jake232 joined #ruby
Emmanuel_Chanel joined #ruby
<burgestrand> %x{whoami} # => "Kim\n"
<burgestrand> Looks like it.
<burgestrand> I’ve had a similar issue in the past, specifically related to archives.
<d3c> I use --touch with tar, maybe that changes something
<burgestrand> In that the archives themselves were extracted and the resulting files had the same UID as the user on the system that compressed it had.
<d3c> I just want it to set the timestamp correctly
<d3c> burgestrand: exactly - I think that's it
<d3c> burgestrand: might very well be the case. how did you solve it?
enikar joined #ruby
<Jake232> Anybody using Sublime Text 2 with Ruby?
smgt joined #ruby
<burgestrand> This was like two/three years ago, I don’t quite remember. It’s a really retarded feature/bug…
MendelGusmao joined #ruby
theRoUS joined #ruby
yekta joined #ruby
eignerchris joined #ruby
<burgestrand> Are you untaring it as root?
<burgestrand> d3c: ^
ghanima joined #ruby
<d3c> burgestrand: yes
vitoravelino joined #ruby
vitoravelino joined #ruby
<burgestrand> d3c: from the tar manpage: -o, --no-same-owner extract files with owner set to current user (the default for non-root users)
<burgestrand> Hm.
<burgestrand> But yeah, no idea actually.
<d3c> burgestrand: oh, that might work. will check it out
<burgestrand> I’d probably run another command after the extraction just to fix things up :(
<d3c> burgestrand: hacky but probably required. thanks a lot for your help, appreciate it!
<burgestrand> d3c: good luck :)
Morkel joined #ruby
lkba joined #ruby
<JonnieCache> Jake232: yes. its brilliant.
Know1edge1 joined #ruby
<Jake232> JonnieCache: I know, but I'm strugglign to get it to work
<Jake232> when I press ctrl + B
ckrailo joined #ruby
<Jake232> I just get
Ch4rAzZz joined #ruby
<Jake232> Syntax OK
<Jake232> [Finished]
<Jake232> I want it to display the output from my ruby code
Know1edge2 joined #ruby
<JonnieCache> whats that meant to do? build? im on mac so the keys are different
<Jake232> Sorry, Im on mac too
<Jake232> Cmd +
<Jake232> Cmd + B*
<Jake232> Shouldn't that, run my Ruby code, and display the output at the bottom?
kenichi joined #ruby
mengu joined #ruby
<JonnieCache> i never use that functionality, but i just tried it and it worked
<JonnieCache> i had to save the file first
ank joined #ruby
<Jake232> Yea, my file is saved
<Jake232> and
<Jake232> THen how do you see the output, from your code?
<JonnieCache> I just tried it with `100.times {|i| puts i}` and it printed the numbers and then said [Finished]
<JonnieCache> in the panel at the bottom
havenn joined #ruby
<Jake232> That's what I'm expecting
<Jake232> But not what I get
<Jake232> I just get: Syntax OK
<Jake232> [Finished]
Sliker joined #ruby
<JonnieCache> hmm i dont get Syntax OK just finished
friskd joined #ruby
flou joined #ruby
grekko joined #ruby
<Jake232> Hmm
<Jake232> What version of sublime
<Jake232> are you on
<JonnieCache> the latest dev build
Rango joined #ruby
<JonnieCache> 2144
<Jake232> So mine should work, It just isn't :/
smgt joined #ruby
<JonnieCache> weird
<Jake232> Ill try redownload I guess
VxJasonxV joined #ruby
<VxJasonxV> You guys have an onjoin channel notice, and it links to modruby.net , I suspect that isn't intentional; One because it's not in the channel topic, two because: "It Works!" (go view the domain)
p0y joined #ruby
eywu joined #ruby
<Jake232> JonnieCache: Still the same
hydrozen joined #ruby
<Jake232> Weird.
sdwrage left #ruby
eldariof joined #ruby
vootey joined #ruby
cpruitt joined #ruby
n8ji joined #ruby
ank joined #ruby
io_syl joined #ruby
io_syl joined #ruby
<Jake232> JonnieCache: Got it working
<skim1776> anyone speaking Russian here?
<Jake232> Deleted Packages directory
cafesofie joined #ruby
<Jake232> then reinstalled sublime
Brozilla joined #ruby
<JonnieCache> ah
<JonnieCache> have you got the package manager thing?
<JonnieCache> its much better than managing packages yourself
fgro joined #ruby
<Jake232> I'll grab it now, I havent usedsublime
<Jake232> in quite a while
<Jake232> I used it when Sublime 2, was in really early alpha stages
<Jake232> I believe its in late beta stages now
daniel_hinojosa joined #ruby
<JonnieCache> yeah its coming along very nicely
cdepue joined #ruby
austinbv joined #ruby
CannedCorn joined #ruby
<Jake232> Hmm
<Jake232> need to find something
<Jake232> to finish ruby syntax for me
<Jake232> eg: something.each do |f|
<Jake232> and it auto completes the 'end'
jamiejackson joined #ruby
thone_ joined #ruby
<JonnieCache> press tab after do
<JonnieCache> its like textmate
<jamiejackson> i'm trying to install rvm in multi-user mode, on ubuntu 11.10, via these instructions: http://beginrescueend.com/rvm/install/
<jamiejackson> at step 3, i get:
<jamiejackson> jamie@icf109118-Ubuntu:~$ type rvm | head -1
<jamiejackson> bash: type: rvm: not found
dv310p3r joined #ruby
<jamiejackson> please help me get rvm "found?"
<Jake232> JonnieCache: Does nothing for me :9
raincole joined #ruby
<JonnieCache> jamiejackson: ask in #rvm
<jamiejackson> i don't think there's an #rvm? at least i can't join one, anyway. am i wrong about that?
<Jake232> jamiejackson: /j #rvm
maletor joined #ruby
<jamiejackson> yeah, not working for me. maybe something's goofy with my freenode registration
jamiejackson joined #ruby
<jamiejackson> nope, i'm identified, but can't join #rvm
ianbrandt joined #ruby
<bjhaid> hi please who has installed ruby-oci8, i keep getting issues installing it
<bjhaid> /usr/bin looks like a full client
<bjhaid> *** /home/abejide/ruby-oci8-2.0.6/ext/oci8/extconf.rb failed ***
<bjhaid> Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
wilmoore joined #ruby
noImagination left #ruby
Beoran__ joined #ruby
kenperkins joined #ruby
<skim1776> if you are to write an questionary application for about 200 questions with variable number of variants on each given in a text form where would you store the data?
SamNotFrodo joined #ruby
thone joined #ruby
flip_digits joined #ruby
<Jake232> skim1776: A schemaless database? such a Mongo?
SamNotFrodo left #ruby
<Jake232> or am I mis-interpreting the question maybe
<skim1776> you sure? database just for 200 questions?
<skim1776> isn't it kinda wasty?
<benj_> does it need to be persistent?
<Jake232> Well, I suppose you don't need a database, but mongo is fairly lightweight. And, You're probably going to want to store your answers somewhere, right?
<shevy> hmm
airhorns joined #ruby
<benj_> is it multi-user?
<benj_> why re-invent the wheel; an embedded database like SQLite is a fine alternative to rolling your own file storage
<StitchedKite> skim1776: not really a DB would be more efficient than hard coding everything
<skim1776> why not just xml or yaml if we know the data won't be changed definitely
<JonnieCache> if theyre never gonna change then just use csv or something
<JonnieCache> or just linebreaks
Sigma00 joined #ruby
<JonnieCache> the thing is, they will change. even if your client has told you they wont change
<JonnieCache> in fact, ESPECIALLY if the client has told you they wont change
SplitNova joined #ruby
<benj_> if you have the final versions of them in a format easily convertible to, say, YAML, then that sounds fine
<Jake232> ^ The words of a man thats been fucked over by clients in the past.
dazoakley joined #ruby
cbuxton joined #ruby
<JonnieCache> not really fucked over. i just know enough to not believe that anything in a project is ever set in stone.
<benj_> however if the questions don't exist yet, someone needs to do some data entry
Revernd joined #ruby
<benj_> if that person is you - go ahead and write raw YAML. If not, make a sqlite database and give that person an off-the-shelf database admin tool to do it
p1d joined #ruby
Volodymyr-UA left #ruby
alfism joined #ruby
Tuxist joined #ruby
shadoi joined #ruby
quest88 joined #ruby
trivol joined #ruby
StitchedKite joined #ruby
mikepack joined #ruby
StitchedKite joined #ruby
daniel_hinojosa joined #ruby
Emmanuel_Chanel joined #ruby
Russell^^ joined #ruby
bluOxigen joined #ruby
<eighty4> I'm trying to create a symlink from ruby using the following puts %x[ln -s #{base_path}application_support/#{item} #{library}] where #item is the name of a folder. The problem is that the folder name can contain white-spaces and if they do the symlink fails. I've tried to gsub the folder name with something like gsub(' ', '\ ') but for some reason that gives me a folder name with two \. Anyone know how to
<eighty4> replace " " with "\ "?
Araxia_ joined #ruby
dyer__ joined #ruby
<JonnieCache> eighty4: maybe use the FileUtils.ln_s method http://ruby-doc.org/stdlib-1.9.3/libdoc/fileutils/rdoc/FileUtils.html#method-c-ln_s
<JonnieCache> it might handle it for you
adamkittelson joined #ruby
ephemerian left #ruby
Tuxi joined #ruby
burgestrand joined #ruby
zastaph joined #ruby
thepix joined #ruby
strife25 joined #ruby
musee joined #ruby
atmosx joined #ruby
ethndbst joined #ruby
robotmay joined #ruby
PhilK joined #ruby
kidoz joined #ruby
elliot98 joined #ruby
Pip joined #ruby
elliot98 joined #ruby
<eighty4> JonnieCache: thanks! I'll read up on that
ikaros joined #ruby
emiltin joined #ruby
Targen_ joined #ruby
gener1c joined #ruby
Emmanuel_Chanel joined #ruby
<emiltin> how can i make a rake task depend on the header files in a folder - plus a few cpp files?
<elliottcable> o7 all.
<elliottcable> How can I quickly/easily tell if a Net::HTTP request suceeded?
<elliottcable> there seem to be a lot of possible return values, like HTTPCreated and HTTPClientError
<gener1c> is there a way to protect my code>
<gener1c> ?
Manhose joined #ruby
danshultz joined #ruby
josh_____ joined #ruby
zedUNDginger joined #ruby
eywu joined #ruby
<shadoi> define protect
PaciFisT joined #ruby
isaqual joined #ruby
<JonnieCache> eighty4: oh yeah btw the reason youre getting multuple \ in your regex replace is because \ is the regex escape character. to replace with a slash you actually need \\\\ or some crazy shit like that
<isaqual> Yo, If i had hash like {"a"=>{"jee"=>23, "cee"=>24}, "b"=>200} , How I should delete "cee" ?
dyer joined #ruby
<eighty4> JonnieCache: yeah I realize that the problem was caused by \ being a replace char but googled it and couldn't find a solution for it ><
<JonnieCache> isaqual: the_hash["a"].delete("cee")
<eighty4> JonnieCache: but no :/ FileUtils.ln_s doesn't handle white-spaces
<isaqual> JonnieCache: Thanks :)
rrrreimer joined #ruby
<JonnieCache> eighty4: also double and single quoted strings handle escaping differently that might be something to do with it
rafa2000 joined #ruby
<musee> limited number of escapes in single quoted
jensn joined #ruby
<rrrreimer> what is the difference between a webserver and a webserver interface?
<rrrreimer> I just don't know what rack exactly is
Icehawk78 left #ruby
Manhose_ joined #ruby
<apeiros_> rrrreimer: a webserver is the thing your browser talks to
<JonnieCache> rack is a standardised way for webservers to talk to web apps (rails apps, sinatrta apps etc)
bronsen left #ruby
<apeiros_> a webserver interface is the thing the webserver and your ruby app talk to
<apeiros_> iow, it is: brower <-> webserver <-> rack <-> your ruby app
<musee> *browser
<ReinH> apeiros_: app(s)
<shadoi> s/rack/tiiiiiiits/
<JonnieCache> rack is a very thing layer though. its more of a protocol or a standard than anything else really
<musee> shadoi: yew wish
<shadoi> musee: don't I know it.
<apeiros_> sapp his bowser!
<musee> hahaha
mengu_ joined #ruby
mengu_ joined #ruby
rbanffy joined #ruby
bartd joined #ruby
Manhose__ joined #ruby
<shevy> what bowser
<apeiros_> shevy: y u not kno bowser?!?
jbpros joined #ruby
<shevy> is that something chinese
<shadoi> lol
<rrrreimer> can rack be compared to the php parser which sits between the web app and the webserver?
apok joined #ruby
Morkel joined #ruby
<JonnieCache> its closer to the fcgi interface i think
sepp2k1 joined #ruby
<shadoi> yeah, more like the apache module, etc.
raythecat joined #ruby
hlan joined #ruby
dcarper joined #ruby
austinbv joined #ruby
root joined #ruby
joshsmith joined #ruby
<joshsmith> if anyone here can help with this, I'd be most appreciative: http://stackoverflow.com/questions/8346413/why-cant-i-dbpush-to-heroku
<shadoi> joshsmith: using bundler or something?
h4mz1d joined #ruby
<joshsmith> shadoi: what's bundler?
nachtwandler joined #ruby
<joshsmith> shadoi: my usage of Ruby is limited to Heroku
luxurymode joined #ruby
sswitch joined #ruby
tatsuya_o joined #ruby
badabim joined #ruby
<zastaph> if I have str.split(%r{\t}) suppose I want the split regex in a var called splitVar = "\t" .. how do I insert it in there? {\t} is not really a string is it? so I guess %r{#{splitVar}} wouldnt work?
akem joined #ruby
bwlang joined #ruby
<rippa> zastaph: try it
<rippa> should work
<zastaph> ok, just the color syntaxing didnt seem so :)
<musee> :P
jbw joined #ruby
<zastaph> seems not to work right
<zastaph> though no errors
<zastaph> just the split regex seems off
zodiak joined #ruby
iamjarvo joined #ruby
<zastaph> works
DrShoggoth joined #ruby
aakashvd joined #ruby
daniel_hinojosa joined #ruby
chrxn_ joined #ruby
akem joined #ruby
chrxn_ joined #ruby
chrxn_ joined #ruby
chrxn_ joined #ruby
luxurymode joined #ruby
becom33 joined #ruby
dasfugufish joined #ruby
voodoofish430 joined #ruby
<becom33> http://pastebin.com/mgFv0BkQ I dont get the correct hash :/ one.txt only has "test" (without the qoutes) . test hash is 098f6bcd4621d373cade4e832627b4f6 but its givving me d8e8fca2dc0f896fd7cb4cb0031ba249 .. help
hydrozen joined #ruby
mikeycgto joined #ruby
mikeycgto joined #ruby
imsplitbit joined #ruby
clockwize joined #ruby
daniel_hinojosa joined #ruby
SegFaultAX|work joined #ruby
<becom33> anyone
<becom33> >
<becom33> ?
iocor joined #ruby
EddieBluh joined #ruby
Sailias joined #ruby
<becom33> anyone ?
<becom33> oh for crying out loud
kevinbond joined #ruby
clockwize joined #ruby
atmosx joined #ruby
LBRapid joined #ruby
Jake232 joined #ruby
robotmay joined #ruby
brauliobo joined #ruby
bradhe joined #ruby
<brauliobo> hello all, 'bundle exec rake test:units' is translating to 'ruby -Ilib:test /home/coletivo/.rvm/gems/ruby-1.8.7-p352@noosfero/gems/rake-0.8.1/lib/rake/rake_test_loader.rb "test:units"', anybody know why?
<bradhe> isn't there a way to unpack { "my_key" => { 'id' => 1 }} in to key = "my_key" and val = { 'id' => 1 } as a one liner? I thought that doing something like (key, val) = { 'my_key' => {'id' => 1} } for some reason...
jwmann joined #ruby
enikar joined #ruby
jwmann joined #ruby
jwmann joined #ruby
Pip joined #ruby
jwmann joined #ruby
kirun joined #ruby
jwmann joined #ruby
aakashvd joined #ruby
benja-M-_ joined #ruby
<bradhe> Closest I have to a 1-liner is key = hash.keys.first, values = hash.values.first
btanaka joined #ruby
<csavola> bradhe: is that the only thing in the hash/
<csavola> *?
daniel_hinojosa joined #ruby
<bradhe> csavola: yeah
<bradhe> it's a json-deserialized array of hashes
<csavola> bradhe:ugly but key, value = hash.to_a.first
<bradhe> ahh
<bradhe> hmm
brauliobo left #ruby
<bradhe> does the job I guess
<csavola> bradhe: not sure what you are really attempting to do :)
<bradhe> csavola: Array of hashes representing some objects, looking for a specific value for a attr of an object...really kinda silly. i.e. [{ "some_type" => { 'id' => 1 }, { 'some_type' => { 'id' => 2 }}], does the array contain a hash where 'id' == 1
mickn joined #ruby
<bradhe> csavola: here's what I came up with, open to more idiomatic solutions: https://gist.github.com/7af4197498992dfdc863
<bradhe> (or just otherwise better ones :))
<csavola> bradhe: check the gist... that's on way
<bradhe> ahh, nice
<bradhe> dig it
<csavola> I really need to get with the markdown
manizzle joined #ruby
daniel_hinojosa joined #ruby
ethndbst joined #ruby
aakashvd joined #ruby
pantsman joined #ruby
pantsman joined #ruby
Axsuul joined #ruby
mikeric joined #ruby
<yfeldblum> anybody in the know ... does `Class.new(some_other_class)` clear the method cache?
mikeric joined #ruby
bosphorus joined #ruby
fl0w joined #ruby
dnyy joined #ruby
PhilK joined #ruby
aakashvd joined #ruby
<zastaph> if I have a hash symbol myHash[:mySymbol] how do I put "mySymbol" in a var foo? myHash[:#{foo}] ? it would be easy if the keys were just strings
<zedUNDginger> zastaph: :"#{foo}"
<negative> grammar check please: Here will open a brand new networking service.
<zastaph> yoda says: A brand new networking service open here will
jeremy_ joined #ruby
<joshsmith> whoops
<joshsmith> that is not the link!
<Guest64889> what's the best way to get a new array from an existing one without a specified element ?
<joshsmith> and that is not work safe depending on your work, so don't click!
viuo_ joined #ruby
justicefries joined #ruby
minijupe joined #ruby
Blondyn joined #ruby
Blondyn left #ruby
skim1776 left #ruby
theRoUS joined #ruby
theRoUS joined #ruby
<Tachyon> is there a function like stripcslashes in php ?
<Tachyon> i cannot find it
<apeiros_> Tachyon: I try hard to forget php, so please explain what you want the method to do instead
jetblack joined #ruby
<Tachyon> i have string "some \"escaped\" string\nblah"
<Tachyon> and i want to convert it back
<Tachyon> so it would look like
<apeiros_> do you mean "some \\"escaped\\" string\nblah"?
<Tachyon> some "escaped string
<Tachyon> blah
<Tachyon> no
<apeiros_> the former is just a string with double quotes in it, no backslashes.
<Tachyon> yes
KarlHungus joined #ruby
<apeiros_> puts "\"" # => "
dcarper joined #ruby
<Guest64889> what's the best way to get a new array from an existing one without a specified element ?
LiquidInsect joined #ruby
<apeiros_> there is no convert it back from that - to what would you want to convert it back?
<apeiros_> Guest64889: ary - [ele]
<Tachyon> apeiros_: if i could get the output of the puts it would be sufficient
<Tachyon> something like converted_string=puts my_string
<apeiros_> Tachyon: I think you're not understanding inspect
<Tachyon> ?!
<apeiros_> x = "\""
<apeiros_> x does NOT contain a backslash
<Tachyon> omg
<KarlHungus> is there a way to set system wide irb config info? specifically, i'd like to log all irb commands in a central location
<Tachyon> i have got the string from html scraping
<Tachyon> i don't assign it to the string
<Guest64889> thank you apeiros_
<apeiros_> KarlHungus: ~/.irbrc is loaded by irb at start
<KarlHungus> apeiros_: correct, but thats per user env, not system wide
<Mon_Ouie> Doesn't it try to use something like /etc/irbrc too if it exists?
<KarlHungus> apeiros_: and tracing irb doesnt show it searching for /etc/irbrc
<Tachyon> if i assigned it, it would contain my_variable="some \\\"escaped\\\" string\\nblah"
<apeiros_> KarlHungus: there is none systemwide. you'll have to add an irbrc for every user. or modify your irb executable.
<apeiros_> Tachyon: that was the first question I asked…
<KarlHungus> apeiros_: ack. thanks, i'll replace it with a wrapper for something
<Tachyon> i didn't get it
<Tachyon> :)
<apeiros_> Tachyon: gsub
jbpros joined #ruby
<apeiros_> gsub(/\\(.)/, '\1') should probably do
<Tachyon> i try it
<apeiros_> ah, though, for \\n it won't work
<apeiros_> what version of ruby are you using?
<Tachyon> i think 1.19.1
<apeiros_> that's highly unlikely :)
<apeiros_> ruby -v # that gives you the ruby version
<Tachyon> ok
<Tachyon> D
DDAZZA joined #ruby
rickmasta joined #ruby
<Tachyon> X:\programs\ruby\bin>ruby -v
<Tachyon> ruby 1.9.2p180 (2011-02-18) [i386-mingw32]
iamjarvo joined #ruby
<Tachyon> apeiros_: is there a way to redirect puts into string ?
<apeiros_> Tachyon: won't work that way
<Mon_Ouie> Using StringIO
<apeiros_> puts there will just rpint it with quotes
<Mon_Ouie> $stdout = StringIO.new
<apeiros_> *print
clockwize joined #ruby
<Tachyon> ah
<Tachyon> right
<Tachyon> hm
<Tachyon> i could use eval
<apeiros_> you could
<Tachyon> but that is _VERY_ unsafe
<apeiros_> you could also give me a second…
<Tachyon> since i gather the string from web
<Tachyon> :D
<Tachyon> ok, /me stfu :D
<apeiros_> https://gist.github.com/1100314 in that is a piece of code to interpret strings
<apeiros_> don't know how complete it is…
dfamorato_ joined #ruby
<Tachyon> O.o
<apeiros_> line 74-88 is of interest to you, that builds a hash with all replacements.
<joshsmith> I can't install the addressable gem for some reason
<apeiros_> and line 184
<Tachyon> hmm
<Tachyon> i could use it
<apeiros_> hm, I think that needs a change in line 184, though :-/
<apeiros_> string.gsub(/\\(?:[0-3]?\d\d?|x[A-Fa-f\d]{2}|.)/) { |m| DStringEscapes[m] || m }
<apeiros_> ah, wrong
<apeiros_> string.gsub(/\\(?:[0-3]?\d\d?|x[A-Fa-f\d]{2}|.)/) { |m| DStringEscapes[m] || $1 } # better
<apeiros_> no, still not, damit…
<apeiros_> string.gsub(/\\(?:[0-3]?\d\d?|x[A-Fa-f\d]{2}|(.))/) { |m| DStringEscapes[m] || $1 } # now, I hope - maybe I should test it…
BrokenCog joined #ruby
<apeiros_> jupp, the last one works at least for your sample
<Tachyon> apeiros_: i try it
<apeiros_> I wonder, though… that should be doable easier on 1.9…
workmad3 joined #ruby
GreaseMonkey joined #ruby
GreaseMonkey joined #ruby
tvo joined #ruby
<apeiros_> you, can be simplified.
<Tachyon> well i need the dstringescapes to be defined
<apeiros_> Tachyon: http://pastie.org/2951378 there
<apeiros_> with that, you can just do: "some \\\"escaped\\\" \\string\\nblah".strip_slashes # => "some \"escaped\" string\nblah"
<Tachyon> wow!
<Tachyon> it works!
dv310p3r joined #ruby
<Tachyon> apeiros_: thank you very very much :)
<apeiros_> fascinating, isn't it… doesn't look like it should…
<apeiros_> ;-p
<Tachyon> it seems to me like bit of black magic
<apeiros_> if I omitted an escape sequence, just add it to the hash
<apeiros_> e.g. I just noticed, that "\s" == " ", didn't know that. so you just add '\s' => " ",
<Tachyon> yes
<Tachyon> no problem :)
<apeiros_> hm, there's a couple I omitted…
* apeiros_ wonders why…
<apeiros_> \v e.g. is missing as well… maybe I was in a hurry when I wrote the first one…
<Tachyon> i think this will suffice to the rest of my life :)
<Tachyon> i've only seen \n \" \\ \' and \t
<Tachyon> :)
<BrokenCog> is wxrubey2 still the GUI framework of choice?
<apeiros_> http://pastie.org/2951378 I updated the pastie. added some I missed. doesn't do ruby's \C-… sequences, though.
<Tachyon> not a problem :)
btanaka joined #ruby
badabim_ joined #ruby
<joshsmith> anyone here use the taps gem?
netogallo joined #ruby
stephenjudkins joined #ruby
_debo joined #ruby
btanaka joined #ruby
maletor joined #ruby
thepix joined #ruby
moonunitzappa joined #ruby
<Avi`> is there a bot here that can link to documentation etc?
ChampS_ joined #ruby
<Avi`> cause asking google about "=~" is a total fail
<apeiros_> Avi`: afaik no
<apeiros_> don't use google. use ri in your shell
<apeiros_> or ruby-doc.org, or rdoc.info, if you need a browser based one.
<Avi`> ri fails on =~
<Mon_Ouie> No, it doesn't
<apeiros_> does it also fail on `ri Array` (also, define 'fail')
<Avi`> ri =~
<Avi`> Nothing known about .=~
milkpost joined #ruby
<Mon_Ouie> ah, yeah, if you don't have the documentation installed
<apeiros_> you probably have not installed the docs then.
<Avi`> it works fine on ri Array
<moonunit> where does ruby store libs on UBUNTU ?
<apeiros_> Avi`: did you install ruby using rvm?
<moonunit> new to ruby
king313 joined #ruby
<apeiros_> moonunit: that'd depend on how you installed it.
<Avi`> apeiros_: yes
<moonunit> apt-get
<apeiros_> Avi`: rvm docs generate
<moonunit> ruby and rubygems or something elase
<apeiros_> moonunit: #ubuntu then. ruby devs are not in control of what apt does.
<joshsmith> while we're on the topic of how we installed ruby
<moonunit> well normaly were are they?
<moonunit> on windows or for you personaly?
<joshsmith> I think this is an issue with how I installed things and my OS: http://stackoverflow.com/questions/8346413/why-cant-i-dbpush-to-heroku
<apeiros_> moonunit: you can try `require 'rbconfig'; pp RbConfig::CONFIG` in irb, a couple of things are listed there.
<joshsmith> if someone can help me resolve that, I would be eternally grateful
<moonunit> ok ty apeiros_
<joshsmith> I think it probably has something to do with my PATH or where the gems are installed or how
<joshsmith> because I can use `taps push` just fine
<apeiros_> moonunit: well, for me, all stuff is under ~/.rvm/rubies/<selected ruby version>/
<joshsmith> but not `heroku db:push`
<joshsmith> heroku acts as though taps is just not installed
ilyam joined #ruby
eignerchris joined #ruby
<Avi`> apeiros_: ah thanks
DrShoggoth joined #ruby
cassarani left #ruby
tatsuya_o joined #ruby
<joshsmith> apeiros_: can you help me figure out if I have taps installed somewhere inaccessible?
paraglade joined #ruby
jarjar_prime joined #ruby
siksia joined #ruby
<moonunit> can anyone tell me what im doing wrong? started teaching myself ruby today and am running into a simple problem
<moonunit> im trying to use ARGV with user input
ilyam joined #ruby
<csavola> moonunit: what's the issue?
alfism joined #ruby
<moonunit> Its not working?
<moonunit> without the gets.chomp it works fine
<moonunit> but i dont know how to get user input in my script
<csavola> moonunit: just pasted it into a file and works for me... what version of ruby? how are you executing it?
mikewintermute joined #ruby
<moonunit> not sure, i used apt-get ruby and rubygems 1.8
<ccooke> moonunit: ... the error looks like it's coming from file system access, which you aren't fdoing
baroquebobcat joined #ruby
<moonunit> and hello.rb first second thrid
<csavola> moonunit: ruby -v
<moonunit> 1.8.7
<moonunit> 32 bit
<moonunit> linux
<csavola> moonunit: and you are just running ruby some_script.rb?
firmasaga joined #ruby
<moonunit> script.rb blah blah blah
<moonunit> hello.rb:5:in `gets': No such file or directory - eat (Errno::ENOENT)
<moonunit> from hello.rb:5
<csavola> moonunit: there isn't a shebang line... is there stuff you removed in the link?
<moonunit> oh weird, i think im running it wrong
<apeiros_> moonunit: Kernel#gets works off ARGF
<apeiros_> which means it'll treat all args passed to your script as files and try to read from them, and only after that it starts to read from $stdin. you probably want $stdin.gets instead of just gets.
<moonunit> ok ill try that
<moonunit> Combine gets.chomp() with ARGV to make a script that gets more input from a user.
<moonunit> that is my problem set
<moonunit> or exercise
<csavola> apeiros_: that is something I totally wouldn't expect
<moonunit> havent used $stdin yet
<apeiros_> csavola: most don't expect it. one of the biggest source for bugs.
linduxed joined #ruby
<linduxed> why does ruby both provide send and __send__ ?
<apeiros_> cost myself quite a bit of my time too (but that was ages ago)
<apeiros_> linduxed: because send might be overridden.
<linduxed> ooooh
<linduxed> that's sensible
<linduxed> thx for the quick answer
mklappstuhl joined #ruby
firmasaga joined #ruby
tdmackey joined #ruby
<apeiros_> linduxed: generally if you don't know the object you're calling send on, use __send__
<linduxed> ok
firmasaga joined #ruby
rpowell joined #ruby
<moonunit> how can i run ARGV with gets? if i run it like script.rb it works fine
<moonunit> but the vars are blank
<moonunit> but when i run it script.rb first second thirst doesnt work
firmasaga joined #ruby
<moonunit> do i need a comma or anything to run it?
<apeiros_> moonunit: you may want to re-read what I just wrote to you…
Jake232 joined #ruby
<linduxed> hmmm
firmasaga joined #ruby
<linduxed> i don't think i quite understand what send does... it looks like foo.bar could also be done with foo.send(:bar)
<joshsmith> can someone PLEASE help me
cantonic joined #ruby
<joshsmith> I have been blocked on a project all day long
<linduxed> but does that mean that every function is also a constant?
<linduxed> or sorry
<linduxed> :stuff are not called constants... forgot what they're called
<apeiros_> :stuff are objects
<linduxed> ok...
<apeiros_> :stuff.class # => Symbol
Y_Ichiro joined #ruby
<apeiros_> you can do foo.send("bar") too
<linduxed> symbols, that was the name
<apeiros_> if that helps you.
<moonunit> ok got it apeiros_ , so i need to use $stdin.gets everytime i have a ARG in script if i want user input?
<cantonic> hey guys. i am trying around with ruby for a while now and decided to write my first gui app. Can you recommend me a good starting point or a framework? I have googled and the choice is quite overwhelming for a semi-newbie :)
<apeiros_> but yes, every thing that has a name in ruby will define a matching symbol.
<apeiros_> moonunit: I'd just always use $stdin.gets
<linduxed> joshsmith: you haven't described the issue you face at all
<linduxed> joshsmith: do that first
<moonunit> ok ty
manizzle_ joined #ruby
<linduxed> apeiros_: i see
<joshsmith> linduxed: I have, an hour ago. and multiple times before that
<linduxed> joshsmith: oh, i wouldn't know, i just joined
<joshsmith> linduxed: ah, my bad
firmasaga joined #ruby
<joshsmith> I *think* the issue here is that the heroku gem can't find taps
<linduxed> apeiros_: so what does send do then? ask a function to do its thing? i'm confused
<joshsmith> I don't know ruby whatsoever, but I still dug around in their code trying to figure out what's going on
<apeiros_> linduxed: x = "foo"; bar.send(x)
<apeiros_> that's what you use send for.
<apeiros_> you can invoke a method by its name using a variable.
John_P joined #ruby
<joshsmith> the logic for checking for taps can be found on line 173
<joshsmith> actually, it's 202
<joshsmith> def load_taps
DrShoggoth joined #ruby
<joshsmith> and it throws the load LoadError error
Mohan joined #ruby
<joshsmith> I have taps 0.3.23
<joshsmith> but my guess is that it's installed somewhere that's inaccessible to the heroku client somehow
<joshsmith> I'm on Mac OSX
<joshsmith> I believe I installed Ruby with RVM, but not positive
dankest joined #ruby
firmasaga joined #ruby
Samoi joined #ruby
firmasaga joined #ruby
bosphorus joined #ruby
firmasaga joined #ruby
EddieS joined #ruby
thepix joined #ruby
firmasaga joined #ruby
mindCrime joined #ruby
siksia joined #ruby
zennny joined #ruby
Telling joined #ruby
firmasaga joined #ruby
firmasaga joined #ruby
firmasaga joined #ruby
firmasaga joined #ruby
negative joined #ruby
Sailias joined #ruby
MekkisFreenode joined #ruby
headius joined #ruby
Morkel joined #ruby
wyhaines_ joined #ruby
MchlFreenode joined #ruby
hydrozen joined #ruby
wyhaine__ joined #ruby
cdepue joined #ruby
stkowski joined #ruby
stephenjudkins joined #ruby
hadees joined #ruby
cableray joined #ruby
DrShoggoth joined #ruby
pantsman joined #ruby
pantsman joined #ruby
kdrsx joined #ruby
jetblack joined #ruby
mksm joined #ruby
mksm joined #ruby
tschundeee joined #ruby
blueadept` joined #ruby
booginga left #ruby
<frem> can someone recommend a jabber gem? I'm trying to use Blather, but it appears to have starttls required, which the server I'm connecting to doesn't use.
Squarepy joined #ruby
paraglade left #ruby
paraglade joined #ruby
mxweas_ joined #ruby
babinho joined #ruby
benja-M-_ joined #ruby
clockwize joined #ruby
<moonunit> hello
<moonunit> For somereason if i have IF DO or return in a string after a puts
<moonunit> example "puts "if you do want that, hit RETURN"
<moonunit> they go bold and break the script
<moonunit> as if they are not in a puts or something? anyideas?
littlebill902 joined #ruby
<littlebill902> why can't i do: m.message == "1" || "2" || "3" || "4" || "5" || "6" || "7" || "8"
<littlebill902> warning: string literal in condition
<moonunit> not sure what i am diong wront
<littlebill902> is that the wrong or operator?
<bean> littlebill902, ~= is what you want, I think.
VxJasonxV left #ruby
<apeiros_> littlebill902: that's always the same as just m.message == "1"
<apeiros_> "1" || "2" || "3" || "4" || "5" || "6" || "7" || "8" #=> "1"
<littlebill902> how do i check to see if the message is the number 1-8
<apeiros_> I'd concur with bean
<littlebill902> i thought i was saying message == 1 or 2 or 3
<littlebill902> ?
iocor joined #ruby
<littlebill902> ~= gives a syntax error
<apeiros_> he typoed. it's =~
<bean> littlebill902, i meant =~ i believe.
<apeiros_> and you can't just replace == with =~
tvw joined #ruby
<bean> =~ /1||2||3||4||5||6||7||8/ is what you'll want I think.
<littlebill902> regex is the devil
Bonkers joined #ruby
<apeiros_> o…kay…
<littlebill902> :(
<moonunit> nvm forgot a "
<aces1up> anyone know of any good project tracking software, that is free or inexpensive? just need something to keep track of like feature updates and then have a list of features / time to add, then a project milestone / estimation.
drizz joined #ruby
<bean> littlebill902, this explains regex pretty well: http://www.ruby-doc.org/docs/ProgrammingRuby/html/language.html#UJ
<Zeks> aces1up, rednine?
<bean> and http://rubular.com/ is pretty badass for testing.
<Zeks> redmine*
Mch1 joined #ruby
Mch1 left #ruby
hadees joined #ruby
randym joined #ruby
<mksm> littlebill902: (1..8).include? m.message.to_i
pootpoot left #ruby
joshsmith joined #ruby
Fraeon joined #ruby
ckrailo joined #ruby
Azure joined #ruby
nari joined #ruby
Samoi joined #ruby
beilabs joined #ruby
root joined #ruby
ilyam_ joined #ruby
<rpowell> hey does anyone know of a good library for parsing RSS feeds?
<rpowell> gem, whatever
macmartine joined #ruby
<rpowell> oh wait, there's a built in class for that
ilyam_ joined #ruby
gregorz joined #ruby
h4mz1d joined #ruby
mikeycgto joined #ruby
mikeycgto joined #ruby
max_ joined #ruby
benja-M-_ joined #ruby
xpot-mobile joined #ruby
sdwrage joined #ruby
sythe joined #ruby
sythe joined #ruby
annon joined #ruby
tomzx joined #ruby
cantonic joined #ruby
Guedes joined #ruby
<annon> Any way to force an encoding when pulling a file using Net::FTP::gettextfile?
Guedes joined #ruby
<annon> I have a file that is being detected as ASCII-8BIT that is breaking
<annon> Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
mxweas_ joined #ruby
<heftig> annon: well, obviously it's not utf-8
<annon> I have a workaround using getbinaryfile, writing it to disk, opening, and then deleting
benja-M- joined #ruby
<annon> but it would be nice to just use gettextfile and not write
<heftig> annon: or is it? do you know what the encoding of the file is?
<annon> the file is UTF-8, but i think the gettextfile ASCII mode is confusing the encoding
<annon> here's the workaround I'm currently doing: https://gist.github.com/1420723
wyhaines joined #ruby
strife25 joined #ruby
ceej joined #ruby
tomzx joined #ruby
<heftig> try that
<heftig> err whoops
<heftig> annon: forgot to remove the local filename
<annon> ah, that works
<annon> thanks!
kuadrosx joined #ruby
minijupe joined #ruby
i8igmac joined #ruby
<i8igmac> im looking for a way to dump output of a program to a file
xpot joined #ruby
iocor joined #ruby
<i8igmac> there are a few ways of doing this but my method does not work with specific apps
mjording joined #ruby
<mksm> i8igmac, code?
<i8igmac> IO.popen("app options -lmksiw > log.txt")
<i8igmac> im looking for other options
<mksm> open3 gem
Targen joined #ruby
ikaros joined #ruby
<mksm> actually
<mksm> it's in stdlib
emmanuelux joined #ruby
<i8igmac> really im trying to process output from airodump-ng
<i8igmac> ill have to check out open3
<i8igmac> this app does not print output in the same way as other apps
<mksm> i8igmac, it uses stdout/stderr/stdin, right?