Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
SexyHot-TV has joined #ruby
SexyHot-TV has joined #ruby
tommyvyo_ has joined #ruby
tommyvyo_ has joined #ruby
<sullx> i have a page parsed with nokogiri, there are 100 elements that each have 4 pieces of data I need to save. how can I do this in one pass? currently I am looping through the page four times, each time using a different xpath for the different piece of data for each element
banister_ has joined #ruby
banister_ has joined #ruby
ascarter has joined #ruby
ascarter has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
sacarlson has joined #ruby
sacarlson has joined #ruby
xkws49er has joined #ruby
xkws49er has joined #ruby
ribayr has joined #ruby
ribayr has joined #ruby
<gate> axl_: that's part of the regexp. /^bob$/ will only match strings that are exactly "bob"
xissburg_ has joined #ruby
xissburg_ has joined #ruby
<axl_> gate: i am now using ===
<axl_> my_regex === my_string
<gate> axl_: I don't think that does what you need, /bob/ === 'bobette'
hadees has joined #ruby
hadees has joined #ruby
tomzx has joined #ruby
tomzx has joined #ruby
<axl_> hmm...
<axl_> interesting
<axl_> k
<axl_> thanks!
startling has joined #ruby
startling has joined #ruby
cbuxton has joined #ruby
cbuxton has joined #ruby
whitenoise has joined #ruby
whitenoise has joined #ruby
<whitenoise> hi all, I am trying to setup a project where I use ActiveRecord with sqlite3 and can use rake and all that stuff, but I don't know how to create the rakefile so that I can do what I need to do without Rails
<robacarp> whitenoise: well, I don't *know* but I expect you could just generate a rails project, copy out the rakefile and delete the project...
idletom has joined #ruby
idletom has joined #ruby
<whitenoise> robacarp: no, Rakefiles in Rails are just two-liners.
<whitenoise> They use a class method for the application generated
<gate> robacarp: nope, rails rakefiles use load_tasks from the application class
davidd``` has joined #ruby
davidd``` has joined #ruby
sizz_ has joined #ruby
sizz_ has joined #ruby
<gate> whitenoise: so you are trying to get the rake db:create tasks and the like?
<robacarp> well, then I'd go read the methods and see what they do...
<whitenoise> gate: yeah
Sliker has joined #ruby
Sliker has joined #ruby
<whitenoise> gate: i found a Rakefile online, but it was Mysql-specific.
<gate> got it
<gate> whitenoise: just take it straight from the horse's mouth :) https://github.com/rails/rails/blob/master/activerecord/lib/active_record/railties/databases.rake
mxweas_ has joined #ruby
mxweas_ has joined #ruby
<gate> so since it's part of activerecord, you likely just have to include it correctly
mikepack has joined #ruby
mikepack has joined #ruby
<ereslibre> is gem also ignoring --install-dir for you ? `sudo gem install gem-0.0.1.gem` will install the gem in /root/.gem. Running `sudo gem install --install-dir /usr/lib/ruby/gems/1.9.1 gem-0.0.1.gem` still installs the gem in /root/.gem. Ideas ?
breidh has joined #ruby
breidh has joined #ruby
kevinbond has joined #ruby
kevinbond has joined #ruby
aim-On has joined #ruby
aim-On has joined #ruby
kevinbond has joined #ruby
kevinbond has joined #ruby
havenn has joined #ruby
havenn has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has joined #ruby
mxweas_ has joined #ruby
mxweas_ has joined #ruby
_obiJuan has joined #ruby
_obiJuan has joined #ruby
hadees has joined #ruby
hadees has joined #ruby
tsd_usa has joined #ruby
tsd_usa has joined #ruby
kylemcgill has joined #ruby
kylemcgill has joined #ruby
asobrasil has quit [#ruby]
asobrasil has quit [#ruby]
<td123> ereslibre: let me guess, are you using arch? :{
axl_ has joined #ruby
axl_ has joined #ruby
phantasm66 has joined #ruby
phantasm66 has joined #ruby
ryannielson has joined #ruby
ryannielson has joined #ruby
yawniek has joined #ruby
yawniek has joined #ruby
snearch has joined #ruby
snearch has joined #ruby
<ryannielson> Is there an array method to return all indexes that match what I'm looking for? For example, if have the array ['cat','dog',cat']. I want a method that returns [0, 2] given 'cat'
mattonrails has joined #ruby
mattonrails has joined #ruby
<td123> I don't know a function like that, but you can easily write it yourself with each_with_index
sbanwart has joined #ruby
sbanwart has joined #ruby
tsd_usa has quit [#ruby]
tsd_usa has quit [#ruby]
<banister_> ryannielson: a.each_with_index.select{ |k, i| k == "cat" }.map(&:last)
neurodrone has joined #ruby
neurodrone has joined #ruby
<ryannielson> banister_: Thanks, I'll give that a shot. Didn't see each_with_index in the docs
<ereslibre> td123: yes
<ereslibre> td123: ... packager problem ?
chessguy has joined #ruby
chessguy has joined #ruby
libertyprime has joined #ruby
libertyprime has joined #ruby
<ereslibre> td123: LOL. thanks... missed that email, and that wasn't pretty discoverable
sacarlson has joined #ruby
sacarlson has joined #ruby
<banister_> ryannielson: a.each.with_index.with_object([]) { |(k, i), o| o << i if k == "cat" }
<banister_> :P
<ryannielson> banister_:haha
xissbur__ has joined #ruby
xissbur__ has joined #ruby
ilyam has joined #ruby
ilyam has joined #ruby
<ryannielson> banister_: That pretty much does what I'm looking for. Thanks a lot!
<banister_> np
ttm has joined #ruby
ttm has joined #ruby
<shevy> the coolest thing about distributions is
<shevy> they all reinvent the wheel
<shevy> :>
<td123> shevy: they all reinvent the wheel with their own idea of what a wheel should be :P
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
ada2358 has joined #ruby
ada2358 has joined #ruby
<shevy> yeah
replore has joined #ruby
replore has joined #ruby
<shevy> usually the wheel is still round, but painted differently
<shevy> sometimes it is a cubic, but the label says it is a wheel
csprite has joined #ruby
csprite has joined #ruby
frishi has joined #ruby
frishi has joined #ruby
<shevy> new kids on the block see all the different wheels and think they must make a wheel too
<shevy> but a spaceship would be much better than a wheel. you could fly to other places with it much faster than with any wheel!
tvw has joined #ruby
tvw has joined #ruby
sizz has joined #ruby
sizz has joined #ruby
philcrissman has joined #ruby
philcrissman has joined #ruby
jnh has quit [#ruby]
jnh has quit [#ruby]
havenn has joined #ruby
havenn has joined #ruby
mxweas_ has joined #ruby
mxweas_ has joined #ruby
randym_ has joined #ruby
randym_ has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
pdtpatr1ck has joined #ruby
pdtpatr1ck has joined #ruby
ca_bud has joined #ruby
ca_bud has joined #ruby
<ca_bud> Can someone assist? http://pastie.org/3484584
yekta has joined #ruby
yekta has joined #ruby
<genexp> ca_bud: What are you trying to do here?
<ca_bud> genexp: I think I found it, it's called bit masking
undersc0re has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
ckrailo has joined #ruby
ckrailo has joined #ruby
nari has joined #ruby
nari has joined #ruby
axl_ has joined #ruby
axl_ has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
fr0sted has joined #ruby
fr0sted has joined #ruby
liluo has joined #ruby
liluo has joined #ruby
sizz_ has joined #ruby
sizz_ has joined #ruby
burns180 has joined #ruby
burns180 has joined #ruby
<ryannielson> Any idea why something like reordered.inject(Hash.new { |h, k| h[k] = [] }).with_index do |(h, v), i|
<ryannielson> h[v] << i
<ryannielson> h
<ryannielson> end
<ryannielson> Doesn't work?
<ryannielson> Oh god, that didn't show up well
wroathe has joined #ruby
wroathe has joined #ruby
<ryannielson> I basically want to store the index in that hash
adeponte has joined #ruby
adeponte has joined #ruby
seanstickle has joined #ruby
seanstickle has joined #ruby
ascarter has joined #ruby
ascarter has joined #ruby
<ryannielson> Tried something else here: https://gist.github.com/1936881
sbanwart_ has joined #ruby
sbanwart_ has joined #ruby
blischalk has joined #ruby
blischalk has joined #ruby
tobym has joined #ruby
tobym has joined #ruby
acidjazz has quit [#ruby]
acidjazz has quit [#ruby]
sdwrage has joined #ruby
sdwrage has joined #ruby
emocakes has joined #ruby
emocakes has joined #ruby
kinderman has joined #ruby
kinderman has joined #ruby
twock has joined #ruby
twock has joined #ruby
robertjpayne has joined #ruby
robertjpayne has joined #ruby
QaDeS has joined #ruby
QaDeS has joined #ruby
carlyle has joined #ruby
carlyle has joined #ruby
coreydaley has joined #ruby
coreydaley has joined #ruby
_obiJuan has joined #ruby
_obiJuan has joined #ruby
neutrino has joined #ruby
neutrino has joined #ruby
Zolrath has joined #ruby
Zolrath has joined #ruby
<ryannielson> Anyone have any ideas why this isn't working? https://gist.github.com/1936881
paissad has joined #ruby
paissad has joined #ruby
CheeToS has joined #ruby
CheeToS has joined #ruby
paissad has joined #ruby
paissad has joined #ruby
MasterIdler has joined #ruby
MasterIdler has joined #ruby
albemuth has joined #ruby
albemuth has joined #ruby
andrewhl has joined #ruby
andrewhl has joined #ruby
mattonrails has joined #ruby
mattonrails has joined #ruby
burns180_ has joined #ruby
burns180_ has joined #ruby
shtirlic has joined #ruby
shtirlic has joined #ruby
djbpython has joined #ruby
djbpython has joined #ruby
davidcelis has joined #ruby
davidcelis has joined #ruby
rexbutler has joined #ruby
rexbutler has joined #ruby
macmartine has joined #ruby
macmartine has joined #ruby
b_ has joined #ruby
b_ has joined #ruby
yeoj has quit [#ruby]
yeoj has quit [#ruby]
<msch> is there a different method to build a hash like inject but where i don't have to always return the memo object? e.g. [1,2,3].inject({}) { |hash, e| hash[e] = Kernel.rand }
briankbuckley has joined #ruby
briankbuckley has joined #ruby
<seanstickle> reduce is such a nicer term for injedct
sacarlson has joined #ruby
sacarlson has joined #ruby
ipsifendus has joined #ruby
ipsifendus has joined #ruby
audy has quit ["Textual IRC Client: http://www.textualapp.com/"]
audy has quit ["Textual IRC Client: http://www.textualapp.com/"]
<msch> seanstickle: ok i agree :) but is there a method that does what i want it to?
sbanwart__ has joined #ruby
sbanwart__ has joined #ruby
mikepack has joined #ruby
mikepack has joined #ruby
pingfloyd has joined #ruby
pingfloyd has joined #ruby
<seanstickle> msch: Hash[*[1,2,3].map {|v| [v, rand] }.flatten]
<seanstickle> msch: Hash[[1,2,3].map {|v| [v, rand] }]
<seanstickle> Even shorter
wmoxam has joined #ruby
wmoxam has joined #ruby
<msch> seanstickle: thanks. but that has way worse performance doesn't it? i think i'll just stick with reduce :/
<seanstickle> msch: You didn't specify it had to have better performance
<rexbutler> Okay folks, question here. How would using arrays like [u,v], hashes like {x_coord: u,y_coord: v}, and an pair class with attr_accessor's compare speed wise?
adeponte has joined #ruby
adeponte has joined #ruby
<seanstickle> Goddamn people and their hidden requirements.
<seanstickle> rexbutler: test it
<msch> seanstickle: hehe :) sorry
<msch> seanstickle: it doesn't have to have better performance, just not worse :)
<rexbutler> seanstickle: I probably would learn more that way, true
stepnem has joined #ruby
stepnem has joined #ruby
ca_bud has quit [#ruby]
ca_bud has quit [#ruby]
mattonrails has joined #ruby
mattonrails has joined #ruby
wmoxam has joined #ruby
wmoxam has joined #ruby
<seanstickle> msch: also, the performance difference is negligible
<seanstickle> On a million runs, the difference is 0.2 secs
<msch> seanstickle: interesting, i'm already so burnt by ruby's performance that i don't trust it even a little bit :)
<seanstickle> Use JRuby then
<seanstickle> Freakishly fast.
<seanstickle> For a Ruby
burns180 has joined #ruby
burns180 has joined #ruby
<msch> seanstickle: i know, i just have to convince my team that it isn't "java hurr durr evil"
<msch> seanstickle: also doesn't help that (before the JIT warms up i guess) it's niceable slower when running Rails in dev mode
<msch> s/niceable/noticable/
<seanstickle> True
<seanstickle> Still, better than SmallTalk Ruby
<seanstickle> Or Gemstone Ruby, or whatever that was called
<seanstickle> Which tanked
<msch> maglev :)
<seanstickle> That's the one
<msch> never evaluated it's performance on rails. just played a bit with it's distributed features. which were very nice.
Targen has joined #ruby
Targen has joined #ruby
<seanstickle> Yeah, well, Cardinal was cool too. :)
banisterfiend has joined #ruby
banisterfiend has joined #ruby
<msch> seanstickle: never heard of it. that? http://cardinal2.rubyforge.org/
<seanstickle> The very same
jergason has joined #ruby
jergason has joined #ruby
<msch> i have high hopes for rubinius. i don't need v8-like speed, but python-like would be nice :)
lachyg has joined #ruby
lachyg has joined #ruby
<seanstickle> Well, it's still based on 1.8.7, right?
<lachyg> Ruby Noob Here: If I'm parsing a ruby file into a Ruby AST library (RubyParser, Ruby2Ruby)... How can I extract the methods from the tree?
<cout> seanstickle: what do you mean "based on"?
<msch> seanstickle: the current master on github which should become stable 2.0 soon has a working 1.9 mode. afaik the only thing that stops them from releasing 2.0 is that encoding support isn't fully done
<seanstickle> "For now Rubinius is targeting MRI 1.8.7"
<seanstickle> Is what I mean
<cout> so "compatible with"
<seanstickle> Sure.
<banisterfiend> cout: hey homie, do you know much about LD_PRELOAD and dynamic linking in general? when overwrite rb_raise() with my shim (via LD_PRELOAD) i occasionally get some weird happenings, complaints about missing symbols (specifically _environ) and so on. Any idea?
<msch> seanstickle: https://github.com/rubinius/rubinius Rubinius currently is compatible with Ruby version 1.8.7. Support for Ruby version 1.9.2 is coming soon.
<seanstickle> msch: right, so what I said.
<cout> banisterfiend: weird
<msch> seanstickle: yes. still, with rails 4.0 i expect them to scramble to release a 1.9 compatible version soon
<banisterfiend> cout: it generally works though, i just get a bunch of warnings
<cout> banisterfiend: try setting LD_DEBUG
<banisterfiend> cout: oh, interesting
<robert_> hii banisterfiend
<banisterfiend> hi
<robert_> how's it going?
<banisterfiend> good
ninor has joined #ruby
ninor has joined #ruby
<cout> banisterfiend: evil! :)
shadoi has joined #ruby
shadoi has joined #ruby
<robert_> cout << "Haha." << endl;
nokada has joined #ruby
nokada has joined #ruby
<msch> banisterfiend: you can't inject that into a running ruby process right? so no EE.intercept! in environment.rb?
<banisterfiend> cout: it generally works though, i can intercept exceptions like 1/0 or name errors
luxurymode has joined #ruby
luxurymode has joined #ruby
<banisterfiend> msch: if you're talking about the C exception stuff, you have to start the process with `pry-shim` or `pry --c-exceptions -w` cos you need to load the shim when the process starts AFAIK
<banisterfiend> msch: but if you're just talking about intercepting normal ruby exceptions, that can be done at runtime
ilyam_ has joined #ruby
ilyam_ has joined #ruby
<msch> banisterfiend: yep. yeah i know intercepting normal ruby exceptions works prefectly, was just thinking that you were planning on replacing whatever hacks you use now with the shim
<banisterfiend> maybe cout knows a way to override C functions at runtime
<banisterfiend> msch: the shim is the way we do it now, hehe, it's just kind of noisy and unreliable :/
youdonotexist has joined #ruby
youdonotexist has joined #ruby
<msch> banisterfiend: yep, i'm fighting with it right now :) doesn't want to intercept NoMethodError for some reason...
<cout> banisterfiend: dlopen with RTLD_GLOBAL, I think
Squee-D has joined #ruby
Squee-D has joined #ruby
<cout> banisterfiend: but I'm not sure how to get ruby to call dlopen
<banisterfiend> ^ that's what happens
<banisterfiend> msch: ah yeah, NoMethodError is one we dont yet support
<msch> banisterfiend: ah that explains that :)
<banisterfiend> msch: the way ruby deals with exceptions under the hood is pretty ugly, there's like 3 or 4 different methods it can invoke to raise exceptions, it's like they kept refactoring the API and didnt update old code
ckrailo has joined #ruby
ckrailo has joined #ruby
<banisterfiend> msch: sometimes they use really low level functions like rb_exc_raise() other times they use rb_raise() and othe rtimes still they use high level functions like rb_name_error()
<msch> banisterfiend: sounds awesome.... thanks for investing the time :) *holding my fingers for rubinius*
<banisterfiend> makes it really hard to catch everything
wefawa has joined #ruby
wefawa has joined #ruby
<banisterfiend> msch: i just got pry-stack_explorer working on rbx :)
<banisterfiend> PEE shouldn't be far behind
<wefawa> Does ruby have any methods for "groupping"? (like SQL Group by?)
<msch> banisterfiend: nice. although i was thinking that everyone migrates to rbx so you don't have to hack around MRI's warts
<banisterfiend> yeah that would be nice, rbx is really nice to work with
<msch> wefawa: Rails adds Enumberable#group_by IIRC
<banisterfiend> though it has a couple of bugs, but hopefully we can fix them
<cout> banisterfiend: this code doesn't compile on my machine
<banisterfiend> cout: are you on 1.9.2+ ?
Progster has joined #ruby
Progster has joined #ruby
<cout> banister: 1.8.7
<banisterfiend> cout: ah, this is 1.9.2+ only sorry
<cout> banisterfiend: then why do you hardcode 1.9.1?
<banisterfiend> cout: it's ruby that decides to call that folder 1.9.1 i dont know why :)
<banisterfiend> i just used its folder names
<wefawa> msch: thx
linyows_ has joined #ruby
linyows_ has joined #ruby
<msch> banisterfiend: i think it's because the API of 1.9 was declared stable in 1.9.1 so the folder isn't supposed to change any more
<banisterfiend> oh ok
snip_it has joined #ruby
snip_it has joined #ruby
sroy2_ has joined #ruby
sroy2_ has joined #ruby
<cout> banisterfiend: I think what you want is RbConfig::CONFIG['rubyhdrdir'] (on 1.9.x) and RbConfig::CONFIG['archdir'] (on 1.8.x)
ilyam has joined #ruby
ilyam has joined #ruby
<banisterfiend> cout: oh ok thanks, but the library (that makes use of the shim) generally doesnt work on 1.8 anyway as it's build on the binding_of_caller hack that i wasn't able to backport to 1.8
<banisterfiend> built*
<cout> banisterfiend: sure, but you want to be forward-compatible too
t0mmyvyo has joined #ruby
t0mmyvyo has joined #ruby
<banisterfiend> cout: good point
<cout> banisterfiend: I was just giving the 1.8.x dir for reference in case you have other code that might make use of it
rickmasta has joined #ruby
rickmasta has joined #ruby
<banisterfiend> oh ok, thanks, i would like to get binding of caller working in 1.8, ill probably give it another try sometime but it seems pretty difficult
alexonthemoon has joined #ruby
alexonthemoon has joined #ruby
<alexonthemoon> hi, quick question guys. how do I use ruby to select an option from a dropdown list?
<cout> banisterfiend: you should also include <stdarg.h> since you are using va_start
<alexonthemoon> I have the option value and the dropdown 'name' but I don't know how to format the command correctly
cjs226 has joined #ruby
cjs226 has joined #ruby
choffstein has joined #ruby
choffstein has joined #ruby
burns180 has joined #ruby
burns180 has joined #ruby
robertjpayne has joined #ruby
robertjpayne has joined #ruby
<cout> banisterfiend: I don't get any warnings when I run: LD_PRELOAD=~/.pry-exception_explorer/1.9.2/lib_overrides.so ruby1.9.2 -e ''
philips has joined #ruby
philips has joined #ruby
<msch> alexonthemoon: you mean in Ruby on Rails?
<banisterfiend> cout: did you install pry-exception_explorer ?
<banisterfiend> cout: can you try: pry --c-exceptions
MasterIdler__ has joined #ruby
MasterIdler__ has joined #ruby
<cout> banisterfiend: no, I just built the code you pasted earlier
<banisterfiend> cout: oh ok
<cout> I was hoping it would just boil down to a simple test case
<alexonthemoon> anyone? :/
<cout> is pry-exception_explorer a gem?
<banisterfiend> cout: well if you just run ruby executable it generates no warnings for me either, it's when you use it with a larger program that the warnings appear to arise
<msch> alexonthemoon: are you using Ruby on Rails?
<banisterfiend> cout: yes, gem install pry-exception_explorer
dv310p3r has joined #ruby
dv310p3r has joined #ruby
<alexonthemoon> msch: hi thanks for your time. no, i'm using ruby
<msch> alexonthemoon: ok, then i have no idea what you mean by dropdown :)
<alexonthemoon> msch: I have <select name="state">
<alexonthemoon> msch:and then option value="AL"></option>
<cout> using gem... here goes my download quota for the month :(
<alexonthemoon> msch: and I'm trying to get ruby to select the option "AL" from the drop down list
<banisterfiend> cout: haha, dont worry about it man
<banisterfiend> cout: dont waste your quota on this :)
<cout> banisterfiend: I'm kidding
<msch> alexonthemoon: that's HTML not ruby :) you need to do <option value="AL" selected></option>
kpshek has joined #ruby
kpshek has joined #ruby
<banisterfiend> cout: i was hoping :)
<alexonthemoon> msch: right, I'm using ruby to select the option "AL" from HTML that already exists
<cout> banisterfiend: I know that historically gem has liked to download lots of data (kinda sucked when I was on a modem)
Aaaarg_ has joined #ruby
Aaaarg_ has joined #ruby
Squee-D has joined #ruby
Squee-D has joined #ruby
<msch> alexonthemoon: so you are web scraping?
<alexonthemoon> msch: yep
<cout> hmm.
<cout> ERROR: While executing gem ... (NameError) uninitialized constant Encoding::US_ASCII
<alexonthemoon> msch: no worries, they aprove scraping, just can't distribute it to anyone else
<cout> I've never seen that before.
nokada has joined #ruby
nokada has joined #ruby
<msch> alexonthemoon: ah ok. no idea then, sorry.
<banisterfiend> cout: me either
<alexonthemoon> msch: no worries, thanks for your time regardless :)
nobitanobi has joined #ruby
nobitanobi has joined #ruby
<nobitanobi> I'm under 1.9.2p290 - When I do this: s = "asd#d" ; s =~ /[~!@#$%^&*()]+/ - I get a syntax error, unexpected ']', expecting tCOLON2 or '[' or '.' -- Anybody knows why_
<nobitanobi>
<cout> I probably shouldn't bother trying to get this to work on ruby 1.9.2-preview1
<banisterfiend> cout: Yeah
<banisterfiend> my test environment is 1.9.3, but i have travis setup to test on 1.9.2 as well
<banisterfiend> but never -preview :)
<cout> travis?
<banisterfiend> cout: travis-ci.org
<cout> I downloaded it some time in 2009 and it's always been close enough to the real thing until now
_kinderman has joined #ruby
_kinderman has joined #ruby
<banisterfiend> cout: travis is a great little project, automatically tests your app on a huge range of rubies whenever you make a commit
<banisterfiend> for pry itself we test on about 4-5 different rubies iirc
<banisterfiend> 1.8.7, rbx18, rbx19, 1.9.2, 1.9.3, jruby
<cout> banisterfiend: there was some other service I used before, can't remember what it was called
<cout> used it back when I was doing ludicrous
<randym_> travis-ci rocks
<banisterfiend> oh ok
<banisterfiend> oh jruby in both 1.8 and 1.9 modes
sdwrage has joined #ruby
sdwrage has joined #ruby
<rexbutler> Okay, as suggested I did some benchmarking of array pairs [u,v] vs hashes {x: u,y: v} vs pair objects. The results are kind of surprising.
rramsden has joined #ruby
rramsden has joined #ruby
khakimov has joined #ruby
khakimov has joined #ruby
<banisterfiend> rexbutler: why dont u gist the results too
<banisterfiend> so we dont have to run it ourselves :)
kawa_xxx has joined #ruby
kawa_xxx has joined #ruby
<rexbutler> Okay...
<rexbutler> banisterfiend: It may not be surprising to you folks, but it was to me :)
<rexbutler> sec
laidback_01 has joined #ruby
laidback_01 has joined #ruby
xnm has joined #ruby
xnm has joined #ruby
burns180_ has joined #ruby
burns180_ has joined #ruby
<rexbutler> banisterfield: https://gist.github.com/1937398
<rexbutler> banisterfiend: https://gist.github.com/1937398
<rexbutler> there :)
<rexbutler> Of course there are other things I could test
<banisterfiend> rexbutler: well a hash is a much more complicated object than an array
<rexbutler> banisterfiend: What surprised me is that objects are pretty fast
<laidback_01> hey, honestly, I don't know if I'm in the right channel. I'm trying to install a RoR app (tracks - getontracks.org) with postgresql. there's a file, deploy.yml, where i have to define my database. I've tried pg, postgres, psql, postgresql. None of these seem to work. I'm trying to find out where Ruby's "cpan" is so I can work through this. Sorry if I sound like a total newb.
luxurymode has joined #ruby
luxurymode has joined #ruby
<banisterfiend> so setup times are going to be a bit more expensive
<banisterfiend> laidback_01: #rubyonrails
neutrino has joined #ruby
neutrino has joined #ruby
<rexbutler> banisterfiend: I'm looking more closely at the write times
<rexbutler> banisterfiend: I mean, the objects are FASTER
<banisterfiend> rexbutler: objects that have < 3 ivars work a little bit like arrays iirc
<banisterfiend> it embeds the objects in the object struct itself
<laidback_01> ok thanks
<banisterfiend> hte ivars*
gh has joined #ruby
gh has joined #ruby
<rexbutler> but after 3 ivars how do objects hold up?\
linyows_ has quit ["Linkinus - http://linkinus.com"]
linyows_ has quit ["Linkinus - http://linkinus.com"]
<banisterfiend> rexbutler: probably a bit worse as they have to then create an external ivar table
<banisterfiend> so they'd perform more like hashes i guess
<rexbutler> banisterfiend: Clearly I have a lot to learn
sako has joined #ruby
sako has joined #ruby
<banisterfiend> rexbutler: this is implementation details really
<banisterfiend> you dont need to know this unless you're hacking on internals
Asher has joined #ruby
Asher has joined #ruby
<rexbutler> So, is MRI/YARV holding up well vs Python?
swarley has joined #ruby
swarley has joined #ruby
<cout> what is that supposed to mean?
<rexbutler> cout: Shouldn't have phrased it as a negative
linyows_ has joined #ruby
linyows_ has joined #ruby
MrGando has joined #ruby
MrGando has joined #ruby
<rexbutler> cout: Esp. considering this is the ruby channel?
<swarley> so, potentially noobish question. I want to add a method ('->') to class Foo
<swarley> Is it possible
<rexbutler> I meant speed wise
<cout> rexbutler: about the same, depending on who you ask
<banisterfiend> rexbutler: run that benchmark on 1.8
<cout> IMO cpython has a slight advantage in that it is reference counted, which gives more predictable results for some applications
<banisterfiend> my guess is objects would be proportionally slower
blischalk has joined #ruby
blischalk has joined #ruby
<cout> python likes to allocate memory for all its integers, while ruby prefers to use bit tricks to avoid allocating memory (at the expense of bit manipulatino)
BrenoPerucchi has joined #ruby
BrenoPerucchi has joined #ruby
<rexbutler> Hmm... As a langauge I like Ruby, but Python has lots of neat libraries I wish I could use, being a math afficianado
<banisterfiend> rexbutler: was i right about 1.8
coreydaley has joined #ruby
coreydaley has joined #ruby
<rexbutler> banisterfiend: Remind me... right about what?
<banisterfiend> rexbutler: run the benchmark under 1.8
kinderman has joined #ruby
kinderman has joined #ruby
<rexbutler> banisterfiend: One second, I'm new to rvm, etc...
<cout> swarley: I believe you will be able to add such a method but you won't be able to call it easily
<banisterfiend> swarley: you will probably have trouble as -> is now syntax
<banisterfiend> in 1.9
radic has joined #ruby
radic has joined #ruby
bwlang has joined #ruby
bwlang has joined #ruby
<rexbutler> banisterfiend: compiling...
<swarley> banisterfiend, got any docs as to its use?
<swarley> i suppose i could have self.- return itself and then use self.>
<banisterfiend> swarley: it's just a lambda
albemuth has joined #ruby
albemuth has joined #ruby
rohit has joined #ruby
rohit has joined #ruby
<rexbutler> banisterfiend: Yeah, I was expecting something like that the first time
<swarley> oh
blueadept has joined #ruby
blueadept has joined #ruby
<rexbutler> banisterfiend: Well, thanks for the feedback
<banisterfiend> rexbutler: yeah, the diff IMO is due to the embedded ivars in 1.9
mikepack has joined #ruby
mikepack has joined #ruby
<cout> banisterfiend: still compiling 1.9.2
<banisterfiend> cout: haha
<banisterfiend> cout: which patchlevel? 290? :)
<cout> banisterfiend: but I believe those warnings are either because you are on osx (is that right?) or they are coming from somewhere other than that little extension you pasted earlier
codespec_ has joined #ruby
codespec_ has joined #ruby
<cout> banisterfiend: 290, yeah
manojhans has joined #ruby
manojhans has joined #ruby
<banisterfiend> cout: i get similar kinds of warnings on linux too
_obiJuan has joined #ruby
_obiJuan has joined #ruby
ninor has joined #ruby
ninor has joined #ruby
lkba has joined #ruby
lkba has joined #ruby
burns180 has joined #ruby
burns180 has joined #ruby
al3xnull has joined #ruby
al3xnull has joined #ruby
nfluxx has joined #ruby
nfluxx has joined #ruby
CheeToS has joined #ruby
CheeToS has joined #ruby
jfelchner has joined #ruby
jfelchner has joined #ruby
csprite has joined #ruby
csprite has joined #ruby
CannedCo_ has joined #ruby
CannedCo_ has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
_obiJuan has quit [#ruby]
_obiJuan has quit [#ruby]
ePirat has joined #ruby
ePirat has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
burns180_ has joined #ruby
burns180_ has joined #ruby
sroy2 has joined #ruby
sroy2 has joined #ruby
Azure has joined #ruby
Azure has joined #ruby
manojhans has joined #ruby
manojhans has joined #ruby
stenno_ has joined #ruby
stenno_ has joined #ruby
ed_hz_ has joined #ruby
ed_hz_ has joined #ruby
savage- has joined #ruby
savage- has joined #ruby
wmoxam has joined #ruby
wmoxam has joined #ruby
ryanf has joined #ruby
ryanf has joined #ruby
Squee-D has joined #ruby
Squee-D has joined #ruby
choffstein has joined #ruby
choffstein has joined #ruby
sako has joined #ruby
sako has joined #ruby
maletor has joined #ruby
maletor has joined #ruby
ipsifendus has joined #ruby
ipsifendus has joined #ruby
snip_it has joined #ruby
snip_it has joined #ruby
MrGando has joined #ruby
MrGando has joined #ruby
xnm has joined #ruby
xnm has joined #ruby
Seisatsu has joined #ruby
Seisatsu has joined #ruby
fayimora has joined #ruby
fayimora has joined #ruby
JohnBat26 has joined #ruby
JohnBat26 has joined #ruby
nfluxx has joined #ruby
nfluxx has joined #ruby
denysonique__ has joined #ruby
denysonique__ has joined #ruby
looopy has joined #ruby
looopy has joined #ruby
ninor has joined #ruby
ninor has joined #ruby
randym has joined #ruby
randym has joined #ruby
<sunaku> Companion! previously a plain old method or variable name; now a supreme constant!
<Companion> ???
<sunaku> hehe never mind. just jabbering about your nick rename ;)
<sunaku> slow night in #ruby eh? (crickets chirping)
zackattack has joined #ruby
zackattack has joined #ruby
<randym> lmao
<randym> sunaku thanks for the smile
artOfWar has joined #ruby
artOfWar has joined #ruby
TheShrew has joined #ruby
TheShrew has joined #ruby
* epochwolf sips his beverage
<Companion> sunaku, its 7 AM here
<epochwolf> 10pm here
<Companion> Raspberri pi website is down :(
<Companion> just when I wanted to order :@
<epochwolf> also, 7am is too damn early.
<sunaku> p Time.now.localtime
alexonthemoon has joined #ruby
alexonthemoon has joined #ruby
<sunaku> alas, i forget that we rubyists are truly world citizens
<epochwolf> What's this world you speak of?
<sunaku> i heard that it exists beyond $RUBYLIB. how unthinkable!
wyhaines_ has joined #ruby
wyhaines_ has joined #ruby
rickmasta has joined #ruby
rickmasta has joined #ruby
rickmast has joined #ruby
rickmast has joined #ruby
bigkm has joined #ruby
bigkm has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
* epochwolf heads over to make a purchase
<Companion> epochwolf, its down :p
<epochwolf> works for me
<epochwolf> Companion: http://uk.rs-online.com/web/ you'll need to search for it
<Companion> epochwolf, did that ;p
x0F__ has joined #ruby
x0F__ has joined #ruby
<Companion> Down for Maintenance
<Companion> This store is currently unavailable. Please visit our main website at www.raspberrypi.org.
porco has joined #ruby
porco has joined #ruby
rohit has joined #ruby
rohit has joined #ruby
yxhuvud has joined #ruby
yxhuvud has joined #ruby
sacarlson has joined #ruby
sacarlson has joined #ruby
<sunaku> Raspberry Pi - An ARM GNU/Linux box for $25. Take a byte!
iamjarvo has joined #ruby
iamjarvo has joined #ruby
tbrock has joined #ruby
tbrock has joined #ruby
csherin has joined #ruby
csherin has joined #ruby
replore_ has joined #ruby
replore_ has joined #ruby
chrxn has joined #ruby
chrxn has joined #ruby
khakimov has joined #ruby
khakimov has joined #ruby
genivf has joined #ruby
genivf has joined #ruby
CheeToS has joined #ruby
CheeToS has joined #ruby
sawjig has joined #ruby
sawjig has joined #ruby
TomWork has joined #ruby
TomWork has joined #ruby
<TomWork> hey guys, I am output=%x[a_python_script]
<TomWork> I can do print output but I can't chop or chomp it
<TomWork> any why ?
liluo has joined #ruby
liluo has joined #ruby
zakwilson_ has joined #ruby
zakwilson_ has joined #ruby
tonini has joined #ruby
tonini has joined #ruby
<canton7> might the python script be writing to STDERR? What happens if you don't print it -- any output?
twelvechairs has joined #ruby
twelvechairs has joined #ruby
moshef has joined #ruby
moshef has joined #ruby
codespectator has joined #ruby
codespectator has joined #ruby
Bartzy has joined #ruby
Bartzy has joined #ruby
KL-7 has joined #ruby
KL-7 has joined #ruby
<CacheMoney> I'm having trouble determining how to organize my classes. I'm creating a script to record Basketball stats and so far I've written my Player and Shot class http://pastie.org/3486090 However, I don't think I'm organizing this correctly. Does anyone have some insight?
jergason has joined #ruby
jergason has joined #ruby
iamjarvo has joined #ruby
iamjarvo has joined #ruby
<TomWork> canton7: ta you're right
<TomWork> fixed
ph^ has joined #ruby
ph^ has joined #ruby
senny has joined #ruby
senny has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
maletor has joined #ruby
maletor has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
Jonah11_ has joined #ruby
Jonah11_ has joined #ruby
<Jonah11_> can someone tell me why only 5 of the assertions are being run in this TestCase: http://codepad.org/svVMkKRB
daglees has joined #ruby
daglees has joined #ruby
robbyoconnor has joined #ruby
robbyoconnor has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
RomyRomy has joined #ruby
RomyRomy has joined #ruby
macmartine has joined #ruby
macmartine has joined #ruby
luckyruby has joined #ruby
luckyruby has joined #ruby
<MIST_`> anyone gotten their hands on a raspberry pi yet?
TaTonka has joined #ruby
TaTonka has joined #ruby
<canton7> apparently a lucky few have
<canton7> looks like they went through the phone system very early on, before it clogged up
banseljaj has joined #ruby
banseljaj has joined #ruby
r0bby_ has joined #ruby
r0bby_ has joined #ruby
<MIST_`> ah
<MIST_`> i actually got access to the site but i couldn't find ap lace to order
robert__ has joined #ruby
robert__ has joined #ruby
BrenoPerucchi has joined #ruby
BrenoPerucchi has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
chrxn has joined #ruby
chrxn has joined #ruby
<MIST_`> it just said "show ur interest"
banisterfiend has joined #ruby
banisterfiend has joined #ruby
Morkel has joined #ruby
Morkel has joined #ruby
macmartine has joined #ruby
macmartine has joined #ruby
twqla has joined #ruby
twqla has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
chrxn has quit ["Leaving"]
chrxn has quit ["Leaving"]
mafolz has joined #ruby
mafolz has joined #ruby
tweeKula has joined #ruby
tweeKula has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
xnm has joined #ruby
xnm has joined #ruby
luckyruby has joined #ruby
luckyruby has joined #ruby
chrxn_ has joined #ruby
chrxn_ has joined #ruby
ccapndave has joined #ruby
ccapndave has joined #ruby
ap0gee has joined #ruby
ap0gee has joined #ruby
ccapndave has joined #ruby
ccapndave has joined #ruby
sspiff has joined #ruby
sspiff has joined #ruby
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
nobitanobi has quit [#ruby]
nobitanobi has quit [#ruby]
Vert has joined #ruby
Vert has joined #ruby
RomyRomy has joined #ruby
RomyRomy has joined #ruby
twqla has joined #ruby
twqla has joined #ruby
porco has joined #ruby
porco has joined #ruby
bgupta has joined #ruby
bgupta has joined #ruby
jergason has joined #ruby
jergason has joined #ruby
Sliker has joined #ruby
Sliker has joined #ruby
Bulkior has joined #ruby
Bulkior has joined #ruby
<Bulkior> Hi, does anyone know anything about writing a bandwidth tester in ruby?
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
ap0gee has joined #ruby
ap0gee has joined #ruby
havenn has joined #ruby
havenn has joined #ruby
KaZeR_W has joined #ruby
KaZeR_W has joined #ruby
<KaZeR_W> hi there
ukwiz has joined #ruby
ukwiz has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
nerdy has joined #ruby
nerdy has joined #ruby
<KaZeR_W> i need to extract a substring matching a regexp. i'm using .scan. so far it works (if i 'puts' the result of the scan i get the expected content). but the result isn't a string, so i can't use it in a string concatenation
<KaZeR_W> what am i doing wrong?
the_hack has joined #ruby
the_hack has joined #ruby
Helius has joined #ruby
Helius has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
<ccapndave> KaZeR_W
<ccapndave> Oops
Vert has joined #ruby
Vert has joined #ruby
<ccapndave> KaZeR_W scan returns an array
adeponte has joined #ruby
adeponte has joined #ruby
<KaZeR_W> ccapndave, yep. so two questions :)
<KaZeR_W> is scan the best way to do this?
<KaZeR_W> why does .flatten doesn't work when i want to concatenate the result with another string?
<ccapndave> I'm not 100% sure about this, but I think scan returns tag & search pairs
<ccapndave> Have a go with match instead
<KaZeR_W> ok thanks
bier has joined #ruby
bier has joined #ruby
<ccapndave> Dunno if this is the best way, but this works: "Hello".match(/H/).to_s
<KaZeR_W> ok thanks trying right now
akemrir has joined #ruby
akemrir has joined #ruby
<canton7> KaZeR_W, if you do #scan with bracketted stuff, it returns arrays of arrays
<KaZeR_W> erm, canton7, could you expand a bit please?
<canton7> "Hello Hello Hello".scan(/H(el)/) => [['el'], ['el'], ['el']]
Bartzy has joined #ruby
Bartzy has joined #ruby
stoffus has joined #ruby
stoffus has joined #ruby
zommi has joined #ruby
zommi has joined #ruby
Ammar01 has joined #ruby
Ammar01 has joined #ruby
Bulkior has quit [#ruby]
Bulkior has quit [#ruby]
<KaZeR_W> canton7, in my case i'm sure that i will be getting only one result. is it worth using scan in this case (i'm thinking of php's preg_match vs preg_match_all for example, even if i'm not sure that scan works in the same way)
<canton7> KaZeR_W, if you're dead certain you'll be getting one result, there's no point in using #scan methinks. Just use #match, as suggested
<KaZeR_W> great thanks
<ccapndave> canton7: Is it 'good' Ruby to use to_s on it or is that dirty?
<canton7> also, re another question of yours, .flatten turns a multi-d array into a 1-d array. It's still an array
<ccapndave> canton7 to turn the MatchData into a string
alem0lars has joined #ruby
alem0lars has joined #ruby
<canton7> ccapndave, according to the docs, #to_s returns the entire matched string, so should be fine
<canton7> using [0] *might* be clearer though
<KaZeR_W> canton7, ah, so i did misunderstood .flattern. to_s was probably what i wanted
<ccapndave> Cool
tatsuya_o has joined #ruby
tatsuya_o has joined #ruby
imami has joined #ruby
imami has joined #ruby
<canton7> KaZeR_W, yeah, or #join, or something
<ccapndave> I am trying to learn to be elegant in Ruby :)
j3r0m3 has joined #ruby
j3r0m3 has joined #ruby
nemesit has joined #ruby
nemesit has joined #ruby
<KaZeR_W> canton7, join, right!
pi3r has joined #ruby
pi3r has joined #ruby
arturaz has joined #ruby
arturaz has joined #ruby
alagu has joined #ruby
alagu has joined #ruby
<alagu> Hello, I have a heterogeneous array (different objects) and each object has <=> implemented. But when I do .sort, it throws ArgumentError: comparison of X with Y failed
<alagu> how do I compare heterogeneous arrays?
<KaZeR_W> works now :) thanks a lot ccapndave and canton7 !
<canton7> alagu, can you compare X and Y directly?
<shevy> can ducks sing?
<canton7> they try...
porco has joined #ruby
porco has joined #ruby
<shevy> I like em. they are made from good stuff
<shevy> alagu the objects that you compare must be comparable to one another
robert_ has joined #ruby
robert_ has joined #ruby
<alagu> shevy: canton7 how do i check if two objects are comparable?
<shevy> if you have "access" to them, you can try to do .. include Comparable
<shevy> and define something like:
<shevy> def <=>(other)
<shevy> str.length <=> other.str.length
<alagu> oh cool
<alagu> let me try that out
<canton7> alagu, you said both object implemented <=>. I was suggesting you try X <=> Y directly
<shevy> "You can redefine the == method to give your objects custom behavior when it comes to equality testing."
<alagu> yes, let me check that. thanks canton7 and shevy :)
<shevy> yeah, just put the logic in that method body
<banisterfiend> shevy: sup
<shevy> banisterfiend die!
<shevy> whops, sorry
<shevy> wrong idiom
<shevy> I meant
<shevy> banisterfiend hi!
<shevy> I am still rewriting ...
peterhellberg has joined #ruby
peterhellberg has joined #ruby
LMolr has joined #ruby
LMolr has joined #ruby
<MIST_`> fcking hell they're sold out now
<MIST_`> xD
<MIST_`> and RS hasn't even started selling'em
<peterhellberg> MIST_`: Raspberry Pi?
<shevy> can it be eaten
<MIST_`> peterhellberg: yes
<MIST_`> shevy: it can, but i doubt there is much nourishment
<peterhellberg> MIST_`: I wonder how long it will take before the second batch is on the market
<shevy> :(
<shevy> we need organic computers
<MIST_`> edible computers, then i would have no computer at all
<peterhellberg> Oh, and more related to our interests; Has 1.9.3 been ported to ARM with decent performance yet?
<shevy> well just take one bite and let it regrow slowly
<shevy> eat slow ARM
<MIST_`> i would like if you would not eat my arm
imami has joined #ruby
imami has joined #ruby
<MIST_`> peterhellberg: i'm assuming it'll be atleast a few weeks unfortunately
<peterhellberg> MIST_`: Yeah, I figured as much
<MIST_`> don't give up hope yet though, RS seems still to have some in stock although their site won't allow it. You can order by phone if ur that desperate
sunaku has joined #ruby
sunaku has joined #ruby
<peterhellberg> MIST_`: I got the mini2440 in the mean time
<peterhellberg> MIST_`: It doesn’t come with a compiler though, so I need to jump through some hoops to get custom binaries running on it :)
<MIST_`> well i guess then u got ur addiction sorted i guess ;) i only got a ion2 to play with, i need arm
snearch has joined #ruby
snearch has joined #ruby
<MIST_`> well need.. do we really need theese things? haha ;)
<peterhellberg> I was in China last week, they have some crazy electronics markets in Shenzhen
<MIST_`> i'm going there in april
<shevy> whoa
<MIST_`> ^^
<MIST_`> landing in beijing where my cousins live
<shevy> you speak mandarin?
<peterhellberg> MIST_`: I can recommend the SEG electronics market (赛格电子市场) in Futian
<MIST_`> unfortunately not, i only speak swedish, german, dutch and english
<MIST_`> my mom speaks mandarin though, i guess i'll have to pick it up eventually
<peterhellberg> MIST_`: A bit far from Beijing though :)
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
<MIST_`> yeah
alem0lars has joined #ruby
alem0lars has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
<peterhellberg> http://www.startinchina.com/shenzhen_map.html <- Crazy "Simcity like" map of Shenzhen (What you can achieve with an endless supply of cheap labour)
<alagu> canton7: doing a <=> gives nil and I still get the same error
<alagu> comparison of ContentType::WikiContent with ContentType::Issue failed
Morkel has joined #ruby
Morkel has joined #ruby
<alagu> when i do a .sort of arrays with WikiContent and Issue
<alagu> shevy: ^^
<shevy> why is there a nil?
<alagu> 1.9.2-p290 :005 > ContentType::WikiContent <=> ContentType::Issue
<alagu> => nil
<shevy> I dont think that is how you compare methods
<shevy> I mean, classes
<shevy> alagu, did you look at this too? http://www.ruby-doc.org/core-1.9.3/Comparable.html
<alagu> should I be comparing the objects?
<shevy> I dont know what WikiContent and Issue are. It's easier to try with two very small test objects first
<alagu> shevy: true, let me try that out
<shevy> The important part is this: "The class must define the <=> operator, which compares the receiver against another object, returning -1, 0, or +1 depending on whether the receiver is less than, equal to, or greater than the other object."
<shevy> so you must make sure that your class returns -1 0 or +1
<shevy> in <=>
<alagu> got it
* alagu goes back to check his <=> again
<shevy> if you need an example for this, jump to part "if self.size < another_sock.size" on page http://www.skorks.com/2009/09/ruby-equality-and-object-comparison/
glosoli has joined #ruby
glosoli has joined #ruby
tvo has joined #ruby
tvo has joined #ruby
<shevy> "Also, notice that you automatically get the == method by defining the spaceship, so you don't need to provide separate equality behavior for your object any more."
pu22l3r has joined #ruby
pu22l3r has joined #ruby
TaTonka has joined #ruby
TaTonka has joined #ruby
<zaargy> rvm install 1.9.3 && rvm use 1.9.3 but Date.parse not parse method found despite http://ruby-doc.org/stdlib-1.9.3/libdoc/date/rdoc/Date.html#method-c-parse?
<zaargy> what am i doing wrong? :(
<arturaz> puts RUBY_VERSION
<arturaz> are you sure you're using right ruby?
<zaargy> 1.9.3p125 :001 > puts RUBY_VERSION
<zaargy> 1.9.3 => nil
<zaargy> yes
<arturaz> require 'date'
<zaargy> lol
<zaargy> good point
the_hack has joined #ruby
the_hack has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
d3vic3 has joined #ruby
d3vic3 has joined #ruby
replore_ has joined #ruby
replore_ has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
trivol has joined #ruby
trivol has joined #ruby
apeiros_ has joined #ruby
apeiros_ has joined #ruby
adambeynon has joined #ruby
adambeynon has joined #ruby
Sliker has joined #ruby
Sliker has joined #ruby
randym has joined #ruby
randym has joined #ruby
ephemerian has joined #ruby
ephemerian has joined #ruby
ephemerian1 has joined #ruby
ephemerian1 has joined #ruby
Aaaarg_ has joined #ruby
Aaaarg_ has joined #ruby
BiHi has joined #ruby
BiHi has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
johndbritton has joined #ruby
johndbritton has joined #ruby
<alagu> shevy: it does work correctly - https://gist.github.com/1939374
<alagu> Fixing my implementation now
TaTonka has joined #ruby
TaTonka has joined #ruby
<shevy> cool
Morkel has joined #ruby
Morkel has joined #ruby
timonv has joined #ruby
timonv has joined #ruby
pdelgallego has joined #ruby
pdelgallego has joined #ruby
<bgupta> anyone familiar with thor?
<bgupta> Trying to figure out if it supports "subtasks"
Bartzy has joined #ruby
Bartzy has joined #ruby
TaTonka has joined #ruby
TaTonka has joined #ruby
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
pu22l3r has joined #ruby
pu22l3r has joined #ruby
stenno has joined #ruby
stenno has joined #ruby
ickmund has joined #ruby
ickmund has joined #ruby
shtirlic has joined #ruby
shtirlic has joined #ruby
workmad3 has joined #ruby
workmad3 has joined #ruby
TaTonka has joined #ruby
TaTonka has joined #ruby
Helius has joined #ruby
Helius has joined #ruby
briankbuckley has joined #ruby
briankbuckley has joined #ruby
tayy has joined #ruby
tayy has joined #ruby
jlebrech has joined #ruby
jlebrech has joined #ruby
mklappstuhl has joined #ruby
mklappstuhl has joined #ruby
etehtsea has joined #ruby
etehtsea has joined #ruby
pp01bit has joined #ruby
pp01bit has joined #ruby
chaitanya has joined #ruby
chaitanya has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
visof has joined #ruby
visof has joined #ruby
visof has joined #ruby
visof has joined #ruby
dazoakley has joined #ruby
dazoakley has joined #ruby
<ccapndave> Dunno if anyone uses RubyMine or IntelliJ, but if so does anyone know how to get the debugger to kick in when an exception happens instead of only on breakpoints? (This might actually be a more general ruby-debug question for all I know...)
hagabaka has joined #ruby
hagabaka has joined #ruby
<banisterfiend> ccapndave: pry can do that (for ruby exceptions anyway) not sure about ruby-debug
<ccapndave> banisterfiend I'll check it out
sawjig has joined #ruby
sawjig has joined #ruby
<banisterfiend> ccapndave: on 1.9.2+ only though
<ccapndave> banisterfiend I am on 1.9.3 so that's cool
<hagabaka> banisterfiend: http://pastie.org/3486991
<ccapndave> Thanks!
<banisterfiend> hagabaka: use `binding.pry` not just `pry`
<hagabaka> oh
<drizz> what's the AT&T syntax for jmp dword ptr ds:[pFunc]?
<drizz> x86
<visof> hello
M- has joined #ruby
M- has joined #ruby
<visof> is possible to write assembler using ruby?
sacarlson has joined #ruby
sacarlson has joined #ruby
jwmann1 has joined #ruby
jwmann1 has joined #ruby
<drizz> ¯\(°_o)/¯
<Afal> visof: wilson?
francisfish has joined #ruby
francisfish has joined #ruby
<visof> Afal, what ?
<visof> Afal, oh wow thanks
<visof> where can i find the source code, github?
<Afal> should be on github
LMolr has joined #ruby
LMolr has joined #ruby
j3r0m3 has joined #ruby
j3r0m3 has joined #ruby
ginsun has joined #ruby
ginsun has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
<ginsun> Is it possible to do a recursion based on the input's type? I have a bracketed array and I need to recursively call a function on the leaves (the tree is represented as a nested/bracketed array of arrays). I know how I would do that in Haskell and OCaml but I'm not sure if this is the way one would have to implement it like that in Ruby
chaitanya has joined #ruby
chaitanya has joined #ruby
<stenno> ginsun, hmm thats a nice one
<stenno> you can test the class with obj.class?
<stenno> and then you could implement it just like in any other language, recursivly
<ginsun> stenno, oh ok, I'll do that then
<stenno> let me write up a quick example if you need it
<ginsun> stenno, I should be fine, thank you!
<stenno> kk :)
<stenno> ginsun, sorry, its obj.class and not obj.class?
<stenno> iirc the question mark indicates boolean return by convention
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
* apeiros_ wonders what a bracketed array is…
* apeiros_ wonders what other kinds of arrays exist
aers has joined #ruby
aers has joined #ruby
<stenno> well if they call it 'nested/bracketed' i assume a bracketed array is an array in an array :)
<stenno> so i herd u liek arrays...
<stenno> sorry
LMolr has joined #ruby
LMolr has joined #ruby
<stenno> one could extend the Array class or an instance with such method
<stenno> although i have to admit i am kinda scared of extending instances :/
<stenno> doesn't feel right :)
<apeiros_> stenno: ever wrote class methods?
<stenno> yes...
<ginsun> stenno, hahaha
<apeiros_> then you already did…
<ginsun> stenno, ("so I herd u liek arrays...")
<apeiros_> I hope you weren't too scared ;-p
<stenno> ooh i get it!
<stenno> right!
<stenno> had to think a bit >_>"
<apeiros_> ^^
<stenno> ruby is strange
<apeiros_> it's one of the cool things about ruby IMO
ph^ has joined #ruby
ph^ has joined #ruby
<apeiros_> the basic principles are very simple
<apeiros_> there are only instance methods.
iocor has joined #ruby
iocor has joined #ruby
<apeiros_> only modules can hold methods.
<apeiros_> that's it :)
<apeiros_> (ok, +inheritance, +weird class variables, +someotheroddstuff)
<stenno> there are not even public attributes in ruby. right?
<stenno> all these are public instance methods which return the private attribute
<apeiros_> there are no attributes
<apeiros_> attr_* define methods
<stenno> yes
<stenno> and whats with @foo ?
<apeiros_> there is public/protected/private - but that's mostly to be considered "an advice"
<apeiros_> those are instance variables
<stenno> aren't these private instance attributes?
<stenno> yeah
<apeiros_> you can only ever access ivars if you're in the right scope. no chance otherwise whatsoever
<apeiros_> attr_accessors -> method, instance_variable_get -> method, instance_eval -> method
<apeiros_> so the only two ways to read an ivar are: 1) be in the right scope 2) use a method (and 2 needs 1 to work)
h4y4shi has joined #ruby
h4y4shi has joined #ruby
emmanuelux has joined #ruby
emmanuelux has joined #ruby
* apeiros_ off for lunch
<stenno> so they are really only 'variables in a scope' and not even 'attributes' in that sense
<stenno> hehe good hunger
mdw_ has joined #ruby
mdw_ has joined #ruby
wvdschel has joined #ruby
wvdschel has joined #ruby
LMolr has joined #ruby
LMolr has joined #ruby
fearoffish has joined #ruby
fearoffish has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
MrGando has joined #ruby
MrGando has joined #ruby
alem0lars has joined #ruby
alem0lars has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
remink has joined #ruby
remink has joined #ruby
remink has joined #ruby
remink has joined #ruby
Vert has joined #ruby
Vert has joined #ruby
InBar has joined #ruby
InBar has joined #ruby
remink has joined #ruby
remink has joined #ruby
remink has joined #ruby
remink has joined #ruby
Jay_Levitt has joined #ruby
Jay_Levitt has joined #ruby
davidpk has joined #ruby
davidpk has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
Kingsy has joined #ruby
Kingsy has joined #ruby
roolo has joined #ruby
roolo has joined #ruby
pu22l3r has joined #ruby
pu22l3r has joined #ruby
Indian has joined #ruby
Indian has joined #ruby
<roolo> Say i have library working with remote xml. Now i am writing specs for the library and i want to have local testing xml file. Where should i put it?
<roolo> Into spec/support?
<Kingsy> I am attempting to learn ruby and I still don't understand what |var| means? what is the point in the || ?
<roolo> Kingsy: Its variable containing right now iterating item
<Kingsy> so for example --> Net::HTTP.start( 'www.ruby-lang.org', 80 ) do |http| <-- what is |http|? it could be either the string or the int
<stenno> Kingsy, http is the thing returned by Net::HTTP.start
<roolo> Kingsy: I am no sure what start returns :)
<roolo> Kingsy: Look at this example http://ruby-doc.org/core-1.9.3/Array.html#method-i-each
<roolo> Kingsy: I think from the example it's pretty clear
<roolo> Kingsy: In what language were you programmin before?
<stenno> to be exact, the start function takes 3 parameters: the url, the port, and a block which is executed in the start function
<stenno> and in the start function the http parameter is passed to the block
<stenno> and the block gets executed (yielded)
tshirtman has quit [#ruby]
tshirtman has quit [#ruby]
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
<stenno> if you would not specify a block, it should just return the http object
fixl has joined #ruby
fixl has joined #ruby
<Kingsy> stenno: thanks that makes sense
<Kingsy> roolo: cheers
mklappst_ has joined #ruby
mklappst_ has joined #ruby
shruggar1 has joined #ruby
shruggar1 has joined #ruby
xnm has joined #ruby
xnm has joined #ruby
tayy has joined #ruby
tayy has joined #ruby
TheShrew has joined #ruby
TheShrew has joined #ruby
mrake has joined #ruby
mrake has joined #ruby
fixl has joined #ruby
fixl has joined #ruby
johndbritton has joined #ruby
johndbritton has joined #ruby
zaydana has joined #ruby
zaydana has joined #ruby
_pdelgallego has joined #ruby
_pdelgallego has joined #ruby
emocakes has joined #ruby
emocakes has joined #ruby
Sliker has joined #ruby
Sliker has joined #ruby
thecreators has joined #ruby
thecreators has joined #ruby
rohit has joined #ruby
rohit has joined #ruby
wefawa has quit [#ruby]
wefawa has quit [#ruby]
_srp has joined #ruby
_srp has joined #ruby
<alagu> In ruby, how do i create a custom ~/.myapprc file and read values from it?
xkws49er has joined #ruby
xkws49er has joined #ruby
emmanuelux has joined #ruby
emmanuelux has joined #ruby
<Mon_Ouie> File.open(File.join(Dir.home, ".myapprc"))
Rishi_ has joined #ruby
Rishi_ has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
mklappstuhl has joined #ruby
mklappstuhl has joined #ruby
gianlucadv has joined #ruby
gianlucadv has joined #ruby
mfridh has joined #ruby
mfridh has joined #ruby
jeffmess has joined #ruby
jeffmess has joined #ruby
<jeffmess> anyone here use rubyamqp?
sawjig has joined #ruby
sawjig has joined #ruby
eka has joined #ruby
eka has joined #ruby
Azure has joined #ruby
Azure has joined #ruby
KJF has joined #ruby
KJF has joined #ruby
x0F__ has joined #ruby
x0F__ has joined #ruby
<shevy> alagu create?
alem0lars has joined #ruby
alem0lars has joined #ruby
gianlucadv has joined #ruby
gianlucadv has joined #ruby
pu22l3r_ has joined #ruby
pu22l3r_ has joined #ruby
thone has joined #ruby
thone has joined #ruby
jquorning has joined #ruby
jquorning has joined #ruby
<alagu> Mon_Ouie: , shevy thanks!
fr0gprince_mac has joined #ruby
fr0gprince_mac has joined #ruby
<jquorning> Anyone know why I can't WIN32OLE.new('ADODB.Connection') under CygWin ruby ?
Husel has joined #ruby
Husel has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
a_meba has joined #ruby
a_meba has joined #ruby
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
the_hack has joined #ruby
the_hack has joined #ruby
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
philcrissman has joined #ruby
philcrissman has joined #ruby
solars has joined #ruby
solars has joined #ruby
<solars> question: if I use CGI.escape for url encoding, and unescape to decode, I get a ' ' for a former '+' - if I use an online tool to do the same it is working - what did I miss here?
xkws49er has joined #ruby
xkws49er has joined #ruby
tk_ has joined #ruby
tk_ has joined #ruby
d34th4ck3r has joined #ruby
d34th4ck3r has joined #ruby
alesguzik has joined #ruby
alesguzik has joined #ruby
<looopy> hmm is this in a terminal? or a graphics library? https://vimeo.com/37406843
<looopy> game of life example
<solars> hmm seems its URI.escape vs CGI.escape
Progster has joined #ruby
Progster has joined #ruby
tvw has joined #ruby
tvw has joined #ruby
<cout> yay ruby finally built
<ex0a> what do i need to require for mkdir_p to work? i tried require 'fileutils' but that didn't help.. still receiving undefined method `mkdir_p'
neurodrone has joined #ruby
neurodrone has joined #ruby
TaTonka_ has joined #ruby
TaTonka_ has joined #ruby
<nw> are you doing FileUtils.mkdir_p('path/to/dir') ?
<ex0a> i wasn't specifying the FileUtils. part
<nw> okay, you need to
Jackneill has joined #ruby
Jackneill has joined #ruby
<ex0a> okay
<ex0a> ty let me try that
_pdelgallego has joined #ruby
_pdelgallego has joined #ruby
<ex0a> that did it
si14 has joined #ruby
si14 has joined #ruby
<ex0a> tyvm
<nw> np
archaic has joined #ruby
archaic has joined #ruby
nari has joined #ruby
nari has joined #ruby
Ferdev has joined #ruby
Ferdev has joined #ruby
srp_ has joined #ruby
srp_ has joined #ruby
JonnieCache has joined #ruby
JonnieCache has joined #ruby
DamienDeVille has joined #ruby
DamienDeVille has joined #ruby
Indian has quit [#ruby]
Indian has quit [#ruby]
BiHi has joined #ruby
BiHi has joined #ruby
lkba has joined #ruby
lkba has joined #ruby
coreydaley has joined #ruby
coreydaley has joined #ruby
nanderoo has joined #ruby
nanderoo has joined #ruby
shtirlic has joined #ruby
shtirlic has joined #ruby
QaDeS has joined #ruby
QaDeS has joined #ruby
jeffmess has joined #ruby
jeffmess has joined #ruby
mfridh has joined #ruby
mfridh has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
pen has joined #ruby
pen has joined #ruby
`brendan has joined #ruby
`brendan has joined #ruby
<`brendan> morning folks
alagu has joined #ruby
alagu has joined #ruby
alagu has joined #ruby
alagu has joined #ruby
alagu has quit [#ruby]
alagu has quit [#ruby]
zackattack has joined #ruby
zackattack has joined #ruby
baniseterfiend` has joined #ruby
baniseterfiend` has joined #ruby
lorandi has joined #ruby
lorandi has joined #ruby
<medik> morning
ryannielson has joined #ruby
ryannielson has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
mikeycgto has joined #ruby
mikeycgto has joined #ruby
Richmond has joined #ruby
Richmond has joined #ruby
<cout> banisterfiend: I get different errors than you (undefined symbol rb_eNameError)
<cout> banisterfiend: so I made a change to the script, and now I get another different error (undefined symbol rb_str_new)
<banisterfiend> cout: sounds like it's not seeing the symbols defined in the ruby lib
<banisterfiend> well, clearly :)
jxpx777 has joined #ruby
jxpx777 has joined #ruby
<cout> banisterfiend: http://pastebin.com/4GThGhBS
fayimora has joined #ruby
fayimora has joined #ruby
<cout> IMO this is an improvement even if it still gives warnings
jxpx777_ has joined #ruby
jxpx777_ has joined #ruby
al3xnull has joined #ruby
al3xnull has joined #ruby
<cout> it's closer to what Rice does, which took me weeks to iron out
red13 has joined #ruby
red13 has joined #ruby
<banisterfiend> cout: thanks
<banisterfiend> cout: it seems like all your errors are from the rb_name_error() shim, what if you just got rid of that and stick with rb_raise?
Vert has joined #ruby
Vert has joined #ruby
bluOxigen has joined #ruby
bluOxigen has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
_obiJuan has joined #ruby
_obiJuan has joined #ruby
wyhaines has joined #ruby
wyhaines has joined #ruby
bogwonch has joined #ruby
bogwonch has joined #ruby
bogwonch has quit ["WeeChat 0.3.6"]
bogwonch has quit ["WeeChat 0.3.6"]
jrist has joined #ruby
jrist has joined #ruby
yalue has joined #ruby
yalue has joined #ruby
philips has joined #ruby
philips has joined #ruby
sbanwart_ has joined #ruby
sbanwart_ has joined #ruby
iamjarvo has joined #ruby
iamjarvo has joined #ruby
Talvino has joined #ruby
Talvino has joined #ruby
randym has joined #ruby
randym has joined #ruby
nari has joined #ruby
nari has joined #ruby
cout has joined #ruby
cout has joined #ruby
j3r0m3 has joined #ruby
j3r0m3 has joined #ruby
<cout> banisterfiend: what was the question again?
<shevy> lol
<shevy> priceless :)
td123 has joined #ruby
td123 has joined #ruby
Spockz` has joined #ruby
Spockz` has joined #ruby
runeb has joined #ruby
runeb has joined #ruby
<banisterfiend> cout: it seems like all your errors are from the rb_name_error() shim, what if you just got rid of that and stick with rb_raise?
<cout> banisterfiend: since you redefine rb_raise, calling it is tricky
<cout> I can't remember how to do it
<cout> (but I've done it before)
<banisterfiend> a previous commit did that
<banisterfiend> but i got rid of it (keeping around the old version)
<cout> oh, it's rb_str_new that's the problem, not rb_str_new2
xnm has joined #ruby
xnm has joined #ruby
<cout> I bet that means the warning is coming from somewhere else
looopy has joined #ruby
looopy has joined #ruby
csherin has joined #ruby
csherin has joined #ruby
LBRapid has joined #ruby
LBRapid has joined #ruby
<cout> banisterfiend: I think I've done that a different way in the past
<cout> anyway, as I said, it won't help, because the shim doesn't reference the symbol that the warning is about
geekbri has joined #ruby
geekbri has joined #ruby
the_hack has joined #ruby
the_hack has joined #ruby
hSATAC has joined #ruby
hSATAC has joined #ruby
<banisterfiend> yeah
<banisterfiend> cout: btw when i test it i normally do this: pry --c-exceptions then wen in ptry i type: 1/0 and then enter-exception
manojhans has joined #ruby
manojhans has joined #ruby
TaTonka has joined #ruby
TaTonka has joined #ruby
<banisterfiend> if it successfully hooked rb_raise it'll let me enter the context of the 1/0 exception with 'enter-exception' command
<cout> banisterfiend: Error: Current exception can't be entered! (perhaps a C exception)
<cout> but it doesn't give me any other helpful details
Promethe1s has joined #ruby
Promethe1s has joined #ruby
<banisterfiend> hmm,i get this
S2kx has joined #ruby
S2kx has joined #ruby
davidpk has joined #ruby
davidpk has joined #ruby
<cout> banisterfiend: pry needs a --verbose option so I can figure out what it's doing :)
havenn has joined #ruby
havenn has joined #ruby
bglusman has joined #ruby
bglusman has joined #ruby
<banisterfiend> cout: did u remember to add --c-exceptions option? i guess u added it :) hmm
xnm has joined #ruby
xnm has joined #ruby
<cout> banisterfiend: yes
<cout> but if I remove my hand-built shim and let pry build it, then it still doesn't work
hukl_ has joined #ruby
hukl_ has joined #ruby
<banisterfiend> cout: it doesnt work cos it errors out or it compiles but just doesnt work?
<cout> no errors
<banisterfiend> i guess it just doesnt work based on what u said before, yeah
<cout> it just doesn't do what you tell me it should do
bsdbandit has joined #ruby
bsdbandit has joined #ruby
hukl- has joined #ruby
hukl- has joined #ruby
<banisterfiend> cout: when in pry, type show-method raise
j0bk has joined #ruby
j0bk has joined #ruby
<cout> running ubuntu 10.04 with a fresh build 1.9.2p290
<bsdbandit> morning all
TaTonka has joined #ruby
TaTonka has joined #ruby
<bsdbandit> im a python coder but looking to learn ruby to develop my websites
<cout> banisterfiend: what's that supposed to tell me?
<j0bk> Hello, anyone knows how I can serialize data with ruby and sqlite3?
havenn has joined #ruby
havenn has joined #ruby
<banisterfiend> cout: that it's not a problem with the ruby code it's strictly a problem with the shim (in case u had doubts)
Sailias|work has joined #ruby
Sailias|work has joined #ruby
dv310p3r has joined #ruby
dv310p3r has joined #ruby
chaitanya has joined #ruby
chaitanya has joined #ruby
gener1c has joined #ruby
gener1c has joined #ruby
gener1c has joined #ruby
gener1c has joined #ruby
<cout> banisterfiend: I have no idea where the problem is; I just know it's not a result of the changes I made
<gener1c> is there a built in way to html escape a string?
<gener1c> uri escape maybe would be a better choice of words
<gener1c> like < > and : and ;
<banisterfiend> cout: yeah, i know it's not, it's likely a basic misunderstand i have about the way shims / LD_PRELOAD / the details of this kind of dynamic linking works
<gener1c> i want to make em their equivalent html code...
<banisterfiend> misunderstanding*
<cout> gener1c: require 'cgi'; p CGI.escape('<foo>bar</foo>')
<cout> banisterfiend: well I'd love to help debug it, but I need to pack for my big race this weekend
<gener1c> thanks
sawjig has joined #ruby
sawjig has joined #ruby
<cout> banisterfiend: (hoping our car can place in the top third this time)
<v0n> hi
<banisterfiend> cout: np thanks a lot for taking a look at it
cantbecool has joined #ruby
cantbecool has joined #ruby
<banisterfiend> cout: goodluck! :)
cantbecool has quit [#ruby]
cantbecool has quit [#ruby]
<cout> thanks :)
<cout> I'll be afk and back all day
<v0n> is there a good doc to write a generic Rake task? I mean something to require, which automatically add a new task to the Rakefile
denom has joined #ruby
denom has joined #ruby
wallerdev has joined #ruby
wallerdev has joined #ruby
dotemacs has joined #ruby
dotemacs has joined #ruby
KL-7 has joined #ruby
KL-7 has joined #ruby
manojhans has joined #ruby
manojhans has joined #ruby
xkws49er has joined #ruby
xkws49er has joined #ruby
vraa has joined #ruby
vraa has joined #ruby
<j0bk> I got it
waxjar has joined #ruby
waxjar has joined #ruby
<j0bk> Marshal.dump(something) and Marshal.load(something) for serializing
kpshek has joined #ruby
kpshek has joined #ruby
randym_ has joined #ruby
randym_ has joined #ruby
<cout> j0bk: not particularly useful if you want to be able to run queries on your data :(
bwlang has joined #ruby
bwlang has joined #ruby
ascarter has joined #ruby
ascarter has joined #ruby
<j0bk> cout, you're right :'(
hasrb has joined #ruby
hasrb has joined #ruby
cantbecool_ has joined #ruby
cantbecool_ has joined #ruby
tomzx has joined #ruby
tomzx has joined #ruby
iocor has joined #ruby
iocor has joined #ruby
Sailias|work has joined #ruby
Sailias|work has joined #ruby
carlyle has joined #ruby
carlyle has joined #ruby
blischalk has joined #ruby
blischalk has joined #ruby
djbpython has joined #ruby
djbpython has joined #ruby
cantbecool_ has quit [#ruby]
cantbecool_ has quit [#ruby]
zunpre has joined #ruby
zunpre has joined #ruby
bwlang_ has joined #ruby
bwlang_ has joined #ruby
phantasm66 has joined #ruby
phantasm66 has joined #ruby
pp01bit has joined #ruby
pp01bit has joined #ruby
ascarter has joined #ruby
ascarter has joined #ruby
pdtpatr1ck has joined #ruby
pdtpatr1ck has joined #ruby
NotMyself has joined #ruby
NotMyself has joined #ruby
cunpre has joined #ruby
cunpre has joined #ruby
fbernier has joined #ruby
fbernier has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
<ex0a> i'm having a lot of trouble figuring out how to use hpricot to get what i want from a url: http://ex0a.privatepaste.com/e2a4b1cb43
havenn has joined #ruby
havenn has joined #ruby
<ex0a> i've narrowed it down to <category ... /> but i can't figure out how to pull the info from label="" from within it
bwlang_ has joined #ruby
bwlang_ has joined #ruby
akiress has joined #ruby
akiress has joined #ruby
akiress has joined #ruby
akiress has joined #ruby
<j0bk> ex0a raise doc.search("//category[@scheme='http://gdata.youtube.com/schemas/2007/categories.cat']").inspect
porco has joined #ruby
porco has joined #ruby
<j0bk> What kind of data is it?
<j0bk> I think you can use doc.search("//category[@scheme='http://gdata.youtube.com/schemas/2007/categories.cat']").attributes
steg132 has joined #ruby
steg132 has joined #ruby
iocor has joined #ruby
iocor has joined #ruby
<ex0a> okay
<ex0a> what you gave me first threw: #<Hpricot::Elements[{emptyelem <category scheme="http://gdata.youtube.com/schemas/2007/categories.cat" term="Music" label="Music">}]>
crankycoder has joined #ruby
crankycoder has joined #ruby
<ex0a> undefined method `attributes'
<ex0a> i've been reading https://github.com/hpricot/hpricot over and over and i can't see any examples on there that do exactly what i need
<cout> I had trouble with hpricot documentation too :(
<ex0a> well, not exactly, but close to
<ex0a> that's my only gripe so far since playing with ruby is the lack of documentation on so many things
jgarvey has joined #ruby
jgarvey has joined #ruby
Prometheus has joined #ruby
Prometheus has joined #ruby
<j0bk> I got it
<j0bk> ex0a, you can do this doc.search("//category[@scheme='http://gdata.youtube.com/schemas/2007/categories.cat']").map{|e| e.attributes["label"]}
wroathe has joined #ruby
wroathe has joined #ruby
<ex0a> awesome
kevinbond has joined #ruby
kevinbond has joined #ruby
<ex0a> ty gonna go test it real quick
<j0bk> :)
mkscrg has joined #ruby
mkscrg has joined #ruby
<ex0a> nice ty j0bk
Jay_Levitt has joined #ruby
Jay_Levitt has joined #ruby
the_hack has joined #ruby
the_hack has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
axl_ has joined #ruby
axl_ has joined #ruby
Seisatsu has joined #ruby
Seisatsu has joined #ruby
n3m has joined #ruby
n3m has joined #ruby
idletom has joined #ruby
idletom has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
josemota has joined #ruby
josemota has joined #ruby
bobbyc has joined #ruby
bobbyc has joined #ruby
adman65 has joined #ruby
adman65 has joined #ruby
anotherkeebler has joined #ruby
anotherkeebler has joined #ruby
<j0bk> ex0a, you're welcome ;)
nixmaniack has joined #ruby
nixmaniack has joined #ruby
bwlang_ has joined #ruby
bwlang_ has joined #ruby
mgraham has joined #ruby
mgraham has joined #ruby
<cout> ex0a: that's true for most of the open source world
<cout> ex0a: documentation isn't very fun or glamorous :(
<cout> but ruby's community does documentation better than most
fayimora has joined #ruby
fayimora has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
<ex0a> :]
audy has joined #ruby
audy has joined #ruby
macmartine has joined #ruby
macmartine has joined #ruby
csexton has joined #ruby
csexton has joined #ruby
bwlang_ has joined #ruby
bwlang_ has joined #ruby
v0yager has joined #ruby
v0yager has joined #ruby
Synthead has joined #ruby
Synthead has joined #ruby
snip_it has joined #ruby
snip_it has joined #ruby
kevinbond has joined #ruby
kevinbond has joined #ruby
dhruvasagar has joined #ruby
dhruvasagar has joined #ruby
minijupe has joined #ruby
minijupe has joined #ruby
jesly has joined #ruby
jesly has joined #ruby
bluOxigen has joined #ruby
bluOxigen has joined #ruby
wmoxam has joined #ruby
wmoxam has joined #ruby
mikepack has joined #ruby
mikepack has joined #ruby
bluOxigen has joined #ruby
bluOxigen has joined #ruby
sohocoke has joined #ruby
sohocoke has joined #ruby
albemuth has joined #ruby
albemuth has joined #ruby
flak has joined #ruby
flak has joined #ruby
TaTonka has joined #ruby
TaTonka has joined #ruby
Whizzy has joined #ruby
Whizzy has joined #ruby
<ekaleido> if i ran a binary that output values to my screen every second, what class/method would i need to capture it for processing?
DuoSRX has joined #ruby
DuoSRX has joined #ruby
Whizzy has quit [#ruby]
Whizzy has quit [#ruby]
<ekaleido> this being an example of the output
<ekaleido> 15:57:56 0.41 2.84 0.00 0.00 0.41 2.84
<ekaleido> 15:57:57 0.40 1.41 0.00 0.00 0.40 1.41
<ekaleido> or is it better to have that output redirected to a file and just read from there?
skitrees has joined #ruby
skitrees has joined #ruby
stupid_one has joined #ruby
stupid_one has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
apok has joined #ruby
apok has joined #ruby
alex__c2022 has joined #ruby
alex__c2022 has joined #ruby
stupid_one has quit [#ruby]
stupid_one has quit [#ruby]
Enquirery_minded has joined #ruby
Enquirery_minded has joined #ruby
<mikepack> What's the best Ruby JSON parser?
undersc0re has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
CheeToS has joined #ruby
CheeToS has joined #ruby
andrewhl has joined #ruby
andrewhl has joined #ruby
<JonnieCache> the built in one is probably fine though unless you need to parse megabytes of json per second for some reason
<mikepack> JonnieCache: That's "built in"?
<JonnieCache> no thats not built in
bwlang has joined #ruby
bwlang has joined #ruby
<JonnieCache> but ruby stdlib does include a json parser as of ruby 1.9 i think
sbanwart has joined #ruby
sbanwart has joined #ruby
paniclater has joined #ruby
paniclater has joined #ruby
<apeiros_> JonnieCache: disagree
lucaspiller has joined #ruby
lucaspiller has joined #ruby
<mikepack> JonnieCache: Hm, not sure which library that is
<apeiros_> depending on the context, a couple of KB can be sufficient to make the built-in a bad choice
ckrailo has joined #ruby
ckrailo has joined #ruby
<mikepack> JonnieCache: I might use the ActiveRecord JSON parser but I've heard it's not performant
punkrawkR has joined #ruby
punkrawkR has joined #ruby
seitensei has joined #ruby
seitensei has joined #ruby
<apeiros_> mikepack: it's activesupport, not activerecord. you can tell rails to use another one.
<JonnieCache> apeiros_: really? the stdlib one is a ragel parser apparently. is it that bad compared to yajl?
<mikepack> Whoops, yeah, that's what I mean :)
<apeiros_> JonnieCache: I thought they had used the pure ruby one?
ckrailo_ has joined #ruby
ckrailo_ has joined #ruby
<apeiros_> JonnieCache: hm, might be that it's just rails that uses the pure-ruby json parser
<JonnieCache> hmm well whenever i build ruby with rvm or rbenv it pulls in some C source for a json parser and builds it
eldariof has joined #ruby
eldariof has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
<JonnieCache> that implies theyre not using the pure one
<JonnieCache> but either way if you need fast stream parsing yajl is just a command line away, and it can override the JSON object to seamlessly replace the original api
<JonnieCache> so no problems :)
<apeiros_> mikepack: ActiveSupport::JSON.backend = 'json_gem' # that's what I use
<mikepack> apeiros_: Thanks
<apeiros_> afaik is the json_gem still the fastest, even if only academically faster than yajl
Jan_ has joined #ruby
Jan_ has joined #ruby
Amorsen has joined #ruby
Amorsen has joined #ruby
<JonnieCache> json.org is the best. there should be more state diagrams like that in programming documentation
chaitanya has joined #ruby
chaitanya has joined #ruby
LMolr has joined #ruby
LMolr has joined #ruby
<apeiros_> JonnieCache: true. I like the ones in the sqlite docs
savage- has joined #ruby
savage- has joined #ruby
td123 has joined #ruby
td123 has joined #ruby
looopy has joined #ruby
looopy has joined #ruby
<Kingsy> guys, I am following a tutor and I am a little confused about this statement --> kitty_toys.sort_by { |toy| toy[:shape] }.each do |toy| <-- isnt kitty_toys.sort_by.each do |toy| the same thing? why do you have to use the {block} ? the contents of that do nothing
g0bl1n has joined #ruby
g0bl1n has joined #ruby
g0bl1n has joined #ruby
g0bl1n has joined #ruby
<JonnieCache> you have to tell it what to sort by
_nyuszika7h_ has joined #ruby
_nyuszika7h_ has joined #ruby
cjs226 has joined #ruby
cjs226 has joined #ruby
Silker has joined #ruby
Silker has joined #ruby
munx has joined #ruby
munx has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
jergason has joined #ruby
jergason has joined #ruby
Targen has joined #ruby
Targen has joined #ruby
Enquirery_minded has joined #ruby
Enquirery_minded has joined #ruby
Enquirery_minded has quit [#ruby]
Enquirery_minded has quit [#ruby]
lkba has joined #ruby
lkba has joined #ruby
briankbuckley has joined #ruby
briankbuckley has joined #ruby
Drewch has joined #ruby
Drewch has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
nyuszika7h has joined #ruby
nyuszika7h has joined #ruby
jergason has joined #ruby
jergason has joined #ruby
eywu has joined #ruby
eywu has joined #ruby
TheShrew has joined #ruby
TheShrew has joined #ruby
twqla has joined #ruby
twqla has joined #ruby
choffstein has joined #ruby
choffstein has joined #ruby
notjohn has joined #ruby
notjohn has joined #ruby
danishkhan has joined #ruby
danishkhan has joined #ruby
nachtwandler has joined #ruby
nachtwandler has joined #ruby
Willejs has joined #ruby
Willejs has joined #ruby
axl_ has joined #ruby
axl_ has joined #ruby
<Willejs> hi, is anyone familiar with nokogiri? I'm not sure how to deal with tags with prefixes like so <news:Snippet>
Prometheus has joined #ruby
Prometheus has joined #ruby
ginsun has joined #ruby
ginsun has joined #ruby
adman65 has joined #ruby
adman65 has joined #ruby
artOfWar has joined #ruby
artOfWar has joined #ruby
bwlang_ has joined #ruby
bwlang_ has joined #ruby
havenn has joined #ruby
havenn has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
jeffmess has joined #ruby
jeffmess has joined #ruby
phragg has joined #ruby
phragg has joined #ruby
maletor has joined #ruby
maletor has joined #ruby
vandemar has joined #ruby
vandemar has joined #ruby
<phragg> when running 'rails generate model tag name:string post:references' i misspelled references and now my rake db:migrate keeps aborting, what should I do?
looopy has joined #ruby
looopy has joined #ruby
Jonah11_ has joined #ruby
Jonah11_ has joined #ruby
artOfWar has joined #ruby
artOfWar has joined #ruby
<TTilus> just delete files the generator created and generate again
MasterIdler_ has joined #ruby
MasterIdler_ has joined #ruby
ap0gee has joined #ruby
ap0gee has joined #ruby
<JonnieCache> better than that just edit the migration manually
<phragg> ah, thanks a bunch
artOfWar_ has joined #ruby
artOfWar_ has joined #ruby
<JonnieCache> you shouldnt rely on the generators like that, learn to use the syntax yourself
<JonnieCache> its not complicated, the generators are just there for convenience
<robacarp> ^^
nyuszika7h has joined #ruby
nyuszika7h has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
blueadept has joined #ruby
perturbedpanda has joined #ruby
perturbedpanda has joined #ruby
Araxia has joined #ruby
Araxia has joined #ruby
pdtpatr1ck has joined #ruby
pdtpatr1ck has joined #ruby
mmokrysz has joined #ruby
mmokrysz has joined #ruby
mmokrysz has quit [#ruby]
mmokrysz has quit [#ruby]
davidpk has joined #ruby
davidpk has joined #ruby
cloke has joined #ruby
cloke has joined #ruby
bglusman has joined #ruby
bglusman has joined #ruby
savage- has joined #ruby
savage- has joined #ruby
cloke has joined #ruby
cloke has joined #ruby
nemesit has joined #ruby
nemesit has joined #ruby
snearch has joined #ruby
snearch has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
boonedocks has joined #ruby
boonedocks has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
jergason has joined #ruby
jergason has joined #ruby
_obiJuan has joined #ruby
_obiJuan has joined #ruby
SegFaultAX|work has joined #ruby
SegFaultAX|work has joined #ruby
virunga has joined #ruby
virunga has joined #ruby
pocitadlo has joined #ruby
pocitadlo has joined #ruby
<shevy> oh man
<shevy> I should have never tried to rewrite 80 .rb files
<JonnieCache> lol what do you mean when you say rewrite
<shevy> JonnieCache I tried to change a few core classes that were too big
<shevy> but a change at the bottom of this pyramid, requires some other changes in the middle part of it
MrGando has joined #ruby
MrGando has joined #ruby
<shevy> and it is not as straightforward as I thought it would be
pocitadlo has quit [#ruby]
pocitadlo has quit [#ruby]
<shevy> and now... I am losing fun to continue :(
SeanLazer has joined #ruby
SeanLazer has joined #ruby
<MrGando> Hey guys, if I have an array of Objectes in ruby, how can I find an object whoose value equals to something in the Array ?
dazoakley has quit [#ruby]
dazoakley has quit [#ruby]
<JonnieCache> shevy: yeah its a bastard isnt it. i feel for ya
<SeanLazer> MrGrando: your_array.select { |i| i.value == "whatever" }
<JonnieCache> ill just DRY up this one class
<JonnieCache> 10 hours later none of your tests pass
<canton7> arrayofobj.find{ |element| array.include?(element) }
munx has joined #ruby
munx has joined #ruby
<JonnieCache> and youve smoked like 200 cigarettes and you need a new keyboard because youve smashed your old one
<SeanLazer> does anyone know how to use the memoize pattern if i'm using define_method with a dynamically named method?
<shevy> the what
Silowyi has joined #ruby
Silowyi has joined #ruby
<SeanLazer> def expensive; @expensive ||= do_expensive_thing; end;
<JonnieCache> ahh right
<SeanLazer> but you can't do instance_variable_set ||=
<JonnieCache> so the problem is the name of the @expensive variable is dynamic
<SeanLazer> JonnieCache: yeah
ipsifendus has joined #ruby
ipsifendus has joined #ruby
<SeanLazer> exactly
<JonnieCache> use some combination of instance_variable_get with an if statement to replicate ||=
<SeanLazer> ha, can't believe i didn't think of it
<SeanLazer> got so wrapped up in the style i didn't think about what it was actually doing
<SeanLazer> thanks :)
<JonnieCache> np
looopy has joined #ruby
looopy has joined #ruby
<shevy> I still didnt understand it :(
iocor has joined #ruby
iocor has joined #ruby
thecreators has joined #ruby
thecreators has joined #ruby
GiambalaGiambala has joined #ruby
GiambalaGiambala has joined #ruby
gianlucadv has joined #ruby
gianlucadv has joined #ruby
philcrissman has joined #ruby
philcrissman has joined #ruby
mdw has joined #ruby
mdw has joined #ruby
<JonnieCache> shevy: he is doing this: def expensive; @expensive ||= do_expensive_thing; end;
<JonnieCache> but rather than def its define_method and everything is dynamic
<JonnieCache> so "expensive" everywhere is replaced by some variable name
<robacarp> thats sounds overly meta
<shevy> hmmm
<shevy> I used to like magic but now it just confuses me
<JonnieCache> yeah it is kinda overly meta but every ruby developer has a god given right to do overly meta things in the privacy of their own home
ph^ has joined #ruby
ph^ has joined #ruby
ilyam has joined #ruby
ilyam has joined #ruby
<shevy> hehe
<JonnieCache> it amuses me that in ruby we are all careful not to be too overly meta, and then theres lisp
<JonnieCache> i wonder do lisp uberhackers tell each other off for going too far?
ph^ has joined #ruby
ph^ has joined #ruby
badabim has joined #ruby
badabim has joined #ruby
munx_ has joined #ruby
munx_ has joined #ruby
rramsden has joined #ruby
rramsden has joined #ruby
mikewintermute has joined #ruby
mikewintermute has joined #ruby
CannedCorn has joined #ruby
CannedCorn has joined #ruby
<CannedCorn> is it possible to make an ssl request using httparty?
<CannedCorn> sorry about the double
adeponte has joined #ruby
adeponte has joined #ruby
bwlang_ has joined #ruby
bwlang_ has joined #ruby
<robacarp> CannedCorn: well, I don't know about httparty but I do ssl requests frequently with Net::HTTP and OpenSSL:SSL
theRoUS has joined #ruby
theRoUS has joined #ruby
<CannedCorn> ok i need to post via ssl
DamienDeVille has joined #ruby
DamienDeVille has joined #ruby
<CannedCorn> using basic auth
<CannedCorn> and there is basically no documentation on Net::HTTP::Post
j3r0m3 has joined #ruby
j3r0m3 has joined #ruby
<robacarp> hmm
<robacarp> 1sec, I'll gist what I'm doing
codespectator has joined #ruby
codespectator has joined #ruby
tewecske has joined #ruby
tewecske has joined #ruby
<mikewintermute> Not sure what's going on with this regex - is it a problem with irb? http://pastebin.com/uxFdN28t
<robacarp> CannedCorn: https://gist.github.com/1942760
<CannedCorn> AH
<CannedCorn> thank you!
<robacarp> CannedCorn: I bet you can combine our approaches to get SSL and basic auth!
ginsun has quit ["Hasta la vista, baby."]
ginsun has quit ["Hasta la vista, baby."]
<robacarp> np!
<CannedCorn> what if i want to set headers though
<robacarp> of that I am unsure
<CannedCorn> i can just set them on request object
<CannedCorn> brilliant dude
<CannedCorn> thanks
<robacarp> :-D np, good luck
<CannedCorn> net/http documentation kind of sucks
adman65 has joined #ruby
adman65 has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
SegFaultAX|work has joined #ruby
SegFaultAX|work has joined #ruby
<Tasser> net/http kind of sucks
<robacarp> mikewintermute: what are you trying to accomplish with a regex?
<Tasser> CannedCorn, jruby? HttpClient is nice. otherwise curb
<CannedCorn> is the form data a hash?
<mikewintermute> robacarp: I'm just working my way through the Ruby Regex docs. The regex works in rubular but not irb. wondered why.
<CannedCorn> yeah true thanks Tasser
<Tasser> CannedCorn, depends.
QaDeS has joined #ruby
QaDeS has joined #ruby
<robacarp> well, mikewintermute, I suppose it could be an irb parsing issue, but write it into a .rb file and run it to see
<Tasser> CannedCorn, in crub probably, httpclient not. but there's a bunch of metadata there, so a hash would be a bit complicated
<robacarp> CannedCorn: the post *can* be a hash, or you can just set the request body to some text directly...I've had to do both
davidcelis has joined #ruby
davidcelis has joined #ruby
khem_ has quit [#ruby]
khem_ has quit [#ruby]
<MrGando> Hey guys, I'm trying to find an element in my array using array.find but I'm getting a wrong number of arguments error… could anyone help me a bit ? https://gist.github.com/2abeb525959416fc9ed1
<CannedCorn> wait so robacarp what is post when it comes in
<CannedCorn> thats a string right?
<robacarp> ummmm...I think so, lemme check
jeffmess has quit [#ruby]
jeffmess has quit [#ruby]
<robacarp> well, you get back a httprequest object, and .body has a string containing the data...but I don't think its considered POST data
<MrGando> CannedCorn yeah, email_string it's a string
bwlang_ has joined #ruby
bwlang_ has joined #ruby
apok has joined #ruby
apok has joined #ruby
cbuxton has joined #ruby
cbuxton has joined #ruby
ePirat has joined #ruby
ePirat has joined #ruby
khakimov has joined #ruby
khakimov has joined #ruby
<robacarp> MrGando: well, that gist isn't really helpful...how about some context? what is designers?
flak has joined #ruby
flak has joined #ruby
<MrGando> robacarp hey :), designers is an array of Designer objects, each designer object . I think I just solved the issue :)
DrShoggoth has joined #ruby
DrShoggoth has joined #ruby
<robacarp> care to share the solution ?
<shevy> hopefully
<shevy> designer objects scare me
briankbuckley has joined #ruby
briankbuckley has joined #ruby
Helius has joined #ruby
Helius has joined #ruby
banisterfiend has joined #ruby
banisterfiend has joined #ruby
d34th4ck3r has joined #ruby
d34th4ck3r has joined #ruby
ChampS666 has joined #ruby
ChampS666 has joined #ruby
ed_hz_ has joined #ruby
ed_hz_ has joined #ruby
<SeanLazer> I have a factory_girl question... I have some factories that look like this: https://gist.github.com/1942914
idletom has joined #ruby
idletom has joined #ruby
<SeanLazer> when I create a consumed_item factory it correctly has the consumable association built as well
<SeanLazer> however when i create a job it doesn't created the consumable on the consumed_items that it builds
bwlang_ has joined #ruby
bwlang_ has joined #ruby
snip_it_ has joined #ruby
snip_it_ has joined #ruby
t0mmyvyo has joined #ruby
t0mmyvyo has joined #ruby
badabim_ has joined #ruby
badabim_ has joined #ruby
adamkittelson has joined #ruby
adamkittelson has joined #ruby
kenichi has joined #ruby
kenichi has joined #ruby
nyuszika7h has joined #ruby
nyuszika7h has joined #ruby
shadoi has joined #ruby
shadoi has joined #ruby
choffstein has joined #ruby
choffstein has joined #ruby
Helius1 has joined #ruby
Helius1 has joined #ruby
virunga has joined #ruby
virunga has joined #ruby
Helius has joined #ruby
Helius has joined #ruby
Sailias|work has joined #ruby
Sailias|work has joined #ruby
Drewch has joined #ruby
Drewch has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
jergason has joined #ruby
jergason has joined #ruby
nfluxx has joined #ruby
nfluxx has joined #ruby
sacarlson has joined #ruby
sacarlson has joined #ruby
scalebyte has joined #ruby
scalebyte has joined #ruby
<scalebyte> how to give classes to label and input field and form in simple_form ?
Russell^^ has joined #ruby
Russell^^ has joined #ruby
sbanwart has joined #ruby
sbanwart has joined #ruby
CacheMoney has joined #ruby
CacheMoney has joined #ruby
bagratte has joined #ruby
bagratte has joined #ruby
<CannedCorn> im still struggling to make this request with net::http curl -i -u user:pass --data '{"value": "whatev"}' http://crowd.yeah.com/crowd/rest/usermanagement/1/authentication?username=me@whatever.com --header 'Content-Type: application/json' --header 'Accept: application/json'
theRoUS has joined #ruby
theRoUS has joined #ruby
hagabaka has joined #ruby
hagabaka has joined #ruby
hagabaka has joined #ruby
hagabaka has joined #ruby
porco has joined #ruby
porco has joined #ruby
macmartine has joined #ruby
macmartine has joined #ruby
SegFaultAX|work has joined #ruby
SegFaultAX|work has joined #ruby
codespectator has joined #ruby
codespectator has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
sungji has joined #ruby
sungji has joined #ruby
hadees has joined #ruby
hadees has joined #ruby
rippa has joined #ruby
rippa has joined #ruby
alex__c2022 has joined #ruby
alex__c2022 has joined #ruby
ikaros has joined #ruby
ikaros has joined #ruby
voodoofish430 has joined #ruby
voodoofish430 has joined #ruby
alex__c2022 has joined #ruby
alex__c2022 has joined #ruby
`damien has joined #ruby
`damien has joined #ruby
khakimov has joined #ruby
khakimov has joined #ruby
bobbyc has joined #ruby
bobbyc has joined #ruby
Vejuotas has joined #ruby
Vejuotas has joined #ruby
ph^ has joined #ruby
ph^ has joined #ruby
hukl has joined #ruby
hukl has joined #ruby
apok has joined #ruby
apok has joined #ruby
GiambalaGiambala has joined #ruby
GiambalaGiambala has joined #ruby
ascarter has joined #ruby
ascarter has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
Drewch has quit [#ruby]
Drewch has quit [#ruby]
Drewch has joined #ruby
Drewch has joined #ruby
kevinbond has joined #ruby
kevinbond has joined #ruby
ylluminate has joined #ruby
ylluminate has joined #ruby
v0n has joined #ruby
v0n has joined #ruby
<CannedCorn> which is better rest client or httparty
nuked has joined #ruby
nuked has joined #ruby
<stenno50> are these two even comparable?
<CannedCorn> yeah, why wouldn't they be
ryanf has joined #ruby
ryanf has joined #ruby
shruggar has joined #ruby
shruggar has joined #ruby
jlebrech has joined #ruby
jlebrech has joined #ruby
<stenno50> eh didn't know httparty was restful
Danielpk has joined #ruby
Danielpk has joined #ruby
the_hack_ has joined #ruby
the_hack_ has joined #ruby
the_hack_ has joined #ruby
the_hack_ has joined #ruby
ginsun has joined #ruby
ginsun has joined #ruby
luckyruby has joined #ruby
luckyruby has joined #ruby
Ferdev has joined #ruby
Ferdev has joined #ruby
artOfWar has joined #ruby
artOfWar has joined #ruby
looopy has joined #ruby
looopy has joined #ruby
tvo has joined #ruby
tvo has joined #ruby
BrenoPerucchi has joined #ruby
BrenoPerucchi has joined #ruby
chrisrhoden has joined #ruby
chrisrhoden has joined #ruby
shadoi has joined #ruby
shadoi has joined #ruby
robert_ has joined #ruby
robert_ has joined #ruby
solars has joined #ruby
solars has joined #ruby
snip_it_ has joined #ruby
snip_it_ has joined #ruby
n3m has joined #ruby
n3m has joined #ruby
glosoli has joined #ruby
glosoli has joined #ruby
apeiros_ has joined #ruby
apeiros_ has joined #ruby
csherin has joined #ruby
csherin has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
leoncamel has joined #ruby
leoncamel has joined #ruby
ilyam has joined #ruby
ilyam has joined #ruby
chrxn has joined #ruby
chrxn has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
td123 has joined #ruby
td123 has joined #ruby
<CacheMoney> I am building some classes to track Basketball stats. I want to build a relationship of Player has_many Shots. How do I create a new player and then attribute shots to him?
Adkron has joined #ruby
Adkron has joined #ruby
emocakes has joined #ruby
emocakes has joined #ruby
danishkhan has joined #ruby
danishkhan has joined #ruby
<CacheMoney> is has_many only a Rails method?
lorandi has joined #ruby
lorandi has joined #ruby
wookiehangover has joined #ruby
wookiehangover has joined #ruby
cantbecool has joined #ruby
cantbecool has joined #ruby
<Tasser> what would you use for textile generation?
<Tasser> moustache? :-)
hooper has joined #ruby
hooper has joined #ruby
philcrissman has joined #ruby
philcrissman has joined #ruby
ceej has joined #ruby
ceej has joined #ruby
BrenoPerucchi has joined #ruby
BrenoPerucchi has joined #ruby
apok has joined #ruby
apok has joined #ruby
spanner has joined #ruby
spanner has joined #ruby
archaic has quit [#ruby]
archaic has quit [#ruby]
_whitelogger1 has joined #ruby
tobym has joined #ruby
enherit has joined #ruby
Targen has joined #ruby
adamjleonard has joined #ruby
Helius has joined #ruby
d34th4ck3r has joined #ruby
stringoO has joined #ruby
havenn has joined #ruby
nobitanobi has joined #ruby
<nobitanobi> What's the best way to add key/value to an existing hash? is it my_hash[:key] = value ?
<stenno50> for example
<stenno50> a very direct, good approach :)
oposomme has joined #ruby
<davidcelis> nobitanobi: Yes.
<nobitanobi> ok, thanks guys
samxor has joined #ruby
Morkel has joined #ruby
michaelh has joined #ruby
shtirlic has joined #ruby
stephenjudkins has joined #ruby
sohocoke has joined #ruby
justinmcp has joined #ruby
<gate> nobitanobi: if you need to add many keys at the same time, you can do my_hash.merge! :key1 => value1, :key2 => value2
<nobitanobi> oh, that is beautiful. thanks
martman has joined #ruby
<martman> is there a easy way to get a name of a method? looks like objects can do something like self.name, but i dont see anything for methods
pdtpatr1ck_ has joined #ruby
<martman> (im passing them as arguments and would like to print their names)
geekbri_ has joined #ruby
jamw has joined #ruby
<deryl> are you meaning something like var.methods ?
<deryl> to see what methods are avail on a particular object?
<mikewintermute> any idea why this only returns the first word in the sentence? http://pastebin.com/cL6uXmYJ
<martman> deryl: nope, im writing something that will test a bunch of functions. if one fails i want to print out its name
hck89 has joined #ruby
<martman> def self.check(getFunc, setFunc, setVal, msg)
<Nowaker> hey. I got a question regarding a class structure in Ruby. Can you please take a look at it? http://pastie.org/3490667
snip_it has joined #ruby
philcrissman has joined #ruby
<Nowaker> mikewintermute: words = 'a b c'.split(' ').to_a
<Nowaker> => ["a", "b", "c"]
<Nowaker> is this split() that you wanted to use?
<Tasser> Nowaker, why the #to_A ?
<Nowaker> sorry, mistake, without to_a
<Nowaker> i was first messing around with mikewintermute's /regexp/.match().to_a
<Nowaker> Tasser: could you please take a look at this? http://pastie.org/3490667
<mikewintermute> Nowaker: split() would work but I'm trying to use a regex to help me understand it.
Sailias|work has joined #ruby
lucidstudios has joined #ruby
pantsman has joined #ruby
pantsman has joined #ruby
pantsman has quit [#ruby]
<martman> anyone know?
<stenno50> martman, i'd say not possible :)
tobago has joined #ruby
<Nowaker> martman: how should that work?
denom has joined #ruby
<martman> Nowaker: im guessing just like it does for classes
<martman> Nowaker with alittle preprocessor magic i could do this in c easily enough
<Nowaker> but I don't know what you want to achieve with this: def self.check(getFunc, setFunc, setVal, msg)
<Nowaker> what is it intended to do?
<SeanLazer> OO design question: I have a system where Estimates create jobs, and when those jobs are done they come back and create an invoice. When an invoice is created it has to combine information from the job and the estimate to be pre-populated. The behaviour to do this is fairly complicated, does it belong in the Invoice class or should I create a class whose sole responsibility is to create Invoices?
aaronpeterson has joined #ruby
<aaronpeterson> I have the ruby module active in netbeans 6.9.1 yet I have no erb mime type. Do I need something else?
<martman> Nowaker: it runs getFunc, calls setFunc with setVal, calls getFunc again, and compares the returns of the 2 getFuns
<martman> Nowaker so basic unit test
<martman> Nowaker i just want to print out the names of the functions when something fails
<martman> Nowaker so i dont need that msg arg
<shevy> SeanLazer, if the code stays small, it is easier to keep it in the Invoice class
tobago has joined #ruby
baroquebobcat has joined #ruby
jfelchner has joined #ruby
<mikewintermute> odd - so here we only get "a" in words -> words = /\w+/.match("a b c")
<SeanLazer> shevy: it has the potential to get pretty big... maybe i need to think about how i want this code to look
<mikewintermute> must be missing something obvious
nfarring has joined #ruby
<shevy> and what is "words"?
PragCypher has joined #ruby
eywu has joined #ruby
<shevy> ah
<shevy> I guess it is the ' '
<nfarring> What is the Ruby way to define a factory method?
adambeynon has joined #ruby
<shevy> mikewintermute, see: "a b c" =~ /(.+)/; $1 # => "a b c"
<shevy> I suppose \w stops at ' '
<nfarring> def FooMaker(stuff) should return Foo(other stuff)
<shevy> that looks terribly un-ruby
<nfarring> actually Foo.new(other stuff)
<martman> Nowaker that make any sense?
<mikewintermute> shevy: yeah - Perly
<shevy> I mean the def Foo thing for a method name if they are not class methods :)
shtirlic has joined #ruby
<nfarring> shevy, should I just use two different constructors?
<shevy> nfarring it all depends on your needs. if you need a method to instantiate a specific class, that's the way to go
<shevy> two different constructors? what is that?
<nfarring> Foo.new(arg1, arg2) is one constructor
pandora17 has joined #ruby
<nfarring> Foo.new(hash) is the other constructor
<shevy> ah, you want to call with different parameters?
<nfarring> shevy, yes
macmartine has joined #ruby
Willejs has joined #ruby
<shevy> that is quite easy
<nfarring> I know in other languages but not ruby
<shevy> nfarring http://pastie.org/3490802
<robert_> hmm, does anyone have any experience with Prawn?
daglees has joined #ruby
<shevy> robert_ I have! I tried it two weeks, I could not get it to install here, I kicked it away
Chaazd has joined #ruby
<robert_> aha. :D
<shevy> But I decided to start maintaining the old free rfpdf
lorandi has joined #ruby
<robert_> hm
<robert_> old free?
<shevy> but I have to finish my current rewrite first
<Chaazd> Is it possible to list all the directories in an amazon cloud directory?
<shevy> yeah
cpruitt has joined #ruby
<robert_> aha.
<shevy> it misses quite some features... but for easy pdf generating it is ok
<nfarring> shevy, thanks I will give it a try
<shevy> prawn has become like the BULLDOZER
<aaronpeterson> oh I did it. Didn't realize I needed the ruby and rails plugin.
sacarlson has joined #ruby
daglees has joined #ruby
havenn has joined #ruby
mdw has joined #ruby
aaronpeterson has quit [#ruby]
mikewintermute has joined #ruby
<Nowaker> martman: it's possible, without any problem
<Nowaker> martman: give me a second
<robert_> like, I can't figure out which end is "up" in the pdf documenjt
swarley has joined #ruby
<robert_> document*
PragCypher has joined #ruby
daglees has joined #ruby
<robert_> [ 0, 0 ] or [ document-height, document-width]
<robert_> lol
xnm has joined #ruby
<swarley> I'm looking to give a socket a certain ammount of time to connect or it no longer blocks, point me to a doc?
<robert_> shevy: If you maintain fpdf, you should add helpers to it.
<shevy> helpers?
<shevy> well, you will be able to report the issues to github then :)
Foxandxss has joined #ruby
kirun has joined #ruby
mrsolo has joined #ruby
<robert_> like, I generate PDFs with dashed borders
<shevy> I am finally making progress with the porting of the other project, very slowly but still
<shevy> ah
<robert_> i.e. "cut here"
<shevy> I see
<robert_> sections on the page
glosoli has joined #ruby
<CacheMoney> I know I'm doing this incorrectly because now that I want to add a Rebound class I won't be able to access the previous instance variables in the Shot class http://pastie.org/3490845 Any advice on how I should refactor my classes?
<Nowaker> martman: http://pastie.org/3490861 - something like this?
<robert_> I like prawn's "markup"-style api though
daglees has joined #ruby
<shevy> how is it doing that markup style api?
<shevy> or rather, what the hell is markup styled api anyway :D
jergason has joined #ruby
dnyy has joined #ruby
shruggar has joined #ruby
<shevy> CacheMoney I think you can call super() in your subclassed class
<shevy> that copy paste in initialize looks a bit odd otherwise
Chaazd has quit [#ruby]
ceej has joined #ruby
ph^ has joined #ruby
<shevy> you also have lots of instance variables
<martman> Nowaker: thats the start of it, yeah. my question was on how do i print the names of the functions for whats pass in for getter and setter
vikingly has joined #ruby
<shevy> perhaps it may be better to use one hash instead
<martman> Nowaker if they really were called getter and setter id like to be able to print out "Unit test failed: getter()/setter()" or something like that
<shevy> at least in the last class
<CacheMoney> shevy: yeah, I'm new to using classes -- mostly been doing proceedural math problems with Ruby.
<robert_> lol
<shevy> CacheMoney it is usually best to stick to ways that work and only slowly change them
daglees has joined #ruby
<shevy> because that code in itself does not seem to be *doing* much
<robert_> that's "markup"-style
<robert_> as in text, bounding_box, etc.
<shevy> it's nothing more than just a collection of data structures your code has right now. barely any behaviour
<robert_> like I said; I'm trying to pick up how prawn works by slowly writing something using it. :p
<shevy> interesting robert_
nate_h has joined #ruby
<shevy> one reason I want to take over that rfpdf is because I also need pdf things for ruby web stuff
<CacheMoney> shevy: again I'm new to Classes. But I'm attempting to record stats from the command line and I need somewhere to store the commands
<robert_> but the way it's working right now, I can't find the top/left of the document
<robert_> lol
<shevy> from the command line?
<Nowaker> martman: I don't get it. let's say we have class Test; attr_accessor :blah; end. my method would be called that way: check(Test.new, 'blah', 'blah=', 'new_val', 'msg')
<shevy> hmm is that the full code? I dont see an ARGV used
<CacheMoney> yeah... just to familiarize myself and then move it to the web
<CacheMoney> shevy: right now I'm just doing x = Player.new... x.ftmiss.... x.threemake... etc
daglees has joined #ruby
<shevy> yeah
<shevy> weird method names btw ;P
<CacheMoney> then i print out the results using x.shot_info
<CacheMoney> haha its my rough draft
<martman> Nowaker oh sorry, didnt realize that. that should work perfect then
<martman> thanks alot
<CacheMoney> BUT... I don't know how to attribute shots, or rebounds or assists to a player based on my class structures/inheritances
<Nowaker> martman: 'send' method dynamically calls the method from the string parameter - have fun
luckyrub_ has joined #ruby
<CacheMoney> shevy: any advice on how I should move forward
jdstroy has joined #ruby
<robert_> shevy: I see. I'm trying to write more or less a script polls a directory for filesystem changes
<robert_> and then parses the new files
<shevy> CacheMoney unfortunately I dont really know what you are trying to do
<robert_> and gneerates a pdf from the data contained inside said new files
<shevy> you can remove some of the code though
<shevy> unless @name == nil
<shevy> should be equal to
<shevy> if @name
<shevy> hmm
<jdstroy> Hello. Are there alternatives to DRbUndumped? There's a class that I want marked as "pass by proxy" only, and I cannot change it (because it is part of the CLR runtime in IronRuby).
<shevy> also I wonder if you really need all those instance variables
<CacheMoney> shevy: I guess I don't really know what I'm trying to do... I want to create 5 instances of a Player. And each Player will have name, age, height, and weight. But also depending on what they do in a game, they will Shoot, Rebound, Assist, etc
scalebyte has joined #ruby
<scalebyte> got stuck up over it : Help : https://gist.github.com/1944117
<shevy> ok so you need a player class
<scalebyte> shevy: ^^
francisfish has joined #ruby
<CacheMoney> shevy: should I put all the shot, rebound, assist, etc in the Player class?
<shevy> so the first thing is, focus on that player class and finish it
<shevy> well I guess so
<shevy> for now, just put it there
<CacheMoney> okay
<shevy> if you need to change it lateron you can do so anyway
<shevy> it is easy to make simple code more complicated :)
<shevy> but making complicated code simple is not so easy
<CacheMoney> ok. i think i was trying to make it more complicated. I guess I thought each statistical category (shot, rebound, etc) should be placed in its own class
<CacheMoney> shevy: what were you saying about all the unnecessary initializations?
<shevy> CacheMoney well I think you can use super() instead but perhaps start from scratch with a class Player first
<scalebyte> Please help me with this : got stuck up over it : Help : https://gist.github.com/1944117
francisfish has joined #ruby
<CacheMoney> shevy: okay. I'm going to finish up the Player class and then I'll get back to you with what I have. Thanks for your guidance
fermion has joined #ruby
fr0gprince_mac has joined #ruby
<scalebyte> somebody just help me pls... :(
pu22l3r has joined #ruby
theishi has joined #ruby
choffstein has joined #ruby
simao has joined #ruby
pangur has joined #ruby
bbttxu has joined #ruby
Helius has joined #ruby
<pangur> I have a long array of data - about 300 items - (surname, forenames, age, telephone, puppets,science). The data consists of 50 sets such as I have mentioned. How can I go through the list picking out each set of data?
luckman212 has joined #ruby
<nfarring> Please help with module namespace problem: http://pastie.org/3491057
geekbri has joined #ruby
pdtpatr1ck_ has joined #ruby
hagabaka has quit ["http://quassel-irc.org - Chat comfortably. Anywhere."]
<pangur> Is assert a reserved name nfarring?
oposomme has joined #ruby
<nfarring> I am no ruby expert but I think no, assert is not reserved
<shevy> you can use include Foo nfarring
adambeynon has joined #ruby
<nfarring> shevy: that works
<nfarring> it is very strange that code inside the module will not work without including Foo after the module
<pangur> nfarring, I am newbie. I wonder if http://ruby-doc.org/stdlib-1.9.3/libdoc/test/unit/rdoc/Test/Unit/Assertions.html is at relevant?
<pangur> at all
<nfarring> pangur: yes I saw that but I did not want to use the mixin
<nfarring> maybe I should use the mixin?
<Tasser> what would you use to test text output? a diff comparison built-in would be nice
<pangur> I know that in python that if you use for a definition a reserved name, you will have problems. Imagine it is the same in ruby.
<Tasser> I can use assert_equal or something similar, but that won't help while debugging
<nfarring> pangur: pretty sure that assert is not reserved in Ruby
<Tasser> pangur, nope, assert isn't. And def case(foo); end is valid ruby
<pangur> The other thing that I have noticed, nfarring, is that if ignoramuses like me start offering advice, people who really know will chime in eventually :)
ilyam has joined #ruby
<pangur> So, I feel that I help by encouraging those who really know to pipe up :)
<nfarring> pangur: I probably know less than you about Ruby. Anyway here is the solution: http://pastie.org/3491057
fermion has joined #ruby
moshef has joined #ruby
<pangur> Thanks nfarring. I am forever learning.
<Willejs> can anyone help with my nokogiri xml problem?
<moshef> how would you reject empty value from hash and get the keys of those values?
<moshef> something like coll_hash.reject!{|k,v| v.empty? k << non_public_colls} . is it possible in one sentance?
havenn has joined #ruby
cantbecool has joined #ruby
glosoli has joined #ruby
<pangur> I want to group items in a list into data belonging to a person. There are 60 such persons' data in the list. How do I pick out successive groups of say 6 fields?
<pangur> or six elements rather.
Kiall has joined #ruby
glosoli has quit [#ruby]
<moshef> anyone?
<pangur> Is there a ruby port of kohana, I wonder.
<moshef> [asking in another room as well]
<pangur> Sounds a good idea, moshef :)
<moshef> :)
nate_h has joined #ruby
<matti> nate_h: ;-)
ryannielson has quit [#ruby]
visof has joined #ruby
simao has joined #ruby
KL-7 has joined #ruby
anotherkeebler has quit [#ruby]
h4mz1d has joined #ruby
llaskin has joined #ruby
<llaskin> can somoen ehelp me identify what I am doing wrong here? http://pastie.org/3491201
<llaskin> i don't understand why split is private method here...
a1ph4g33k has joined #ruby
mononofu has joined #ruby
<robacarp> llaskin: you appear to be calling .split on an array, is that what you meant to do?
stephenjudkins has joined #ruby
<llaskin> yes
<robacarp> also, you don't need to declare your type when you define m
<llaskin> i know i don't
<heftig> also that first line is horribly wrong already
<llaskin> i'm just trying to helpyou guys understand the problem
<mononofu> I get this error when trying to run a script: "./cp2s3.rb:59:in `require': no such file to load -- aws/s3 (LoadError)"
<llaskin> thats not my result
<mononofu> but in irb, I can load aws/s3 just fine
<llaskin> " site_id = site_link.find_element(:xpath, "./../..").attribute("class").scan(/(site_id-.*) summary/)" returns that first line of [["712 summary-index-23 even"]]
<mononofu> am I complete ruby noob, so I guess I'm missing something
tkellen has joined #ruby
<llaskin> was just trying to slim down the output for u guys
<mononofu> *I am
davidpk has joined #ruby
<robacarp> I see
<llaskin> robocarp so any thoughts?
munx has joined #ruby
<tkellen> is there a way to launch irb and run arbitrary code besides -r? like, can you inline the code you want to run right in the command?
guillaum has joined #ruby
<heftig> you probably want m[0][0].split[0]
<robacarp> tkellen: you can just say `irb`
<robacarp> llaskin: I agree with heftig
<robacarp> I don't think you can use .split on arrays
<tkellen> robacarp: no, i want to include some files and run a few lines of code (and i don't want it in my dotfiles)
<tkellen> s/include/require some gems
glosoli has joined #ruby
<robacarp> tkellen: what I do in that spot is have that code in a file and do "load 'file.rb'"
<robacarp> you don't have to restart irb to get it to reload the file, just hit the load command again
<tkellen> robacarp: that is what i'm doing right now and exactly what i'm trying to avoid, if possible
llaskin has joined #ruby
<robacarp> tkellen: well, the other option is to use ruby debugger
<CacheMoney> shevy: Here is my updated Player class http://pastie.org/3491222 Now, how would I initialize a game and record 5 different players stats, at the end print out the sum of all 5's points, shots, rebs, etc?
flagg0204 has joined #ruby
timonv has joined #ruby
<a1ph4g33k> tkellen: you can put any arbitrary code you want to happen every time you load IRB into ~/.irbrc
<tkellen> robacarp: i don't think you understand. i'm trying to write a oneliner that i can use to launch irb and run a few commands immediately after, without using the -r switch
<tkellen> a1ph4g33k: i already said i didn't want it in my dotfiles
<heftig> tkellen: or do require 'irb';IRB.start(__FILE__) in your code when you want to launch an IRB session
<llaskin> robocarp, sorry my internet cut out, did you respond?
<robacarp> tkellen: well, whats wrong with loading a file then
<robacarp> llaskin: there is no .split method for arrays
voodoofish430 has joined #ruby
philcrissman has joined #ruby
<tkellen> robacarp: i want to throw this in my rakefile without having to have a separate file to maintain
<robacarp> llaskin: even if there was, I'm not sure what .split[0] would even mean
luckman212 has joined #ruby
<mikewintermute> slight odd behaviour in irb: any ideas why? http://pastebin.com/9Zv9C3zQ
<tkellen> robacarp: short of echoing it to a file and then loading irb with -r and rming it after, i'm unclear if this is possible
<robacarp> tkellen: waitwaitwait you want it to be in a rakefile?
sacarlson has joined #ruby
Kyle__ has joined #ruby
akem has joined #ruby
<robacarp> mikewintermute: thats not odd behavior at all
akem has joined #ruby
<tkellen> robacarp: this is whati have now task :console do
<tkellen> sh 'irb -r ./tasks/console.rb'
<tkellen> end
affix has joined #ruby
<heftig> mikewintermute: array.each just returns the array after iterating
<tkellen> i want the contents of console.rb in the rakefile, so i don't need the console.rb file at all
<heftig> so that gets printed
<tkellen> the contents of console.rb load up the environment for an app i'm building
<a1ph4g33k> robacarp: I didn't see that.
CannedCorn has joined #ruby
eywu1 has joined #ruby
<robacarp> a1ph4g33k: eh?
<tkellen> it's just a few lines of code--i don't want the extra file, i just want to inline them as i launch irb
<llaskin> i got it
<llaskin> m[0].flatten[0].split[0] allows it to work
* robacarp facepalm
<a1ph4g33k> robacarp: A rake file is just ruby code.
<mikewintermute> robacarp: so why does test.count("a") output data to the console differently?
<mikewintermute> i.e. in lines 8 and 13
<robacarp> a1ph4g33k: yes, I am aware of this. why are you telling me?
<heftig> mikewintermute: because array.count returns the count, so that gets printed
<a1ph4g33k> robacarp: you can just use a HEREDOC to have the code you want and pipe that into your irb session.
<heftig> mikewintermute: in your iteration, you just throw the result away
<tkellen> a1ph4g33k: can you show me a pastie of that? that is exactly what i want to know, how to pipe code into irb as it launches
<mikewintermute> heftig: which is why it gets output on line 8, right?
<robacarp> a1ph4g33k: you're trying to give advice to tkellen, not me.
<heftig> mikewintermute: IRB will output whatever your code snippet returns
<tkellen> a1ph4g33k: as far as i can tell, the only way to load arbitrary code is using the -r switch and giving it a file
daglees has joined #ruby
<tkellen> (or having it in your dotfiles, which doesn't make sense in this case)
<mikewintermute> so, why doesn't anything get output on line 13?
<heftig> mikewintermute: if you use puts, you're doing additional output besides the REPL
<heftig> mikewintermute: because you're not telling it to output
<robacarp> O.O
brjannc has joined #ruby
<mikewintermute> heftig: puts isn't being used until line 19
<heftig> you're just basically saying, count this and then do nothing with it
<heftig> because .each does not care about the return value of the block
<mikewintermute> gotcha - so if you're within an each iterator output is suppressed?
<robacarp> mikewintermute: no
<heftig> it's not suppressed
<robacarp> there is no output being made
adman65 has joined #ruby
<a1ph4g33k> robacarp: are you looking to have irb run something and just give output, or are you looking for a live console AFTER the code has been run?
<robacarp> you need to distinguish between output and repl
<robacarp> a1ph4g33k: DAMMIT MAN I'm not looking to do anything!
<a1ph4g33k> robacarp: just trying to help.
<robacarp> yes, which is all well and good but I'm not the one looking for help!
scalebyte has joined #ruby
lkba has joined #ruby
<tkellen> a1ph4geek: yes, i want a live console after the code is run
<scalebyte> need to fix this : https://gist.github.com/1944117
<a1ph4g33k> robacarp: ah ... gotcha.
kevinbond has joined #ruby
<a1ph4g33k> tkellen: irb doesn't have that option.
* robacarp goes to do something productive...herding cats maybe...
<heftig> tkellen: as i said, you can run IRB from any ruby code by doing require 'irb';IRB.start(__FILE__)
PragCypher has joined #ruby
Mammutpanzer has joined #ruby
DrShoggoth has joined #ruby
<tkellen> heftig: ahh, missed your note. perfect, that is what i needed
<tkellen> heftig: thanks! that worked
tylerwillingham has joined #ruby
tylerwillingham has quit [#ruby]
kenichi has joined #ruby
hobodave has joined #ruby
chrxn[a] has joined #ruby
stephenjudkins has joined #ruby
dkr has joined #ruby
jergason has joined #ruby
<nfarring> Anyone know a good way to turn on debugging in ruby code to output extra info to stdout?
<nfarring> Should there be a gobal debug variable?
demian`_ has joined #ruby
<robacarp> nfarring: yea, you can do that
<robacarp> you can use an environment variable too
<heftig> ruby -w -d
<heftig> sets $VERBOSE and $DEBUG
<robacarp> yea, thats the env variable I was thinking of ^^
<nfarring> heftig: thanks, that is exactly what I was looking for.
ilyam_ has joined #ruby
sohocoke has joined #ruby
llaskin has joined #ruby
workmad3 has joined #ruby
llaskin has joined #ruby
TheShrew has quit [#ruby]
MissionCritical has joined #ruby
bobbyc has joined #ruby
oposomme has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
jbw_ has joined #ruby
<Mammutpanzer> Is this the right channel if I have questions to ruby and ruby gems?
kevinbond_ has joined #ruby
<madhatter> Mammutpanzer: Try.
oposomme has joined #ruby
mengu has joined #ruby
<shevy> Mammutpanzer yes
<shevy> for gems there is also #rubygems though
<pangur> How can I iterate over an array so that I pick out six adjacent elements at a time?
<Mon_Ouie> each_slice(6)
<pangur> thanks, Mon_Ouie :)
<workmad3> pangur: should the elements picked overlap or be distinct?
<Mon_Ouie> Or each_cons(6), depending on what you mean
<Mon_Ouie> (depending on what workmad3 said)
<workmad3> :)
<pangur> There are 6 data items associated with a person. There are 60 persons - each with their own separate six.
coucher has joined #ruby
libertyprime has joined #ruby
<workmad3> pangur: each_slice then I believe
<pangur> The data is one continuous array.
Promethe1s has joined #ruby
<pangur> Thanks workmad3 :)
<a1ph4g33k> pangur: is the data per person contiguous?
<Mammutpanzer> Okay here is my case. I want to install Redmine bug tracker/ticket system. I followed this tutorial http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache . Up to now all worked fine. However now the problems come. 1. It installed rake 0.9.2.2 instead of 0.8.7 and installing rails gives me an error saying it doesn't know the directive "make"
<Mon_Ouie> [1, 2, 3, 4].each_slice(2).to_a #=> [[1,2],[3,4]]
<pangur> The data sets are contiguous.
<Mon_Ouie> [1,2,3,4].each_cons(2).to_a #=> [[1,2], [2,3], [3,4]]
greenarrow has joined #ruby
shadoi has joined #ruby
<pangur> Mon_Ouie: Thanks - I shall need to study that answer. I may be some time :)
nerdy has joined #ruby
<pangur> I take it that the cons version is overlapping?
<Mon_Ouie> Yep
<madhatter> Mammutpanzer: A newer version of rake should be no problem.
<madhatter> Mammutpanzer: How do you install Rails?
<pangur> OK, that was very helpful.
<sungji> What's the correct way to do the following in ruby: class_eval %Q(' @attr_name = ... ') ? I.e. I'd like to refer to attr_name within the string after class_eval
* pangur clicks the link
<Mon_Ouie> sungji: Not sure what you mean exactly, but you can pass a block to class_eval or use string interpolation just as usual
<pangur> Thanks a1ph4g33k :)
<Mammutpanzer> madhatter according to this site I need special versions ( http://www.redmine.org/projects/redmine/wiki/RedmineInstall ) Also I am using cmd if this is what you asked for
<madhatter> Mammutpanzer: Do you install rake and rails as gems?
tilde` has joined #ruby
<Mammutpanzer> madhatter yes I follow this tutorial http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache so "gem install rake" and "gem install rails"
mononofu has quit ["Leaving"]
DrShoggoth has joined #ruby
<pangur> array.each_slice(6) {|a| p a} worked perfectly for me, a1ph4g33k, Mon_Ouie, and workmad3 :)
stephenjudkins has joined #ruby
ChampS666 has joined #ruby
<sungji> Mon_Ouie: class defines attr_name and I'd like to refer to it in the string after class_eval... do I have to refer to it by using #{attr_name} ?
compcube has joined #ruby
<madhatter> Mammutpanzer: gem install rake --version 0.8.7
alek_b_ has joined #ruby
<madhatter> Mammutpanzer: Remove the installed rake first
hadees_ has joined #ruby
<madhatter> Mammutpanzer: Then do similar for rails
eywu has joined #ruby
<davidcelis> lawl
<robert_> shevy: so is the top of the document 0, or the height of the document? because I can't tell.
diago has joined #ruby
Redjack1964 has joined #ruby
araujo has joined #ruby
araujo has joined #ruby
yoklov has joined #ruby
glosoli has joined #ruby
ged has joined #ruby
snip_it_ has joined #ruby
glosoli has joined #ruby
<shevy> lol
<shevy> no idea yet
oposomme has joined #ruby
mdw has joined #ruby
oposomme has joined #ruby
badabim_ has joined #ruby
<shevy> davidcelis, well the Encoding is the worse joke ;)
<davidcelis> lol
artOfWar has joined #ruby
sacarlson has joined #ruby
wyhaines has joined #ruby
the_hack has joined #ruby
oposomme has joined #ruby
zackattack has joined #ruby
bbttxu_ has joined #ruby
sungji has joined #ruby
pangur has joined #ruby
the_hack has joined #ruby
<CacheMoney> I want to call a method, and inside this method I want to call a couple other methods that all ready exist in the same class. I tried putting the desired methods into an array and then cycling through the array to call each individual method but it's not working. Any ideas? http://pastie.org/3491762
akem has joined #ruby
<CacheMoney> having trouble specifically with 'def display...'
<pangur> Although c.each_slice(6) {|a| p a} works for me (i.e. prints out the an array per person), how do I actually access/manipulate these inner arrays? How do I refer to them individually?
undersc0re has joined #ruby
undersc0re has joined #ruby
jdstroy has quit [#ruby]
dv_ has joined #ruby
mdw has joined #ruby
headius has joined #ruby
themadcanudist has joined #ruby
akem has joined #ruby
akem has joined #ruby
ceej has joined #ruby
josx has joined #ruby
<themadcanudist> hey guys…i have a capistrano question. Can I easily remove the chmod g+w action that happens in the default deploy method?
manizzle has joined #ruby
<pangur> How can I refer to an internal array of array.each_slice(6) {|a| p a} ?
revans has joined #ruby
<CacheMoney> how do I call other methods from within a method?
<apeiros_> pangur: what's an "internal array" there?
<apeiros_> CacheMoney: def foo; puts "foo"; end; def bar; foo; end; bar # prints "foo"
<apeiros_> CacheMoney: also, read a book. there's free ones online.
<pangur> Well, I had a long array of 360 elements (actually data belonging to 60 people). I want to be able to access each person's data.
andrewhl has joined #ruby
<CacheMoney> apeiros: I've tried implementing what a book told me to do and it isn't working, which is why I'm here asking a questions and posting my code (above) http://pastie.org/3491762
sohocoke has joined #ruby
<pangur> array.each_slice(6) {|a| p a} broke the 360 elements into 60 sub arrays, as it were.
themadcanudist has quit [#ruby]
<robacarp> CacheMoney: currently looking at your code, what are you trying to accomplish
seanstickle has joined #ruby
<pangur> each sub array has 6 elements
<CacheMoney> robacarp: I want to call the function display, as opposed to calling def player_info, and then def shot_info (and a couple more)
<robacarp> pangur: a is an array, you should be able to do a[0]
<pangur> surname, name, age, telephone, puppets, science are the fields.
<pangur> ok, thanks, shall try that straight away, robacarp.
<CacheMoney> i'm going to try what apeiros suggested
<apeiros_> CacheMoney: you meant by name?
<apeiros_> CacheMoney: as in, how to properly write line 43 of your paste?
<CacheMoney> apeiros_: yes
<apeiros_> see Object#send: send(:foo)
<robacarp> CacheMoney: oh, I see what you're trying to do... just call the method
<robacarp> CacheMoney: also, you're missing a comma on line 42
<apeiros_> pangur: you can also do: ary.each_slice(6) { |surname, name, age, telephone, puppets, science| … }
<CacheMoney> robacarp: thanks. So, you mean just do def display; player_info; shot_info; end;?
<robacarp> CacheMoney: yes.
<CacheMoney> okay thanks
<Rorgo> is there a file that lists locally installed gems, a la 'gem list'?
cableray has joined #ruby
<apeiros_> Rorgo: I don't think so
<seanstickle> Rorgo: gem list > gem-list.txt
<Rorgo> heh, thanks.
<pangur> ah, apeiros, sorry I was creating an fpaste while you were speaking :)
IAmNotMyself has joined #ruby
<pangur> What you are suggesting seems like what I need.
<pangur> Thanks
artOfWar has joined #ruby
<Boohbah> hi, is it possible to parallelize this algorithm? http://pastie.org/3491875
<Boohbah> if so, how would i do that?
<apeiros_> somebody playing too much poker?
<workmad3> Boohbah: you could probably map-reduce it
<apeiros_> Boohbah: yes, you can.
<apeiros_> in this case, the easiest would probably be to split the first 0.upto(47) into N slices
<apeiros_> where N = number of cores you've got
<apeiros_> also, 0.upto(47) --> 48.times
<apeiros_> alternatively you could of course employ maths and calculate the probabilities.
<workmad3> yeah, I was just thinking that :)
<Boohbah> this is basically a ruby port of http://www.suffecool.net/poker/evaluator.html
sohocoke has joined #ruby
<Boohbah> i could not get Paul Senzee's hash table lookup working
workmad3 has joined #ruby
<Boohbah> these are apparently the fastest algorithms for evaluating poker hands
<apeiros_> lol, "The beauty of this system is that if you multiply the prime values of the rank of each card in your hand, you get a unique product,"
<pangur> apeiros - c.each_slice(6) { |surname, name, age, telephone, puppets, science| p surname, name, age, telephone, puppets, science } - Do I need the 'p' after the bar?
<apeiros_> he definitively doesn't come from the CS corner…
<pangur> I am not sure what it does?
<workmad3> pangur: it prints it
<apeiros_> p obj --> puts obj.inspect
<workmad3> ^^
<apeiros_> a short-hand for inspecting data at runtime
<pangur> <-- blushing because of how ignorant he feels
<apeiros_> ri Kernel#p
<Boohbah> apeiros_: please elaborate, why do you lol at Cactus Kev?
<apeiros_> if you want to see the docs, type the above in your shell
<workmad3> apeiros_: although it's really 'puts obj.inspect || obj' ;)
startling has joined #ruby
<apeiros_> Boohbah: in computing, you'll use binary logic to do sets
<Boohbah> btw, thanks apeiros_ and workmad3 for the suggestions :)
<apeiros_> Boohbah: iow, each bit in an int will represent the presence/absence of a card
<apeiros_> easier and quite a bit faster
DrShoggoth has joined #ruby
<Boohbah> apeiros_: he does this...
<pangur> Thanks apeiros_ and workmad3 :)
CannedCorn has joined #ruby
<apeiros_> anyway, bedtime for me
<Boohbah> apeiros_: the primes are so that we can work backwards from a hand product and find the cards that compose it
<pangur> Good night :)
<workmad3> Boohbah: yeah... you know that prime factorisation isn't an easy thing to do, right?
<pangur> I am still not sure how I would access the inner arrays that I mentioned?
<Boohbah> workmad3: i understand it as the basis of public-key crypto
revans has quit ["Linkinus - http://linkinus.com"]
yoklov has joined #ruby
<workmad3> Boohbah: yeah, and that's with two (admittedly very large) primes
Knodi has joined #ruby
ascarter_ has joined #ruby
bbttxu_ has joined #ruby
<pangur> If I say children= c.each_slice(6) { |surname, name, age, telephone, puppets, science| p surname, name, age, telephone, puppets, science }, will that put an array of arrays into children?
<pangur> It does not seem to.
td123 has joined #ruby
<pangur> How can I put the contents of an each_slice into an array that I can then access?
* pangur keeps refining his perception of what his problem is.
<workmad3> pangur: no... if you wanted that, you'd want to do children = c.each_slice(6).to_a
<workmad3> pangur: also, the each_slice is an iterator method, so it is already accessing each item
<workmad3> pangur: for example, you can do c.each_slice(6){|...| create_person(...) }
<pangur> ah, that is what I really want to do.
<workmad3> (obviously, replace the ... with your variables, I'm just too lazy to write them out ;) )
<pangur> I understand.
<workmad3> pangur: or, if you wanted to do that and keep a reference to each person in a new array, you could do people = c.each_slice(6).map {|...| ...}
the_hack has joined #ruby
<pangur> workmad3: you are making my head spin :) Thanks, I really appreciate it.
<workmad3> Boohbah: still, back to your original question - with something like your algoritm, map-reduce is probably the most applicable way to parallelize
<Boohbah> workmad3: thank you, do you of any tutorials on using these methods?
<pangur> Basically, I was trying to get data from a csv file and trying to create person objects but although all this data was being revealed by each_slice, I felt that I could not get hold of it. Now I feel more confident :)
<workmad3> Boohbah: if you search for map-reduce, you should get some good info on it ;)
* Boohbah performs a world wide web search :)
<pangur> Basically, I am using a real life project to learn how to do ruby :)
<workmad3> pangur: always fun :)
<pangur> Fortunately, there is nobody in a hurry for my processings :)
<Boohbah> pangur: i think it's a good way to learn, i am doing the same
<workmad3> pangur: solving real problems is always the better way to learn
<pangur> Boohbah: I think it makes the Ruby more relevant that way.
<Boohbah> have you all seen Matz' rubyconf 2011 keynote? i am excited for the future of Ruby on Robots :)
albemuth has joined #ruby
a1ph4g33k has quit [#ruby]
artOfWar has joined #ruby
<RubyPanther> mRuby!!!! I am excited!
artOfWar has joined #ruby
<RubyPanther> Boohbah: did you see the RiteVM bytecode screenshot twitter??
Azure has joined #ruby
Guest has joined #ruby
<Boohbah> RubyPanther: i don't know
<Boohbah> luckily i can sort of read Japanese :)
<Boohbah> RiteVMはオープンソースになるの?
<Boohbah> will RiteVM become open source?
dzhulk has joined #ruby
TaTonka has joined #ruby
choffstein has joined #ruby
<RubyPanther> Boohbah: http://togetter.com/li/251999
<RubyPanther> Yes, it will be open source, dual license, but not until it is ready for a release
nari has joined #ruby
<heftig> ninaruno is "becoming"?
<Boohbah> naru is the verb "to become"
<heftig> er, probably just naruno
startling has joined #ruby
drbawb has joined #ruby
<heftig> has been a while since my introduction into japanese class
cantbecool_ has joined #ruby
<Boohbah> yahoo! answers is the definitive resource on japanese grammar :)
<heftig> hrm, i just had "ka" as the question modifier
choffstein has joined #ruby
artOfWar has joined #ruby
Silker has joined #ruby
randym has joined #ruby
undersc0re has joined #ruby
Mac_ has joined #ruby
KL7 has joined #ruby
randym has joined #ruby
the_hack has joined #ruby
bbttxu_ has quit [#ruby]
triptec has joined #ruby
cloke_ has joined #ruby
Squarepy has joined #ruby
looopy has joined #ruby
Squarepy has joined #ruby
sdwrage has joined #ruby
d34th4ck3r has joined #ruby
jbhewitt has joined #ruby
zomgbie has joined #ruby
denom has joined #ruby
codespectator has joined #ruby
h4mz1d has joined #ruby
stephenjudkins has joined #ruby
ephemerian has joined #ruby
vraa has joined #ruby
crodas has joined #ruby
ap0gee has joined #ruby
decentrality has joined #ruby
shevy has joined #ruby
tayy has joined #ruby
mxweas_ has joined #ruby