apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
mrsolo has quit ["Leaving"]
dipnlik has joined #ruby
helichopter has joined #ruby
mibato has joined #ruby
lucasefe has joined #ruby
Drewch has joined #ruby
stephenjudkins has joined #ruby
<sabooky> if I want to add a method to array, what's the better path, subclass it or create a mixin?
<sabooky> I only need to add one method
<banisterfiend> sabooky: neither, just add the method directly
<sabooky> I need to use that array type 2-3 times in my class
<sabooky> oh, you meant modify Array itself?
<sabooky> isn't that a bit dangerous?
MrGando has joined #ruby
<sabooky> this is one library amongst many for cucumber tests
ctp has joined #ruby
seanstickle has joined #ruby
snip_it has joined #ruby
<banisterfiend> sabooky: put it in a mixin then
<banisterfiend> sabooky: but putting it in a mixin makes no practical difference really (unless there's conflict with another method). It just makes it easier to track where the method came from
<sabooky> Is it normal for a user to see an Array with extended methods? (I'm fairly new to ruby)
<banisterfiend> sabooky: what do u mean
wefawa has joined #ruby
<sabooky> is it normal to extend base class types like that in ruby?
<sabooky> for someone to see a my_array.class be "Array" but for it to have extra functionality
<banisterfiend> sabooky: it happens, but you shouldn't just do it willy nilly
<banisterfiend> sabooky: you should only do it if you have good reason
ash__ has joined #ruby
chson has joined #ruby
<ash__> does anyone know where I might find postgresql database file in my ruby on rails folder?
albemuth has joined #ruby
<sabooky> banisterfiend: thanks for all your help
<havenn> ash__: for quicker help you might want to try the #ror channel.
looopy has joined #ruby
davidcelis has joined #ruby
<ctp> Hi folks. A noob question :) How to fetch the host value out of ["{:host=>"101.255.17.78", :port=>"8080", :username=>nil, :password=>nil}"] ?
<havenn> ash__: not sure I understand the question, but might want to look at config/database.yml
<samuelkadolph> ctp: Depends on how you got that string.
qnt4b has joined #ruby
<Veejay> the_array.first[:host] would be how but yeah depends on how you got it like samuelkadolph said
<Veejay> Wait no
<samuelkadolph> Veejay: It's a string in the array, not a hash
<Veejay> Yeah
<samuelkadolph> So the only easy way of doing it is with eval
<Veejay> I just noticed
ilyam has joined #ruby
<samuelkadolph> Which would be stupid unless you built the string yourself
<Veejay> If you built it yourself now
<Veejay> That's kind of strange as well
<Veejay> hah
<qnt4b> Anybody have trouble installing 1.8.7 on Lion using rbenv? I'm getting seg faults, read about it and used gcc-4.2 to install 1.8.7 again but still get the error when trying to install gems.
<Veejay> samuelkadolph: Maybe splitting on comma and then on => and then flattening etc.
<havenn> If you can manage getting the hash without it being a String inside an Array >.>: {:host=>"101.255.17.78", :port=>"8080", :username=>nil, :password=>nil}[:host] #=> "101.255.17.78"
<qnt4b> I've symlinked cc, gcc and everything to point to gcc-4.2 instead of the LLVM gcc.
<Veejay> Also the quotes are not even escaped
<qnt4b> gem install bundler causes a seg fault referencing timeout.rb:60
<havenn> ash__: yeah, they are right, eval =O: eval ["{:host=>'101.255.17.78', :port=>'8080', :username=>nil, :password=>nil}"].first
<ctp> Veejay: ups, sorry, they're escaped: ["{:host=>\"101.255.17.78\", :port=>\"8080\", :username=>nil, :password=>nil}"]
<qnt4b> I can install gems using system rubygems, but trying to use the version installed in the custom 1.8.7 causes the error.
<havenn> ctp: eval ["{:host=>\"101.255.17.78\", :port=>\"8080\", :username=>nil, :password=>nil}"].first #=> "101..."
zakwilson has joined #ruby
nirg has joined #ruby
__class__ has joined #ruby
jmcphers has joined #ruby
<ctp> ah, cool, that works !
<ctp> mni thx guys
frishi has joined #ruby
<ctp> (eval ["{:host=>'101.255.17.78', :port=>'8080', :username=>nil, :password=>nil}"].first)[:host]
<qnt4b> So I can't install any gems using 1.8.7 on Lion.
<samuelkadolph> ctp: Keep in mind that using eval is extremely dangerous.
<ctp> samuelkadolph: yepp, I know :)
shevy has joined #ruby
Whoop has joined #ruby
ZachBeta has joined #ruby
jlogsdon has joined #ruby
nirg has quit [#ruby]
sabooky has joined #ruby
kevinbond has joined #ruby
linoj has joined #ruby
replore has joined #ruby
kpshek has joined #ruby
<qnt4b> 1.8.7 on Lion with rbenv, anybody using it successfully? I've spent about 6 hours trying to get to the point where I can install gems, but keep getting seg faults. Like this, but this doesn't work and I'm using rbenv: http://stackoverflow.com/questions/7734344/bug-bus-error-ruby-1-8-7
freeayu has joined #ruby
phantasm66 has joined #ruby
prometheus has joined #ruby
nirg has joined #ruby
nirg has quit [#ruby]
mattyoho has joined #ruby
mikepack has joined #ruby
<bawer> qnt4b: silly question: do you have to run 1.8.7?
<bawer> what version of XCode are you running?
<Asher> also why are you compiling 1.8.7 on lion - it comes with 1.8.7
<Asher> presumably you have reasons 1. for wanting 1.8.7 2. for wanting other than the system provided version
<bawer> yes, that is also true
cloke has joined #ruby
tommyvyo has joined #ruby
M- has joined #ruby
qnt4b has joined #ruby
nif has joined #ruby
carlyle has joined #ruby
cloke_ has joined #ruby
<qnt4b> Here's what I'm seeing when I try to install a gem: http://pastie.org/3814054
Careott has joined #ruby
fayimora has joined #ruby
ilyam_ has joined #ruby
niklasb has joined #ruby
josefig has joined #ruby
liluo has joined #ruby
libertyprime has joined #ruby
adamkittelson has joined #ruby
ArtCarlton has joined #ruby
williamcotton has joined #ruby
ArtCarlton has quit [#ruby]
dipnlik1 has joined #ruby
Careott has joined #ruby
SeySayux has joined #ruby
jrhorn424 has joined #ruby
surfprimal has joined #ruby
libertyprime has joined #ruby
bwlang has joined #ruby
fbernier has joined #ruby
elalande has joined #ruby
havenn has joined #ruby
brngardner has joined #ruby
elliot98 has joined #ruby
pabloh has joined #ruby
men4ce has joined #ruby
men4ce has quit [#ruby]
jobicoppola has joined #ruby
jarred has joined #ruby
linoj has joined #ruby
abra has joined #ruby
jchauncey has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
flingbob has joined #ruby
flingbob has quit [#ruby]
maletor has joined #ruby
jergason has joined #ruby
tommyvyo has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
Bleehort has joined #ruby
<Bleehort> Anyone familiar with the parallel-forkmanager gem?
bglusman has joined #ruby
<Bleehort> I can't seem to have my run_on_finish callback actually receive data...
<shadoi> I remember trying to use it a while ago and realizing it was a mistake. :)
olivoil has joined #ruby
<Bleehort> I'd rather do threading and let jruby take care of it, except I have a native-compiled gem to content with as well.
<shadoi> try rubinius?
luxurymode has joined #ruby
<Bleehort> And I'm not up to writing a native Ruby voronoi diagram generator.
<Bleehort> Hrm. Haven't looked at rubinius lately.
<Bleehort> I could also try to be clever and avoid the O(n^2) algorithm, but...
nso95 has joined #ruby
<Bleehort> Ah, damn... only implements 1.8.7. My code relies on 1.9.3.
nso95 has quit [#ruby]
<Bleehort> (in the sense that I don't want to rewrite somethings due to being lazy)
jax has quit [#ruby]
<banisterfiend> Bleehort: i think many C extensions work on jruby these days
<banisterfiend> Bleehort: so long as they dont use private c api
radic_ has joined #ruby
jitesh_shetty has joined #ruby
libertyprime has joined #ruby
ryansch has joined #ruby
<Bleehort> Hmm. I saw warnings and stuff last time I tried... let me double check.
Ethan has joined #ruby
<Bleehort> Yeah, jruby 1.6.7 barfs trying to build rubyvor.
Evixion has joined #ruby
<Bleehort> Although, if someone can recommend something else that can do Voronoi diagrams... :)
<Bleehort> Everything I've found relies on external C.
moshee has joined #ruby
<Bleehort> The ultimate destination for my babbling: I've written code to build a 2d starmap with jumplines. Voronoi diagrams make sure that stars only link to others nearby.
<Bleehort> perfectly fine with 50-100 stars. 3000, that's where the O(n^2) bites me.
<Bleehort> Yeah, I could do 30-60 runs of 50-100 stars and stitch them together by hand... and there's advantages to doing that anyway... but, enh.
Careott has joined #ruby
igotnolegs has joined #ruby
jgrevich_ has joined #ruby
jgrevich_ has joined #ruby
cloke has joined #ruby
Guest71832 has joined #ruby
<shadoi> Bleehort: try a worker system like resque or something to make it a real batch processing system so you can spin up (n-cpus) workers and have them report the results to a DB
SeySayux has joined #ruby
<shadoi> Or patch your gem to work on jruby :)
<Bleehort> I'll take a look at resque... the second option is "rewrite it to not use C", and... yeah.
<shadoi> no, like banisterfiend said, most C gems will work as long as they don't use a private API
<Bleehort> Its not my gem, I have no clue how it works.
<banisterfiend> shadoi: hey did u update pry yet? i'll be interested in your opinion
<shadoi> soooo close to getting back to a major ruby project, I'll let you know in a bit
<Bleehort> (I suppose it'd just have been easier to say 'what's the current hotness in multiprocessing?'...)
<Bleehort> Ah well. Thanks for the help, and listening to my rambling. :)
kvirani has joined #ruby
skrewler has joined #ruby
havenn has joined #ruby
nerdy_ has joined #ruby
Hsparks has joined #ruby
brianpWins has joined #ruby
savage- has joined #ruby
Hsparks has joined #ruby
carlyle has joined #ruby
ysiad has joined #ruby
blueadept has joined #ruby
AndChat- has joined #ruby
tommyvyo has joined #ruby
ckrailo has joined #ruby
Careott has joined #ruby
havenn has joined #ruby
frishi has joined #ruby
ilyam has joined #ruby
looopy has joined #ruby
freeayu has joined #ruby
brngardner has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
blueadept` has joined #ruby
wefawa has quit [#ruby]
benkevan has joined #ruby
snip_it has joined #ruby
libertyprime has joined #ruby
jergason has joined #ruby
ckrailo has joined #ruby
Careott has joined #ruby
noyb has joined #ruby
JivaD has joined #ruby
elliot_ has joined #ruby
ryanw_ has joined #ruby
mikeg has joined #ruby
adeponte has joined #ruby
zakwilson has joined #ruby
rippa has joined #ruby
soveran has joined #ruby
RubyPanther has joined #ruby
shobhitg has joined #ruby
rohit has joined #ruby
albemuth has joined #ruby
sluggy has joined #ruby
gen0cide_ has joined #ruby
ryanw_ has joined #ruby
acts_as_david has joined #ruby
lkba has joined #ruby
n8ji has joined #ruby
quest88 has joined #ruby
shadoi has joined #ruby
phipes has joined #ruby
sonkei has joined #ruby
olivoil has joined #ruby
ePirat has quit ["[Textual IRC Client: http://www.textualapp.com/]"]
olivoil has joined #ruby
bawer has joined #ruby
fayimora has joined #ruby
EzeQL has joined #ruby
fukushima has joined #ruby
ABK has joined #ruby
ed_hz_ has joined #ruby
phipes_ has joined #ruby
friskd has joined #ruby
StevenR121 has joined #ruby
prometheus has joined #ruby
babinho has joined #ruby
andrewhl has joined #ruby
joaoh82 has joined #ruby
shadoi has joined #ruby
Morkel has joined #ruby
StevenR12 has joined #ruby
pubis has joined #ruby
c0rn has joined #ruby
CheeToS has joined #ruby
yxhuvud has joined #ruby
nilg` has joined #ruby
a_a_g has joined #ruby
sluggy has joined #ruby
_null has joined #ruby
shruggar has joined #ruby
Advocation has joined #ruby
Advocation has joined #ruby
michaelmartinez has quit [#ruby]
davidw has joined #ruby
emmanuel__ has joined #ruby
Careott has joined #ruby
chovy has joined #ruby
djdb has joined #ruby
havenn has joined #ruby
alem0lars has joined #ruby
nikhil_ has joined #ruby
JivaD has joined #ruby
ryanf has joined #ruby
maletor has joined #ruby
greenarrow has joined #ruby
x0F_ has joined #ruby
mborromeo has joined #ruby
cezar has joined #ruby
JohnBat26 has joined #ruby
Advocation has joined #ruby
moshee has joined #ruby
moshee has joined #ruby
maesbn has joined #ruby
senny has joined #ruby
MrGando has joined #ruby
Eldariof-ru has joined #ruby
etehtsea has joined #ruby
Blah1 has joined #ruby
<Blah1> is it possible to to bundle a shell script in the bin dir of a gem (yet the shell script will still work)?
<Blah1> the problem is a rubygems pointer for the executable shell script is created in /usr/local/bin/gemexecutable and it's a ruby wrapper so when it executes the shell script it bombs
zommi has joined #ruby
<Blah1> I think i found the answer but just wanted to make sure.. there's simply no way to distribute working shell scripts in a ruby gem right?
c0rn has joined #ruby
sroy2 has joined #ruby
campanolix has joined #ruby
schovi has joined #ruby
<campanolix> I'm seeing minitest lose track of methods in a class of a module that includes another module. I can reproduce this in a simple case, but before I post to pastie, which I am too tired for now, does anyone know of an existing bug about this?
Advocation has joined #ruby
ctwiz has joined #ruby
Advocation has joined #ruby
ephemerian has joined #ruby
bashdy has joined #ruby
mikeg has joined #ruby
shruggar has joined #ruby
pastjean has joined #ruby
workmad3 has joined #ruby
dnyy has joined #ruby
tijmencc has joined #ruby
mborrome1 has joined #ruby
KL-7 has joined #ruby
robert__ has joined #ruby
Careott has joined #ruby
moshef has joined #ruby
nvez_ has joined #ruby
allanm has joined #ruby
mikeg has joined #ruby
pjn_oz has joined #ruby
Careott has joined #ruby
Advocation has joined #ruby
Advocation has joined #ruby
antihero has joined #ruby
Blah1 has joined #ruby
<antihero> where does gem install scripts to? I gem installed stuff and I still don't have the commands :O
Squarism has joined #ruby
sandGorgon has joined #ruby
nfluxx has joined #ruby
shruggar has joined #ruby
schovi has joined #ruby
mdw has joined #ruby
davidcelis has joined #ruby
davidcelis has joined #ruby
zemanel has joined #ruby
neurotech has joined #ruby
ryanw_ has joined #ruby
c0rn has joined #ruby
symb0l has joined #ruby
shiroginne has joined #ruby
<shiroginne> morning all :)
jeffmess has joined #ruby
apeiros_ has joined #ruby
falena has joined #ruby
ephemerian has joined #ruby
madmax_ has joined #ruby
Ammar01 has joined #ruby
madmax- has joined #ruby
maletor has joined #ruby
Squarism has joined #ruby
keymone has joined #ruby
keymone has joined #ruby
robert__ has joined #ruby
maletor has joined #ruby
Careott has joined #ruby
mdw has joined #ruby
JohnBat26 has joined #ruby
apeiros_ has joined #ruby
schovi has joined #ruby
QaDeS has joined #ruby
JohnBat26 has joined #ruby
timonv has joined #ruby
monzie has joined #ruby
monzie has quit [#ruby]
francisfish has joined #ruby
TheIronWolf has joined #ruby
Careott has joined #ruby
Squarism has joined #ruby
ukwiz has joined #ruby
bluOxigen has joined #ruby
arturaz has joined #ruby
nemesit has joined #ruby
kpshek has joined #ruby
nemesit has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
KJF has joined #ruby
tvw has joined #ruby
replore_ has joined #ruby
schovi has joined #ruby
davejacobs has joined #ruby
eka has joined #ruby
simao has joined #ruby
sspiff has joined #ruby
roolo has joined #ruby
Squarism has joined #ruby
fixl has joined #ruby
workmad3_ has joined #ruby
adelcampo has joined #ruby
peterhil` has joined #ruby
adelcampo has joined #ruby
artm has joined #ruby
artm has joined #ruby
CoverSlide has joined #ruby
jimeh has joined #ruby
spuz has joined #ruby
Kevin- has joined #ruby
jenglish has joined #ruby
provideal has joined #ruby
<provideal> Hey folks, when using a 'case <somefancyexpression> when ... ' -- is there a builtin way to acces the case'd expression? I mean... without giving it a name by myself...
frogstarr78 has joined #ruby
Guest90009 has joined #ruby
<banisterfiend> provideal: you mean the code for the eval(File.readlines(__FILE__)[__LINE__ - 1])
<banisterfiend> - 2
<provideal> :D
<provideal> Kinda, yeah. I dislike that case a=... when... pollutes the scope
pdtpatrick has joined #ruby
<banisterfiend> provideal: same with if and begin
<banisterfiend> and while
<provideal> yeah
<provideal> I hoped for some strange implicit variable of the $%# kind
<banisterfiend> provideal: i kind of like it, it means i can do
<banisterfiend> if blah; x = 20; else; x = 30; end puts x
<banisterfiend> witout having to put: x = nil before it
<provideal> THAT'S neat!
<provideal> eh
bier has joined #ruby
<banisterfiend> provideal: you could of course just go
<banisterfiend> provideal: x = if blah; 20; else; 30; end
<provideal> yeah, that's what I usually do
<banisterfiend> i find that a bit weird
<provideal> I come from more functional programming ;)
<banisterfiend> as the if/else get indented strangely
<provideal> that's an issue
bier|tp has joined #ruby
mrwalker has joined #ruby
simao has joined #ruby
jenglish has joined #ruby
Careott has joined #ruby
burgestrand has joined #ruby
tatsuya_o has joined #ruby
amaia has joined #ruby
<Tasser> how would I parse "1" to 1 and "" to nil?
<Tasser> ... instead of 0
<rippa> Tasser: Integer "" rescue nil
<Tasser> ah well
berserkr has joined #ruby
<banisterfiend> Tasser: str.empty? ? nil : str.to_i
sam113101 has joined #ruby
fermion has joined #ruby
francisfish has joined #ruby
ctp has joined #ruby
ctp_ has joined #ruby
nipra has joined #ruby
roolo has joined #ruby
jonathanwallace has joined #ruby
visof has joined #ruby
nipra has joined #ruby
fermion has joined #ruby
machine2 has joined #ruby
ctp has joined #ruby
ctp- has joined #ruby
spuz has joined #ruby
ryanwy has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
madmax_ has joined #ruby
simao has joined #ruby
madmax- has joined #ruby
stefanp has joined #ruby
stefanp has joined #ruby
simao has joined #ruby
nikhil_ has joined #ruby
ryanwy has quit ["Leaving"]
Asher has joined #ruby
banjara has joined #ruby
banjara has joined #ruby
justinmcp has joined #ruby
rohit has joined #ruby
waxjar has joined #ruby
Holek has joined #ruby
<Holek> mornin'
<Holek> how can I get rid a UTF BOM mark from a beginning of a string in 1.9.3?
<Holek> string.sub("\xEF\xBB\xBF", '') # => ArgumentError Exception: invalid byte sequence in UTF-8
yeggeps_ has joined #ruby
bluenemo has joined #ruby
Gonzih has joined #ruby
<Holek> I don't have access to a file, I only have access to uploaded data
iocor has joined #ruby
<Holek> so I can't open it with File.open(… , 'r:bom|utf-8')
dipnlik has joined #ruby
<rippa> encode it to binary
<Holek> wow, that worked
dipnlik has quit [#ruby]
banjara has joined #ruby
Gonzih has joined #ruby
<Holek> thanks, rippa :)
dbgster has joined #ruby
keymone has quit [#ruby]
Gonzih has joined #ruby
ChampS666 has joined #ruby
Floydzy has joined #ruby
simao has joined #ruby
fr0gprince_mac has joined #ruby
jeffmess has joined #ruby
symb0l has joined #ruby
simao has joined #ruby
apeiros_ has joined #ruby
lolmaus has joined #ruby
<lolmaus> Is it correct that when i a apply a sort_by to a hash, an array of arrays is returned?
<rippa> yes
<lolmaus> Ruby documentation for Array gives one parameter for `.each`. But when you apply .each to an array of arrays, you actually can use more parameters, and the second parameter will store the second value of each sub-array. I can provide an example working code.
<lolmaus> Question: is this behavior documented somewhere?
replore has joined #ruby
<rippa> it's kind of a special case
<rippa> normally you'd have to |(x, y)|
<apeiros_> auto-splat
<banisterfiend> apeiros_: how was the ruby conf
<apeiros_> sadly, ruby does that (sadly because it makes some things ambiguous and problematic)
<apeiros_> banisterfiend: good so far
<apeiros_> missing power outlets
<apeiros_> now a talk about vim… so coding time for me :-p
<lolmaus> Okay, so when you do `.each{|x,y| ...}`, that's kinda syntactic sugar for `.each{|a| x = a[0]; y=a[1]; ...}`?
notcareoto has joined #ruby
<apeiros_> oh, banisterfiend - are there plans to make prompt procs more powerful in pry? like getting an indicator on what's still open in multi-line? how deep we're in nested control structures?
SPYGAME has joined #ruby
<banisterfiend> lolmaus: |x,y| where the yield is yield([1, 2]) is equivalent to: x, y = [1, 2]
notcareoto has quit [#ruby]
bwlang has joined #ruby
<banisterfiend> apeiros_: that information is kind of available, but not exposed in an easy way. We yield the pry itself itself to the prompt proc so u can get nearly all info about the session from that
<banisterfiend> pry instance itself*
<lolmaus> banisterfiend, i don't quite get it... Does Ruby use different yield for .each depending on whether you've asked for one or more parameters?
<apeiros_> banisterfiend: how about yielding a single object instead? a small struct
<apeiros_> would be less fragile wrt api changes
sohocoke has joined #ruby
ctp has joined #ruby
<banisterfiend> apeiros_: yeah we thought about just yielding the pry instance itself :P since all the info is available on that, but that's kind of confusing for people. You're probably right about yielding a struct though that's a cool idea
<banisterfiend> apeiros_: very cool actually, can u file an issue?
<banisterfiend> apeiros_: https://github.com/pry/pry/issues
<apeiros_> so you could do .prompt = proc { |state| "#{state.line}:#{state.pry_nesting}#{state.main_object}" etc.
<apeiros_> will do
willb has joined #ruby
<banisterfiend> yeah that's actually a nifty pattern we could use in a bunch of places
nacengineer has joined #ruby
josefig has joined #ruby
josefig has joined #ruby
<lolmaus> banisterfiend, when there is one parameter, Ruby puts the whole sub-array in it, and parameter's class is Array. When there are two parameters, Ruby puts the first item of the sub-array in the first parameter, and its class could be Symbol, String, etc...
<banisterfiend> lolmaus: block variable assigns are (almost) equiavlent to array destructurings
<lolmaus> banisterfiend, my initial question was whether this difference in the behavior is documented.
<banisterfiend> lolmaus: proc { |x,(y, z), w| }.call( [1, [2, 3], 4] )
<lolmaus> banisterfiend, you mean that's the code universally used for block variable assignments?
<tommylommykins> hmm, ooi, wy doesn't puts return the string that it prints?
jitesh_shetty has joined #ruby
<lolmaus> tommylommykins, use tap
<tommylommykins> yeah
<tommylommykins> tbh, I'm not too sure what use I could make with the return value of puts though :s
<banisterfiend> lolmaus: proc { |x,(y, z), w| }.call( [1, [2, 3], 4] ) is equivalent to: x, (y, z), w = [1, [2, 3], 4 ] (as far as the assignment rules are concerned, i.e which variable gets what value from the array)
<tommylommykins> except maybe writing puts puts puts puts puts puts puts "this"
<tommylommykins> for fun
amaia has quit ["Saliendo"]
<banisterfiend> lolmaus: so long as you think of block arguments as destructing an array you'll be fine
<banisterfiend> though there was one edge case i forget about
<banisterfiend> hm sorry
<banisterfiend> .call(1, [2, 3], 4) i mean
<banisterfiend> iirc: .call(1, 2) is more or less the same as if you'd gone .call([1, 2])
Ethan has joined #ruby
<lolmaus> banisterfiend, thank you, but i'm so confused that your generous explainations haven't contributed to my knowledge. :(
<banisterfiend> lolmaus: sorry im half asleep really
<banisterfiend> ill try again another time :)
<lolmaus> tommylommykins, use `string_var.tap(&:display)` instead of `print string_var` to both print its value and pass on
simao has joined #ruby
jeffmess has joined #ruby
<lolmaus> banisterfiend, the problem is my Ruby illiteracy, not the quality of your explainations. :)
Ethan has joined #ruby
Squarism has joined #ruby
davidcelis has joined #ruby
<lolmaus> tommylommykins, for instance, when you've got calculations like `(1 + 2) * 3`, you can do `(1 + 2).tap(&:display) * 3` to print the intermediate result without interrupting the calculations.
<apeiros_> banisterfiend: https://github.com/pry/pry/issues/545
<lolmaus> Also, i've got no idea what `&:display` means. :)
<banisterfiend> apeiros_: awesome
<banisterfiend> apeiros_: i think we can use that pattern for all our config procs
<banisterfiend> i was really wondering what to do with the preponderance of arguments
<apeiros_> makes sense, yes
<apeiros_> oooh, you can even do it in a backwards compatible way by leveraging to_ary
<apeiros_> let me add a comment to the issue
mattyoho has joined #ruby
roolo has joined #ruby
Ethan has joined #ruby
Ethan has joined #ruby
<banisterfiend> apeiros_: thanks, this really tidies up all those fiddly config APIs :))
<banisterfiend> apeiros_: btw did u get a chance to play with the new find-method / show-source -a commands? checkout my comment here for some gists showing what they can do http://www.reddit.com/r/ruby/comments/sgsym/pry_099_finding_methods_line_highlighting_and_more/
<apeiros_> banisterfiend: not much. took medicine against tinnitus. caused shitload of headache. *hate*
<apeiros_> (I stopped taking it, I prefer tinnitus as it is over that much headache…)
<banisterfiend> apeiros_: check this out: https://gist.github.com/2417846
<banisterfiend> :P
<banisterfiend> IMO it kills ack ;)
<apeiros_> I don't use ack. bbedit has awesome search.
<banisterfiend> ah ok
<apeiros_> but I think pry will replace a couple of patterns for me :)
banjara has joined #ruby
zemanel has joined #ruby
<apeiros_> (behavioral patterns)
Divinite has joined #ruby
<banisterfiend> cool
<lolmaus> Could you please recommend a hands-on introduction of Ruby TDD for newbies?
fetimo has joined #ruby
banjara has joined #ruby
zommi has joined #ruby
nikhil_ has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
Divinite has joined #ruby
tk__ has joined #ruby
nanderoo has joined #ruby
fridim_ has joined #ruby
heldopslippers has joined #ruby
madmax_ has joined #ruby
davidw has joined #ruby
nilg` has joined #ruby
Beoran__ has joined #ruby
Mohan has joined #ruby
Mohan has joined #ruby
seanstickle has joined #ruby
ctp has joined #ruby
francisfish has joined #ruby
abionic has joined #ruby
rohit_ has joined #ruby
rohit_ has joined #ruby
agilobable has joined #ruby
soveran has joined #ruby
symb0l has joined #ruby
lkba has joined #ruby
krusty_ar has joined #ruby
grin has joined #ruby
maasha has joined #ruby
<maasha> Hey, is there some elegant way to iterate over a list in increments of say 12?
<apeiros_> step
<apeiros_> ah, hm, that's not over a list, just integer. can be used for it, though
<apeiros_> you could use each_slice and ignore all but the first
simao has joined #ruby
rohit_ has joined #ruby
<maasha> step it is
<maasha> ty
Faris has joined #ruby
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
ukd1 has joined #ruby
dql has joined #ruby
frishi has joined #ruby
frishi has joined #ruby
nvez has joined #ruby
nvez has joined #ruby
mdw has joined #ruby
S1kx has joined #ruby
S1kx has joined #ruby
Faris1 has joined #ruby
Morkel has joined #ruby
justinmcp has joined #ruby
`brendan has joined #ruby
elliot_ has joined #ruby
withnale has joined #ruby
simao has joined #ruby
alup has joined #ruby
<withnale> Hello. Is there a way to add an object to an array inside a hash in one line? Each time I try to write it I end up with the nil in the array if it was empty
nilg` has joined #ruby
<rippa> hash[key] << object
<withnale> if they key doesn't already exist I get a NilClass error
<banisterfiend> withnale: if it doesnt already exist then you dont have an array inside a hash
<banisterfiend> withnale: which goes against the premise of your entire question
yannis has joined #ruby
<withnale> ok. the intention is to have an array of objects associated with each key. I did mention the problem if the array is empty.
<banisterfiend> withnale: array is empty != not no array
<banisterfiend> withnale: but maybe try this: hash[key] ||= []; hash[key] << object
<rippa> Hash.new {[]}
<banisterfiend> rippa: or do what rippsy just said
<banisterfiend> withnale: *
<withnale> I don't get the Hash.new{[]}
batmanian has joined #ruby
albemuth has joined #ruby
apeiros_ has joined #ruby
<artm> join #qt
<artm> pff
visof has joined #ruby
krusty_ar has joined #ruby
vk has joined #ruby
jeffmess has joined #ruby
Kruppe has joined #ruby
Azure|netbook has joined #ruby
schovi has joined #ruby
<ksk> hi
<ksk> is there something like bashs -x commandline-option for ruby, to see what its doing internally? im using array.include? which does not match as expected, i guess things in the array dont look like i expect them to be..
kvirani has joined #ruby
asuka_ has joined #ruby
pu22l3r has joined #ruby
MarcWeber has joined #ruby
<MarcWeber> announce: http://www.vim.org/scripts/script.php?script_id=4024 kiss rdebug debugging for vim - feedback welcome
nu7hatch has joined #ruby
BrokenCo1 has joined #ruby
yoklov has joined #ruby
<heldopslippers> Hy ksk: You could just do put, p, or inspect.
<heldopslippers> on the array
seanstickle has joined #ruby
<rking> Hrm. I am wanting to take the output of `rake -t` and split it so that each "** Execute ____" output section becomes a separate file. Can you think of a way I could do it without parsing stdio?
xea has joined #ruby
<rking> MarcWeber: Cool man, I'll give it a shot.
<rking> MarcWeber: Should link to vim-addon-async for convenience.
<rking> MarcWeber: And for your convenience, here's the URL. =) http://www.vim.org/scripts/script.php?script_id=3307
<MarcWeber> rking: use VAM and be happy.
<MarcWeber> You also need vim-addon-mw-utils
<rking> MarcWeber: OK, I will. I have no idea what it is but I like using things and being happy.
tommyvyo has joined #ruby
<MarcWeber> github.com/MarcWeber/vim-addon-manager
jrist-mtgs has joined #ruby
<MarcWeber> Then vam#ActivateAddon(['vim-addon-rdebug']) is enough to make everything work ..
BrokenCog has joined #ruby
<MarcWeber> rking: There are likely to be some small updates. Just noticed that I broke something while adding breakpoint support
<ksk> heldopslippers: if i output the array it looks fine, using inspect it looks more "array like"...
<ksk> my question is how its value is used by .include? - a simple test works, but not with the data i want to use...
<rking> MarcWeber: OK. I have to BBIAB anyway. Can you make the README a bit more noobish? I'm new to some of the vim-scripts stuff, and I'd benefit from the exact: "Make sure you have vim-addon-mw-utils from http://.., vim-addon-async from http://.., and VAM from http://.." -- I'd benefit and I think someone else would, too.
madmax_ has joined #ruby
jrist-mtgs has joined #ruby
<rking> MarcWeber: You get bonus points if it's a pasteable snippet that has "git clone ..." and "ln -s" lines for the installation.
<MarcWeber> rking: that is what VAM is about. So shut up and read its getting started guide :)
bwlang has joined #ruby
liluo has joined #ruby
apeiros_ has joined #ruby
<rking> MarcWeber: OK, but it's still unclear exactly how to go from a stock vim with an empty ~/.vim/{autoload,ftplugin,indent,plugin}/ and get to a running vim-addon-rdebug ... does it /only/ need VAM first?
<MarcWeber> rking: I've pushed some more notes to the github repo some minutes ago.
<MarcWeber> Let me one bug first, please
fbernier has joined #ruby
KJF has joined #ruby
tommyvyo has joined #ruby
geekbri has joined #ruby
mattyoho has joined #ruby
mstratman has joined #ruby
linoj has joined #ruby
<heldopslippers> ksk: ah ok!
ephemerian has joined #ruby
jeffmess has joined #ruby
kevinfagan has joined #ruby
BrokenCog has joined #ruby
<MarcWeber> rking: What's your progress in giving it a try?
<ksk> "puts array[0].inspect" says "#<MatchData "mydata"> - do i have to match this non-data stuff using array.include? ?
kevinfagan has joined #ruby
vitor-br has joined #ruby
bbttxu has joined #ruby
netrealm has joined #ruby
mrwalker has joined #ruby
bwlang has joined #ruby
tomzx has joined #ruby
emmanuel__ has joined #ruby
bwlang_ has joined #ruby
kpshek has joined #ruby
<rking> MarcWeber: OK, I'm mostly back. First, none of the URLs around here are actual links. http://www.vim.org/scripts/script.php?script_id=4024 has the github one that you have to copy & paste, then the README there (which should probably be README.md, right?) has another github.com non-link (personally I'd make it maximally lazy and have the "git clone https://github.com/MarcWeber/vim-addon-manager.git" line) ...then VAM's README has a link with a stray ")" ...
<rking> ... at the end. Then, vim-addon-manager-getting-started.txt in the "Installation" section says "Gentoo users: skim VAM-gentoo", but you can't actually hop to that tag until you've installed.
abby_j has joined #ruby
BrokenCog has joined #ruby
ccapndave3 has joined #ruby
fr0gprince_ has joined #ruby
<MarcWeber> rking: Right, that's because I split the help file into two parts: 1) mandatory 2) optional details you don't want to read about first
<rking> MarcWeber: I mean, I can figure all of this out fine... I'm only trying to give feedback of where the friction is.
<MarcWeber> rking: I know. Thinking about how to improve it.
<MarcWeber> Its because I don't think installing VAM system wide is the best choice ..
<rking> MarcWeber: I'm actually at that point right now. I kind of want to do the "VAM-gentoo" instructions, because I haven't used Gentoo overlays or paludis, and it sounds interesting. But I think I agree with the comment about SetupVAM, so I'll do that.
BrokenCog has joined #ruby
mattyoho has joined #ruby
LMolr has joined #ruby
<MarcWeber> rking: Haven't I seen you on #nixos as well? So you're back to gentoo?
mattyoho has joined #ruby
<rking> MarcWeber: Hrm, no #nixos for me. Now that I look at their site it does seem like something I'd be interested in. I stuck with Debian for 16 years, and am only now branching out.
<MarcWeber> rking: go nixos.org. You can learn about layman etc - but its just a way to add ebuilds to your system which are used not often enough - thus they are not officially supported - or only supported by groups.
<MarcWeber> Eg when I used gentoo there were java overlays and such.
soveran has joined #ruby
petercoulton has joined #ruby
<rking> MarcWeber: Cool. I'm learning a bunch of stuff this morning. =)
<MarcWeber> rking: Do me a favour: goto SetupVAM sample fun, copy paste into your .vimrc and be done.
nilg has joined #ruby
<MarcWeber> You can read up all the other things later ;)
<rking> Good idea. =)
bwlang_ has joined #ruby
philcrissman_ has joined #ruby
<rking> MarcWeber: 1) Pasted, 2) Ran vim, 3) Error detected while processing function SetupVAM..EnsureVamIsOnDisk: line 17: E154: Duplicate tag "VAM-contents" in file /home/rking/.vim/vim-addons/vim-addon -manager/doc/vim-addon-manager-getting-started.txt
zommi has joined #ruby
twinturbo has joined #ruby
<rking> MarcWeber: But maybe that's because I already cloned the vim-addon-manager repo and ran vim from there? Repeated invocations of vim do not cause that message.
<MarcWeber> rking: no, its due to documentation changes
<MarcWeber> ignore it and continue.
davorb has joined #ruby
dustybrains has joined #ruby
Gekz has joined #ruby
<rking> MarcWeber: E492: Not an editor command: vam#ActivateAddon(['vim-addon-rdebug'])
theRoUS has joined #ruby
<MarcWeber> rking: compare with sample in SetupVAM
td123 has joined #ruby
td123 has joined #ruby
<rking> MarcWeber: Oh. It's ActivateAddons not ActivateAddon
looopy has joined #ruby
replore_ has joined #ruby
<rking> MarcWeber: Here's my humble opinion on this. VAM should have a "quickstart" command that you can do like: curl https://github.com/.../raw/... > ~/.vim/plugin/vam.vim ; vim
<rking> MarcWeber: It would simply put the EnsureVamIsOnDisk() and SetupVAM() in there, initially.
<MarcWeber> rking Thanks. Copy pasting the SetupVAM is "quickstart". don't overoptimize.
dfamorato has joined #ruby
<MarcWeber> You want to do that with your .vimrc, not with VAM.
<MarcWeber> That's how VAM is meant to be used, yes :)
<rking> MarcWeber: Then the rdebug README would have that line, plus also the line: call vam#ActivateAddons(['vim-addon-rdebug'])
<rking> MarcWeber: You're being stubborn.
zealinux has joined #ruby
<rking> MarcWeber: So far I am having to wade through a whole lot of documentation and new concepts to get up and running.
<rking> I'll try to make this clear.
<rking> http://www.vim.org/scripts/script.php?script_id=4024 <-- Has a non-link that assumes you know about github.
<MarcWeber> rking: Think about it. Its not about making 2000 plugin authors adding the same lines to 10.000 plugins. Its about learnig VAM once, understand that all youh ave to add is a name and be done.
<MarcWeber> fixing www.vim.org is on my todo list since 2009 at least..
<rking> https://github.com/MarcWeber/vim-addon-rdebug <-- Says "get github.com/MarcWeber/vim-addon-manager,
LBRapid has joined #ruby
<MarcWeber> But we're pretty much OT in ruby ..
<rking> Which is also a non-link, and has a comma in it so you can't even double-click it. But the instructions of how to do the quickstart should already be there.
jeffmess has joined #ruby
<MarcWeber> You're the first user. The plugin is 24 hour old, what do you expect?
<rking> https://github.com/MarcWeber/vim-addon-manager <-- Has at least a clickable link (though the text version has the stray ")" that github is smart enough not to include)
jgame has joined #ruby
<MarcWeber> rking: Get it up and running, then tell me whether its worth spending more time on the README file.
<rking> OK, fair enough.
<jgame> Hi How I can access sqlCE database with ruby?
<rking> Back to ActivateAddons()'s result: The following scmnr keys are not known: 4024. No repository location info known for plugin vim-addon-rdebug.
<rking> MarcWeber: So I guess that's down lower in SetupVAM()
<MarcWeber> rking: will be fixed in a couple of days when the cron job runs again.
<MarcWeber> ignore it.
<rking> Oh.
<rking> MarcWeber: I don't think any cron job is going to run.
jchauncey has joined #ruby
d3c has joined #ruby
phantasm66 has joined #ruby
<MarcWeber> rking: That bug is related to vim-addon-manager-known-repositories. If you have a look at that history you know there is a cron job.
<rking> MarcWeber: Well, when I do "crontab -e" I get an error, so I can't imagine what VAM could be doing to create a cron job when I can't as a user.
grin has joined #ruby
ryannielson has joined #ruby
<MarcWeber> rking: a cronjob not running on your machine is going to push commits to VAM-kr which will resolve the issue if you update that repo.
<jgame> any hint to sqlCE db file
<jgame> ?
<rking> MarcWeber: Aha! My bad. I see -- not on my machine.
carlyle has joined #ruby
moisesvargas has joined #ruby
Jackneill has joined #ruby
elhu has joined #ruby
<rking> MarcWeber: OK, at this point, it did some stuff, and now when I start up I only get that "scmnr keys" error, but I don't see vim-addon-rdebug.vim anywhere.
bwlang_ has joined #ruby
Sailias has joined #ruby
yoklov has joined #ruby
EvanR has joined #ruby
EvanR has joined #ruby
kvirani has joined #ruby
jgarvey has joined #ruby
schovi has joined #ruby
gtuckerkellogg has joined #ruby
dv310p3r has joined #ruby
snip_it has joined #ruby
<tommylommykins> hmm
<tommylommykins> is there any method in the standard library to recursively return all the files underneath a certain point?
<tommylommykins> I do I have to write the recursive bit ymself?
thone_ has joined #ruby
a_a_g has joined #ruby
<Tasser> tommylommykins, Find.find, but it's pretty stupid
<tommylommykins> aha, thanks
* tommylommykins notes that appears to have found a lot of things :D
banjara has joined #ruby
kevinbond has joined #ruby
<MarcWeber> rking: VAM installs into ~/.vim/vim-addons/ by default. Can't you just RTFM ? The SetupVAM is commented. And also the install process should tell you where plugins are put.
<rking> MarcWeber: Why are you being irritable?
lorandi has joined #ruby
<rking> MarcWeber: You're sort of telling me to just do the quick way and get it started, but then you're telling me I will actually need to RTFM.
berkes has joined #ruby
<MarcWeber> rking I'm telling you to read the code you're copy pasting into your .vimrc.
<MarcWeber> And that's pretty sane to do so.
<rking> MarcWeber: For one, that error message was definitely not something I was supposed to ignore.
<rking> MarcWeber: Yeah, I've done that.
<MarcWeber> So why are you asking where the .vim file is?
<rking> MarcWeber: Look.
<rking> MarcWeber: You told me to ignore an error that says: No repository location info known for plugin vim-addon-rdebug.
<MarcWeber> wait
<rking> MarcWeber: I'm thinking I should definitely not ignore that error.
<MarcWeber> Then we missunderstood each other.
<MarcWeber> I meant ignore the tag error.
francisfish has joined #ruby
<rking> < rking> Back to ActivateAddons()'s result: The following scmnr keys are not known: 4024. No repository location info known for plugin vim-addon-rdebug.
boonedocks has joined #ruby
<MarcWeber> rking replace the name by 'github:MarcWeber/vim-addon-rdebug'. You've been right. Its realted
<rking> Right.
<rking> I got that now.
<rking> And it's busy being awesome and installing a bunch of stuff.
<MarcWeber> related. Because the cron job hasn't added the name / script-id association VAM-kr does not know about the name yet - thus no plugin.
looopy has joined #ruby
virunga has joined #ruby
<rking> MarcWeber: BTW - I'll have to read the docs on auto_install - because to me that option says "don't automatically install this", which it is doing.
<MarcWeber> its because its set to 0 by default.
<rking> Aha, plugin confirmation.
iocor has joined #ruby
palcu has joined #ruby
nlc has joined #ruby
pastjean has joined #ruby
ecolitan has joined #ruby
jeebster has joined #ruby
chson has joined #ruby
jeffmess has joined #ruby
bwlang_ has joined #ruby
brngardner has joined #ruby
baroquebobcat has joined #ruby
iocor has joined #ruby
bglusman has joined #ruby
PaciFisT has joined #ruby
zealinux has joined #ruby
EzeQL has joined #ruby
krusty_ar has joined #ruby
brngardner has joined #ruby
a_a_g has joined #ruby
mrwalker_ has joined #ruby
moshef has joined #ruby
Drewch has joined #ruby
btaitelb has joined #ruby
quest88 has joined #ruby
ben_alman has joined #ruby
SQLStud has joined #ruby
Aristata has joined #ruby
joaoh82 has joined #ruby
<Aristata> Does anyone here know how to change the page margins of a prawn document on a per page basis?
Sailias has joined #ruby
Holek has joined #ruby
nu7hatch has joined #ruby
wmoxam has joined #ruby
rippa has joined #ruby
Notimik has joined #ruby
jbw has joined #ruby
fbernier has joined #ruby
SQLStud has joined #ruby
CannedCorn has joined #ruby
fangwen has joined #ruby
grin has joined #ruby
krusty_ar has joined #ruby
ckrailo has joined #ruby
mikepack has joined #ruby
<visof> what is the best way to how start to write wm using ruby ?
oooPaul has joined #ruby
<withnale> I've got log4r installed in the proper location, installed with gem as root, and if I type gem list log4r it comes back present but if I try ruby -e 'require "log4r";' I get a load error. Have I missed something?
<Tasser> visof, ask unexist ;-)
<visof> Tasser, who?
d3c has joined #ruby
jedir0x has joined #ruby
joast has joined #ruby
<jedir0x> is this a good channel to ask DataMapper questions in?
grin has quit [#ruby]
<jedir0x> nevermind
<jedir0x> #datamapper
<jedir0x> :)
benkevan has joined #ruby
Vert has joined #ruby
<withnale> nvm. fixed it
CheeToS has joined #ruby
andrewhl has joined #ruby
<jedir0x> using DataMapper - how can i tell if one of my unique constraints (ie on :email) has been violated after a create(). ie: i check that valid? returns false, now i want to see if it's not valid because i've violated a unique constraint on the :email field.
zealinux has joined #ruby
johnmilton has joined #ruby
dv310p3r has joined #ruby
<visof> what is the best GUI library for ruby? can i deal with windows via something like using css in web ?
LiquidInsect has joined #ruby
gnzh has joined #ruby
albemuth has joined #ruby
rushed has joined #ruby
<oooPaul> visof: I have no idea, I'm pretty much only ever doing up Rails web apps or command-line tools, neither of which require actual gui work.
<visof> oooPaul, thanks
<jedir0x> "wxRuby is an open source GUI toolkit for the [Ruby] programming language. It allows native-looking desktop applications to be written for Windows, OS X, Linux GTK and other platforms using only Ruby. It's based on the cross-platform [wxWidgets] C++ GUI framework. "
Gonzih has joined #ruby
coreyo has joined #ruby
ChampS666 has joined #ruby
maloik has joined #ruby
maloik has quit [#ruby]
jchauncey_ has joined #ruby
uris has joined #ruby
stantona has joined #ruby
Holek has joined #ruby
Holek has joined #ruby
hormigas has joined #ruby
grin has joined #ruby
<stantona> I'm just wondering how I can check if an object has extended a module? can I use obj.is_a?
baroquebobcat has joined #ruby
fabrice31 has joined #ruby
rcrossan has joined #ruby
LMolr has joined #ruby
twinturbo has joined #ruby
grin has quit [#ruby]
<rcrossan> Not using rails, seeking direction or site that could provide me examples or documentation on basic reporting for my scripts. The most important item I need in my script is to log how long the script took and then pass/fail for items of course.
grin has joined #ruby
<Aristata> Is the
<campanolix> I'm seeing minitest lose track of methods in a class of a module that includes another module. I can reproduce this in a simple case, but before I post to pastie, which I am too tired for now, does anyone know of an existing bug about this?
<Aristata> weird
<Aristata> Is there anyone here familiar with prawn?
jchauncey has joined #ruby
banjara1 has joined #ruby
td123 has joined #ruby
flagg0204 has joined #ruby
fr0gprince_ has joined #ruby
Gonzih has joined #ruby
flingbob has joined #ruby
lkba has joined #ruby
Guest41259 has joined #ruby
flingbob has quit [#ruby]
jchauncey has joined #ruby
jchauncey has joined #ruby
daed has joined #ruby
Gonzih has joined #ruby
<coreyo> I'm trying to create a class whose constructor can take an optional method as an argument. If no optional method is specified, a default is used. For now, I'm using the "Proc" object as the optional parameter. Is there a cleaner way of doing this?
axl_ has joined #ruby
<Tasser> coreyo, def initialize(arg = "foo"); ... ; end ?
grin has joined #ruby
cjlicata has joined #ruby
Natch| has joined #ruby
<coreyo> Tasser yes, that is the idea
<Tasser> coreyo, so why don't you?
<coreyo> Tasser, I'm sorry, I think we both misunderstood each other. the arg must be a method (i.e. a function), not a string
zakwilson has joined #ruby
Guest41259 has quit [#ruby]
grekko has joined #ruby
<coreyo> Tasser, the function will then be stored in a state variable within the class and used later to do some calculations
<Tasser> yes, that's a proc object.
<coreyo> Tasser, so proc is the only way pass an external method to an object?
<Tasser> coreyo, method(:puts)
<Tasser> => #<Method: Object(Kernel)#puts>
<Tasser> ... kind of.
<coreyo> does that approach require that the method be in the class's scope?
<Tasser> a Proc isn't that different from a Method, I'd say it's a superclass
<Tasser> nah, a bound method takes the scope with it
<coreyo> you mean a closure
<Tasser> yeah, the same
blueadept` has joined #ruby
<coreyo> The main reason that I'm asking is that, by wrapping my functions in Proc objects, I took about a 5% performance hit in the benchmark
<coreyo> I assumed it was just an extra pointer lookup and that was it, but judging by the extra running time, I'd say something else is going on
grin has quit [#ruby]
<jimeh> if that helps
NivenHuH has joined #ruby
<coreyo> jimeh, I think the problem with that approach is that the function already has to be defined in the class
umarsheikh has joined #ruby
grin has joined #ruby
<jimeh> coreyo: so you're basically after an anonymous function like in javascript or erlang if I understand you correctly? :)
<umarsheikh> i am trying to move a rails 3.1 app from 1.8.7 to 1.9.3. when i try to log in, i get the error ArgumentError (argument out of range):
<umarsheikh> how can i fix this error?
campanolix has joined #ruby
grin has quit [#ruby]
grin has joined #ruby
<Veejay> umarsheikh: You might want to consider pasting the whole stack trace on #rubyonrails
brngardner has joined #ruby
<umarsheikh> Vejay, ok
<umarsheikh> Veejay, ok
grin has quit [#ruby]
grin has joined #ruby
grin has quit [#ruby]
<jimeh> coreyo: any reason a regular block won't work for your purpose?
iocor has joined #ruby
<coreyo> jimeh, Is it possible to store an anonymous function as a variable, then call that variable as a function?
<jimeh> yes, technically that is a Proc...
grin has joined #ruby
grin has quit [#ruby]
<jimeh> but what you can also do is something like: def initialize; if block_given?; yield; else; my_default_behavior; end; end
<coreyo> jimeh, so we go full circle. Does this mean that Proc is the only way to achieve this (or at least the cleanest and preferred way) ?
wimplash has joined #ruby
grin has joined #ruby
<a_a_g> there's lamdas as well
grin has quit [#ruby]
<a_a_g> which are closer to anonymous functions
<coreyo> a_a_g, isn't a lambda just an anonymous function?
<a_a_g> it is. procs are a bit different
grin has joined #ruby
<jimeh> basically, yes, either you pass a Proc assigned to a variable as an argument when initializing the instance, or the simplest way is probably to call it with a block
<coreyo> basically, I need to be able to store a function like a variable, then call it later with parameters when the class needs it
<a_a_g> proc and lambdas both will work
eywu has joined #ruby
<coreyo> a_a_g, how do you assign a lambda expression to a variable?
<a_a_g> but return behaves differently with procs and lambdas
<a_a_g> x = lambda ...
<coreyo> then to call x?
<jimeh> coreyo: here's a good explanation of proc vs. lambda: http://stackoverflow.com/a/723/42146
<a_a_g> x.call
Araxia_ has joined #ruby
mengu has joined #ruby
grin has quit [#ruby]
<coreyo> lol a_a_g that does look an awful lot like a Proc
<coreyo> jimeh, thanks *reads
<a_a_g> coreyo. it is very similar, except for the return context
grin_ has joined #ruby
<Tasser> coreyo, lambdas have a defined number of arguments, procs don't
<Tasser> I don't use return, so I don't care :-)
MrGando has joined #ruby
joaoh82 has joined #ruby
<jimeh> coreyo: here's a good comparisong to using yield and &block that might be of interest too: http://mudge.github.com/2011/01/26/passing-blocks-in-ruby-without-block.html
<coreyo> interesting, so Proc essentially calls an implicit "return" ... after returning
<coreyo> that actually sounds very bad
<a_a_g> eh?
<jimeh> coreyo: To me though it seems like you should be pretty alright with something like: MyClass.new('arg') { |var1, var2| puts "custom method here" }
bean_dharma has joined #ruby
<jimeh> the block being your custom method...
moshee has joined #ruby
moshee has joined #ruby
<jimeh> or if you have a Proc assigned to a variable called `block`: MyClass.new('arg', &block)
<a_a_g> coreyo: what do you mean by proc calls and implicit return?
mdw has joined #ruby
<coreyo> a_a_g, look at jimeh's stackoverflow link
xcyclist has joined #ruby
<coreyo> not knowing that could create a nasty bug that could be very hard to track down
mborromeo has joined #ruby
<xcyclist> Say, pastie.org is not working for me today.
cloke has joined #ruby
maletor has joined #ruby
<jimeh> a_a_g: he means that a return call within a Proc effectively returns the enclosing scope, rather than the Proc block, while within a lambda it only returns from within the lambda block
<coreyo> jimeh, Tasser, a_a_g thanks for the advice, I think that sufficiently answers my question
<coreyo> ^^^
thone has joined #ruby
Corren has joined #ruby
savage- has joined #ruby
<xcyclist> Is there a recommended pastie for this group that is working today?
<jimeh> coreyo: as a general rule in Ruby, `return` will return the first enclosing method, for example, a return statement within a do...end block passed to #each will return the method the #each call is within, not the #each call's block itself...
<jimeh> lambda is about the only exception to that rule I know about :)
<a_a_g> ah ok. its not really that 'procs return from the enclosing method'. actually lambdas create a new 'stack frame'
<a_a_g> which procs dont
berserkr has joined #ruby
emmanuel__ has joined #ruby
<dbgster> how can I delete all files in a folder that don't end with .leave , does FileUtils have anything helpful?
cwang has joined #ruby
<dbgster> I then need to rename the remaing files, by removing the .leave extension.
<dbgster> so some_file.xml.leave becomes some_file.xml
<coreyo> jimeh, Tasser, a_a_g in fact the lambda does appear to have less overhead than the Proc
rramsden has joined #ruby
<a_a_g> really? that is a bit surprising
<coreyo> still raises my running time by about 2%, but that's better than the 4 - 5% added by the block wrapping
<jimeh> coreyo: Makes sense, I've always had the understanding that lambda's are simply simpler Procs...
<jimeh> coreyo: I'm assuming you're using #call on the lambda right?
mcwise has joined #ruby
<coreyo> jimeh, yessir
<coreyo> is there another way to do it?
<a_a_g> is it because the proc call tries to bind the arguments intelligently?
<jimeh> actually, with that little performance difference, I'd personally go with passing a normal do...end block when initializing the class, as it makes the code cleaner :)
<a_a_g> i dont really see any other difference that could account for the increased overhead
hormigas has joined #ruby
<xcyclist> Does anyone out there use minitest?
<jimeh> and no, I was going off on a nonsense tangent for a second when I asked about #call, sorry :)
<coreyo> jimeh, can you give me a quick example?
Floydzy has joined #ruby
<a_a_g> coreyo: are you taking arguments in the lambda or proc?
niku4i_ has joined #ruby
<jimeh> I'm assuming you're doing this now: func = lambda { |arg| do_something(arg) }; instance = MyClass.new(func)
<jimeh> am I right?
<coreyo> jimeh, yessir
<coreyo> a_a_g, yes, the function takes 5 arguments
adeponte has joined #ruby
<jimeh> then how about this? instance = MyClass.new { |arg| do_something(arg) }
<jimeh> the initialize method can check if a block was passed with #block_given?, and if so call #yield, which should be loads faster than passing blocks or lambdas around...
<jimeh> alternatively, you can define your initialize method like so: def initialize(&block)
BRMatt has joined #ruby
<jimeh> and then do `block.call` to call the block, but that does turn it into a fully-fledged Proc and slows it down vs. just calling yield
jgrevich has joined #ruby
jgrevich has joined #ruby
RegEchse has joined #ruby
<coreyo> jimeh, the link that you gave me does indeed show a huge benchmark difference, and explains the small slowdown that I have from using Proc
<coreyo> jimeh, but when you call yield, can you actually pass parameters to it? i.e. "yield(arg1, arg2, arg3, etc.)
chad_ has joined #ruby
<jimeh> coreyo: yepp, that's exactly how you pass parameters to it :)
<coreyo> jimeh, excellent, I actually think that's exactly what I want. Let me try it out.
<jimeh> oki :)
<jimeh> I gotta run for a train, but I'll be around again in about 4-5 hours probably :)
<coreyo> thank you for your time jimeh, you've been most pleasant and helpful
pen has joined #ruby
<jimeh> no worries, good luck :)
<coreyo> lol ... the ruby channel has a much different atmosphere than the css channel
Zolrath has joined #ruby
<stantona> ruby newb here, I was wondering if some could briefly explain what this code does (class << @profile; self; end), thanks.
<LiquidInsect> I'm afraid to ask, what happens in the css channel?
<LiquidInsect> "Your stylesheets are bad and you should feel bad"?
rippa has joined #ruby
<coreyo> LiquidInsect, almost exactly!
<LiquidInsect> stantona: returns the eigenclass (singleton class) of @profile
<stantona> LiquidInsect: how is that different to @profile.class?
niku4i_ has joined #ruby
<LiquidInsect> stantona: @profile.class is the class the @profile belongs to
<LiquidInsect> but every object has an eigenclass, that belongs to that object and that object alone
michael_mp has joined #ruby
<stantona> I see, thanks
<LiquidInsect> you can put methods in it, and only that one object will respond to them
michaelmartinez has joined #ruby
rh1n0 has joined #ruby
sirdeiu has joined #ruby
rh1n0 has joined #ruby
<xcyclist> Anyone out there using minitest?
slackgen has joined #ruby
<slackgen> Quick question, when I do a "string % arg" to format a string, how do I escape a % in the string?
Careott has joined #ruby
<slackgen> ie- "Your score is %s%" % [100] -- should be "Your score is 100%"
<slackgen> Nvm found the documentation in Kernel::sprintf.
<pastjean> slackgen: in c ?
<pastjean> slackgen: %%
<slackgen> The solution is "Your score is %s%%" % [100]
JivaD has joined #ruby
<slackgen> Thanks pastjean
Aristata has quit [#ruby]
aibo has joined #ruby
<xcyclist> slackgen: I don't usually use that. Interpolation std is usually "#{something}". irb is where you try stuff like that.
ViperMaul has joined #ruby
<xcyclist> Sorry. Scrollbar confusion.
Advocation has joined #ruby
<slackgen> xcyclist: Coming from a java background, I prefer this style as it is comparable to java's String.format. I'll try to start moving towards the standard-Ruby string interpolation though. Thanks.
Rizzle has joined #ruby
ed_hz_ has joined #ruby
pubis_ has joined #ruby
<xcyclist> slackgen: What are you using for your test suite?
<slackgen> I'm not using automated tests... This is my first ruby project. It's more proof-of-concept.
t0mmyvyo has joined #ruby
<xcyclist> Ok. Perhaps I need to find another group for my question.
nfluxx has joined #ruby
SegFaultAX|work has joined #ruby
aef has joined #ruby
OwenOu has joined #ruby
<OwenOu> hi, i am getting this issue for resque's web interface, which is a rack app: NoMethodError (undefined method `process_route' for irc://chat.freenode.net:6667/#%3CResque::Server:0xdf2f780%3E)
<OwenOu> if anyone know why, please let me know :)
jchauncey has joined #ruby
francisfish has joined #ruby
replore__ has joined #ruby
aef has joined #ruby
danielvdotcom has joined #ruby
aef has joined #ruby
ianbrandt has joined #ruby
ctwiz has joined #ruby
bradsocks has joined #ruby
Advocation has joined #ruby
shadoi has joined #ruby
<bradsocks> if I have a class called DummyClass, and then I do something like DummyClass("argument"), which method is being invoked?
<arturaz> none
<oooPaul> Nothing, you'll get an error.
<bradsocks> I'm trying to figure out how they did it in Forgery
<bradsocks> where you can just go
<bradsocks> Forgery(:name).first_name
<arturaz> bradsocks, def DummyClass
<bradsocks> it seems like a class method of some kind
<oooPaul> Look at Forgery's code. :)
<bradsocks> why can't you just explain this
<bradsocks> it's fairly simpel
davidw has joined #ruby
boonedocks has joined #ruby
aef has joined #ruby
chad_ has joined #ruby
aef has joined #ruby
krz has joined #ruby
cloke has joined #ruby
adaoraul has joined #ruby
apok has joined #ruby
c0rn has joined #ruby
aef has joined #ruby
burgestrand has joined #ruby
apeiros_ has joined #ruby
pubis has joined #ruby
williamcotton has joined #ruby
brngardner has joined #ruby
shruggar has joined #ruby
Sailias has joined #ruby
devjj has joined #ruby
kvirani has joined #ruby
waxjar has joined #ruby
TheIronWolf has joined #ruby
surfprimal has joined #ruby
guns has joined #ruby
sery has joined #ruby
nilg has joined #ruby
shruggar has joined #ruby
sery has quit [#ruby]
ukd1 has joined #ruby
mdw has joined #ruby
<shevy> bradsocks I think this is a method call actually
<shevy> def DummyClass
Eldariof-ru has joined #ruby
<shevy> you probably must invoke it with the () otherwise it won't work
<shevy> does Forgery :name work for you bradsocks?
nobitanobi has joined #ruby
<nobitanobi> I have a method that returns a has with two index. Is there an easier way to assign the values of those two indeces than doing:
<nobitanobi> a = my_method[:key1]
tayy has joined #ruby
<nobitanobi> b = my_method[:key2]
<nobitanobi> can I do it in one line?
<shevy> you could do a, b = my_method[:key1], my_method[:key2]
<apeiros_> a,b = my_hash.values_at(:key1, :key2)
seivan has joined #ruby
<nobitanobi> thanks guys
nilg has joined #ruby
<Veejay> Can 0 be a key in a hash?
<Veejay> It seems not according to my testing in irb
<apeiros_> yes, it can
<apeiros_> any object responding to .hash and .eql? can.
<any-key> you can use hashes as hash keys
<any-key> I tried it
<apeiros_> (and that's pretty much every object in ruby)
<Veejay> {0: "foo"} is a valid hash then, right?
<any-key> if you use a hash as a hash key I'll find you and kick you though :P
<any-key> Veejay: yeah
<apeiros_> Veejay: that's a symbol, not 0
d3c has joined #ruby
<Veejay> True
<any-key> you can use json-esque hash notation in 1.9 though
<Veejay> 1.9.3p0 :011 > {0: "foo" }
<Veejay> SyntaxError: (irb):11: syntax error, unexpected ':', expecting tASSOC
<any-key> { 0 => "foo" }
<Veejay> OK
stephenjudkins has joined #ruby
<Veejay> Thanks guys
dfamorato has joined #ruby
<any-key> you're welcome, guy
<Veejay> This one is funny { _ => "foo" } ==> { true => "foo"}
<any-key> _ is just whatever the last return value in irb was
<Veejay> Ahh
<Veejay> Totally forgot about that
luxurymode has joined #ruby
banjara has joined #ruby
<any-key> s'all good, it's easy to
<lectrick> What's the gem website that lets you look at the most popular gems given a use case name?
fmcgeough has joined #ruby
qnt4b has joined #ruby
<qnt4b> Any thin users around? I'm suddenly getting an error 'invalid option: --all' with 'thin start --all /etc/thin'.
mdw_ has joined #ruby
<qnt4b> And that's what I typically use. 'thin start' works, and the version is current (1.3.1).
fmcgeough has joined #ruby
fetimo has joined #ruby
shruggar has joined #ruby
zakwilson has joined #ruby
<bradsocks> shevy: nvm
<bradsocks> i got it working
andrewhl has joined #ruby
chad_ has joined #ruby
Bosma has joined #ruby
babinho_ has joined #ruby
schovi has joined #ruby
audy has joined #ruby
<audy> what do I use if I need exact Decimal arithmatic?
<audy> There are the flt and ruby-decimal libraries. Is there anything in the standard lib?
<any-key> What do you mean by "exact"?
<audy> any-key: has accurate down to the last significant digit
<any-key> so...no floats?
bafilius has joined #ruby
<any-key> I don't think the core language has anything of that nature
matt_yoho has joined #ruby
<rippa> core language has rational
<rippa> and BigDecimal
<audy> rippa: bigdecimal is just float with more bits?
<rippa> no
<audy> nevermind. /me reads the docs
<rippa> well, yes
<rippa> but it has arbitrarily many
<rippa> and it's decimal
mfridh has joined #ruby
<qnt4b> I don't get it, 'thin --servers' and 'thin --only' give me the appropriate 'missing argument' error, but 'thin --all' is 'invalid option'. But these are all included in thin's runner.rb.
KL-7 has joined #ruby
brianpWins has joined #ruby
<audy> rippa thanks.
KleenexDevourer has joined #ruby
abionic has joined #ruby
<Veejay> Mon_Ouie: http://pastie.org/3818255
geronimod has joined #ruby
Gonzih has joined #ruby
gogiel2 has joined #ruby
<Veejay> What do you think? Do you somehow like the idea, do you think it could be extend to match things like _::tail or more generic constructs
Careott has joined #ruby
greenarrow has joined #ruby
jfelchner has joined #ruby
geronimod has quit [#ruby]
<qnt4b> thin start -C /etc/thin/blah.yml works, thin start --all /etc/thin gives 'invalid option: --all' error. Doesn't make sense.
luckyruby has joined #ruby
abionic has joined #ruby
<oooPaul> qnt4b: Um... --all isn't a valid option?
abionic has joined #ruby
<qnt4b> But it is a totally valid option, in use all the time, see runner.rb.
KleenexDevourer has joined #ruby
<oooPaul> What do those two things have to do with each other?
cloke_ has joined #ruby
abionic has joined #ruby
cloke has joined #ruby
<shevy> they are all thin!
td123 has joined #ruby
<oooPaul> I thought runner.rb was Rails?
<Veejay> --all isn't listed when I thin --help dude
coreyo has joined #ruby
<qnt4b> Did school just let out? See lib/thin/runner.rb.
xcyclist has joined #ruby
<coreyo> is there a way to include a newline character in an interpolated string? (i.e. %Q{newline\n}) ?
nemesit|osx has joined #ruby
KleenexDevourer has joined #ruby
<shevy> not sure coreyo
<rippa> coreyo: yes
<rippa> you just did it
<shevy> seems to work indeed
ctwiz has joined #ruby
nixmaniack has joined #ruby
kalleth has joined #ruby
<coreyo> I might be calling it incorrectly, all of my \n and \" are being printed literally
<rippa> are you printing it?
<shevy> x = %Q{ newline\n joe }
<rippa> print %Q{newline\n}
<shevy> puts x
<rippa> try this
_pol has joined #ruby
<shevy> puts the newline \n in the string properly
axl___ has joined #ruby
<coreyo> hmm... indeed it is working in the console, strange that it's coming out literally in my script.
<coreyo> let me do some more tests to see if I can track it down
nilg has joined #ruby
mdw has joined #ruby
<shevy> it is the kobold in your computer
yekta has joined #ruby
schovi has joined #ruby
<yekta> Is it possible to install only the ruby environment but not the command line scripts?
<shevy> what
<coreyo> more like the newline gnome
<shevy> "ruby environment", "command line scripts"
<shevy> yekta, you seem to talk not about official ruby source
<lectrick> Is there any way to determine the class of the object that called my method, from within my method?
axl_ has joined #ruby
gfuggiano has joined #ruby
<shevy> lectrick with caller
LiquidInsect has joined #ruby
<shevy> require 'pp'; def foo(i = 'hi'); pp caller; end; foo('yo')
<lectrick> shevy: it seems to just output a stack trace
carlyle has joined #ruby
<shevy> hmm
<yekta> shevy: Just installed the rubygems1.9.1 via apt-get on Ubuntu but `ruby -v` returns "The program 'ruby' is currently not installed." But the command /var/lib/gems/1.9.0/bin/compass clean from that gem seems to work. That doens't seem normal to me.
<shevy> yekta the problem is, debian cripples ruby
<shevy> and puts gems things into non standard locations
<shevy> whoa
<shevy> yekta, you mean... you can install rubygems on ubuntu, without ruby?
<yekta> shevy: oh? please expand...
<yekta> shevy: I guess so... I don't have a ruby when I do `which ruby` or `ruby -v`
<shevy> that is so gross man
<yekta> shevy: my pythonista friend is installing it :-/
<shevy> using gems without ruby, what were the debian apes thinking?
<coreyo> ahh okay, it appears that if I have embedded functions that both call %Q{}, the embedded %Q doesn't process the newline characters
<shevy> yekta, the problem is that you are stuck in the debian worldview right now
<shevy> that means you have to deal with the shit they do :)
bbttxu has joined #ruby
<yekta> Wouldn't something like RVM circumvent that?
<shevy> on ruby 1.9.x source install, gem is a file that is typically in /usr/bin prefix and bundled with the source distribution
<shevy> sure
<shevy> the debian idiocy was one reason why RVM existed
<yekta> hehe
<soveran> and RVM is the reason why yet other solutions emerged :-)
stkowski has joined #ruby
<shevy> running different ruby versions was another reason for RVM
<shevy> yeah
brngardner has joined #ruby
<yekta> OK so ruby is in /usr/bin its just not connected because of Debian
<shevy> this is a very odd path btw /var/lib/gems/1.9.0/bin/compass
<yekta> is it?
<shevy> yup
<shevy> not sure who is the first to blame
imsplitbit has joined #ruby
<shevy> debian uses /var/lib/gems for some reason
<yxhuvud> yekta: what does 'which ruby1.9.1' give you?
<shevy> have a look at "gem env" output yekta
timonv has joined #ruby
<shevy> yekta, for me this returns this: http://pastie.org/3818469
<shevy> - INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8
<shevy> your INSTALLATION DIRECTORY is probably this /var/lib thingy
<yekta> OK, /usr/bin/ruby1.9.1 with ruby gems 1.3.5
<shevy> ack
<yekta> I didn't set this up my python friend did. Hence I don't know where its at yet.
<shevy> that must be ancient
<shevy> he probably used debian's ruby
<yekta> I think he just did a package install of rubygems1.9.1
<yxhuvud> what does ruby1.9.1 -v output.
<shevy> rubygems version 1.3.5 is from:
Drift_ has joined #ruby
Drift has joined #ruby
<yekta> old :)
<shevy> 2009-07-22 00:02
ctwiz has joined #ruby
<shevy> yeah
<Drift> hmm
<yxhuvud> cause ubuntu has the curious thing that both 1.9.2 and 1.9.3 are packaged as 1.9.1
<Drift> Anyone else here find Batch scripting annoying?
<yekta> yxhuvud: yeah, there's still cruft to take care of
<shevy> Drift, no longer. years ago I gave it up. all my batch scripting is done in ruby since then.
<td123> Drift: you mean bash?
<td123> or batch as in windows?
<shevy> yekta but ruby is non critical so you could remove all of debian ruby
<Drift> Scripts you run when starting the computer, in this case to check to see if a certain drive exists, if a certain file exists in the drive, and if not to create all these things.
<yekta> well thanks for expounding shevy
<shevy> then you could use RVM or compile from source
<shevy> Drift on what OS? windows? linux?
<gogiel2> Drift: sometimes writing a set of pipe with textutils is easier than firing ruby script
chad_ has joined #ruby
n3m has joined #ruby
<Drift> Windows Batch files, .bat
<shevy> can all be replaced with ruby scripts!
<gogiel2> Drift: kill it with fire :O
<Drift> I know im in the wrong channel, for that I blame search IRC.
MrGando has joined #ruby
banjara1 has joined #ruby
<shevy> i am using linux here most of the time though
WhereIsMySpoon has joined #ruby
<Drift> you can do all that with Ruby? didnt know. I just whipped this thing together because my boss had old scripts that ran off a combination of batch and VisualBasic scripts that were a mess, confusing, and did not do a very good job at what they needed to do
babinho_ has joined #ruby
WhereIsMySpoon has quit [#ruby]
<Drift> yeah, I got RedHat on this box, but I never use it. I kind of have anomosity towards it because it refuses not to be a pain in the ass.
banjara has joined #ruby
<shevy> yeah you should be able to do all with ruby. you can interface with windows, from ruby, with that OLE module... or what was it called
<shevy> then there are some other bindings
kirun has joined #ruby
audy has quit ["["Textual IRC Client: www.textualapp.com"]"]
<shevy> i.e. create and fill up excel files from within ruby
<shevy> http://rubyonwindows.blogspot.com/ sometimes has useful info for that
<Drift> ah neat.
<Drift> One of these days i need to stop being a bitch and learn Linux.
<shevy> require 'win32ole' <-- I think that is the name
<Drift> Its a shame no one noticed the creater died. Fuck Jobs. He was a duche and yet peopled loved him for it.
<shevy> Drift, there is no real need to use linux per se. you can use ruby on both windows and linux. the main difference I see from linux is mostly to use a shell to do tasks. but on windows this works too, like MSYS shell or even cygwin.
codezombie has joined #ruby
<shevy> only apple fanbois care about apple stuff
ilyam has joined #ruby
<Drift> Batch files fucking suck though. I am afraid to even comment them because they decided to make the REV command also an active command which can make it behave unexpectedly.
<Drift> so instead I wound up with this: http://pastie.org/private/05gxoeik6lgp7mfihhvoa
<shevy> what is REV?
mattyoho has joined #ruby
<shevy> that is horrible to look at
<Drift> REM, that was a typo
<shevy> pity all poor souls who have to waste their lives on things like that
<Drift> REM not REV, to comment
<Drift> yeah, thank god its short.
looopy has joined #ruby
dotnull has joined #ruby
<shevy> transition to ruby man ;)
<Drift> the fun of using terminal services to host an ERP system. Gotta make sure all the registry values and key files exist for each new virtual user.
<shevy> ewww
robacarp1 has joined #ruby
babinho has joined #ruby
<Drift> using terminal services, on a virtual server, on a single-level domain.
<Drift> I could cry
<Drift> Im not even supposed to be able to do half of what I do on a single level domain because it breaks the fully qualified domain names.
<Drift> but ive got scripts to fix it, that being said the authentication can be a little spotty on my sharepoint server sites
canton7 has joined #ruby
basicx12352 has joined #ruby
Drift_ has joined #ruby
artm has joined #ruby
niklasb has joined #ruby
<lectrick> ewww, sharepoint
shruggar has joined #ruby
<Drift> Yeah, I found out that MS Project does authenticate like it is supposed to with sharepoint. That is annoying. It doesnt even bother to ask. (other office 2010 applications work though)
QKO_ has joined #ruby
<Drift> and that is a pain, because you cannot open Project files from a Sharepoint Document Library from Windows Explorer.
<Drift> Works if you open it from the Sharepoint Site though, just not Windows Explorer
emmanuel__ has joined #ruby
<Drift> No one wants to acknowledge there is an issue though.
<Drift> Fucking MS BS
nif has joined #ruby
ringotwo has joined #ruby
Drift_ has quit [#ruby]
jrhorn424 has joined #ruby
emmanuel__ has joined #ruby
justinmcp has joined #ruby
jimeh has joined #ruby
robert__ has joined #ruby
twinturbo has joined #ruby
sonkei has joined #ruby
emmanuel__ has joined #ruby
<shevy> ewwww, microsoft
nif has joined #ruby
tatsuya_o has joined #ruby
emmanuel__ has joined #ruby
saml has joined #ruby
<saml> dirs.map{ |dir| Dir["#{dir}/**/*.js"] }.flatten I have this.. how can I exclude anything that has jquery in the path? foo/jquery/main.js bar/main.jquery.js should be excluded
friskd has joined #ruby
<shevy> split up the task
<shevy> Dir["#{dir}/**/*.js"] returns an array
<saml> i don't know ruby
<shevy> on that array, use .reject
<saml> ok thanks
<shevy> Dir["#{dir}/**/*.js"].reject {|x| x.include? 'jquery' }
<shevy> or
<shevy> Dir["#{dir}/**/*.js"].reject {|x| ! x.include? 'jquery' }
<shevy> one of these two should work
<saml> shevy, ah thanks
workmad3_ has joined #ruby
Squarepy has joined #ruby
<saml> so, array has reject method and {|x| .. is like lambda
Zolrath has joined #ruby
<saml> i shall learn ruby
Squarepy has joined #ruby
<workmad3_> saml: that's the spirit! :)
ken_barber has joined #ruby
<shevy> saml I think .reject is in Enumerator
<shevy> but yeah Array includes that
adamkittelson has joined #ruby
<shevy> dunno if it is like a lambda, within the || you just give a name to the variable and the {} denotes the block
<shevy> *Enumerable
<shevy> why do I mix up these two :(
seich has joined #ruby
<workmad3_> shevy: they're pretty similar and pretty related
<shevy> saml, http://ruby-doc.org/core-1.9.3/Enumerable.html on the left side you see the index of methods... .reject .each and so on (I think I have not used more than 50% of these in 5 years of ruby...)
<shevy> lol
<shevy> #minmax_by
<shevy> never seen that one before
<shevy> #none?
<shevy> #take_while
<shevy> EXOTIC!!!
<shevy> #cycle
<workmad3_> shevy: I didn't think Enumerable gave you .each... isn't that the required method to mix in Enumerable?
<shevy> no idea
<shevy> I am staring at other things in it
<shevy> .cycle!!!
<shevy> ["a", "b", "c"].cycle(2) {|x| puts x } # print, a, b, c, a, b, c.
<shevy> isn't that like .map? :\
stephenjudkins has joined #ruby
<shevy> oh no wait
<workmad3_> shevy: no, it seems to iterate twice over it
<shevy> it cycles over the whole group
<shevy> yeah
<shevy> quite odd
blueadept` has joined #ruby
kjellski has joined #ruby
chad_ has joined #ruby
zakwilson has joined #ruby
bandu has joined #ruby
ctwiz has joined #ruby
<oooPaul> ([:a, :b, :c] * 2).map{|x| puts x } :)
jergason has joined #ruby
<shevy> hmmmm
workmad3_ has joined #ruby
<oooPaul> ... although I missed what the original question was. ;)
<shevy> and why did you use symbols? :P
<oooPaul> One less character to type. :)
<shevy> I accept that
<shevy> being lazy is what drives mankind forward
<oooPaul> For demo purposes, it's a lot easier. ;)
<shevy> and robots
<oooPaul> So... what was the original question that brought up the cycle() method?
dfamorato has joined #ruby
<shevy> I first thought it is like .map
<oooPaul> Ah.
<shevy> but it seems to take the whole collection rather than every part of it at first like map
<oooPaul> More like each.
Sudrien has joined #ruby
<oooPaul> Ooo, I should use .partition() more often.
<Sudrien> puts "01.10".to_f gives 1.1, puts "01.00".to_f gives 1.0 - is there a quick way to get rid of the .0 part, if there is nothing in the decimal place?
<shevy> hmm
<shevy> so your float either has 1.0 or 1.1
<shevy> and if it is 1.0 you want to display a "1" string, otherwise if it were 1.1 you want to display "1.1" string
<xcyclist> Say, wont_be_silent and wont_raise seem to be implied to exist in minitest, but first try I didn't see them work. Are they there?
<Sudrien> just as an example, I know "use .to_i" isn't the answer
<shevy> .to_i would convert to integer all the time
<oooPaul> ((x.to_f - x.to_i) == 0) ? x.to_i : x.to_f
<shevy> clever :)
<Sudrien> why not (x.to_f != x.to_i) ? x.to_i : x.to_f then
<oooPaul> Better: [x.to_i, x.to_f].max
* oooPaul feels deliciously evil for that one.
<shevy> how does the .max way work
dfamorato_ has joined #ruby
<shevy> Sudrien, your way does not work
<shevy> x = 1.1; (x.to_f != x.to_i) ? x.to_i : x.to_f # => 1
<oooPaul> shevy: Internally, Ruby will "note" the first element. If the subsequent element is not greater, it doesn't change the note. Then it returns the note. :)
calango has joined #ruby
calango has quit [#ruby]
<oooPaul> So, if x.to_i and x.to_f are mathematically equivalent, the first result is returned. If they are different, by definition, x.to_f must be greater, and gets returned. ;)
zakwilson_ has joined #ruby
<shevy> hmm
<shevy> I like your first solution more
<shevy> x = 1.0; ((x.to_f - x.to_i) == 0) ? x.to_i : x.to_f # => 1
<Sudrien> got the logic backwards... [x.to_i, x.to_f].max looks good
<shevy> x = 1.1; ((x.to_f - x.to_i) == 0) ? x.to_i : x.to_f # => 1.1
<oooPaul> That's definitely clearer, and less dependent on internal implementation. :)
nif has joined #ruby
<shevy> Sudrien, how will you use .max ?
wedgeV has joined #ruby
<oooPaul> [1, 1.0].max => 1; [1.0, 1].max => 1.0
* oooPaul muwuhahahahahahas.
<xcyclist> Isn't there a method that shows the hierarchy of a class/object?
<oooPaul> .ancestors
surfprimal has joined #ruby
<xcyclist> Thank you.
<oooPaul> It's not a true "hierarhcy", just a list of things it inherited/included.
brngardn_ has joined #ruby
dfamorato has joined #ruby
<xcyclist> oooPaul is there one that works from an arbitrary object, or am I expected to just do obj.class.ancestors?
<oooPaul> The latter.
<xcyclist> 'k
schaerli has joined #ruby
QaDeS has joined #ruby
<Sudrien> (It's working) Thanks oooPaul
bandu has joined #ruby
musl has joined #ruby
baroquebobcat has joined #ruby
nobitanobi has joined #ruby
<xcyclist> Say, wont_be_silent and wont_raise seem to be implied to exist in minitest, but first try I didn't see them work. Are they there?
Advocation has joined #ruby
TheIronWolf has joined #ruby
emmanuelux has joined #ruby
symb0l has joined #ruby
piotr_ has joined #ruby
schovi has joined #ruby
Vendethiel has joined #ruby
zakwilson has joined #ruby
Drakx_ has joined #ruby
brngardner has joined #ruby
grin has joined #ruby
heftig has joined #ruby
<xcyclist> NoMethodError: undefined method `must_be_silent' for #<Proc:0x00000002191d90@ProbeKitTest.rb:22 (lambda)>
medik has joined #ruby
ben_alman has joined #ruby
bwlang has joined #ruby
pubis has joined #ruby
mattyoho has joined #ruby
maxamillion has joined #ruby
<maxamillion> how would I inspect the methods available to an object while I'm in irb?
<oooPaul> object.methods.sort
<oooPaul> (the .sort is just helpful :)
<maxamillion> oooPaul: awesome, thanks!
<oooPaul> I use that trick *constantly*. :)
theRoUS has joined #ruby
theRoUS has joined #ruby
michaelmartinez has quit [#ruby]
<maxamillion> oooPaul: its a good one, I come from a python background and I would use dir(object) quite often which appears to have a similar result/effect ... this is perfect, many thanks
waxjar has joined #ruby
Russell^^ has joined #ruby
robdodson has joined #ruby
<oooPaul> I did Python back in the day. I tried doing it again about a year ago and found that Ruby had *totally* spoiled me. :)
linoj_ has joined #ruby
<maxamillion> there are things I'm finding from both languages that I really like and as always with everything ... there are some that I don't, but so far my time with ruby has been positive
fr0gprince_mac has joined #ruby
<jergason> maxamillion: you should look at pry too
<jergason> like a better irb
<jergason> you can do `ls some_object` and it will show all instance vars and methods
<jergason> tons of other neat stuff
gfuggiano has joined #ruby
bwlang_ has joined #ruby
<maxamillion> jergason: ah, cool ... I'll have to check that out
<maxamillion> jergason: thanks! :)
tewecske has joined #ruby
emmanuel__ has joined #ruby
<jergason> np
gfuggiano has joined #ruby
<robdodson> if anyone has a moment, i'm trying to get a unit test to run following the pickaxe book, here's the test: http://pastie.org/3819133 … when I just do ruby test_roman.rb nothing is output. any ideas?
<friskd> When you guys run your deploy process, if you have javascript that gets build and compiled, do you typically include the compiled js in your git repo, or do you build the production js as a part of the deploy process
Axsuul has joined #ruby
redgetan has joined #ruby
nif has joined #ruby
Morkel has joined #ruby
<robdodson> do i need to call my test case with a flag from the CLI to get it to run the tests?
machine2 has joined #ruby
<oooPaul> friskd: I don't do anything special, so it gets compiled on the servers.
symb0l has joined #ruby
<oooPaul> robdodson: CLI -- you mean your console command line, or from within IRB or something?
<robdodson> from the console. terminal in my case
SeanTAllen has joined #ruby
<robdodson> if i do "ruby test_roman.rb" it just gives me the prompt again
<robdodson> here's the test i'm trying to run http://pastie.org/3819133
nobitanobi1 has joined #ruby
<oooPaul> Yeah, I'm looking at it.
<oooPaul> Is this in a Rails environment?
<robdodson> nope
<oooPaul> Hmm, dunno.
<xcyclist> NoMethodError: undefined method `must_be_silent' for #<Proc:0x00000002191d90@ProbeKitTest.rb:22 (lambda)>
aef has joined #ruby
<robdodson> i mean, i have rails gems installed but i'm not in a rails app or anything
yoklov has joined #ruby
<robdodson> just a class and a test case in a folder
<xcyclist> Hey, oooPaul. Can you answer my question about must_be_silent?
<oooPaul> When I run individual tests in a Rails environment, I always run them from the Rails root dir, since that seems to make the paths all work better.
<xcyclist> I'm using this the same way I use other minitest methods, but it just fails.
<oooPaul> xcyclist: Maybe -- what was the question? :)
* oooPaul isn't familiar with minitest.
emmanuelux has joined #ruby
<xcyclist> I have this failure:
HoMing has joined #ruby
<xcyclist> NoMethodError: undefined method `must_be_silent' for #<Proc:0x00000002191d90@ProbeKitTest.rb:22 (lambda)>
HoMing has quit [#ruby]
<oooPaul> Sounds like you're missing a require, maybe... ?
<xcyclist> but for instance must_raise works, and it has a similar syntax.
<oooPaul> Not a clue.
<oooPaul> Sorry.
bwlang_ has joined #ruby
<xcyclist> Ok. Thanks.
<oooPaul> robdodson: What's the error you're getting?
<robdodson> no error
<robdodson> it just returns the prompt
<oooPaul> Oh, maybe it just works then.
<oooPaul> Fudge the test so it fails, see if you still get nothing. :)
<oooPaul> Oh wait, duh...
<oooPaul> There's nothing there that's actually *running* the tests.
<oooPaul> Maybe...
<robdodson> oh weird
<robdodson> you're totally right
<robdodson> i fudged it and started getting output
chomp has joined #ruby
<robdodson> then un-fudged it and started getting passing output
<oooPaul> Ah, there you go.
<oooPaul> Heh. :)
<robdodson> bizarre. well thank you! maybe i just didn't hit save somewhere. I'm new to sublime text 2. been using text mate forever
schovi has joined #ruby
ProLoser|Work has joined #ruby
<ProLoser|Work> i need some help with sass
<ProLoser|Work> i'm doing this: @import "new/header/*.png";
<ProLoser|Work> @include header-sprite;
dekz has joined #ruby
<oooPaul> Might want to try #rails or #rubyonrails -- may be more people familiar with SASS there.
<ProLoser|Work> Syntax error: Mixin header-sprite is missing parameter $name.
<ProLoser|Work> on line 2 of /Users/dean/dev/TalentNetwork/www/core/sass/new/_header.scss, in `header-sprite'
ilyam has joined #ruby
deobald_ has joined #ruby
brngardner has joined #ruby
yekta has quit [#ruby]
fetimo has joined #ruby
tatsuya_o has joined #ruby
QKO_ has joined #ruby
emmanuel__ has joined #ruby
<xcyclist> Can anyone recommend a fully descriptive document for minitest? I find pickaxe, and the few web pages I've found seriously deficient.
pubis has joined #ruby
tatsuya_o has joined #ruby
<xcyclist> Wow. That was like Robert Byrd's speech to stop the war.
nobitanobi has joined #ruby
dkissell has joined #ruby
rushed has joined #ruby
Rizzle|afk has joined #ruby
robacarp has joined #ruby
dbgster has joined #ruby
Rizzle|afk has joined #ruby
davidw has joined #ruby
eywu has joined #ruby
<xcyclist> Can anyone recommend a fully descriptive document for minitest? I find pickaxe, and the few web pages I've found seriously deficient.
<robacarp> anyone with pty experience ever just had the pty go away in the middle of a tight echo loop?
d34th4ck3r has joined #ruby
<robacarp> xcyclist: have you tried http://docs.seattlerb.org/minitest/
ProLoser|Work has quit [#ruby]
jmeeuwen_ has joined #ruby
thams_ has joined #ruby
<lectrick> Is there any way to prune a hash... but for any depth of hash?
<thams_> Anyone up for a design pattern question?
<lectrick> (i.e., a hash where its values might also be hashes)
<Squarepy> what's the question I mean pattern
<thams_> Say you have a class hierarchy, where there are methods that do not pertain to all of the subclasses...
<thams_> For example, maybe you have Tickets....
<thams_> For example, maybe you have Tickets….some of them have expirations that may or may not be set.
<thams_> Others just do not have an expiration date.
pdtpatrick has joined #ruby
<thams_> Thus, Ticket#expiration (on the base class) is kind of confusing.
<thams_> BUT….
brngardner has joined #ruby
<thams_> if you have a collection of Tickets, you'd like to be able to say, give me one that expires today, if it expires today.
<jedir0x> the D language should change it's name to Diamond
<jedir0x> :D
<thams_> I see this pattern somewhat frequently… and wonder if there is a clean answer.
robert_ has joined #ruby
<thams_> Ticket#expiration_date_if_you_are_expirable … this is lardy
<Squarepy> thams, one thing that pops in my mind is using decorators
mikepack has joined #ruby
<Squarepy> add expiration to a standard ticket object
<thams_> But then, when asking for "expiration" for a ticket object that doesn't expire… what do you get back?
Cache_Money has joined #ruby
batmanian has joined #ruby
<Squarepy> indeed
<thams_> I.e., the client of such an object would reasonably expect that "expiration" would give a meaningful answer to any Ticket it was sent to.
<thams_> And in some cases, it can not.
<thams_> (BTW… I looked around for an OO design room and didn't find one)
<Squarepy> in general that is a problem, not for this example let's say, set default expiration date to inf
mborromeo has joined #ruby
<shevy> jedir0x but perl, ruby are lightweight languages compared to D
zakwilson has joined #ruby
<jedir0x> shevy: yeah, i was just messing around
jchauncey has joined #ruby
Diranged has joined #ruby
MrGando has joined #ruby
<Diranged> hey.. im pretty new to ruby but i need a bit of help. i have a script thats going to potentially run hundreds or thuosands of times every hour. the script is going to go to a remote data source and get some data, and return it. however, i want to cache that data locally — not for performance reasons, but in case that remote data source is unavailable..
<Diranged> i was thinking i'd open a text file, and do a yaml dump to the file … but then i thought about the prospects of opening and closing the file all the time, and the one script overwriting changes from another script .. bla bla bla ..
<Diranged> im wondering if theres a smarter way to do this in ruby .. something that deals with file locking…
troulouliou_dev has joined #ruby
<troulouliou_dev> hi what is the best thing to say i wan to slice from the the 4 byte up to the end
<troulouliou_dev> in a string
emmanuel__ has joined #ruby
<Diranged> any thoughts on the best way to handle caching this data to a local tmp file?
<Veejay> troulouliou_dev: Look up each_byte and .to_a
<troulouliou_dev> Veejay, ok thanks
davidpardy has joined #ruby
davidpardy has quit [#ruby]
elake has joined #ruby
bbttxu has joined #ruby
gregorg has joined #ruby
chson has joined #ruby
savage-_ has joined #ruby
pandora17 has joined #ruby
<shevy> Diranged tell you what
<shevy> if you have not yet tried the yaml approach, go and use it first
<shevy> you can also check if the file is being modified/opened right now
<shevy> in that case you could simply write a new yaml dump
<shevy> and have your script always check in the latest new yaml file
zakwilson has joined #ruby
apeiros_ has joined #ruby
<shevy> if that is not enough, you can easily change that class lateron
Boohbah has joined #ruby
thams_ has joined #ruby
<Diranged> hmm
<Diranged> right now im looking at FileCache as a potential solution..
thams_ has joined #ruby
Squarepy has joined #ruby
thams has joined #ruby
Haydos has joined #ruby
bluOxigen has joined #ruby
sbanwart has joined #ruby
replore has joined #ruby
jeebster has quit [#ruby]
ZeBordoada has joined #ruby
manizzle has joined #ruby
devjj has joined #ruby
devjj has joined #ruby
justinmcp has joined #ruby
Aaton has joined #ruby
netrealm has joined #ruby
snip_it has joined #ruby
medik has joined #ruby
bwlang has joined #ruby
chico has joined #ruby
yannis has joined #ruby
vitosdc has joined #ruby
seanstickle has joined #ruby
vitosdc has quit [#ruby]
zakwilson has joined #ruby
btaitelb has joined #ruby
stephenjudkins has joined #ruby
rramsden has joined #ruby
<Kovensky> hmm
<Kovensky> is there a way to have an unsigned number in ruby?
zakwilson has joined #ruby
<Kovensky> more specifically, I want to do an unsigned complement
<Kovensky> (I have a 32-bit CRC, want to invert every bit there)
Squarism has joined #ruby
<Kovensky> I instead get a negative number + 1 :S
<apeiros_> & 0xffffffff
<Kovensky> oh
<Kovensky> you mean ^ btw
<apeiros_> no
MrGando has joined #ruby
<apeiros_> I mean &
<Kovensky> (~crc)&0xffffffff will do what I want
<Kovensky> but so will crc^0xffffffff
<Kovensky> as long as it's a Bignum instead of a Fixnum ._.
<apeiros_> you still have a 32bit ruby? o0
<Kovensky> cygwin
SolarisBoy1 has joined #ruby
<Squarepy> it is hard to get at the way an integer is stored
<Kovensky> a890feb4 (576f014b) <-- seems correct
* apeiros_ fails to make the connection between cygwin & 32bit ruby - cygwin is only capable of running 32bit apps?
<Kovensky> could be because a890feb4 is already a Bignum though
<Kovensky> apeiros_: if it's linked against cygwin1.dll, yes
<Kovensky> there has been talks in cygwin's development ML about a 64bit version though
<Kovensky> ave*
<Kovensky> have**
boom has joined #ruby
<boom> I have a block, that is iterating through an array, if the variable (let's call it "e") created by the block what does !e mean?
xpot-mobile has joined #ruby
<Veejay> Most of the time it means not e
<Veejay> What is the array made of?
<boom> just a bunch of words
<Veejay> Strings?
<boom> that's what I thought too
<boom> yes
<Veejay> Well that's peculiar
<Kovensky> apeiros_: cygwin can run non-32bit apps, but they have to be linked against mingw or msvcrt and thus those apps have no knowledge of the cygwin environment
jimeh has joined #ruby
<Veejay> Kovensky: Out of curiosity, do you develop on Windows because you want to?
<Veejay> Honest question
<shevy> lol
kpshek has joined #ruby
<Kovensky> lol
<Kovensky> easy access to games :D
<boom> just install a virtual server
<shevy> this will eat the time of your life man
<LiquidInsect> virtualbox + linux would be better than cygwin
<boom> it's easy
<Kovensky> more seriously, because my OSX is broken and other unixes are misbehaving with my GPU :(
<boom> yeah exactly
<Veejay> shevy: I'm curious man, Windows is such a blatant piece of shit for anything non-Microsoft development-related
<Kovensky> LiquidInsect: and access files through SMB? nothx
<LiquidInsect> Kovensky: SMB?
<Veejay> Kovensky: Double boot? VMWare>
<shevy> Veejay yeah pretty much like linux too :>
<LiquidInsect> no, just use the built in folder sharing
<LiquidInsect> it's seamless
<Kovensky> ...which emulates a SMB server
<boom> LiquidInsect: actually do you have a link to set that help?
<boom> that would help me out
<shevy> Veejay my plan is for RubyOS to save this world
<Veejay> What do you mean RubyOS?
<shevy> but it's too much work so it will never happen
m_3 has joined #ruby
<shevy> everything ruby!
jergason has joined #ruby
<LiquidInsect> boom: haven't set it up myself but we use vagrant here, which uses virtualbox
<Veejay> Ruby is a high-level dynamic language dude
rexbutler has joined #ruby
<Veejay> Do you think it's possible to write a decent operating system with it?
<Veejay> I mean a serious one
<LiquidInsect> and our files sit in a folder in the host's filesystem which is shared to the VM
<LiquidInsect> works fine
<shevy> if I'd have some 100.000 man-hours sure
kylemcgill has joined #ruby
<Veejay> Unless there's a dramatic improvement in terms of speed it will not happen
<Kovensky> Veejay: you could... if you wrote the operating system's services as C modules!
<rexbutler> Okay, random question:
<LiquidInsect> that's my dream, a green-threaded operating system
<LiquidInsect> gag
<rexbutler> what is the meaning of "tmp/**/*", ie a double ** in an RE?
<Veejay> Kovensky: Then it's not really RubyOS anymore now is it though?
<Kovensky> well, ruby itself isn't written in ruby, so... :>
<apeiros_> LiquidInsect: because green threads is a language feature and not a runtime feature…
<Kovensky> what are "green threads"
<shevy> they were yellow then got bad and thus turned green
<apeiros_> Kovensky: interleaved concurrency instead of true parallelism
<Kovensky> cooperative threading?
<apeiros_> no, that's orthogonal
<shevy> Veejay if there would be an underlying VM, the language that is used would no longer have to matter or?
<Kovensky> at any rate, ruby can't do real parallelism? :(
<LiquidInsect> Kovensky: it can
<LiquidInsect> depends on the vm
<Veejay> shevy: How many operating systems are written in Java?
<apeiros_> it means that no code is ever truly run in parallel, instead the scheduler interleaves the code of different threads
<LiquidInsect> jruby uses real threads
<Veejay> Serious ones I mean
<shevy> Veejay none
<Veejay> Exactly, none
<Kovensky> what about YARV
<LiquidInsect> but MRI/YARV use green threads
<shevy> but that is no surprise. java is a shit language
<Veejay> haha
<shevy> it is not funny, it is sad
<Veejay> Alright, peace, I'm out
<apeiros_> *yarv uses real threads, but has a gil
<LiquidInsect> oh does it
<LiquidInsect> well
<LiquidInsect> with the gil still there it might as well be green
<apeiros_> similar in the end effect, but different for a couple of things
<LiquidInsect> we'll see
campanolix has joined #ruby
<LiquidInsect> what happens in the next few years
<apeiros_> it's better for threaded native extensions (easier to manage)
<Kovensky> yeah, that was what just came to mind :S
<Kovensky> so you can only do real threading with C extensions? :(
heftig has joined #ruby
<apeiros_> no, as LiquidInsect said, you can do real threading with jruby
zakwilson has joined #ruby
<LiquidInsect> Kovensky: or use another VM, like jruby
<apeiros_> I think rubinius uses real threads + gil too and intends to drop the gil
<Kovensky> not like I need it to do real computation (I run two threads in my code, but one just prints stuff to console once a second, and the other is just a SIGHUP monitor)
<LiquidInsect> apeiros_: yeah. YARV has the same intent though, I think. Whichever one wins, I'm swicthing to for personal playground stuff
<apeiros_> you don't need a thread for sighup trapping
adeponte has joined #ruby
M- has joined #ruby
<Veejay> apeiros_: No GIL anymore in the Hydra branch I think
<apeiros_> LiquidInsect: I thought matz said short to longterm the gil will stay due to compat problems…?
<apeiros_> Veejay: well possible, I'm not up to date with rubinius dev
<apeiros_> gah, damit, 0200 - when did that happen?
blaine has joined #ruby
nyuszika7h has joined #ruby
<Kovensky> apeiros_: the SIGHUP handler sets a variable; that thread detects the variable change and sends #run to the main thread (which is probably in sleep state at that point)
<Veejay> I'm extremely excited with Rubinius, but it's hard to gauge where they're going and how swiftly they're progressing from the outside
<apeiros_> gotta get some sleep or I'll fall asleep during presentations tomorrow :-S
<Kovensky> I tried sending #run from the SIGHUP handler itself but it wasn't working for some reason :S
<apeiros_> Kovensky: oooh, good old issue
<Veejay> Night, sleep tight, don't let the GIL bite
<Kovensky> I just used the opportunity since I already had that thread polling for the config file's mtime
<apeiros_> Kovensky: the scheduler sets the main thread back into the state before the trap proc was run
<apeiros_> Kovensky: so if you wake up the main thread from within the sighup handler, it'll be set back to sleep again
<Kovensky> lol
<apeiros_> cost me an hour or so of my life to figure that one out…
<apeiros_> yeah, lol and wtf - two for one! in a single package!
<apeiros_> anyway, sleep
<apeiros_> n8
<Kovensky> nite