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/
dyer joined #ruby
craigglennie_ joined #ruby
Seisatsu joined #ruby
tomzx joined #ruby
_numbers left #ruby
Bonkers joined #ruby
craigglennie_ joined #ruby
craigglennie__ joined #ruby
skrewler joined #ruby
mr_shadow joined #ruby
<mr_shadow> help
<mr_shadow> mt
h4mz1d joined #ruby
Azure joined #ruby
<mr_shadow> exit
apeiros_ joined #ruby
apeiros_ joined #ruby
n8ji_ joined #ruby
<shevy> lol
j3r0m3 joined #ruby
Knodi joined #ruby
Cervajz joined #ruby
Cervajz joined #ruby
mikepack joined #ruby
brownies joined #ruby
theRoUS joined #ruby
<brownies> where can i learn about writing tests?
j3r0m3 joined #ruby
craigglennie_ joined #ruby
theRoUS joined #ruby
kevinluikens joined #ruby
theRoUS joined #ruby
<kevinluikens> hello there, is it possible to have conditionals when utilizing string interpolation?
frogstarr78 joined #ruby
raincole joined #ruby
<kevinluikens> nevermind that question -- found the relevant docs
S1kx joined #ruby
S1kx joined #ruby
perryh joined #ruby
justinmcp joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
theRoUS joined #ruby
badabim joined #ruby
mengu joined #ruby
mengu joined #ruby
skillachie joined #ruby
<skillachie> Hi I am using xchat. How do i respond directly to someone when they are addressing me in a convo
<skillachie> sorry really noob irc question
h4mz1d joined #ruby
wyhaines joined #ruby
<RubyPanther> skillachie: normally you type the first few letters and then hit tab (again if it chooses wrong) or for a private message you type /msg name blahblah and xchat opens a tab
<skillachie> RubyPanther, ohh
<skillachie> RubyPanther, so just like that you got the msg. Thank you
zambaboo joined #ruby
<zambaboo> hey guys, im wondering how to get bundler to install two versions of a gem
<RubyPanther> skillachie: and you put all your names in the preferences->chatting->alerts "Extra words to highlight"
<zambaboo> is that possible?
skrewler_ joined #ruby
<skillachie> RubyPanther, thx
fixl joined #ruby
<RubyPanther> zambaboo: I'm not sure bundler can "install" them that way or not, but you probably can't actually use two versions at once in the same code.
<zambaboo> RubyPanther, yes yes i am aware of that. however i need two versions of the same gem installed.
j3r0m3 joined #ruby
bwlang joined #ruby
sbanwart joined #ruby
cdepue joined #ruby
nari joined #ruby
Wizywig joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
tvw joined #ruby
Hellojere joined #ruby
fennec joined #ruby
<fennec> I am writing tests. I've got a Zlib::GzipReader object in hand. I know that this reader was constructed either with a StringIO or a Tempfile as the IO object that it wraps, and I want to know which, and I don't particularly care how clean or black-box the solution is.
<fennec> any ideas? :)
yfeldblum joined #ruby
<jmontross> inspect the different objects and look for differences
<jmontross> throw your example object in irb.
<jmontross> puts object_from_stringIO.inspect
<jmontross> puts object_from_Tempfile.inspect
banister`sleep joined #ruby
<fennec> jmontross: you mean, ah, #<Zlib::GzipReader:0x007fa54cad0c70> vs #<Zlib::GzipReader:0x007fa54d91a3f8>?
<jmontross> but inspec them in further detail
<jmontross> fennec: yes I mean those objects, but you may want to see if they share some common method like .origin or something that tells you from whence it came
<jmontross> they sadly both are gzip reader objects so you'll need to look further… perhaps you could know prior to this step and keep track by passing in some additional parameter and wrapping the zlip reader function with somethign of your own
<jmontross> object.methods.sort. get them in irb
<jmontross> and then play with the methods to see if there is something consistent that tells you its origin
<fennec> gmontross - with all due respect, I'm aware of how to execute the process of "figure it out myself". the problem is that this process has not been particularly fruitful.
<fennec> :)
<jmontross> i did not tell you to figure it out yourself. I gave you a specific way of discovering this yourself.
<jmontross> good luck.
phrame joined #ruby
<jmontross> fennec : if you could store the source in the file name somehow that might help
jmontross left #ruby
jmontross joined #ruby
<fennec> source in the filename…. how's that? if it's a stringio there's no file involved, it's just reading a stream…
<jmontross> then that won't work.
<jmontross> are there headers on the stream?
<jmontross> object.headers - what are the methods on those objects?
<jmontross> puts stringIOobject.methods.sort
ontehfritz joined #ruby
<fennec> i don't know what you're talking about. StringIO has a lot of headers and doesn't have a .headers method.
mxweas_ joined #ruby
<fennec> context. some networking code gets a byte count and it is followed by a gzipped data stream. if there is going to be a lot of data, it will be buffered to disk (Tempfile). If not, it will remain in memory (StringIO). this will be wrapped a gzipreader and thrown halfway across the codebase to the point where I'm testing it. i'd like to specifically test that the gzipreader that I got is backed by a file in this case. the gzipreader object does not seem to have
<fennec> any obvious way to tell me that, and it would be mildly onerous to restructure the code in question to record this data for the sake of a test. i'm hoping there's something I'm overlooking.
zodiak joined #ruby
Draco_ joined #ruby
sdavis joined #ruby
<fennec> unfortunately, gzipreader seems to be light on methods which would tell me about its contents.
<jmontross> I'd say inspect the beginning of stream and find unique signature or keep it in memory until it reaches said limit…
<jmontross> while StringIO somecheck < somemaximum
sdavis joined #ruby
<fennec> what "unique signature"? The contents of the stream is dummy test data, and it looks the same whether it's on disk or in memory.
<jmontross> i guess there is not a unique signature…. i was hoping for your sake there was
acml joined #ruby
<fennec> moreover it's entirely beside the point. i need to be able to recieve abitrary data and if it's big enough, I want it stuffed on disk instead of eating all my RAM. that needs to depend on the length of the data. if I'm testing that the data has a 'unique signature' after it does a round trip over network sockets I'm not really testing whether or not it was streamed to disk, am I?
<fennec> the data's unique signature is that the data is the string 'big' x (1024*1024). if I wrote assert_equal(('big' x 1024*1024), gzipreader.read) then it's a pretty meaningless test. i mean, sure, it tells me that the data was successfully decoded, but I already have that test.
tk_ joined #ruby
strife25 joined #ruby
<fennec> (er, make that 'big' * (1024*1024). the 'x' is the equivalent Perlism. my bad.)
<jmontross> while StringIO.length < somemaximum
<jmontross> there must be a way to count the size of it as it comes in and determine to write to disk at some point...
redgetan joined #ruby
phrame joined #ruby
<fennec> again, you're missing the point. someone already has determined the size and counted it as it came in. that's why it was written to disk in the first place. i am doing something with the code known as 'testing' (perhaps you've heard of it) where I am attempting to verify programatically that the code works as intended.
Cervajz joined #ruby
Cervajz joined #ruby
<shevy> http://anderse.wordpress.com/os-js/ <--- WHY NOT RUBY!!! :(
sebastor_ joined #ruby
<fennec> shevy - what, why not ruby in a browser? ask Mozilla + Google + Microsoft + Opera
cooper joined #ruby
<jmontross> fennec: i suggest you start by writing a test that fails.
<jmontross> define a specific unit test that defines this intended way i don't understand
<shevy> fennec yeah, it's an unfair win for js
<fennec> jmontross: http://pastebin.com/PiqaYfFS
phrame joined #ruby
flip_digits joined #ruby
<skillachie> Hey does anyone know of a good gem to convert postscript to html ?
<skillachie> used rghost to convert pdf to ps, now I would like to convert postscript to html. If there are no gems, how would you convert it
phrame joined #ruby
<fennec> jmontross: handle_bigness runs in a separate process from test_bigness and they communicate over the network. handle_bigness gets passed an object named data. the data object is a GzipReader, and is wrapping either a StringIO or a Tempfile object. I want to know which, and haven't access to those StringIO and/or Tempfile objects directly. i really don't think it's an A/B problem; I really want to know whether there's some way to figure that out from the zlib o
<fennec> bject, for the purposes of testing.
<jmontross> yeah. - this is why I had earlier thought to look at the methods on the z lib object and see their output. hopefully it indicates some origin.
<jmontross> have you done a zlibobject.methods.sort?
<fennec> wait, wrong paste sorry :D
<fennec> -- there, fixed.
<fennec> i mean, sure, there's some things in there which look promising. like orig_name. but that actually tells you the original name of the file which became the stream of gzip data which is actually 'nil' because it was never a file before it was gzipped.
asuka_ joined #ruby
dankest joined #ruby
steph021 joined #ruby
steph021 joined #ruby
<jmontross> have you looked at the readlines for any hint? or the lines? you could use lines and see if there is any sort of way of telling its origin — -or you could possibly go to the original place where these are written and stuff in some header type thing that helps you… this is a tough one
<jmontross> i dont know
<jmontross> good luck
<jmontross> puts StringIO.new(gzdata).methods.sort is nicer than puts StringIO.new(gzdata).methods.inspect because it puts alphabetical
banister`sleep joined #ruby
<shevy> hmmmmmm
<fennec> jmontross - i recognize that this is somewhat difficult. i understand that, and it does not trouble me. however, i'm very worried that you're still advising me to manipulate my data. because that's Stupid. the lines are whatever I set them to be, and if I try to test that the lines are something or another it's not actually testing anything! it's testing that I wrote a useless test! the test is a tautology!
<jmontross> you're clearly more advanced than me.
<jmontross> just offering humble opinion. i'm done. good luck.
_debo joined #ruby
<fennec> thanks.
<fennec> i think i'll head home and worry about it monday
__class__ joined #ruby
redgetan joined #ruby
jmontross left #ruby
jmontross joined #ruby
lobo_d_b joined #ruby
mxweas_ joined #ruby
[2]maarten joined #ruby
fixl joined #ruby
nari joined #ruby
Knodi joined #ruby
badabim joined #ruby
thecreators joined #ruby
jmontross left #ruby
nari_ joined #ruby
<shevy> hmm
robyurkowski joined #ruby
zodiak joined #ruby
philcrissman joined #ruby
robbyoconnor joined #ruby
banister`sleep joined #ruby
robyurkowski joined #ruby
fixl joined #ruby
Wizywig joined #ruby
wyhaines joined #ruby
banister_ joined #ruby
youdonotexist joined #ruby
banister`sleep joined #ruby
danted joined #ruby
<danted> Can anyone give me some tips on how to code this faster? http://pastie.org/2886601
<danted> It takes forever to cycle through each number
ThatDudeGuy_ joined #ruby
dburton joined #ruby
<skillachie> no one has done postscript to html before
<banister`sleep> anyone here speak portugese?
pen_isident joined #ruby
Targen joined #ruby
manizzle joined #ruby
kevinbond joined #ruby
andoku joined #ruby
ryanf joined #ruby
akem joined #ruby
akem joined #ruby
x0F_ joined #ruby
BrokenCog joined #ruby
banister`sleep joined #ruby
thecreators joined #ruby
mxweas_ joined #ruby
beilabs joined #ruby
incluye joined #ruby
macmartine joined #ruby
krz joined #ruby
minijupe joined #ruby
devdazed joined #ruby
iamjarvo joined #ruby
krz joined #ruby
ryanf_ joined #ruby
<shevy> banister`sleep bebe merda!
hunterman joined #ruby
Clooth joined #ruby
voodoofish joined #ruby
hunterman left #ruby
macmartine joined #ruby
jcrites joined #ruby
tomzx joined #ruby
td123 joined #ruby
radic_ joined #ruby
redgetan joined #ruby
thecreators joined #ruby
ryanf joined #ruby
sullx joined #ruby
andersen joined #ruby
<td123> is there a preference for using tabs over 4/8 spaces in ruby liker there is in python? (for python pep8 recommend 4 spaces)
steph021 joined #ruby
steph021 joined #ruby
<ryanf> ruby is universally 2 spaced
mxweas_ joined #ruby
<ryanf> *spaces
<sullx> How would on write a script that would monitor values of a integer variable while another part of the script was running through a very long loop? Is this multithreading? What is the proper lingo so I can do some research?
<td123> ryanf: ah, cool, I find that a reasonable choice :)
<td123> ryanf: thanks
<Clooth> HI EVERYBODY
andersen joined #ruby
<sullx> hello one
andersen joined #ruby
dabaR joined #ruby
<td123> sullx: I guess you would have to implement some checking inside the loop, otherwise you will probably have to do threading
<dabaR> I am looking to make a gem for some code that requires a config file. How should I make it distributable and configurable, but still be a gem?
<dabaR> I mean, the distributable is covered by the gem, just wondering how to make it know about a config?
<dabaR> maybe it require '~/.config' ?
andersen joined #ruby
Y_Ichiro joined #ruby
<td123> sullx: I don't know very much about ruby yet, but that sounds awefully like you would want to use a debugger to watch a variable
<sullx> td123: hm, thanks for the input
<sullx> Just trying to puzzle through an app that is monitoring the progress of other scripts for statistical purposes
<shevy> td123 I use 2 spaces consistently when indenting, never any \t tab chars
andersen joined #ruby
<td123> shevy: k, thx
<dabaR> And, when making a executable script in bin, how should it include files in lib?
CannedCorn joined #ruby
macmartine joined #ruby
dotnull joined #ruby
<sullx> can anyone shed a little more light on my question?
redgetan left #ruby
<shevy> sullx no idea really ... I think you could use mutex somehow ... http://www.ruby-doc.org/core-1.9.3/Mutex.html
<shevy> or perhaps simply run Thread.new within your main script
j3r0m3__ joined #ruby
ujihisa joined #ruby
mxweas_ joined #ruby
macmartine joined #ruby
kennethreitz joined #ruby
kennethreitz joined #ruby
j3r0m3 joined #ruby
lobo_d_b joined #ruby
fixl joined #ruby
<tightwork> I am following the getting started guide, and after adding posts controller in sec 7.4 when I try to save a comment I get:uninitialized constant CommentsController::Posts, everything is verbatim to the guide.
macmartine joined #ruby
<Kiten> yeah uhh tightwork you'll need to be more specific about what gem your using, though as it were i wouldn't be able to help anyhow though i'm sure the other kind chaps would though
<mattp_> whats the best way to tak the first and last characters off a string?
<ryanf> mattp_: str[1, -2] probably
<mattp_> word. thanks :)
BitPuffin joined #ruby
<ryanf> fuck wait
<mattp_> 1 .. -2 you mean
<ryanf> yup
Adman65 joined #ruby
<ryanf> my bad
ryanf_ joined #ruby
luckyruby joined #ruby
j3r0m3 joined #ruby
robyurkowski joined #ruby
mxweas_ joined #ruby
Cervajz joined #ruby
Cervajz joined #ruby
minijupe joined #ruby
macmartine_ joined #ruby
bluOxigen joined #ruby
RomD joined #ruby
peterhil joined #ruby
qo joined #ruby
<skillachie> Hey anybody done postscript to html before, in ruby. If so how did you do it ? What gem did you use etc
iband joined #ruby
wyhaines joined #ruby
sdavis joined #ruby
j3r0m3 joined #ruby
BrokenCog joined #ruby
mxweas_ joined #ruby
badabim joined #ruby
macmartine joined #ruby
j3r0m3 joined #ruby
sandstrom joined #ruby
sandstrom joined #ruby
xpot joined #ruby
xpot-mobile joined #ruby
macmartine joined #ruby
sqbell joined #ruby
kawa_xxx joined #ruby
moshee joined #ruby
moshee joined #ruby
slact joined #ruby
<slact> is it sleepy here?
<slact> yeah, it's sleepy.
rippa joined #ruby
robyurkowski joined #ruby
RomD joined #ruby
mxweas_ joined #ruby
tomzx joined #ruby
j3r0m3 joined #ruby
Draco_ joined #ruby
nari_ joined #ruby
<Kiten> mostly
<Kiten> ;p
<Kiten> 2:36 am EST (GMT -5:00)
<Clooth> I love ruby
<Clooth> [:A..:Z,0..9].map(&:to_a).flatten.sample(16).join.scan(/.{1,4}/m).join('-')
<banister`sleep> Clooth: or you could skip the .map(&:to_a).flatten
<Clooth> yeah?
<banister`sleep> by just putting: [*(:A..:Z), *(0..9)]
<banister`sleep> in 1.9+
<Clooth> hmm
<Clooth> nice
<Clooth> thank you!
<Clooth> (:
mxweas_ joined #ruby
<banister`sleep> np
<Clooth> is there a better alt for the scan part?
<heftig> 4.times.map{rand(36**4).to_s(36).upcase.rjust(4,?0)}.join(?-)
<Clooth> im not trying to get down to smaller bytesizes
<Clooth> :P
<Clooth> but thats nice too
<Clooth> wait, rjust
<banister`sleep> Clooth: [*('A'..'Z'), *('0'..'9')].sample(16).each_slice(4).map(&:join).join('-')
<Clooth> hmm
cosmikduster joined #ruby
<Clooth> nice, thank you
<Clooth> I like the scan one so far the most I think
<Clooth> [*(:A..:Z),*(0..9)].sample(16).join.scan(/.{4}/).join('-')
cosmikduster left #ruby
stunna joined #ruby
axisys joined #ruby
cosmikduster joined #ruby
moondiamond joined #ruby
raincole joined #ruby
kawa_xxx joined #ruby
dave joined #ruby
manizzle joined #ruby
s0ber joined #ruby
skillachie joined #ruby
<Kiten> hmm i'm having trouble finding out how to read in a file as hexadecimal ideas ?
<Kiten> err rather
Draco_ joined #ruby
<Kiten> read in a file and read the contents in hex
j3r0m3 joined #ruby
workmad3 joined #ruby
flippingbits joined #ruby
Seisatsu joined #ruby
stephans joined #ruby
trivol joined #ruby
stephans joined #ruby
hobodave joined #ruby
sillylogger joined #ruby
Newbs joined #ruby
Draco_ joined #ruby
<sillylogger> Hi I'm having trouble evaluating a block of code such that it has access to a variable
kaneda__ joined #ruby
<sillylogger> i'm really just sort of fleshing out this part of my project and i want to separate a bunch of logic out of a particular class.. put it in a module, but i want access to a particular variable
<sillylogger> i mean, i can put a 'user' helper function on that ComplexMath module… that pulls the user off the current thread… perhaps i should do that
sooli joined #ruby
pantsman joined #ruby
pantsman joined #ruby
moondiamond joined #ruby
Morkel joined #ruby
hobodave joined #ruby
segv left #ruby
will302 joined #ruby
will302 joined #ruby
CapsuleNZ joined #ruby
Morkel_ joined #ruby
adambeynon joined #ruby
ChampS_ joined #ruby
yxhuvud joined #ruby
dnjaramba joined #ruby
rippa joined #ruby
sandstrom joined #ruby
jensn joined #ruby
ramusara joined #ruby
kawa_xxx joined #ruby
apeiros_ joined #ruby
Manhose joined #ruby
ksinkar joined #ruby
Manhose_ joined #ruby
grekko joined #ruby
iband joined #ruby
bluOxigen joined #ruby
jbpros joined #ruby
banister`sleep joined #ruby
Manhose__ joined #ruby
perryh joined #ruby
Manhose joined #ruby
Manhose_ joined #ruby
johnnus_ joined #ruby
_debo joined #ruby
pantsman- joined #ruby
sdavis joined #ruby
Vendethiel joined #ruby
kszatan left #ruby
Seventoes joined #ruby
virunga joined #ruby
<virunga> Hi, Do methods of FileUtils work only on Unix?
<whitequark> virunga: afaik they're implemented in pure OS API (i.e. "FileUtils.rm_rf" does _not_ invoke "/bin/rm")
<whitequark> but I don't know about their Windows compatibility
<virunga> whitequark, mm ok. If you were move a file with ruby under Win, what method would you use?
johnnus_ joined #ruby
<whitequark> virunga: wait a sec
justinmcp joined #ruby
<virunga> whitequark, ok, thank you
<whitequark> virunga: FileUtils uses raw OS read and write API
<whitequark> i.e. it implements cp, mv, etc. logic
<whitequark> FileUtils.cp should just work
<whitequark> or mv
justinmcp joined #ruby
AndChat- joined #ruby
<virunga> whitequark, thank you so much!
<virunga> whitequark, bye
timonv joined #ruby
BitPuffin joined #ruby
Cervajz joined #ruby
robyurkowski joined #ruby
polysics joined #ruby
<polysics> hello! how do i mock a call to a static method, please?
<polysics> i need to test that a method calls MyModule::MyClass.method
timonv joined #ruby
Mchl joined #ruby
desmovalvo joined #ruby
<skillachie> Hey was here yesterday, sorry for the repeat question, but no one responded
<skillachie> does anyone know a good postscript to html converter ?
tvo joined #ruby
RB143 joined #ruby
<RB143> Hello every one
<RB143> Have one doubt
<RB143> anyone there
Cervajz joined #ruby
<RB143> hello
tatsuya_o joined #ruby
<RB143> hello
Jackneill joined #ruby
Jackneill joined #ruby
Pip joined #ruby
polysics left #ruby
blackflys joined #ruby
stoffus joined #ruby
fleixius joined #ruby
<fleixius> I need help with some regex, I need to capture everything after the 3rd '/'
<fleixius> WIth a test string looking like abc/def/ghi/123/456.
<fleixius> Or I could just split by slashes and pop 3 times, then join it with a slash. lol
manizzle joined #ruby
jgrau joined #ruby
<rippa> "abc/def/ghi/123/456".match /\/[^\/]+\/[^\/]+\/(.*)/
Adman65 joined #ruby
michael_mbp_ joined #ruby
AlecTaylor joined #ruby
<AlecTaylor> hi
<AlecTaylor> Is there a 64-bit version for Windows?
codespectator joined #ruby
jbpros joined #ruby
kawa_xxx joined #ruby
dzhulk joined #ruby
moond joined #ruby
jay_zawrotny joined #ruby
pen_isident joined #ruby
moondiamond joined #ruby
kawa_xxx_ joined #ruby
kawa_xxx joined #ruby
kidoz joined #ruby
bier joined #ruby
BitPuffin joined #ruby
timonv joined #ruby
codespectator joined #ruby
moondiamond joined #ruby
Maya-PSK joined #ruby
dburton joined #ruby
shevy joined #ruby
iocor joined #ruby
onisen joined #ruby
lusory joined #ruby
jcromartie joined #ruby
Guedes joined #ruby
Guedes joined #ruby
Sliker_ joined #ruby
fixl joined #ruby
iband joined #ruby
araujo joined #ruby
lkba joined #ruby
statarb3 joined #ruby
AzizLight joined #ruby
Morkel joined #ruby
hekin joined #ruby
hekin joined #ruby
yfeldblum joined #ruby
Staal_Burger joined #ruby
Newbs joined #ruby
sepp2k joined #ruby
linoj joined #ruby
workmad3 joined #ruby
lusory joined #ruby
Paladin joined #ruby
<AlecTaylor> I can't install spree on Windows: https://github.com/spree/spree/issues/789
gener1c joined #ruby
Paladin joined #ruby
nricciar__ joined #ruby
Russell^^ joined #ruby
gener1c joined #ruby
Cervajz_ joined #ruby
Newbs joined #ruby
incluye joined #ruby
iamjarvo joined #ruby
KL-7 joined #ruby
nerded joined #ruby
jbpros joined #ruby
Paladin joined #ruby
p0y joined #ruby
raincole joined #ruby
Manhose joined #ruby
workmad3 joined #ruby
Hellojere joined #ruby
Maya-PSK joined #ruby
workmad3 joined #ruby
linoj joined #ruby
Guedes joined #ruby
p0y_ joined #ruby
kawa_xxx joined #ruby
brianherman joined #ruby
negative joined #ruby
<AlecTaylor> Ruby isn't as fast as C
dburton joined #ruby
berkes joined #ruby
wyhaines joined #ruby
p0y joined #ruby
steph021 joined #ruby
steph021 joined #ruby
j3r0m3 joined #ruby
Manhose_ joined #ruby
jay_zawrotny joined #ruby
Hellojere joined #ruby
Maya-PSK joined #ruby
kirun joined #ruby
Hellojere joined #ruby
Axsuul joined #ruby
zastaph joined #ruby
jcromartie joined #ruby
krish joined #ruby
<zastaph> am looking for some gem that can limit the output so that the console doesnt get spammed... like.. allow 10 puts within X seconds, and if more fills up, then ditch some of them so that only one per second is displayed until it throttles down beyond a threshold again
Mahoek joined #ruby
srji joined #ruby
wyhaines joined #ruby
AzizLight joined #ruby
p0y joined #ruby
Guest60827 left #ruby
p0y_ joined #ruby
thecreators joined #ruby
CannedCorn joined #ruby
SolarisBoy joined #ruby
p0y__ joined #ruby
akem joined #ruby
akem joined #ruby
tobyo joined #ruby
jfredett joined #ruby
p0y joined #ruby
Jake232 joined #ruby
lapinferoce joined #ruby
guest_ joined #ruby
guest_ left #ruby
hack_ joined #ruby
trivol joined #ruby
nimred joined #ruby
luckyruby joined #ruby
pgpkeys joined #ruby
iband joined #ruby
EddieBluh joined #ruby
Tomasso joined #ruby
bartd joined #ruby
wyhaines joined #ruby
<Tomasso> im using rvm, i successfully and easily switch among ruby versions, but my question is, is that possible to use different ruby versions at same time?
<Tomasso> run a ruby app with a version, and other ruby app with another version..
jimgg joined #ruby
<thomasfedb> Tomasso, in separate shells, yes. For further questions see #rvm
<Tomasso> thanx xD, in separate shells you mean separate sessions right?
Manhose joined #ruby
<thomasfedb> Tomasso, separate virtual terminals
g0bl1n joined #ruby
<thomasfedb> Tomasso, or screen sessions, etc
<Tomasso> ok, and if you use some command like "nohup" ?
BitPuffin joined #ruby
<thomasfedb> Tomasso, hmmm. You should be fine as it's not going to magically change interpreter, might be an issue with GEM_HOME though. Move this discussion to #rvm if you have further questions.
<Tomasso> thanx xD
minijupe joined #ruby
deryl joined #ruby
Paladin joined #ruby
<td123> python has pep8 for structuring code, does ruby have something similar? I'm just not sure whether method(hi) is more preferred than method hi
dch4pm4n joined #ruby
<thomasfedb> td123, there are a set of "rules" somewhere, but i forget where. and they're not really enforced.
gards joined #ruby
<thomasfedb> td123, i suggest you just read some good code
<gards> hi, havn't used ruby in many years and forgotten most everything. I have a list of things, say [a,b,c], I want to turn that list into [/regex/.match(a)[0],...] what do I google?
kidoz joined #ruby
ontehfritz joined #ruby
<gards> I know there is a better way than list.each and append the modified elements to a new list
nooodl joined #ruby
<td123> thomasfedb: ok, so far I have adopted the 2spacing indentation :)
dr_bob joined #ruby
<gards> map! ofc!
<nooodl> http://paste.pocoo.org/show/510219/ is there a nicer way to format this?
<nooodl> it feels odd
<td123> also, I want to ask.. the tutorial on ruby I'm reading said that puts File.superclass should Return "Object" but for me it returns "IO" is this something that has changed in ruby with latest 1.9?
steph021 joined #ruby
<dr_bob> td123: no, IO has been superclass of File for quite a while already
<deryl> yes, File belongs to IO not Object
<deryl> hehe dr_bob got there first
<td123> dr_bob: oh, so is this tutorial really outdated? http://www.humblelittlerubybook.com/book/html/chapter2.html
<KL-7> it's quite old
<dr_bob> Can't decide. There's probably still a lot of truth in there.
<td123> :/ can you recommend any other, more updated tutorial?
<KL-7> in 1.9, for example, Object.superclass will return BasicObject and not nil
<dr_bob> It may be just a simple error. :-)
sweetgirl joined #ruby
cdepue joined #ruby
flexd joined #ruby
<dr_bob> KL-7: right. That's a fairly recent change.
<dr_bob> Hm, Chris Pine's "learning to program"?
<td123> is "learning ruby the hard way" any good?
Draco_ joined #ruby
<deryl> learning Ruby is pretty good, as is Ruby Essentials
<deryl> :shrug" up to you
<AlecTaylor> :shrug:
<KL-7> td123, haven't read this one, but I'd recomend http://www.sapphiresteel.com/The-Book-Of-Ruby
<KL-7> it was my first ruby book and it's quite good
Natch| joined #ruby
macmartine joined #ruby
Paladin joined #ruby
g0bl1n joined #ruby
g0bl1n joined #ruby
jimgg joined #ruby
thecreators joined #ruby
Nisstyre joined #ruby
Weddy joined #ruby
friskd joined #ruby
jimgg left #ruby
robbinn joined #ruby
darkskiez joined #ruby
<deryl> if you can afford to get it, The Wll Grounded Rubyist is WELL worth the coinage
<tightwork> No Why's Ponigant Guide to Ruby?
<tightwork> Luls
<tightwork> .. just started it, a real eye opener o_O
<zastaph> when I do heredocs with <<-STR and I indent my multi-line string with the rest of my code, the indents are included in the string as tabs.. how do I avoid that? and how do I avoid having to remove the indent making my code look weird?
<tightwork> vim I just know :set expandtab :set tabstop=4 is usually best practice iirc.
<tightwork> then you can visual highlight and use < or > to shift blocks
dbgster joined #ruby
Manhose_ joined #ruby
d3c joined #ruby
<zastaph> was that for me?
wyhaines joined #ruby
<thomasfedb> zastaph, i think so
<d3c> what happens when sleeping while reading a (log) file continuously? will I get the lines that came in while sleeping? e.g. http://pastebin.com/HmqfbK3Y
<zastaph> vim users can always find an occasion to highlight its amazing features :p
nerded joined #ruby
__class__ joined #ruby
codespectator joined #ruby
<d3c> anyone? if I sleep while reading a file, will I get lines that were written to the file while sleeping?
<deryl> try it and see?
dotnull joined #ruby
Pip joined #ruby
Pip joined #ruby
td123 left #ruby
sythe_ joined #ruby
TomJ joined #ruby
<thomasfedb> d3c, probably depends where in the file they were written. Interesting problem, you'll probably have to test it yourself though.
<AlecTaylor> ... *** --- \\\ &&& %%% @@@
<workmad3> d3c: you could always poll the file... every 5 seconds or so, open the file, read new lines, close the file again
<workmad3> d3c: you just need to keep track of the line count between openings
<workmad3> so you know if there's new content :)
<AlecTaylor> I can't get any test-data loaded in spree. I created my spree build thusly:
<AlecTaylor> rails new Spree -d sqlite3 && cd Spree
<AlecTaylor> [Add to Gemfile]: gem 'spree'
<AlecTaylor> rake db:create && rails g spree:site && bundle exec rake spree_sample:load && rake db:bootstrap && bundle exec rake assets:precompile RAILS_ENV=development RAILS_ASSETS_NONDIGEST=true
Pip joined #ruby
Pip joined #ruby
kyle_ joined #ruby
<kyle_> ok, I'm guessing there's some relationship between the 10.times block, and the "loop do" part in the Fiber here. What am I missing as to how this works? http://pastie.org/2888949
j3r0m3 joined #ruby
<kyle_> or is it the fact that the Fiber is looping, but each time yield is called it breaks the loop? And since the times block is only being called 10 times it isn't an infinite loop?
gianlucadv joined #ruby
Pip joined #ruby
Pip joined #ruby
<hyperboreean> I am new to ruby; "require File.join(File.dirname(__FILE__), 'test_helper)" or "require File.dirname(__FILE__) + '/test_helper'" ? The first one seems safer
dv310p3r joined #ruby
Beoran__ joined #ruby
<whitequark> hyperboreean: File.join inserts the directory separators (/ or \) appropriate for the OS
<whitequark> so, the second one is worse
<hyperboreean> whitequark: that's why I said the first one is safer, thanks!
<whitequark> kyle_: your second message is quite right
<whitequark> that's how it works
rvmeier joined #ruby
Hellojer_ joined #ruby
Weddy joined #ruby
friskd joined #ruby
friskd joined #ruby
jarjar_prime joined #ruby
mikewintermute joined #ruby
Cervajz joined #ruby
lobo_d_b joined #ruby
burgestrand joined #ruby
Paladin joined #ruby
Paladin joined #ruby
Newbs joined #ruby
ExploraV joined #ruby
BitPuffin joined #ruby
Weddy joined #ruby
j3r0m3 joined #ruby
rungdung joined #ruby
tomzx joined #ruby
jbw joined #ruby
j3r0m3 joined #ruby
patjoh joined #ruby
minijupe joined #ruby
josh_ joined #ruby
brianherman joined #ruby
Azure joined #ruby
workmad3 joined #ruby
maggie_n joined #ruby
bwlang joined #ruby
wyhaines joined #ruby
Manhose_ joined #ruby
goodieboy joined #ruby
Nisstyre joined #ruby
Paladin joined #ruby
Paladin joined #ruby
dv310p3r joined #ruby
dbgster joined #ruby
j3r0m3 joined #ruby
nYmo joined #ruby
brianherman joined #ruby
Guedes joined #ruby
Guedes joined #ruby
codespec_ joined #ruby
mikepack joined #ruby
epochwolf joined #ruby
Minalien joined #ruby
caice joined #ruby
brianherman joined #ruby
Pip joined #ruby
bier joined #ruby
bier|tp joined #ruby
ExploraV joined #ruby
cdepue joined #ruby
minijupe joined #ruby
iamjarvo joined #ruby
dagnachewa joined #ruby
bsdbandit joined #ruby
ChampS_ joined #ruby
j3r0m3 joined #ruby
flippingbits joined #ruby
robbinnn joined #ruby
jensn_ joined #ruby
<robbinnn> hi you know a good lib for upload and resize image in a database
<Afal> attachment_fu
<Afal> or paperclip
<robbinnn> did you have a good code exemple ?
<robbinnn> or tutorial
<Afal> google
<robbinnn> thx
Knodi joined #ruby
Jake232 joined #ruby
probst joined #ruby
Araxia_ joined #ruby
emptyflask joined #ruby
rsampaio joined #ruby
stunna joined #ruby
scitickart joined #ruby
ExploraV left #ruby
h4mz1d joined #ruby
dagnachewa joined #ruby
nicoulaj joined #ruby
Araxia_ joined #ruby
virunga joined #ruby
dagnachewa joined #ruby
Weddy joined #ruby
Indian joined #ruby
jbpros joined #ruby
xpot-mobile joined #ruby
jbw joined #ruby
enikar joined #ruby
maggie_n joined #ruby
j3r0m3 joined #ruby
jgrau joined #ruby
dotnull joined #ruby
nerded joined #ruby
caice joined #ruby
wilmoore joined #ruby
maletor joined #ruby
awesome joined #ruby
RomD joined #ruby
codespectator joined #ruby
TomJ joined #ruby
TomJ joined #ruby
dagnachewa joined #ruby
havenn joined #ruby
ChampS- joined #ruby
kirill joined #ruby
Jake232 joined #ruby
<hyperboreean> so guys, I need some help with doing things in the ruby way
<hyperboreean> say I have a wrapper on top of a HTTP API and I want to unit test that? where should the test data go assuming that I have a test/ directory?
<hyperboreean> do you add another data directory under the test one? test/data ?
lobo_d_b joined #ruby
lobo_d_b joined #ruby
pantsman joined #ruby
pantsman joined #ruby
<whitequark> hyperboreean: why not?
notbrent joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
bluOxigen joined #ruby
<hyperboreean> whitequark: I guess that's the clean way to do it
Amirh joined #ruby
iamjarvo joined #ruby
<Amirh> hello world
dagnachewa joined #ruby
dot_null joined #ruby
<caice> i have a question about the ruby variable scope thing
<Amirh> Is this possible to code an eclipse plugin with ruby?
<caice> how do i do this http://pastebin.com/vseHpKDk more nicely, because i dont want to use @ variables just to get stuff out of the record do part ;)
<Amirh> anybody?
dotnull joined #ruby
ianbrandt joined #ruby
dburton joined #ruby
yekta joined #ruby
araujo joined #ruby
<caice> anyone?
<aces1up> is there an array .push method that pushes new object to position 0 and not at the end of the array?
<deryl> not .psuh, could probably use .inject iirc
<deryl> nope wrong
<yxhuvud> aces1up: unshift
<aces1up> yxhuvud nice thanks.
<shevy> aces1up %w( b c d ).unshift 'a'" # => ['a', 'b', 'c', 'd']
thone_ joined #ruby
minijupe joined #ruby
dagnachewa joined #ruby
<hyperboreean> creating a Net::HTTP object does anything else than setting up the state of the object? does it do any interaction with the provided uri ? I am trying to unit test an object that on its constructor builds such an object and I am wondering if would be better to defer this initialization for later if Net::HTTP.new interacts with the outside world :)
iocor joined #ruby
Newbs joined #ruby
flip_digits joined #ruby
Newbs joined #ruby
burgestrand joined #ruby
mengu_ joined #ruby
mengu_ joined #ruby
jgrau joined #ruby
minijupe joined #ruby
Knodi joined #ruby
djalan joined #ruby
Knodi joined #ruby
djalan left #ruby
djalan joined #ruby
freshcocoa joined #ruby
sythe_ joined #ruby
<djalan> Hello, one trivial question: what is Ruby HEAD? Is it the latest version of a release? 1.9.2-head =? 1.9.2-p290
Guedes joined #ruby
Guedes joined #ruby
<freshcocoa> djalan: google git head
<djalan> freshcocoa: Thanks, that's the feeling I had (git)
djalan left #ruby
workmad3 joined #ruby
sbanwart joined #ruby
iamjarvo joined #ruby
Rango2 joined #ruby
brianherman joined #ruby
dotnull joined #ruby
Pip joined #ruby
sorin joined #ruby
dotnull joined #ruby
Pip joined #ruby
tomzx joined #ruby
sorin left #ruby
Pip joined #ruby
dot_null joined #ruby
Pip joined #ruby
Pip joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
dotNull joined #ruby
Clooth joined #ruby
Pip joined #ruby
h4mz1d joined #ruby
wedtm joined #ruby
includex joined #ruby
mxweas_ joined #ruby
vitoravelino joined #ruby
vitoravelino joined #ruby
dotnull joined #ruby
Manhose joined #ruby
rsampaio joined #ruby
Araxia_ joined #ruby
TomJ joined #ruby
TomJ joined #ruby
Weddy joined #ruby
acml joined #ruby
cdepue joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
j3r0m3 joined #ruby
j3r0m3__ joined #ruby
nanoyak joined #ruby
chiel joined #ruby
<chiel> Hi all, can anybody point me towards a good guide on installing ruby + nginx?
<chiel> on debian squeeze, if it matters
<shevy> debian specific? you probably need use aptitude or apt-get install ruby* something
<shevy> they split it up into 1000000000 packages
<shevy> every line of code gets its own package in debian
<chiel> shevy: rofl :D
<chiel> sounds.... fun
<deryl> you laugh, but he's almost dead on
<chiel> balls. :(
<chiel> So I'm in for quite a fight, I guess.
rsampaio joined #ruby
lobo_d_b joined #ruby
<shevy> chiel well you just have to find that proper line to install it the debian way
<shevy> perhaps:
<shevy> sudo apt-get install ruby-full
j3r0m3 joined #ruby
<deryl> and do yurself a favor, do NOT attempt to override gem update --system blockage
<shevy> though I have no idea how to tell debian to use a specific version
<shevy> chiel, you can also try to use rvm http://beginrescueend.com/
<deryl> not unless yu want to screw your packages and potentially yourself when an updated package comes out
<shevy> but I am sure the debian guys hate non-debian ways to install something
<deryl> you might want rv,beginresccueend.com/rvm/install/
<deryl> err rvm.beginrescueend.com/rvm/install/
<deryl> shevy: so long as it goes in /usr/local/rvm for the multi-user install, and $HOME/.rvm for th per-user its completely fine with Debian GNU/Linux Project. Follows the FHS2.2
<shevy> hmm
<shevy> rvm goes into /usr/local ?
<deryl> yep
<deryl> exactly where its supposed to for 3rd party software
<shevy> not even /usr/local/bin???
<deryl> no
<deryl> we used to but not anymore
<deryl> we use bash functions to manage the environment, physically all files go in /usr/local/rvm or $HOME/.rvm
<deryl> we do add /etc/profile.d/ and /etc/rvmrc but that one is open to debate since it can be *either* /etc/ or /usr/local/etc/
<chiel> hmm, well I suppose I can perhaps changing my distro. The only reason I use debian is cause it's what we use at work, and therefore is what I am most familiar with.
<deryl> err /etc/profile.d/rvm.sh even
<shevy> chiel be a man!
<deryl> chiel: debian. ubuntu either or
<chiel> shevy: lol :P
<deryl> same species of fish
<chiel> let's see, I can pick from... arch, CentOS, Debian, Fedora, Gentoo, Red Hat, ubuntu
<chiel> But I guess it won't matter too much
<deryl> rvm is tested against CentOS, OpenSUSE, Debian, Ubuntu, and OS X. So any of those are fine
<chiel> I prefer rbenv over rvm though
<chiel> I should check if there's a good way to install that on there, I suppose.
<deryl> arch has a problemw here they include the pre-release version of the 4.6 gcc compiler which is buggy as hell. might not want to do that
<deryl> chiel: before you decide on rbenv read this
rebagliatte joined #ruby
zanaga joined #ruby
j3r0m3__ joined #ruby
<deryl> feel free to use whichever you want, just know that rbenv says a few things about rvm that are blatently false. read that before you finally decide
robotmay joined #ruby
<chiel> deryl: of course, but since that article is written by someone who contributes to rvm, I imagine it won't be wholly objective either
<deryl> actually michal went out of his way TO be objective
<chiel> That said, yes, I'm sure there's plenty of name-calling between the two. :P
<shevy> hehe
<shevy> it's war after all
angie joined #ruby
spuz joined #ruby
<chiel> deryl: but yes, I am reading the article. :)
<shevy> but you know
<chiel> I don't care what I use, so long as I can easily set it up locally.
jbpros joined #ruby
macmartine joined #ruby
<shevy> the only true way to handle different versions is by using versioned directories
<chiel> in production, I don't necessarily need a version switcher.
<deryl> and no more objective than blatently lying about rvm. especially trying to say that rvm can execute 'arbitrary and dangerous code' which is false due to the security checks put in place which he completely and utterly said nothing about. he made a whole SLEW of decisions about rvm that were completely false and did so just to garner project release support. never once asked anyone and several of his points showed he never read the docs.
<deryl> (yes, I'm with the rvm project) - however, that being said. I just brought up that article so that you would have additional information from which to decide with.
khindenb` joined #ruby
<chiel> deryl: of course
<chiel> deryl: Like I said, I don't care what I am using
<chiel> I just want something that works
<chiel> :P
<chiel> I'm a typical end-user
<deryl> both work. in different ways.
spuz left #ruby
spuz joined #ruby
j3r0m3__ joined #ruby
<shevy> chiel!
thecreators joined #ruby
<shevy> apt-get your way to glory!
<deryl> lol
<shevy> if you already switch anyway, let's try to break a system :)
<chiel> shevy: well I use rackspace, I guess I could just set up a second machine and break that
<chiel> and then do it on my actual machine once it works :P
<spuz> Hello, I'm having trouble reading and xml file in read-write mode ("w+") while I have no problems with read-only ("r"). The code is: Document.new(File.new(filelocation, "w+")) and the error is : ruby/1.8/rexml/source.rb:149:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError)
<spuz> Any ideas why this would work with read-only but not read-write?
briankim joined #ruby
<chiel> deryl: right so I'll just try to install rvm locally first
<chiel> I want to use it with pow. From what I understand, they're pretty tight-knit.
<spuz> (I'm new to ruby so I figure this would be a trivial error)
<deryl> chiel: cool. either one is fine. like i said, my intent was just to make sure you had opposing statements at hand when you made your choice
<chiel> deryl: yeah I understand. but as it stands, rbenv can only install 1.9.3-p0 for me with manual intervention.
<chiel> that is actually my main reason for using rvm :P
<deryl> ah
<deryl> if you do rvm install 1.9.3 whatever is the most current official 1.9.3 will be installed
<chiel> I don't care much about the performance stuff while I'm devloping anyway :D
<deryl> rather than specifying an *exact* patch match (unless you need to)
<chiel> it's such a small thing.
<chiel> aye
<chiel> right so I'll start by actually installing rvm :P
j3r0m3__ joined #ruby
<deryl> and when its time to update, it makes it easier to just do rvm reinstall 1.9.3 it will remove the old patch version and put in the new one (unless you did specify the patchlevel when you installed, then it isolates it)
<chiel> deryl: cool, no homebrew recipe for rvm, or?
<deryl> hehe I would go with a per-user install rather than a multi-user, for development thats all you really need, and it elimintes a lot of potential hassles due to system config
<deryl> nope. just make sur eall your prerequisites fromt he prereq page are in place.
<chiel> deryl: I am the only user of my laptop so.. :P
<deryl> use homebrew if you want to install the latest git and some of the libs you might need, or rvm pkg install and look at th elist and install whatever you can't find installed already locally
<chiel> deryl: yeah I already have git and such
<deryl> then you just pass rvm install 1.9.3 --with-readline-dir=$rvm_path/usr etc. you'll need the readline one for 1.9.3. either by rvm or by homebrew
<deryl> try without the --with-readline-dir if you installed readline with homebrew though first
Johannes` joined #ruby
bsdbandit joined #ruby
<chiel> deryl: I don't have readline as far as I know
goodieboy joined #ruby
LittleBill902 joined #ruby
<deryl> install with homebrew so you don't hav eto keep passing the --with-readline-dir param (or add it to your $HOME/.rvmrc in rvm_configure_flags
<deryl> )
linoj joined #ruby
<chiel> deryl: you're going too fast, I have only just installed rvm. Reading docs now.
<deryl> hehe i'm going to fast in text??
<deryl> s/to/too/
Knodi joined #ruby
j3r0m3 joined #ruby
<chiel> deryl: :D
<chiel> humm
<chiel> I ran the install script, but I have no rvm command :D
<deryl> did you log out then back in after adding the rvm source lines the docs say to to your .bash_profile?
LittleBill902 joined #ruby
ontehfritz joined #ruby
<chiel> oh right, it's way down.... it has install instructions for a bunch of things. lol
<chiel> my bad.
* chiel let's out a hacking coug.
<deryl> np :)
<chiel> cough*
<deryl> we're showing both install types on that page.
<chiel> yeah
<chiel> I didn't scroll far enough
<chiel> small screen
<deryl> we were going to make the two install types separate pages, but the community wanted it on one so we stuck with one
Kus joined #ruby
LittleBill902 joined #ruby
<Kus> i have a "when d =~ /korrus/"
<Kus> can I add a or to it?
<chiel> cool beans, installing 1.9.3 now.
<Kus> like: when d =~ /korrus/ or d =~ /other/
<Kus> or in the regexp?
j3r0m3__ joined #ruby
<chiel> ERROR: Error running ' ./configure --prefix=/Users/chiel/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc --with-libyaml-dir=/Users/chiel/.rvm/usr ', please read /Users/chiel/.rvm/log/ruby-1.9.3-p0/configure.log
<chiel> ERROR: There has been an error while running configure. Halting the installation.
<chiel> :(
<chiel> oh wait
<chiel> readline I guess.
<chiel> durrrr
<Bish> im glad u let us know
Manhose joined #ruby
<chiel> Bish: You're welcome.
Locke23rus joined #ruby
<Kus> Bish: can you help me with the case?
<Kus> statement
<chiel> deryl: hmm, I installed readline, but it's still throwing the same error. Any tips?
<Bish> chiel, post complete logs
<Bish> because i can see "error while compiling"
<deryl> chiel: try passing the --readline-dir=$rvm_path/usr
<deryl> rvm install 1.9.3 --with-readline-dir=$rvm_path/usr
<chiel> hmm
<chiel> seems there's something with my compiler.
<chiel> balls.
<chiel> I guess it has the same issue as rbenv
<chiel> regarding gcc compilers or so
<deryl> what debian version?
<deryl> oh not debian
<chiel> deryl: I am doing it locally, OS X Lion
<chiel> With xcode 4.2
<deryl> ahh yeah. Xcode 4.2 is known to bust up ruby builds.
<chiel> so it must be the same issue as I had with rbenv, that the gcc libs are not installed, or something.
<chiel> yeah
<chiel> there's something about it in the NEWS file released with 1.9.3-p0
<deryl> no gcc is installed, its that 4.2 uses llvm-gcc. and thats.. well... not solid. lets put it taht way
<chiel> saying you need to --with-gcc=clang or something along those lines.
<deryl> yeah Xcode 4.2 uses --with-gcc=clang to make it build, -with-gcc=gcc-4.2 for Xcode 4.1
<chiel> aye, but it seems that's not being passed. can I pass it myself when using `rvm install 1.9.3` ?
Seisatsu joined #ruby
<lupine_85> argh. bad thin, bad
<lupine_85> what's the point of having code to drop privileges and daemonise if it doesn't let you bind port 80 too ?
<deryl> rvm install 1.9.3 -- --with-readline-dir=$rvm_path/usr --with-gcc=clang (provided you installed readline via rvm)
<chiel> deryl: I installed readline through homebrew already now.
<deryl> ok
<chiel> so I can drop that flag I suppose.
apucacao joined #ruby
jds joined #ruby
<deryl> well you MIGHT have to do --with-readline-dir=/usr/local/Celler/readline/<ver#>/ --with-gcc=clang
<deryl> but try first without the readline flag
<chiel> doing so :)
<chiel> thank you for your help man
<deryl> np
epochwolf|2 joined #ruby
LittleBill902 joined #ruby
<chiel> deryl: it seems like that --with-gcc=clang option is not coming through in the configure.log
j3r0m3__ joined #ruby
<chiel> (it choked on the same step, C compiler crap)
<deryl> did you do the standalone -- i had?
<chiel> deryl: yes
<deryl> hrmm
<chiel> `rvm install 1.9.3 -- --with-gcc=clang`
<chiel> that's what I ran.
marcosdsanchez joined #ruby
<deryl> ok, try adding to .rvmrc using 'export rvm_configure_flags='--with-gcc=clang'
<deryl> then source the .rvmrc for this shell session
apucacao_ joined #ruby
lobo_d_b joined #ruby
lobo_d_b joined #ruby
apucacao joined #ruby
<marcosdsanchez> Hey guys, can somebody please help me with this question ? http://stackoverflow.com/q/8197857/929899
<chiel> deryl: it seems you are missing a quote there somewhere. are the quotes supposed to be around the ='--with-gcc=clang' bit?
jgrau joined #ruby
<deryl> yeah
<chiel> cool
<deryl> the outer were just for me to demark what goes int he file. my bad
mxweas_ joined #ruby
statarb3 joined #ruby
statarb3 joined #ruby
<chiel> np lol, was just checking. :)
<chiel> it seems to not die instantly now at least on the configuring stuff
<chiel> so I think that worked. :)
wedtm joined #ruby
<deryl> awesome :)
<chiel> Yes! Now it's compiling :)
<deryl> it will complete so long as it found the readline stuff
<chiel> deryl: yep, installed it beforehand, so that should be all fine, and I restarted my shell
<deryl> (i'd be truly suprised if it died on anything else)
<deryl> cool beans
dnyy joined #ruby
dbgster joined #ruby
<deryl> so you know the ruby-debug-base19 and linecache19 seem to have issues with 1.9.3. you can apply the known patch to make ruby-debug19 work by doing rvm uninstall 1.9.3 && rvm cleanup sources && rvm install 1.9.3 --patch debug but thats only part of the issue.
<banister`sleep> deryl: that's a fairly extreme solution
<deryl> that exposes the ruby_current_thread but *not* the ruby_threadptr* symbols that are needed
j3r0m3__ joined #ruby
<deryl> banister`sleep: no its not. we do do the --force-autoreconf as it is
<banister`sleep> deryl: i think there's another solution that uses a different internal api, have you tried building ruby-debug from head?
LittleBill902 joined #ruby
<deryl> but cleaning up the sources first and extracting out a fresh source tree and applying the patch is a pretty decent way to do it
<banister`sleep> deryl: but i just dont think u need to unintsall 1.9.3, those symbols were hidden for a reason
<deryl> yes. and it still does that
<deryl> tell that to ruby-debug-base19 and linecache19
<banister`sleep> deryl: i was following the discussion for a while, a ruby commiter (nobu) sent a few patches to ruby-debug that allowed it to work without those symbols
<bsdbandit> anyone using html5 with ruby on rails ?
<deryl> Symbol not found: _ruby_threadptr_data_type (LoadError)
<deryl> banister`sleep: when was this?
<deryl> (I haven't worked on it again for about 2 days)
<banister`sleep> deryl: i'm just not sure he's released it yet, but afaik it's on a branch somewhere and it mostly works
<deryl> banister`sleep: and should we be telling people to add the git repo for the gem to the Gemfile?
<deryl> banister`sleep: good to know we're going forward.
visof joined #ruby
LittleBill902 joined #ruby
<deryl> banister`sleep: the reinstall of 1.9.3 is for applying the debug patch which exposes current_thread. does nothing for the Symbol not found: _ruby_threadptr_data_type (LoadError) error
<deryl> 56.diff
<banister`sleep> deryl: i managed to update my binding_of_caller implementation for 1.9.3 to work, and it was using similar symbols to ruby-debug
<banister`sleep> deryl: yeah holdon i think that #define was wrong, i remmeber i had to mess with it a bit
<deryl> but if users can pull a specific branch via the Gemfile that has the patches you mean to fix the threadptr errors then woohoo
<chiel> well, ruby installed at least
j3r0m3 joined #ruby
<chiel> now I gotta install powder and pow I guess :)
<deryl> I'm taking it you are meaning the ruby-debug git branch pulled via Gemfile.
<banister`sleep> #define ruby_thread_data_type *threadptr_data_type()
<banister`sleep> #define ruby_current_thread ((rb_thread_t *)RTYPEDDATA_DATA(rb_thread_current()))
<banister`sleep> deryl:
<banister`sleep> ^
<banister`sleep> deryl: you dont need the threadptr, change it to just thread
<deryl> where in what file? (I haven't dived into the source for either ruby or the ruby-debug gem)
<banister`sleep> deryl: with those two #defines my code runs on 1.9.2 and 1.9.3 fine
<banister`sleep> deryl: holdon ill find the place
<deryl> ok
<chiel> deryl: so to use 1.9.3 from rvm in my shell, I would do.... `rvm use --default 1.9.3` or so?
cooper joined #ruby
<deryl> yeah
<deryl> if you want a gemset do rvm --create use 1.9.3@mygemset --default
<banister`sleep> deryl: what features do you use in ruby-debug btw?
<deryl> no gemset on there will always make it use 'default' which is whats used when no gemsets are defined
<chiel> deryl: hmm,doesn't every ruby version have it's own gemsets or so?
<deryl> banister`sleep: I'm just trying to make this work for our users.
<deryl> its not so much for me. though I'm enabling debugging in ruby and rails server --debug etc, checking out what it does etc.
<banister`sleep> deryl: what's your product?
<deryl> but this isn't building for most of our userbase so i was trying to find a solution
<deryl> banister`sleep: rvm-testsuite. ruby based testing suite for RVM
linoj joined #ruby
<deryl> as well as rvm-test (console only test suite)
LittleBill902 joined #ruby
onetonturd joined #ruby
onetonturd left #ruby
<chiel> deryl: what benefits will a gemset give me, and doesn't every ruby have it's own gems anyway?
<deryl> chiel: only if you make them. comes with 'default' which is use dwhen you don't define a gemset To use, and 'global' which is mixed into every gemset for a specific ruby
j3r0m3__ joined #ruby
<banister`sleep> deryl: change that from threadptr to thread
<chiel> deryl: I doubt I will ever actually switch ruby version from 1.9.3, do you recommend making a gemset?
<deryl> dont confuse rubygems with gems. rubygems gives you the gem command and ability to use gem packages. gemsets allow you to isolate gems to specific gemsets
<chiel> yeah I am not confusing them
<chiel> just curious if it's something I'll need. I don't really want to meddle with the system ruby
<banister`sleep> deryl: im thinking about adding step/next to pry, those are the only things ppl miss from ruby-debug right?
<banister`sleep> and breakpoints
maletor joined #ruby
<deryl> yes. do you like having ALL your gems in a single HUGE stack? or would you rather be able to isolate say just rails, or just pry+pry-doc, or just thor etc to their own gemset isoalted from the others? what about coupling with per-project rvmrc files along with gemsets named after that project so that you have specific ruby and gemset defined each of which contains *just* the gems that project needs?
<deryl> banister`sleep: definitely. and the ability to do whereami from anywhere and always get a listing of the code relative to where they are
<banister`sleep> deryl: where does 'whereami' not work for u?
ziggles joined #ruby
rvmeier joined #ruby
<deryl> without always having to define binding.pry here or there. (like with rails, using pry as the IRB for the console, i should be able to do a whereami in say my class of TestReport, I should ge ta listing of the source for the definition of TestReport and I don't
<deryl> )
<deryl> now sec. let me catch up on the pull you posted
<deryl> banister`sleep: err, according to that pull it was merged into master a month ago.
<deryl> why are we having to apply this then
<banister`sleep> deryl: hmm
<banister`sleep> deryl: that's very differnt to current whereami functionalit
<deryl> banister`sleep: this is as current as yesterday doing a bundle install so whatever is out on the gems server
<deryl> 0.9.7.1
LittleBill902 joined #ruby
<deryl> here's a case
cyril_ joined #ruby
<cyril_> Hello all
<deryl> I have pry set even with binding.pry defined. i start up my app with ruby bin/run.rb 'rvm info' and it runs the command as i expect then stops at binding.pry and shows me the source. I cd @test_report to cd into the instance variable (its an object not something like a string var or something) and do whereami and I get Error: Cannot find local context. Did you use `binding.pry`?
<deryl> pry(#<TestReport>):1>
<deryl> i can see that it found the class and cd'd me into the class. so now I'm in the object. I should be able to whereami and it should show me the class source at least. but it doesn't
<cyril_> I am newbe in Ruby, I have choosen Sequel has an ORM for my first app. My db is mysql. I have a very simple table created, and then I try to create the corresponding model:
<cyril_> myhost = LinxModel::Host.new(:host_name=>'test')
<cyril_> myhost.save
<deryl> oh, and Im inside TestReport class now. I should be able to ls -qM but I get Error: -M only makes sense with a Module or a Class
<deryl> i'm *in* the class!
<burgestrand> Sorry for barking in, but I don’t get it, what kind of context do you have when cd'ing into a random object?
<deryl> burgestrand: its not a random object. its of a definite type and pry cd's you into that type/class
<cyril_> but I get this error: /sequel/model/base.rb:1094:in `pk': undefined method `[]' for nil:NilClass (NoMethodError)
<deryl> s/type/class/
<cyril_> Can you help please?
<deryl> and i can tell I'm in the class because the prompt shows it *and* I can show-method run_command which is a method on taht class and get the source shown to me for that command
<burgestrand> deryl: if you cd into @whatever, you’ll be in @whatever, but how do you tell the source or location of @whatever?
<burgestrand> Oh, I assume whereami is probably something else, moment
<deryl> one would think the debugger woudl be able to determine what class it is and match it to the files.
<cyril_> (in french but the code is the same :-) )
<banister`sleep> deryl: the situations are quite different though, binding.pry starts a session on the binding and so __FILE__ and __LINE__ information are available from the context u put the binding.pry; but when yu're already inside a session the only __FILE__ and __LINE__ avaiable for when u go into another object with 'cd' is (pry) and the current pry line number so it's useless for whereami
<burgestrand> You’d like it to match you to the definition of the class?
<banister`sleep> deryl: im not saying it's impossible to do, but very difficult. Also it's impossible to just grab the source of a class, ans classes do not have a source_location
<deryl> ok but what about when I cd TestReport. it knows about the class, knows about the methods, can even read the test_report.rb file (has to be to get the lines for show-method) so why is it so difficult to display the class?
<burgestrand> the class could be in many places, ruby’s awesome :3
<banister`sleep> deryl: because methods have source_location ;)
<burgestrand> I feel a class_source gem coming up
<burgestrand> :P
<banister`sleep> classes do not, it's a huge effort in parsing full of edge cases and other BS
LittleBill902 joined #ruby
<deryl> banister`sleep: ahh i was thinking it was also makign a 1-1 with the files on disk and was wondering why it couldn't pull it up
<banister`sleep> deryl: we tried it once, it's not reliable enough, for example it cant work in cases where teh class is reponed with class_eval and methods defined
<banister`sleep> deryl: also, classes can be reopened in multiple places
<banister`sleep> there isn't always going to be 'one' location for a class
<deryl> since i was in the app's root directory, i have the binding at the very bottom, i'm specifically sourcing the files in THAT file specifically, so figured it was watching that
<deryl> i got ya.
<banister`sleep> deryl: also, what would 'whereami' return if you type it inside a core class? or if you type it inside an object (rather than a class) ?
Cervajz joined #ruby
<deryl> i can see the issue is a lack of knowledge on my part as to why its acting the way i'm seeing. i was thinking one thing and that thought was obviously wrong. good to know :) (if for no other reason than to know thats one less thing to think!)
<burgestrand> cyril_: sorry, I know nothing of Sequel
j3r0m3 joined #ruby
<deryl> well the object would still be of a type, so return the source for that object's type (class?)
jfredett joined #ruby
<banister`sleep> deryl: the job for 'whereami' though is not to show u just source, it's supposed to show u the surrounding context for the session, the 'line' that you are currently on.
<banister`sleep> deryl: when you 'cd' into another object inside a session the only current line is one of those internal (pry):5 lines
<deryl> in MY mind I was thinking that say I @x = 1 ; cd @x that it would show the class in the pry prompt (Fixnum) and would display the class definition for Fixnum.
<deryl> i'm seeing i'm wrong in my thinking. (good to know)
<banister`sleep> deryl: it coud be a different command thta may show u that though, perhaps a 'whatami' ;)
<deryl> true :)
<banister`sleep> but we still need to get around the annoying edge cases and parsing problems, it's primarily a technical problem rather than a conceptual problem
<cyril_> burgestrand: Sequel looks great but it seems there is not so much documentation about it
minijupe joined #ruby
<deryl> cool. i wasn't sure if my expecations were like *way* out there in Ludicrous land or not.
LittleBill902 joined #ruby
<deryl> err expectations even
macmartine joined #ruby
wyhaines joined #ruby
linoj joined #ruby
<deryl> banister`sleep: whats the difference between how gcc + gdbg shows you line numbers and the code for lines as they execute when you attach to a debugging-enabled binary, and what pry is doing? (even if you have to severely dumb it down, thats fine. I barely understand how gcc does that as well. probably not the way i think of it either). I do apologize if it sounds idiotic
LittleBill902 joined #ruby
<banister`sleep> deryl: gdb doesnt have 'cd'
<deryl> you asked earlier what my use for it was as well, personally, it would be nice to be able to run something through a debugger, see each line it hits as each line is executed, be able to see what gets hit as you go through what paths in your app down to actual source code lines, see values of variables at different places (breakpoints and variable views), and be able to walk back and forth
<deryl> well i knew that ;)
<banister`sleep> deryl: note if you use pry without using 'cd' it works exactly like gdb
<banister`sleep> deryl: the initial debugging context (before you 'cd') shows line numbers just fine,that's why 'whereami' works there
<banister`sleep> it's only when u move into new contexts inside the session (using 'cd' which gdb cant do) that u run into 'problems'
Manhose joined #ruby
LittleBill902 joined #ruby
<banister`sleep> deryl: i wrote a plugin that lets you walk up/down the stack
<banister`sleep> deryl: but not 'next/step' yet
<banister`sleep> but i wrote 'up/down'
<deryl> location?
<banister`sleep> nah it actually moves up the call stack
<banister`sleep> C extension :)
<deryl> ah
<banister`sleep> it's pretty awesome
<banister`sleep> deryl: did i show u the miniscreencast of it?
<deryl> oh, wait did you think i meant if it showed location? I meant where is it :)
<deryl> no
<banister`sleep> deryl: yeah it changes actual location
<banister`sleep> up the call the stack using bindnig_of_caller
macmartine joined #ruby
<deryl> the next/step would be quite awesome. if i can put say binding.pry at the start of my app (at the top of each section of the if elsif else end I have for the startup) and then be able to next/step through the command i started it with.. that would rock