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
<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?
<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
<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
<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?
<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?
<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 ??
<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?
<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 & and ö to ö ?
<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?
<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
<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
<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?
<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>
"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
<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:
<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
<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!
<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
<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>
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 ><
<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
<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
<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>
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>
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.