apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
lukeshu has joined #ruby
stephenjudkins has joined #ruby
sohocoke has quit [Quit: sohocoke]
tripitakit has quit [Ping timeout: 260 seconds]
<shadoi>
why are you using a global?
<shadoi>
and why is it nil when you think it's a number?
kevinbond has quit [Quit: kevinbond]
<tris>
looks like neither of these work in irb, either, same error
<tris>
if I don't use a global, will it work? again, this is just a simple erb template
oskarth has quit [Read error: Connection reset by peer]
davidpk has quit [Quit: Computer has gone to sleep.]
<shadoi>
0.upto(5) {|i| puts i}
igotnolegs has joined #ruby
<shadoi>
should work fine
<shadoi>
just make sure your $foo var is actually what you think it is
snip_it has quit [Quit: snip_it]
sohocoke has joined #ruby
<lukeshu>
Is there a way to make .collect{...} give back an instance of a class that extends Array?
<tris>
ah, got it now. missed the |i|. duh.
<tris>
thanks!
<stephenjudkins>
tris: never use a global unless you understand that it's terrible thing to do, and then under only very specific circumstances
davidpk has joined #ruby
heph has joined #ruby
<shadoi>
lukeshu: collect can return a collection of anything
<heph>
i want to set an arbitrary value within a hash at the command line. i'd like to use some ux like '--set hash.subhash.key=value'. does anyone have an example of this or can suggest where I should get started?
pdtpatrick_ has joined #ruby
nari has joined #ruby
schovi has quit [Remote host closed the connection]
<lukeshu>
shadoi: "([1,2,3].collect{|x| x}).class" gives "Array", I understand that it can be an array of anything; I would like it to give a subclass of Array.
pdtpatrick has quit [Read error: Connection reset by peer]
pdtpatrick_ is now known as pdtpatrick
looopy has quit [Remote host closed the connection]
Xtek- has quit [Read error: Connection reset by peer]
Xtek has joined #ruby
<Alantas>
.collect puts together a new Array, not a new instance-of-class-you-called-it-on.
<Alantas>
(0..5).collect{|x| x%2} can't be expected to return a Range, for example.
<shadoi>
lukeshu: oh, yeah it always returns an array, you should probably just write your own collect that returns what you want, you can call collect from Enumerable and have it wrap the results in your stuff.
<Alantas>
Or manually implement the behavior of 'collect'; it's not difficult.
<lukeshu>
shadoi: Alantas: Currently I'm doing:
<lukeshu>
out = MySubclass.new
<lukeshu>
in.each{|x| out.push(...)}
<lukeshu>
but figured collect was more efficient
<Alantas>
That's pretty much what collect does anyway, I figure.
<Alantas>
in.each{|x| out.push(yield x)}
nari has quit [Ping timeout: 250 seconds]
<lukeshu>
how would I go about implementing my own collect, that runs quickly, it looks like it's compiled code
<Alantas>
That's about as fast as it can get from within Ruby itself.
malkomalko has quit [Remote host closed the connection]
<lukeshu>
Alantas: ok, thanks!
khakimov has joined #ruby
<Alantas>
And unless you're dealing with a zillion items, it probably won't be noticable.
<lukeshu>
That's the thing, I very well might be dealing with a zillion items :)
jlogsdon has quit [Remote host closed the connection]
<lukeshu>
ah, the "..." in out.push(...) is probably more expensive anyway
looopy has joined #ruby
<Alantas>
Does your class override push()? If so, maybe it would in fact be faster to use the stock 'collect' behavior, then repackage the resulting Array into your type, to take advantage of Array's underlying push() implementation.
perryh_away is now known as perryh
moshef has joined #ruby
<lukeshu>
I don't override push(). But, how would I go about repackaging the Array into my type?
<Alantas>
Well, you might alias 'collect' to '_old_collect' or such, and call the stock behavior that way (from within your class's overridden collect()); *maybe* "super" to get it more elegantly.
<Alantas>
As for how to repackage it, that's up to you. If it works closely enough to a stock Array, you might call 'replace', passing in the stock Array.
manizzle has joined #ruby
<Alantas>
def collect; self.class.new.replace(super); end # Best-case.
adamkittelson has quit [Remote host closed the connection]
amalvagomes has joined #ruby
Haydos has joined #ruby
pygmael_ has joined #ruby
<lukeshu>
Alantas: thanks
<Alantas>
Yeah, some tests in irb says that should work.
berserkr has quit [Quit: Leaving.]
<Alantas>
(The use of "super", specifically.)
khakimov has quit [Quit: Computer has gone to sleep.]
pygmael has quit [Ping timeout: 265 seconds]
pygmael_ is now known as pygmael
cs[tc] has joined #ruby
<Alantas>
class Array;def to_mysubclass;MySubclass.new.replace(self);end;end
<Alantas>
^ another approach, letting you convert arbitrary stock Arrays to your subclass.
<Alantas>
...Or, for that matter, assuming you don't override initialize(), you can just do MySubclass.new(array).
joaoh82 has quit [Remote host closed the connection]
krz has quit [Quit: krz]
icy` has quit [Quit: Leaving]
<Alantas>
And if you do: def initialize(*args); return super if args.collect(&:class) == [Array]; ...; end
Zyclops has joined #ruby
Zyclops has left #ruby [#ruby]
ilyam has quit [Quit: ilyam]
Paradox has joined #ruby
<Paradox>
norman clarke hang out in here?
dagnachewa has quit [Quit: Leaving]
mvangala has joined #ruby
kevinbond has joined #ruby
liluo has quit [Remote host closed the connection]
cephalopod has joined #ruby
<Boohbah>
Paradox: who's that?
<Paradox>
HAML's lead maintainer
<Paradox>
was going to pester him to see if he could put redcarpet support in natively so i dont have to write a helper every time i want to use it in ruby
M- has joined #ruby
<Paradox>
erm
<Paradox>
in rails
snip_it has joined #ruby
<Boohbah>
Paradox: tried email?
<Paradox>
i might send him a GH message
<Paradox>
i just like to check if people are in IRC
moshef has quit [Quit: moshef]
robotmay has quit [Remote host closed the connection]
trollstyre is now known as nisstyre
sbanwart has joined #ruby
banjara has quit [Quit: Leaving.]
moshef has joined #ruby
rasbonics has quit [Quit: rasbonics]
savage-_ has quit [Remote host closed the connection]
pjn_oz has joined #ruby
cj3kim has quit [Quit: Leaving]
icy` has joined #ruby
icy` has quit [Changing host]
icy` has joined #ruby
cj3kim has joined #ruby
sohocoke has quit [Quit: sohocoke]
jchauncey has joined #ruby
jchauncey has quit [Client Quit]
h4mz1d has joined #ruby
nfk has quit [Quit: yawn]
iamjarvo has joined #ruby
jonathanwallace has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
snip_it has quit [Quit: snip_it]
ConstantineXVI has quit [Remote host closed the connection]
maletor has quit [Quit: Computer has gone to sleep.]
mykeus has joined #ruby
voodoofish430 has quit [Quit: Leaving.]
L-----D has joined #ruby
snip_it has joined #ruby
iamjarvo has quit [Quit: Leaving.]
Hanmac1 has joined #ruby
Hanmac has quit [Ping timeout: 248 seconds]
liluo has joined #ruby
dhaskew_ has quit [Read error: Connection reset by peer]
dhaskew has joined #ruby
h4mz1d has quit [Ping timeout: 240 seconds]
sohocoke has joined #ruby
davidcelis has joined #ruby
pdtpatrick has quit [Quit: pdtpatrick]
akem has quit [Ping timeout: 255 seconds]
dv310p3r has joined #ruby
mikepack has joined #ruby
catfired has quit [Ping timeout: 245 seconds]
nlc has joined #ruby
vitor-br has joined #ruby
Ontolog has joined #ruby
Solnse has joined #ruby
replore_ has joined #ruby
<CannedCorn>
guys is it possible to return two values from a block?
<Carson__>
okay thanks i'm getting the same error while doing it as a regular user... i'll try reading the log
<bnagy>
I don't want to sound distro-bigoted, but any chance you could use a distro that doesn't suck donkey balls?
<banisterfiend>
bnagy: sup bnaggy
<bnagy>
banisterfiend: all good man. Shagged any good sheep lately?
<Carson__>
I suppose i can use debian... it's just i've only played around with fedora and centos
<banisterfiend>
bnagy: your mom
<bnagy>
fedora will be much better, as would debian
vjt has quit [Ping timeout: 272 seconds]
<bnagy>
not that I am a fedora fan either, but it beats the hell out of rhel / centos
vjt has joined #ruby
bpgoldsb has quit [Remote host closed the connection]
bpgoldsb has joined #ruby
<bnagy>
banisterfiend: did you dag her while you were at it? That stuff is getting out of hand...
<banisterfiend>
bnagy: No, i like it there
<bnagy>
:D
<Carson__>
bnagy: thanks for the suggestions... i'm primarily a Mac user so I'm not too familiar with linux distros
<bnagy>
Carson__: why can't you just use OSX then?
sparc_ has joined #ruby
<bnagy>
once you install ports it's almost a real *nix OS
heftig has quit [Quit: leaving]
vng|afk_ has joined #ruby
<Carson__>
bnagy: I just decided to do this on my linode VPS and get some more experience with linux
vng|afk__ has joined #ruby
<bnagy>
Ok, sounds good. In general, get a recent FC or ubuntu server or debian or whatever
<bnagy>
use the system ruby to do a user-based install via rvm or rbenv
<bnagy>
then everything should be good
mikepack has joined #ruby
vng|afk has quit [Ping timeout: 244 seconds]
<Carson__>
okay thanks
c0rn has joined #ruby
looopy has quit [Remote host closed the connection]
vinraec has quit [Quit: Leaving]
vng|afk_ has quit [Ping timeout: 245 seconds]
uris has quit [Ping timeout: 256 seconds]
macmartine_ has joined #ruby
jayrulez has joined #ruby
<shevy>
Carson__ if rbenv or rvm does not work for you, you can still use ruby from sources and compile into a specific --prefix :>
vng|afk__ has quit [Ping timeout: 240 seconds]
prometheus has joined #ruby
macmartine has quit [Ping timeout: 272 seconds]
macmartine_ is now known as macmartine
td123 has quit [Ping timeout: 245 seconds]
uris has joined #ruby
EzeQL has quit [Ping timeout: 252 seconds]
looopy has joined #ruby
rippa has joined #ruby
vng|afk_ has joined #ruby
EzeQL has joined #ruby
<Carson__>
shevy: Thanks I'll try that as a last attempt
<shevy>
:)
SeySayux_ has quit [Read error: Connection reset by peer]
CheeToS has quit [Ping timeout: 260 seconds]
<bnagy>
Carson__: don't listen to shevy, he is just trolling :)
tomzx has quit [Ping timeout: 245 seconds]
greyEAX has joined #ruby
<shevy>
my rubies reside at the prefix /Programs/Ruby/ with version 1.8.7p358 and 1.9.3p194 with one symlink pointing to the latest called "Current", these get symlinked into an equivalent /usr/bin /usr/lib equivalent (but it could work with these directories just as well)
<bnagy>
he has 'making life hard for yourself' disorder... we try to be supportive, but...
<shevy>
bnagy AppDirs really are 100x better than dumping things directly into somewhere
jkarayusuf has joined #ruby
<shevy>
(the contents of directories)
<bnagy>
Carson__: just set your centos DVD on fire and install a real linux
<shevy>
on debian, when I stumble into /usr/bin/file, I need to ask the package manager to what this binary belongs to. with AppDirs, I immediately know just by doing "ls -l" or stat
<Carson__>
lol
<shevy>
checking for gcc... no
<shevy>
checking for cc... no
<shevy>
yeah ... on debian based distributions, this usually gets done via "apt-get build essential" or something like that
<bnagy>
shevy: yeah I think it's their idea of a security feature
<shevy>
or essentials
<bnagy>
shevy: it's centos
<bnagy>
did you see the part where the system ruby is 1.8.5?
<Carson__>
shevy: Thanks I was actually just doing that
Mon_Ouie has quit [Ping timeout: 245 seconds]
<shevy>
\o/
<shevy>
bnagy, we'll end up with a flying pig :)
<bnagy>
it's all going to end in tears, you mark my words
Mon_Ouie has joined #ruby
savage- has quit [Remote host closed the connection]
<bnagy>
yum install stuff-from-this-decade
<bambanx>
we have a framework for program in ruby using html5 like bowline for mac and linux , but in windows?
monzie has quit [Remote host closed the connection]
<Carson__>
bnagy: hahaha noted
jkarayusuf has quit [Remote host closed the connection]
CannedCorn has quit [Quit: Computer has gone to sleep.]
tvw has joined #ruby
vng|afk_ has quit [Ping timeout: 248 seconds]
vng|afk has joined #ruby
<bambanx>
which editor is cool for ruby with intellisence code highlight ... for windows? (not rubymine )
MrGando has quit [Read error: Connection reset by peer]
<shevy>
hmmmmmm "intellisence code highlight"
<shevy>
how many editors actually do that kind of highlighting
monzie has joined #ruby
<bambanx>
i dunno
<bambanx>
sorry for my bad english
<shevy>
you can however try out some editors to see if they are useful. notepad++ geany bluefish sublime-text
<bnagy>
vim
<bambanx>
thanks
lkba has quit [Ping timeout: 245 seconds]
SeySayux has joined #ruby
Eldariof-ru has joined #ruby
vng|afk has quit [Remote host closed the connection]
kenperkins has joined #ruby
wargasm1 has joined #ruby
MrGando has joined #ruby
jgrevich has joined #ruby
<Carson__>
bnagy: okay so it looks like rvm completed the install of 1.9.3 without any errors but when i run ruby --version it still says 1.8.5 http://pastie.org/pastes/3918692/text
minijupe has joined #ruby
<bnagy>
Carson__: you need to make some changes to get the path etc correct
<bnagy>
it's all on the rvm site
tchebb has quit [Ping timeout: 272 seconds]
<bnagy>
modify your shell to fix up the path and source the rvm script
wargasm has quit [Ping timeout: 248 seconds]
<bnagy>
.bashrc or probably .cshrc knowing centos
macmartine has quit [Quit: macmartine]
yoklov has quit [Quit: bye!]
michaeldeol has joined #ruby
michaeldeol has left #ruby [#ruby]
<Tref>
has attr_accessor been deprecated in 1.9.3
<bnagy>
no
jrist is now known as jrist-afk
<Tref>
Im having a hard time finding it in the api
<Tref>
can someone point me to it?
<Carson__>
bnagy: sorry I'm not really sure what you mean
kenperkins has quit [Quit: Computer has gone to sleep.]
<shevy>
Tref unlikely, it is doing only very little anyway. attr_accessor :foo is same as ... def foo;@foo;end and def foo=(i);@foo = i; end
<bnagy>
Carson__: read the install docs on the rvm site. After you install RVM you also need to change your shell init script so it 1. modifies your path so your local .rvm directory is before the system bin dirs and 2. sources the RVM init script thingy
Juul has quit [Quit: Leaving]
ilyam has joined #ruby
<shevy>
Tref hmm I think it used to be in Module
<bnagy>
otherwise rvm will put the new binaries in the right place, but you won't be using them because of bad path
<offby1>
Just making sure: is there really still no support for keyword arguments?
cyb3r3li0g has joined #ruby
headius has quit [Quit: headius]
<bnagy>
what are 'keyword arguments' and why should I care?
c0rn has quit []
<shevy>
offby1 some little support exists for it I think
fukushim_ has joined #ruby
fukushima has quit [Ping timeout: 240 seconds]
<offby1>
bnagy: I don't know that you should care. However, _I_ care.
michaeldeol has joined #ruby
nipra has joined #ruby
<bnagy>
offby1: well you phrased the question as if it's some glaring oversight
michaeldeol has quit [Remote host closed the connection]
<offby1>
it's the ability to call a method with arguments in any order, resolving the confusion by giving each actual parameter a name. Some other languages have this feature; it's handy. e.g. drive(:miles => 3, :direction => :northeast)
<shevy>
well you can use a hash still
<banisterfiend>
offby1: oh hey how's things
<offby1>
shevy: yes, I'm aware of that
<offby1>
banisterfiend: ahoy!
<bnagy>
offby1: that will just work? They'll be parsed as a hash
<banisterfiend>
offby1: rubyists 'fake' that by using a hash
<offby1>
bnagy: there appear to be various gotchas with the syntax. According to the three minutes of Googling that I just did :)
<offby1>
banisterfiend: yes, I know
<shevy>
hmm
<offby1>
banisterfiend: heck, Perl doesn't even have named arguments _at all_
<banisterfiend>
offby1: we're getting true named parameters in ruby 2.0, coming next yearh
<shevy>
isn't it possible to do ... def foo(i, b='bla',*c) now?
<shevy>
\o/
<offby1>
shevy: dunno. Is there a bot in the channel? :)
<shevy>
other than bnagy no
* shevy
runs away!
<shevy>
;D
<offby1>
shevy: anyway that looks like you're defining a default value but not necessarily a keyword.
<shevy>
I dont think there is any bot here, on #ruby-lang there is though
<bnagy>
there is?
cyb3r3li0g has quit [Max SendQ exceeded]
<bnagy>
I thought it died
* offby1
sniffs
<shevy>
offby1 hmm I always thought something changed there between 1.8 and 1.9
ABK has joined #ruby
<shevy>
but hey, ruby 1.9 works for me fully only since yesterday, so... :P
<offby1>
shevy: well, I saw some docs that said "keywords are coming in 1.8", then I found something from Matz that said "they'll be here in 1.9" ...
snip_it has quit [Quit: snip_it]
<offby1>
*shrug*
<offby1>
looks like the answer is "not yet".
<shevy>
yeah
<shevy>
they prefer to implement features nobody needs first... :P
<shevy>
like hashrocket!
<banisterfiend>
offby1: are you enjoying your time in ruby, last time we spoke u said 'ruby shouldn't exist' :P
<shevy>
it would be easier to implement a simpler language
<offby1>
sure
<shevy>
I also find ruby complex though
<offby1>
well, compared to what? Forth?
<offby1>
scheme?
<shevy>
lua
<shevy>
:)
indian has joined #ruby
<offby1>
never learned enough lua to judge
<shevy>
and perhaps even php
<offby1>
*shudder*
<offby1>
php might be more complex than perl, to judge by the recent famous rant
<shevy>
been years since I last used php hmm
<shevy>
perhaps I should give it a try again
jgrevich has quit [Quit: jgrevich]
adamkittelson has joined #ruby
jgrevich has joined #ruby
macmartine has joined #ruby
deobald__ has quit [Ping timeout: 260 seconds]
ananthakumaran has quit [Quit: Leaving.]
kylemcgill has joined #ruby
CheeToS has joined #ruby
Eldariof59-ru has joined #ruby
davidpk has quit [Ping timeout: 245 seconds]
indian has quit [Remote host closed the connection]
univers has joined #ruby
davidpk has joined #ruby
snip_it has joined #ruby
Eldariof-ru has quit [Ping timeout: 260 seconds]
Draco_ has joined #ruby
Draco_ has quit [Remote host closed the connection]
Draco_ has joined #ruby
shevy has quit [Read error: Operation timed out]
Draco_ has quit [Remote host closed the connection]
davidpk has quit [Ping timeout: 244 seconds]
davidpk has joined #ruby
davidpk has quit [Client Quit]
<Carson__>
I finally got ruby 1.9.3 installed but when i run gem i -r rails I'll get an error saying loading commad: install (LoadError) cannot load such file --zib .... error while executing gem ... (NameError) uninitialized constant Gem :: Commands::InstallCommand
cantonic has joined #ruby
gokul has joined #ruby
univers has quit []
h4mz1d has joined #ruby
c0rn has joined #ruby
prometheus has quit [Ping timeout: 248 seconds]
djdb has joined #ruby
tonini has joined #ruby
wvdschel_ has quit [Ping timeout: 245 seconds]
shruggar has quit [Quit: Leaving.]
apeiros_ has quit [Remote host closed the connection]
shevy has joined #ruby
apeiros_ has joined #ruby
macmartine has quit [Quit: macmartine]
snip_it has quit [Quit: snip_it]
bambanx_ has joined #ruby
diRect_z1 has left #ruby [#ruby]
h4mz1d has quit [Ping timeout: 272 seconds]
neersighted is now known as neersighted|AFK
looopy has quit [Remote host closed the connection]
<bnagy>
Carson__: real OS. Rails is a whole new ballgame
<bnagy>
find a guide for installing rails
bambanx has quit [Ping timeout: 255 seconds]
<bnagy>
there are a lot of OS packages you will need
jackiechan0 has joined #ruby
Tref has quit [Quit: Tref]
<Carson__>
bnagy: Okay I'l just trying to install a basic package awesome_print and I get the same error
<bnagy>
ok, maybe pastie the exact error
ananthakumaran has joined #ruby
schovi has joined #ruby
apeiros_ has quit [Remote host closed the connection]
joppe has quit [Ping timeout: 252 seconds]
greyEAX has quit [Read error: Connection reset by peer]
greyEAX has joined #ruby
Eldariof59-ru has quit []
diRect_z has left #ruby [#ruby]
eph3meral has quit [Quit: Leaving]
stewart_ has quit [Quit: Leaving.]
indeterminate has joined #ruby
minijupe has quit [Quit: minijupe]
mikepack has quit [Remote host closed the connection]
<bnagy>
you're still using the wrong ruby by the looks
<Carson__>
bnagy: when i run ruby -v i get ruby 1.9.2p320 (2012-04-20 revision 35421) [i686-linux]
cs[tc] has quit [Ping timeout: 255 seconds]
yugui is now known as yugui_zzz
cs[tc] has joined #ruby
yugui_zzz is now known as yugui
bambanx_ has quit [Ping timeout: 255 seconds]
mikepack has quit [Ping timeout: 250 seconds]
<bnagy>
ok well that error is referring to a system install
looopy has joined #ruby
tvw has quit [Remote host closed the connection]
schovi has quit [Remote host closed the connection]
lolmaus has joined #ruby
<Carson__>
bnagy: do you have any recommendations as to what i should do now?
ph^_ has joined #ruby
<bnagy>
format the box, install a real OS, do an rvm user install then follow a rails install guide
<bnagy>
or you could try #rvm
joppe has joined #ruby
<Carson__>
bnagy: okay thanks
crodas has quit [Quit: Disconnecting from stoned server.]
<bnagy>
whenever I try and recover from a system install I just rm -rf all the rvm stuff
<shevy>
hehe
<bnagy>
cause the way it works is...
crodas has joined #ruby
<shevy>
Carson__ you could give the shevy-way a try too
<shevy>
and compile from the source :>
kryptek_ has joined #ruby
kryptek_ has quit [Excess Flood]
kryptek_ has joined #ruby
Hanmac1 is now known as Hanmac
Faris has joined #ruby
Juul has joined #ruby
adamkittelson has quit [Remote host closed the connection]
<Carson__>
shevy: hahaha I might give that try .... when i go into irb it says this now Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.
shruggar has joined #ruby
senny has joined #ruby
<shevy>
hmm
<shevy>
you probably miss readline on your system
<shevy>
you dont have to reinstall ruby per se however
<shevy>
I tell you how I do it. I compile ruby from source, then sometimes the base system lacks readline
<shevy>
so I make sure that readline works first (I compile readline from source into /usr prefix)
<shevy>
then, when it was compiled, I enter the ruby directory, where it was extracted
<shevy>
I go into ext/readline and run the ... extconf.rb file that is there
<shevy>
do make, then start irb, and readline will work
joaoh82 has quit [Remote host closed the connection]
<shevy>
Readline is very useful to have by the way
Ontolog has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
Faris has quit [Quit: Leaving.]
Ontolog has quit [Remote host closed the connection]
keanehsiao has joined #ruby
replore_ has quit [Remote host closed the connection]
TheFuzzball has quit [Quit: Leaving...]
<Carson__>
shevy: sorry where can i find the directory that has Readline?
maesbn has joined #ruby
Drewch has quit [Read error: Operation timed out]
Morkel has joined #ruby
dhaskew has joined #ruby
Juul has quit [Remote host closed the connection]
Drewch has joined #ruby
apeiros_ has joined #ruby
ryanf has quit [Ping timeout: 272 seconds]
jjxtsys_ has joined #ruby
jjxtsys has quit [Ping timeout: 272 seconds]
kil0byte has quit []
LyonJT has joined #ruby
cache_za has joined #ruby
crekev has joined #ruby
ryanf has joined #ruby
cwill747 has quit [Read error: Operation timed out]
Eldariof-ru has joined #ruby
tewecske has joined #ruby
jprovazn_away is now known as jprovazn
dhaskew has quit [Quit: dhaskew]
L-----D has joined #ruby
LyonJT has quit [Ping timeout: 272 seconds]
vladiim has joined #ruby
suppp has left #ruby [#ruby]
iocor has joined #ruby
ymasory has quit [Quit: Ex-Chat]
vladiim has quit [Client Quit]
ryanf has quit [Quit: broken pipes |||]
schovi has joined #ruby
ryanf has joined #ruby
zeromodulus has quit [Remote host closed the connection]
mucker has joined #ruby
cha1tanya has quit [Ping timeout: 272 seconds]
robotmay has joined #ruby
bambanx__ has quit [Read error: Connection reset by peer]
zommi has joined #ruby
ipsifendus has quit [Quit: ipsifendus]
vladiim has joined #ruby
zommi_ has joined #ruby
cads has quit [Ping timeout: 245 seconds]
heftig has joined #ruby
altious has quit [Quit: Leaving]
eka has joined #ruby
tvw has joined #ruby
MrGando has quit [Quit: Bye]
arturaz has quit [Ping timeout: 272 seconds]
wagle has quit [Remote host closed the connection]
crekev has quit [Remote host closed the connection]
cyb3r3li0g has joined #ruby
zz_chrismcg is now known as chrismcg
cyb3r3li0g has quit [Max SendQ exceeded]
shruggar has quit [Ping timeout: 244 seconds]
scb has joined #ruby
wagle has joined #ruby
scb has quit [Remote host closed the connection]
<forestbird>
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●j
<forestbird>
oops
foofoobar has joined #ruby
jackiechan0 has quit [Ping timeout: 245 seconds]
sparrovv has joined #ruby
jackiechan0 has joined #ruby
nfluxx has joined #ruby
aruntomar has joined #ruby
<shevy>
Carson__ you mean the ruby bindings?
pawdro has joined #ruby
<shevy>
Carson__ if you download ruby, i.e. from ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.bz2
neil__ has joined #ruby
<shevy>
when you download this, then extract it
jimeh has joined #ruby
<shevy>
then enter this extracted directory, then enter the directory ext/readline/
<shevy>
I think "ext" means external. Perhaps external bindings
<shevy>
there are other directories there, like zlib and tk and win32ole
M- has quit [Quit: This computer has gone to sleep]
<Carson__>
shevy: how do access this if i install from rvm?
<shevy>
no idea with rvm, sorry
<shevy>
I use the source-only method. the #rvm guys should know about their software
<Veejay>
rvm info would give you some information about the paths
<Carson__>
okay thanks you know what I might just try to reinstall from source tomorrow
lallala has joined #ruby
<jackiechan0>
/join #metasploit,#corelan
ludo4ka has joined #ruby
nfluxx has quit [Quit: nfluxx]
<Carson__>
hmm i see ext/readline in rvm info
<Carson__>
shevy: can i update ruby from source? or do i have to uninstall and reinstall?
<bnagy>
you also need readline installed from the OS side, of course
monzie has quit [Quit: monzie]
<shevy>
Carson__ well if you want another ruby version, you'd have to get the source again and compile that. the only way to avoid using the source is to download binaries which other people did for you, i.e. in your distribution
<shevy>
Carson__ what ruby version are you planning on using? 1.8.x or 1.9.x ?
<Carson__>
shevy: 1.9.3
havenn has joined #ruby
<shevy>
Carson__ you could always compile ruby into a special directory, and if you dont like it anymore, you just remove that directory
<shevy>
"./configure --prefix=/opt/ruby" for instance
<shevy>
Carson__ one advantage that binaries have in theory is that you can just download & install them without much work on your side, and they work
<shevy>
in theory :P
arturaz has joined #ruby
<shevy>
distributions like to do fancy stuff. they also tend to lag behind source releases i.e. new versions
<Carson__>
shevy: yeah I don't know why when I did a yum install ruby it would install such an old version
<shevy>
Carson__ can you download ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.bz2 into a directory, extract it via "tar -vjxf ruby-1.9.3-p194.tar.bz2", then change directory into this, then do "./configure --prefix=/opt/ruby", then make, and tell me if there are any errors?
<shevy>
if you ever are tired of this, you can simply remove the directory /opt/ruby
<shevy>
so there is no harm, nothing will be installed outside /opt/ruby
<bnagy>
you guys could just spend the afternoon slamming your hands in car doors, if you like pain this much, that would be less complicated
<Carson__>
shevy: okay I'll give it a try
<Carson__>
bnagy: lol
<shevy>
\o/
<shevy>
\o/
<shevy>
oops
dangerousdave has joined #ruby
<shevy>
my ascii man shifted...
TheHunter_1039 has quit [Quit: TheHunter_1039]
ronniy has joined #ruby
CheeToS has quit [Ping timeout: 272 seconds]
heftig has quit [Quit: leaving]
iocor has quit [Quit: Computer has gone to sleep.]
robotmay has quit [Remote host closed the connection]
khakimov has quit [Quit: Computer has gone to sleep.]
tomb_ has joined #ruby
jgrevich has quit [Quit: jgrevich]
hoelzro|away is now known as hoelzro
luke3321 has joined #ruby
nilg` has quit [Read error: Connection reset by peer]
ananthakumaran1 has joined #ruby
zeromodulus has joined #ruby
ananthakumaran has quit [Read error: Connection reset by peer]
zeromodulus has quit [Remote host closed the connection]
pygmael_ has joined #ruby
bier_ has quit [Read error: Operation timed out]
pygmael has quit [Ping timeout: 252 seconds]
pygmael_ is now known as pygmael
<Carson__>
shevy: damn doing this from source takes forever
<banisterfiend>
Carson__: shevy always gives the best advice
lallala has quit [Quit: Page closed]
shruggar has joined #ruby
heftig has joined #ruby
dangerousdave has quit [Quit: Leaving...]
<bnagy>
almost two hours since I recommended installing a reall OS... you would have been done by now ;)
pjn_oz has quit [Read error: Connection reset by peer]
Beoran has quit [Remote host closed the connection]
vladiim has left #ruby [#ruby]
Natch has joined #ruby
<banisterfiend>
bnagy: arent you the dude always trying to write code for windows
<Carson__>
shevy: okay it just finished .. now what?
<Carson__>
bnagy: hahaha maybe I'll try that next
<shevy>
Carson__ without error? that is cool, you could now try "make install"
<shevy>
I would have expected an error though :)
nilg` has joined #ruby
zommi has quit [Remote host closed the connection]
<shevy>
Carson__ when it is installed, you probably have to add /opt/ruby/bin to your $PATH variable. export PATH="$PATH:/opt/ruby/bin" should work, you could add this to ~/.bashrc if you use bash or wherever else you set your PATH variable
zeromodulus has joined #ruby
<shevy>
Carson__ another way would be to alias ruby to ruby=/opt/ruby/bin/ruby
bikcmp has quit [Ping timeout: 265 seconds]
<shevy>
if that ruby however works well for you, you could also compile it with --prefix=/usr, then it would "behave" like a "system ruby"
<shevy>
hmm also
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
<shevy>
Carson__, try "gem env" or "/opt/ruby/bin/gem env" if you haven't changed PATH yet
<Carson__>
shevy: i don't even know what the second option is but i think i'll go with yum
<shevy>
Carson__ ok but remember the important part in all of this! you now know that you can install ruby from source any time
<bnagy>
the third option is to set your centos dvd on fire and install a distro that doesn't suck
<Carson__>
shevy: if i do the yum method do i have to configure anything?
<shevy>
Carson__ no you should not, it should just download all the required files and install them
* bnagy
gets popcorn
<chiel>
i've never used centos, but i've only ever heard bad things about it. :D
<chiel>
i just use debian
<shevy>
bnagy is like a cheerleader really
<bnagy>
is there a Guiness Record for 'longest time to perform a trivial unix task' ?
<shevy>
oh god, debian
<Hanmac>
i wonder why my system has ruby1.9.3 without building anything self
<shevy>
Hanmac, how many ruby versions do you use?
<Carson__>
shevy: okay it's done installing with yum
<Hanmac>
i can use two
<chiel>
debian can be a pain as well, no doubt
ephemerian has joined #ruby
<chiel>
but so can any linux distro
<shevy>
Carson__ ok good... hmm
<chiel>
just depends on what you're used to, i suppose
<shevy>
Carson__ you have to go to the directory again where you extracted the ruby 1.9.3
<bnagy>
centos is not a distro, it's a passive agressive bitchy wife
<chiel>
haha :p
<bnagy>
when you run the installer it's full of useless dialog boxes
<Carson__>
shevy: okay so /opt/ruby
<bnagy>
"I'M LONELY! HOLD ME!" [OK]
<shevy>
Carson__, hmm no, where you have the sources
<shevy>
the extracted .tar.bz2
L-----D has quit [Quit: Leaving]
<Carson__>
shevy: yeah i wget the files there
<shevy>
hmm ok
<bnagy>
"I DID A THING! DID YOU SEE?" [OK]
<shevy>
a bit confusing :D
<chiel>
:D
<shevy>
Carson__, in the directory where you ran the ./configure thing
<chiel>
i need to start using capistrano.
<shevy>
do "make uninstall", "./configure --prefix=/opt/ruby","make","make install"
<shevy>
IF yum really installed libyaml, then psych will work and no longer report this annoying error
<shevy>
I dont trust package managers
Vainoharhainen has joined #ruby
DanAutoTester has joined #ruby
<bnagy>
<studio OOOOoohhh...>
<shevy>
:)
<Carson__>
shevy: lol make again
<shevy>
Carson__ yeah
<DanAutoTester>
Hello Everyone - Hope alll is well?
ryanf has quit [Read error: No route to host]
<shevy>
but it should be the last thing you have to do Carson__
<shevy>
if libyaml would have been installed before, the configure script would have found it, and enabled it
<Carson__>
it says make: *** No rule to make target `uninstall'. Stop.
<shevy>
oh wait
<shevy>
try "make clean"
<shevy>
or do the shevy fool proof way and remove the extracted dir, then extract the .tar.bz2 again :D
<shevy>
hmm
<shevy>
you are right
francisfish has quit [Remote host closed the connection]
<shevy>
in a moment I'll know what works
<Carson__>
shevy: okay i'm just go through the .configure
<shevy>
yay \o/
<DanAutoTester>
I could do with some help. I have currently have Xampp but, I will like to install Ruby on it. But I having a number of problems with reference to installing - Im beginner. Reason for installing Ruby - I want to install Bromine, I hope.
<shevy>
DanAutoTester does ruby work on your machine?
jackiechan0 has quit [Ping timeout: 245 seconds]
Hanmac has quit [Ping timeout: 244 seconds]
banseljaj is now known as imami|afk
<Carson__>
shevy: okay now it's doign make ... probably will take a while =(
<shevy>
by the way Carson__ the libyaml/psych bindings are in ext/psych
simao has quit [Ping timeout: 244 seconds]
ukwiz has joined #ruby
<Carson__>
do i have to do something with them later?
<shevy>
yeah Carson__ this is usually done by the distribution folks, they compile things once, then they create binaries/packages
oskarth has joined #ruby
<shevy>
Carson__ no, the configure script will have picked it up this time (hopefully), I am just telling you so you know a tiny bit about the structure
<shevy>
i.e. ext/readline bindings ext/psych bindings and so on
Hanmac has joined #ruby
<Carson__>
okay
<shevy>
ext/tk if you want an ugly graphical user interface ... :P
<Carson__>
shevy: okay well do i install readline after or will it already be installed?
<shevy>
Carson__ hmm we will find out soon
<shevy>
you know how to start "irb" right?
<shevy>
in irb you can then do:
<shevy>
require 'readline'
<shevy>
if this works, your readline works
<shevy>
readline should be no problem though
<Carson__>
okay cause last it said it wasn't working when i started irb I'm assuming readline is used so i can check the history for irb and backspace
<shevy>
I usually go into ext/readline and run the .rb file there
<shevy>
Carson__ we'll know soon!
<DanAutoTester>
shevy: I have done basic programs and have ran them, ok.
Telg has quit [Ping timeout: 272 seconds]
<shevy>
DanAutoTester ok, so you say that ruby works on your system
<shevy>
DanAutoTester I dont know what is Bromine, is that a gem? or installable as a gem?
jimeh has quit [Quit: bye]
simao has joined #ruby
monzie has joined #ruby
<bnagy>
I think it's a co-op version of minecraft
<shevy>
lol
<DanAutoTester>
shevy: Bromine is a Test Management Software, which works with Selenium. And I think I need to install Ruby inorder to install Bromine.
iocor has quit [Quit: Computer has gone to sleep.]
<shevy>
Bromine... Selenium ... all things I heard only in chemistry so far :D
<shevy>
DanAutoTester, usually the easiest way to install something in ruby is by
<shevy>
gem install NAME
<shevy>
gem install wirble
<shevy>
gem install pry
<shevy>
hmm
<shevy>
lemme try gem install bromine
<shevy>
ERROR: Could not find a valid gem 'bromine' (>= 0) in any repository
<shevy>
ok, that does not work
<shevy>
so I conclude that it has no .gem :(
<shevy>
DanAutoTester how is one supposed to install this Bromine thingy?
<DanAutoTester>
shevy: wow yes indeed, my friend.
<bnagy>
it doesn't look like it's anything to do with ruby
<shevy>
Carson__, by the way, I just tried "make clean" and it works for me
<bnagy>
maybe you can write tests in ruby for it somehow *shrug*
<shevy>
the dir I extracted it to was /Depot/j/ruby-1.9.3p194/
<shevy>
it indeed does not seem to have much to do with ruby :)
<shevy>
though I saw someone else link to the selenium website some days ago here hmm
<shevy>
it was the atlantis guy I think
tatsuya_o has joined #ruby
Telg has joined #ruby
<Carson__>
shevy: okay right on
<shevy>
"make install" finished? if so, try to start irb
<shevy>
then require 'readline'
<shevy>
by the way, you can save this into a irbrc file
<shevy>
then on every irb startup, you have this all already required
<shevy>
hmm also you can try ...
jackiechan0 has joined #ruby
<shevy>
YAML::ENGINE.yamler = 'syck'
<shevy>
if you dont want to use psych :D
<shevy>
for yaml files
<chiel>
is it possible to `raise`, but attach an error code as well as a message?
timonv has quit [Remote host closed the connection]
<bnagy>
not afaik, like there is no concept of error codes at all
demian`_ has joined #ruby
<bnagy>
you could put one in your exception string I guess
<Carson__>
shevy: nope hasn't finished yet... I'm doing this on my vps so it's a little slow
<shevy>
okies
<shevy>
I just compiled it again, I swear the rdoc installation took 50% of the compiled time... :P
<DanAutoTester>
shevy: Here is image of sort of errors Im getting when installing Bromine with Ruby. http://i.imgur.com/q9MVu.png
<chiel>
bnagy: ah okay
<shevy>
DanAutoTester that is very strange
<chiel>
was just wondering since I have a User class that throws UserError, but the reason for throwing can vary
<chiel>
so ideally i wanted to return some error code with it, to help me differentiate
<shevy>
DanAutoTester I believe it somehow wants you to tell it where it could find your ruby binary
<DanAutoTester>
shevy: Oh the Binary verson of Ruby?
foofoobar has quit [Quit: bb]
<shevy>
DanAutoTester no, the location, so that it can find it
<shevy>
I dont know where you have ruby installed
<shevy>
perhaps there is some config file or where you can set the paths in bromine
<bnagy>
chiel: usually you would create your own exception domains as subclasses of Exception::StandardException (I think) and use those to differentiate
<DanAutoTester>
shevy: C:\xampp\htdocs
<shevy>
DanAutoTester really???
<bnagy>
chiel: but ruby code, imho, tends to be less finicky about super fine grained exception classes
<shevy>
I cant believe that right now DanAutoTester
<shevy>
DanAutoTester without knowing more, I would suspect that no ruby binary is installed at that location
<chiel>
bnagy: yeah, i mainly want to report back the reason of failure, since this stuff is in an ajax call
jjxtsys has joined #ruby
<chiel>
differentiating on an integer can be easier than a string
<DanAutoTester>
shevy: Oh, I need to install Binary verson of Ruby?
<bnagy>
DanAutoTester: that's only a warning anyway, the error is a PHP thing
jbw has quit [Read error: Connection reset by peer]
<bnagy>
it's only if you want to run ruby tests
<bnagy>
you don't need ruby to run this bromine thing
c0rn has quit []
<shevy>
DanAutoTester, hmm on the image you showed, you only have one ERROR
<shevy>
"max executing time"
<Carson__>
shevy: okay finally done make .. what now?
<shevy>
and it tells you to modify php.ini file to allow a higher executing time or something
<DanAutoTester>
Oh I see I need to change it?
<shevy>
Carson__ ok when "make install" has finished, try to start irb. "irb" should hopefully work
<DanAutoTester>
In the PHP.ini file...
<shevy>
DanAutoTester yeah and then I think restart wampp
<bnagy>
chiel: yeah that's what you'd normally use subclasses for, like Connection::Timeout Connection::Refused (probably bad example, but..)
<Carson__>
shevy: it does
<shevy>
Carson__ if irb started, look if there were errors. if not... try to input "5+5" :D and then... do require 'readline'
<DanAutoTester>
Oh brillant I will try that now, my friends.
<shevy>
ok good!
<shevy>
Carson__, you should also install a test gem
<chiel>
bnagy: ahh okay, but I can catch them all with a single rescue, or so?
<bnagy>
chiel: you can rescue the superclass yeah
<shevy>
Carson__, I think you can do this in IRB too... try ... 'system "gem install wirble"' in irb
<bnagy>
or just 'rescue' which will catch any kind of StandardException
<bnagy>
and then case from there
<chiel>
bnagy: ok cool. so i could have, for example UserError::Exists as an error, but simply catch on `UserError`
<bnagy>
uh you would need to assign it to do that
<chiel>
bnagy: hmm yeah, but I also catch Sequel errors, in case the db goes wonky
<shevy>
I really think you only lack the /usr/include/readline/* things
<shevy>
if you manage to install the "devel" package, you should have a complete readline though
<Carson__>
okay it installed
<shevy>
ok can you check
<bnagy>
so far
<shevy>
in /usr/include if there is now a readline/ directory?
<bnagy>
we're still not up to irb even working properly yet - can't wait for rails XD
<shevy>
bnagy have some hope for centos :)
<Carson__>
shevy: yup it's there now
<bnagy>
yay! let's reconfigure / recompile again! Ninth time lucky!
<Carson__>
bnagy: lmao
<shevy>
ok good Carson__
<shevy>
nah
<shevy>
wont need a recompile
<Carson__>
shevy: okay good
<shevy>
Carson__, go to the extracted dir of ruby, into the ext/readline subdir
yugui is now known as yugui_zzz
<shevy>
when you are there, do "ruby extconf.rb"
ananthakumaran has joined #ruby
<shevy>
you should get several lines, like:
<shevy>
checking for readline() in -lreadline... yes
<shevy>
checking for rl_getc() in stdio.h,readline/readline.h,readline/history.h... yes
<shevy>
though
<shevy>
who knows what else is missing on your system :P
<shevy>
the last message that is shown is:
<Carson__>
shevy: okay there done
<shevy>
"creating Makefile"
<shevy>
really? it worked?
<shevy>
wheee
<shevy>
do "make" then
<shevy>
then "make install", then start irb again, in irb try
<shevy>
require 'readline'
<shevy>
this works for me, hopefully it does for you too
<Carson__>
shevy: lol i thought you said i wouldn't have to do that again -_-
ananthakumaran1 has quit [Ping timeout: 260 seconds]
<shevy>
only the readline bindings
<shevy>
hmm
<shevy>
it would have worked before at ./configure time too
<bnagy>
Carson__: shevy is a mythomaniac, I thought you would have realised that by now
<shevy>
if the readline*.h files would have been there
<Carson__>
shevy: wait so i actually enter creating Makefile?
<shevy>
Carson__ nope
<shevy>
it is just some output generated when you do run "ruby extconf.rb"
heftig has quit [Quit: leaving]
<Carson__>
okay so make > make install
<shevy>
extconf.rb creates the Makefile
mneorr has joined #ruby
<shevy>
yeah but you must run extconf.rb first so you have the Makefile in that directory
<shevy>
and then make and then make install
<shevy>
hmmm
<shevy>
actually
<shevy>
perhaps you dont even have to use make at all
<Carson__>
shevy: okay make and make install done
<shevy>
it seems something changed from ruby 1.8.7 and 1.9.3 here
<shevy>
on 1.8.7, running extcong.rb seems to be enough
<shevy>
anyway, if no errors happened, start irb Carson__
<shevy>
then do require 'readline' again
ananthakumaran has quit [Ping timeout: 272 seconds]
<Carson__>
shevy: it says false
monzie has quit [Quit: monzie]
<shevy>
hmm
<bnagy>
wooo!
IPGlider has joined #ruby
<bnagy>
(that's good)
<shevy>
it is??
<bnagy>
barely four hours in and we have reached step 0!
ananthakumaran has joined #ruby
<bnagy>
yeah false means it has already been required
<shevy>
aha
<Carson__>
lol
<shevy>
I would have now recommended to get rid of centos :)))
<shevy>
but if readline works finally... then we are indeed at step 0 now
nilg`` has joined #ruby
<shevy>
Carson__ try -> system 'gem install wirble'
<shevy>
in irb
<Carson__>
seems to work since i can't now backspace
<shevy>
what
<shevy>
backspace does not work??
<shevy>
oh man
nilg` has quit [Ping timeout: 248 seconds]
<shevy>
here on my system, backspace and readline both work fine
<bnagy>
I am hoping that was a typo for 'can now'
<Carson__>
awesome it worked .. well i tried with awesome_print
<Carson__>
bnagy: lol yeah that was a typo
<shevy>
well good
<shevy>
now we know that gem works, and that you can use gem to install things too
<shevy>
and now you really want to go to rails straight? :\
<shevy>
:/
<shevy>
though
<shevy>
you could try "gem install rails"
<Carson__>
okay how do i make this ruby my default so it doesn't go back to 1.8.5?
<shevy>
it works for me
<bnagy>
Carson__: the good news is that rails is waay less complex and has less dependencies than readline
<shevy>
Carson__, well it depends really
<bnagy>
so it should all be easy now
<shevy>
Carson__, you could remove all of 1.8.5 for instance
<shevy>
or
* bnagy
giggles
<shevy>
you just store the $PATH somewhere
<Carson__>
shevy: i'll go with the path method
<Carson__>
how do i do that>?
<shevy>
hmm try at bashrc first
jbw has joined #ruby
<shevy>
I think other files are sourced in too though, like /etc/profile
jds_ has quit [Remote host closed the connection]
<shevy>
but $PATH in bashrc should work
<bnagy>
.bash_profile but .bashrc I guess is ok
<shevy>
yeah some of these
jjxtsys has quit [Ping timeout: 252 seconds]
<Carson__>
okay what do i add to to bashrc?
<shevy>
I usually source several files. one file alone for instance holds my $PATH settings
<shevy>
Carson__, the export $PATH command that should work there too
<shevy>
output your current $PATH
<shevy>
copy/paste this into your bashrc... export $PATH="insert here the output of that..."
<Carson__>
okay the output of the $PATH command just add it to the end of my bashrc file?
tonini has quit [Remote host closed the connection]
<shevy>
Carson__ yeah, inside "quotes"
<shevy>
for instance
senny has quit [Remote host closed the connection]
<shevy>
export PATH="/usr/bin/:/opt/ruby/bin"
<bnagy>
(except you need /opt/ruby/bin first)
<shevy>
oh yeah
<shevy>
see, bnagy is paying attention to details :)
<shevy>
Carson__, bash processes the entries at : one after the other, so whatever you want to have "highest priority", should come first in your $PATH setting
heftig has joined #ruby
<banisterfiend>
heftig: hi
foofoobar has joined #ruby
berserkr has joined #ruby
<shevy>
Carson__ I must be afk for ~20 minutes or such, sorry. be back after ~20 mins
jjxtsys has joined #ruby
cyb3r3li0g has joined #ruby
<Carson__>
shevy:
<Carson__>
shevy: okay
<Carson__>
wait quick question/opt/ruby/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/home/carson/bin under user specific aliases and fucntions?
<bnagy>
it can go anywhere in that file
cyb3r3li0g has quit [Max SendQ exceeded]
<Carson__>
bnagy: okay so exacly like that
<bnagy>
but it should look like export PATH=/opt/ruby/bin:$PATH
<bnagy>
or similar
<bnagy>
you can spell out the whole thing if you really want
<Carson__>
do i need the export or can it be thisPATH= /opt/ruby/bin:/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/home/carson/bin
<bnagy>
no the export command is optional I just said it because I like wasting people's time
<bnagy>
:|
<Carson__>
bnagy: lol okay thanks
francisfish has joined #ruby
foofoobar has quit [Quit: bb]
cyb3r3li0g has joined #ruby
G3DinUA has joined #ruby
LyonJT has joined #ruby
cyb3r3li0g has quit [Max SendQ exceeded]
sepp2k has joined #ruby
workmad3 has joined #ruby
mneorr has quit [Remote host closed the connection]
mneorr has joined #ruby
monzie has joined #ruby
<schovi>
Hello. Have simple quiz for you. How to convert OpenStruct back to hash?
jbw has quit [Ping timeout: 272 seconds]
<bnagy>
ostruct.marshal_dump ?
<heftig>
ostruct.send(:table), but this violates encapsulation
<ccooke>
ctp_: so you want to turn that into an array of hosts?
<ccooke>
ctp_: array.map { |i| i["host"] } will do it.
jonathanwallace has joined #ruby
<ctp_>
ccooke: ah, ok. thx :)
vectorshelve has joined #ruby
<vectorshelve>
shevy: hai dear :)
<vectorshelve>
shevy: not a day passes with wishing shevy :)
<ctp_>
ccooke:hm, not exactely what i need. i need an array of hashes containing only host/port: [{"host"=>"192.168.1.1", "port"=>"80"}, {"host"=>"192.168.1.2", "port"=>"8080"}]
<shevy>
vectorshelve yeah I wish you'd stop using rails ;P
<ccooke>
ctp_: well, you can still use map to do it.
<chiel>
does any of you use capistrano to deploy non-rails apps?
Neil___ has joined #ruby
<ccooke>
ctp_: array.map { |i| { :host => i["host"], :port => i["port"] } } will work
<shevy>
chiel not me
<ctp_>
ccooke: cool, this works
<vectorshelve>
shevy: what to do... my bread and butter
neil__ has quit [Ping timeout: 244 seconds]
<chiel>
shevy: boo, i wanted long explanations on how to use it for non-rails stuff! :p
includex has joined #ruby
<bnagy>
ctp_: just as a note, using |i| as your block variable there is the kind of habit that makes maintainers hate you
<bnagy>
I'd suggest |hsh| or |h|
<shevy>
or |hash| !
<shevy>
or |_|
d3c has quit [Quit: Sleep]
medik has joined #ruby
<bnagy>
I don't like using identifiers that would be methods in other contexts - just imho
<ctp_>
bnagy: yepp, named it |hash| cause of all the other i's :)
<bnagy>
I really wish there were a nicer way than that, as well. It looks ugly :(
<ctp_>
shevy: what't the meaning of _ in such a case?
<shevy>
ctp_ no, it's just a variable that does not want to have a name :)
<ctp_>
ok
<shevy>
it's a shy variable
<ctp_>
:)\
<shevy>
it's saying "hey... let's just do this, then leave"
<ccooke>
I prefer single-letter variables where the code is short, fully descriptive if it's more than a line or two.
<bnagy>
usually (opinion, again) _ is used for variables you want to ignore
<shevy>
yeah
<bnagy>
so not really appropriate in this case
<ccooke>
and yes, 'h' is a vastly better idea than 'i'
etehtsea has joined #ruby
<ccooke>
'hash' is... not a great idea, because it's very likely to clash with something in scope.
<ccooke>
(whereas if 'h' clashes in scope, you shouldn't have ever used it)
Morkel has quit [Quit: Morkel]
Guedes_out is now known as Guedes
Guedes has quit [Quit: Saindo]
heftig has quit [Quit: leaving]
Guedes has joined #ruby
Guedes has quit [Remote host closed the connection]
Guedes0 has joined #ruby
LyonJT has quit [Remote host closed the connection]
<Mon_Ouie>
Since block variables shadow outer variables, it doesn't matter if there's a name clash
LyonJT has joined #ruby
<banisterfiend>
Mon_Ouie: can u hink of a way to access the outer variable
<bnagy>
I agree it will work, I just don't like it cause it's creepy
<shevy>
banisterfiend is french better than german?
<banisterfiend>
shevy: french is less scary
<banisterfiend>
but also sounds kind of effeminate
LyonJTill has joined #ruby
<Mon_Ouie>
You can't, that's the point of shadowing (well, you could keep the outer binding object and use eval but that's not the point)
liluo has quit [Remote host closed the connection]
<bnagy>
cheese, yes, mustard, no
<banisterfiend>
Mon_Ouie: well i'm not arguing that, im just wondering if there's an evil hack
<bnagy>
wine, yes, bread, tie
<bnagy>
language, who cares, they'll both fall into disuse once europe goes broke :>
davidcelis has quit [Read error: Connection reset by peer]
heftig has joined #ruby
<shevy>
heeh
<shevy>
we just need to print more euros
<bnagy>
yeahhhh...see the thing about the ecb...
<bnagy>
anyway, no politics. I apologise
jkarayusuf has joined #ruby
LyonJT has quit [Ping timeout: 265 seconds]
greyEAX has joined #ruby
davidw has quit [Read error: Operation timed out]
<bnagy>
banisterfiend: have you heard the south eastern dialect / accent? (french)
<bnagy>
it's horr riii bulll :>
<banisterfiend>
bnagy: i think u mean 'orr ii bull' the french have an aversion to 'h'
<banisterfiend>
they steadfastly refuse to pronounce them
<banisterfiend>
even though their words are littered with 'h'
<banisterfiend>
they still refuse
<bnagy>
I wasn't trying to imitate it
<banisterfiend>
my bro used to have a cute little french piece as a gf, and she would always say she's 'appy
<shevy>
banisterfiend, do you know the german word for dog?
<banisterfiend>
when my brother would pull her up on it, she'd struggle to pronounce the 'h' but i just sounded like she was doing a long exhale before again saying 'appy
<bnagy>
or I would have said (pinch nose) mearci parr le coo de meng
<banisterfiend>
it*
davidcelis has joined #ruby
Whoop has quit [Ping timeout: 250 seconds]
codebeaker has joined #ruby
EddieS has joined #ruby
EddieS is now known as Guest63712
<banisterfiend>
anyone nkow what the resolution should be for an osx taskbar icon?
Whoop has joined #ruby
<shevy>
1x1
<bnagy>
shevy: hmm, I see your point
<banisterfiend>
shevy: when i visit u in austria later this year im going to spank u with a mechanical courset
<shevy>
no please :(
<shevy>
can I pay you to not come?
<banisterfiend>
shevy: im going to drag u out of the gloom of yoru house and into the sun, adn we're going to boogie woogie our way round the viennese night life
<banisterfiend>
into the sun --> night life
BrokenCog has joined #ruby
<shevy>
omg
<banisterfiend>
yes a confused sentence, but u know what i mean
<shevy>
seems I will have to die this year
<bnagy>
this is getting more and more win win
<shevy>
:(
fr0gprince_ma has quit [Quit: Leaving...]
Codif has joined #ruby
Guest54355 has quit [Ping timeout: 245 seconds]
yosinof has joined #ruby
iamjarvo has joined #ruby
Guest54355 has joined #ruby
Codif has quit [Remote host closed the connection]
noodletraveler has quit [Quit: leaving]
<bnagy>
ok quiz night
<bnagy>
shevy: try not to break anyone else's linux boxes while I'm gone
headius has joined #ruby
cephalopod has joined #ruby
Beoran_ has joined #ruby
<cephalopod>
tpb still unavailable
* cephalopod
wants moar kung fu moviez
crankycoder has joined #ruby
cephalopod is now known as octobrainz
avirahmed has joined #ruby
<avirahmed>
hi
<octobrainz>
sorry, wrong chan
Beoran4 has quit [Ping timeout: 252 seconds]
avirahmed has left #ruby [#ruby]
jakeanq has joined #ruby
linduxed has quit [Ping timeout: 246 seconds]
shiki has quit [Remote host closed the connection]
BuGo has joined #ruby
<BuGo>
i want to use rake without bundler and when running rake i get : Could not locate Gemfile
<BuGo>
why rake requires Gemfile and how to make it skip it
jakeanq has left #ruby [#ruby]
mwyrobek has joined #ruby
amalvagomes has joined #ruby
nfk has joined #ruby
nfk has quit [Changing host]
nfk has joined #ruby
etehtsea has quit []
uris has joined #ruby
uris has quit [Client Quit]
M- has joined #ruby
M- has quit [Remote host closed the connection]
akemrir has joined #ruby
Solnse has quit [Read error: No route to host]
mucker has quit [Quit: leaving]
<BuGo>
anyone?
DefV has quit [Ping timeout: 272 seconds]
StoSun has joined #ruby
StoSun has quit [Client Quit]
akem has joined #ruby
<Mon_Ouie>
Rake doesn't need a Gemfile
<Mon_Ouie>
It will only do that if you somehow have code in it that uses one
StoSun has joined #ruby
znake has joined #ruby
<BuGo>
Mon_Ouie: then why it complains that it does?
_md has joined #ruby
<Mon_Ouie>
Because you somehow have code in it that uses one
dv310p3r has quit [Ping timeout: 272 seconds]
<BuGo>
Mon_Ouie: how to find that code?
cs[tc] has quit [Ping timeout: 260 seconds]
headius has quit [Quit: headius]
cs[tc] has joined #ruby
DefV has joined #ruby
liluo has joined #ruby
tommyvyo has joined #ruby
tommyvyo has quit [Client Quit]
jcromartie has joined #ruby
blacktulip has joined #ruby
amalvagomes has quit [Ping timeout: 252 seconds]
<shevy>
BuGo you could try to use "grep" if you are linux
codebeaker has quit [Quit: codebeaker]
<BuGo>
shevy: grep what?
krusty_ar has joined #ruby
<BuGo>
more like - what should i search for?
<shevy>
BuGo good question
<shevy>
what project do you try to install?
tommyvyo has joined #ruby
<BuGo>
shevy: i am not trying to install anything :) i am simply running rake
tommyvyo has quit [Client Quit]
<shevy>
BuGo but then there must be a Rakefile
<shevy>
and inside that Rakefile there are the tasks defined that are possible
tommyvyo has joined #ruby
s0ber has quit [Quit: leaving]
berserkr has quit [Quit: Leaving.]
s0ber has joined #ruby
iamjarvo has quit [Quit: Leaving.]
nari has joined #ruby
RoUS has joined #ruby
ecolitan has quit [Read error: No route to host]
<BuGo>
shevy: nah. There is more magit to that
graspee has joined #ruby
demian`_ has quit [Quit: demian`_]
<shevy>
I hate magic
<BuGo>
same
<ctp_>
Howdy. Anyone here's coding EventMachine? Why doesnt the EM loop get the same data struct the callback in the function above returns? https://gist.github.com/2709886 line 26 and 39 *confused*
`brendan has joined #ruby
jcromartie has quit [Quit: jcromartie]
rorymckinley2 has joined #ruby
<vectorshelve>
hemanth: bhai kaise ho ? bahut din ho gaya aapse baat karke
headius has joined #ruby
<apeiros_>
vectorshelve: this is an english channel. if you wish to converse in hindu, join/found a language specific channel or use private messages. thank you.
<BuGo>
16:17 < vectorshelve> hemanth: bhai kaise ho ? bahut din ho gaya aapse baat karke
<BuGo>
The fcuk?
<vectorshelve>
apeiros_: ok.. sorry.. but it's hindi not hindu.. hindu is a religion in India :)
<apeiros_>
ok
oponder has joined #ruby
<BuGo>
its indian
<oponder>
hey guys, im having an issue with Timeout and DRB hanging when i try to connect to a server that isnt up. wrapping it in a timeout block doesn't cause anything to get raised as I expected... http://pastie.org/3920186
dnyy has quit [Remote host closed the connection]
<oponder>
i think its because DRB is locking the whole things trying to connect to the server
BuGo has left #ruby [#ruby]
headius has quit [Quit: headius]
<oponder>
and there was a gem that got around this for 1.8, but they say that it wasnt needed in 1.9.3 (which is what im using)... but am running into it in this case
bgupta has quit [Ping timeout: 244 seconds]
<oponder>
the gem was called SystemTimer, for those wondering
tommyvyo has quit [Remote host closed the connection]
tommyvyo has joined #ruby
amalvagomes has joined #ruby
stepnem has joined #ruby
cyb3r3li0g has quit [Max SendQ exceeded]
lxsameer has joined #ruby
pu22l3r has joined #ruby
<lxsameer>
hi, i'm a python developer, i need to learn ruby as fast as possible to make some changes on a ruby on rails project, what should i read first?
rorymckinley2 has quit [Ping timeout: 245 seconds]
pu22l3r_ has quit [Remote host closed the connection]
pu22l3r_ has joined #ruby
pu22l3r has quit [Ping timeout: 244 seconds]
lorandi has joined #ruby
jimeh has joined #ruby
ConstantineXVI has joined #ruby
geekbri has joined #ruby
yugui_zzz is now known as yugui
nari has joined #ruby
nilg`` has quit [Remote host closed the connection]
cyb3r3li0g has joined #ruby
<shevy>
lxsameer if you know python well, you can read through http://pine.fm/LearnToProgram/ quickly and try the examples. it should be very easy as you can already program, but you get a very nice simple overview
nipra has quit [Ping timeout: 272 seconds]
dhaskew has joined #ruby
<lxsameer>
shevy: nice thanks
imami|afk is now known as banseljaj
cyb3r3li0g has quit [Max SendQ exceeded]
ConstantineXVI has quit [Ping timeout: 245 seconds]
Jackneill has joined #ruby
nilg` has joined #ruby
Morkel has joined #ruby
nilg` has quit [Remote host closed the connection]
true_techie has joined #ruby
nilg` has joined #ruby
nilg` has quit [Read error: Connection reset by peer]
<true_techie>
i need a crash course on ruby. also what is => and why are colons attached to variables?
amalvagomes has quit [Read error: Connection reset by peer]
nilg` has joined #ruby
<banisterfiend>
true_techie: not a variable, it's a symbol
<banisterfiend>
true_techie: buy a book :)
amalvagomes has joined #ruby
<banisterfiend>
true_techie: or read one of the free books online
<banisterfiend>
such as 'learn ruby the hard way'
* hoelzro
is reading "The Ruby Programming Language"
<hoelzro>
it's quite good so far.
<true_techie>
harf way? Im a fast learner
<banisterfiend>
hoelzro: yeah that's the best one
llaskin has joined #ruby
<shevy>
true_techie :foo is a symbol
<true_techie>
hard..
<hoelzro>
I chose wisely then =)
<chiel>
true_techie: symbols are a bit like strings
<shevy>
=> is used in a hash , { :your_key => 'some value here' }
<chiel>
but like light-weight strings, used as keys, for example
davidw has joined #ruby
davidw is now known as Guest81769
<llaskin>
is there any reason why a object might "switch" casting types without any specific reason?
<workmad3>
symbols are an interesting conjunction of 'sort-of string, sort-of enumerable, sort-of interesting' :)
<llaskin>
I am having a weird issue where I have an item going from a WebElement to an Array of WebElements randomly
<workmad3>
*enumeration, not enumerable
rorymckinley2 has joined #ruby
dv310p3r has joined #ruby
ph^ has quit [Read error: Connection reset by peer]
<shevy>
llaskin there is always a specific reason
<llaskin>
shevy i honestly can't find one
<shevy>
something must do something like return an array
maesbn has quit [Remote host closed the connection]
<banisterfiend>
workmad3: i was thinking u meant Enumerator for a minute there before i figured u meant C enum ;)
h4mz1d has quit [Ping timeout: 245 seconds]
<workmad3>
banisterfiend: yeah, C/C++/java style enum... sort of (certainly used in similar contexts :) )
<shevy>
llaskin and what is "webelement"
ph^ has joined #ruby
<llaskin>
WebElement is an Element from Selenium
<llaskin>
its a "single" item, not an array.
emmanuel__ has joined #ruby
jjxtsys has quit [Ping timeout: 256 seconds]
<shevy>
well but it looks like an array
<shevy>
row = webelement[0]
<shevy>
first element is assigned to the variable called row
<llaskin>
here's why that is there
<llaskin>
for some reason i am having find_element basically u can get elements by either a) find_element(which returns an element) or b) find_elements
<llaskin>
woops
<llaskin>
basically u can get elements by either a) find_element(which returns an element) or b) find_elements
znake_ has joined #ruby
<shevy>
also I wonder why you are unable to find where exactly the problem is
<llaskin>
find_elements returns an array of elements
<shevy>
simply do require 'pp' and debug, add pp row.class
<llaskin>
i have spent ~3 days trying to figure
<shevy>
then you know which line is the culprit
<llaskin>
i can do that
<llaskin>
hrm
<shevy>
or puts row.class should work too
jrist-afk is now known as jrist-mtg
<shevy>
but right now this all seems odd
<shevy>
you write "somewhere between do_a and do_z, row becomes an array", why do you not know yet where exactly the error happens
jrbing has joined #ruby
maesbn has joined #ruby
znake has quit [Ping timeout: 244 seconds]
znake_ is now known as znake
snearch has joined #ruby
looopy has quit [Remote host closed the connection]
h4mz1d has joined #ruby
true_techie has quit [Quit: Lost terminal]
<llaskin>
i know shevy
<llaskin>
i'm tracking it now to see what happens
<llaskin>
boy this is gonna be fun to parse
sbanwart has quit [Ping timeout: 260 seconds]
Gavilan has left #ruby [#ruby]
jjxtsys has joined #ruby
<Hanmac>
llaskin: ruby has stict typing ... an object itself can not change its type
<llaskin>
i know
<banisterfiend>
Hanmac: it can with wonderful hacks
<llaskin>
which is why i am like "what the fuck"
<llaskin>
(pardon my french)
fragrant has joined #ruby
fragrant has left #ruby [#ruby]
<vectorshelve>
any suggestions on implementing single sign on using AES encryption algorithm on rails app
<vectorshelve>
sorry wrong channel
Boohbah has quit [Remote host closed the connection]
sbanwart has joined #ruby
Boohbah has joined #ruby
mdhopkins has quit [Quit: mdhopkins]
CannedCorn has joined #ruby
chson has quit [Remote host closed the connection]
linduxed has quit [Ping timeout: 272 seconds]
mstratman has joined #ruby
cmarques has joined #ruby
Poapfel has quit [Ping timeout: 256 seconds]
Poapfel has joined #ruby
Guedes0 has quit [Quit: Saindo]
Guedes has joined #ruby
nilg` has quit [Remote host closed the connection]
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
G3DinUA has quit [Quit: Leaving.]
dhaskew_ has joined #ruby
dhaskew has quit [Read error: Connection reset by peer]
dhaskew_ is now known as dhaskew
rippa has quit [Quit: derp herp]
Zolrath has quit [Quit: Computer has gone to sleep.]
dhaskew has quit [Quit: dhaskew]
snearch has quit [Quit: Verlassend]
gokul has quit [Quit: Leaving]
Targen has quit [Ping timeout: 260 seconds]
Ontolog has joined #ruby
Poapfel has quit [Ping timeout: 256 seconds]
PeterB has joined #ruby
blacktulip has quit [Remote host closed the connection]
<macmartine>
Is there a way to make this verify there are 3 or more non-space characters total, while spaces are allowed? http://rubular.com/r/Nu87gXs3Qj
Poapfel has joined #ruby
amalvagomes has quit [Quit: amalvagomes]
mdhopkins has joined #ruby
blacktulip has joined #ruby
<apeiros_>
macmartine: (?:[^ ] *){3,}
vectorshelve has quit [Quit: Page closed]
<apeiros_>
depending on how you use the regex, just {3} instead of {3,}
<macmartine>
apeiros_: Well, sorry I didn't specify this, but I only want letters and numbers
<banisterfiend>
apeiros_: i told u about that compiler course a while ago, we learned that regex actually form an algebra with well defined operations and u can actually prove that two regular expressions are equivalent
<apeiros_>
macmartine: then adapt the character class accordingly.
<banisterfiend>
pretty interesting
philcrissman has quit [Remote host closed the connection]
<apeiros_>
banisterfiend: heh, that'd probably go over my head
<apeiros_>
but nice… I'd certainly love to have the knowledge
* apeiros_
wants matrix-learning
PeterB has left #ruby ["Leaving"]
<banisterfiend>
apeiros_: well it's just 2 hours of video lectures and you'd have it :)
<banisterfiend>
all free
<banisterfiend>
and pretty accessible
Shahor has joined #ruby
<iamjarvo>
is there downloadable version of the bastards book?
Shahor has quit [Client Quit]
philcrissman has joined #ruby
<macmartine>
apeiros_: not sure how
yugui is now known as yugui_zzz
yugui_zzz is now known as yugui
spacebug has joined #ruby
mike has joined #ruby
spacebug has quit [Client Quit]
mike is now known as Guest77979
jcromartie has joined #ruby
nanderoo has joined #ruby
Guest81769 has quit [Ping timeout: 260 seconds]
oskarth has quit [Read error: Connection reset by peer]
kaneda_ has joined #ruby
kedare has joined #ruby
fowl has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
Guest77979 has left #ruby ["WeeChat 0.3.7"]
mneorr has joined #ruby
Guest54355 has quit [Ping timeout: 265 seconds]
<Synthead>
I have a stream of XML with repetitious tags, like <this><that>stuff</that></this><this>...</this>, etc., and I'm parsing it with Nokogiri::XML. If I do .xpath('//this').each { |xml| puts xml.xpath('//this').to_s }, I get the entire stream of XML to #{xml} every loop. Why?
td123 has joined #ruby
LBRapid has joined #ruby
gtuckerkellogg has joined #ruby
<jcromartie>
is there some drama over Rails or Rack going on right now?
<jcromartie>
or some general community drama?
<banisterfiend>
jcromartie: always is in the rails world
<shevy>
jcromartie no idea but I guess the guys on #rubyonrails would know
<banisterfiend>
rails is a circus
<banisterfiend>
i hope rubymotion refocuses the ruby community, it's embarrassing having the language so closely associated with the pack of witless ninnies that is "rails programmers"
<apeiros_>
macmartine: just replace the [^ ] with your [a-zA-Z\d]
jjxtsys has quit [Ping timeout: 272 seconds]
<kalleth>
banisterfiend:
<kalleth>
you got your ""'s the wrong way round
<kalleth>
it's rails "programmers"
<banisterfiend>
hehe
<macmartine>
apeiros_: ah! thanks
<kalleth>
"i want to implement oauth and facebook api into my rails app anyone link mei want guide copy paste plz"
philcrissman_ has joined #ruby
apeiros_ has quit [Remote host closed the connection]
fr0gprince_mac has joined #ruby
perryh is now known as perryh_away
carloslopes has joined #ruby
amalvagomes has joined #ruby
ph^ has quit [Ping timeout: 272 seconds]
<Synthead>
any clue? :s
lolmaus has quit []
kaneda_ has quit [Ping timeout: 248 seconds]
TheHunter_1039 has joined #ruby
znake has quit [Quit: znake]
Xylo1 has quit [Quit: Leaving.]
Squarepy has joined #ruby
king313 has joined #ruby
king313 has quit [Changing host]
king313 has joined #ruby
simao_ has joined #ruby
<shevy>
Synthead dunno sorry, I stopped using XML years ago
crankycoder has quit [Ping timeout: 244 seconds]
crankycoder has joined #ruby
Kwpolska has joined #ruby
chson has joined #ruby
albemuth has joined #ruby
akemrir has quit [Quit: WeeChat 0.3.7]
<workmad3>
Synthead: because your xpath-fu is off
simao has quit [Ping timeout: 252 seconds]
<workmad3>
Synthead: // will search within the entire document (not scoped)
philcrissman has quit [Remote host closed the connection]
<Synthead>
workmad3: oooooh
<Synthead>
workmad3: even if it's matched bits within a block?
<workmad3>
Synthead: I'm not an xpath expert... I'd suggest looking up the w3c stuff for more details, but from what I remember, // lets you break out of the context of the current node to search the rest of the document
Squarepy has quit [Changing host]
Squarepy has joined #ruby
<workmad3>
Synthead: it's basically saying 'match any path to a node called <this> from the root'
<Synthead>
workmad3: oooh, this conforms to W3C standards? wow, I never knew that! That's very cool :D
<workmad3>
Synthead: xpath is a w3c standard, yes... and nokogiri is a ruby wrapper around libxml2 to 'rubyify' it :)
<fowl>
you're definition of very cool is different than mine
<fowl>
your* :(
kpshek has joined #ruby
<Hanmac>
thats why i like nokogiri ... its the ruby way :P
bbttxu has joined #ruby
axl_ has joined #ruby
linduxed has joined #ruby
b1rkh0ff has joined #ruby
robbyoconnor has quit [Ping timeout: 272 seconds]
simao_ is now known as simao
<workmad3>
fowl: heh :) 'cool' along with 'xml' and 'w3c standard' does seem a bit oxymoronic :)
b1rkh0ff has quit [Client Quit]
b1rkh0ff has joined #ruby
the-newsman has joined #ruby
<the-newsman>
Hello all
<the-newsman>
what does :: mean ?
b1rkh0ff has quit [Read error: Connection reset by peer]
kevinbond has joined #ruby
<DefV>
double double colon
<chiel>
the-newsman: means something is inside a module
b1rkh0ff has joined #ruby
ipoval has quit [Quit: ipoval]
cantonic has quit [Remote host closed the connection]
cantonic has joined #ruby
ikaros has joined #ruby
nari has quit [Ping timeout: 252 seconds]
uris has joined #ruby
BeLucid has quit [Read error: Operation timed out]
BeLucid has joined #ruby
<Synthead>
workmad3: also, I removed '//' from the xpath string and it works :D
<carloslopes>
the-newsman, chiel: or inside a class
<chiel>
carloslopes: ah, can you nest classes?
withnale has quit [Read error: Connection reset by peer]
withnale has joined #ruby
savage- has joined #ruby
<carloslopes>
chiel: i think you don't, but you can declare a constant inside it, and call the constant using MyClass::CONSTANT
<chiel>
ahh right, of course, my bad :)
<carloslopes>
chiel: ;)
<chiel>
i am very much a ruby noob, still. :D
ABK has quit [Read error: Operation timed out]
<carloslopes>
chiel: i think that we all are :)
<lectrick>
class Config < BasicObject; end #=> TypeError: Config is not a class ... uh, what??
<chiel>
carloslopes: lies! :D
cantonic_ has joined #ruby
bbttxu has quit [Quit: bbttxu]
<lectrick>
lol I basically just want a simple container that holds a single attr_accessor
<llaskin>
is there a reason why one would use a do end instead of {} on a multi line block?
Morkel has quit [Quit: Morkel]
<carloslopes>
llaskin: it's just convention..
thone_ has joined #ruby
<lectrick>
omg Config is an RbConfig and is somehow already defined in the root ruby namespace. Who knew??
<llaskin>
i see
king535 has joined #ruby
king313 has quit [Read error: Connection reset by peer]
thone has quit [Read error: Operation timed out]
<carloslopes>
llaskin: but IMO it's better to follow it :) ... i only escape from it when i need nested blocks, in this case i always use {}
asobrasil has joined #ruby
rorymckinley2 has quit [Ping timeout: 248 seconds]
yugui is now known as yugui_zzz
nfk has quit [Quit: yawn]
cantonic has quit [Ping timeout: 250 seconds]
cantonic_ is now known as cantonic
<lectrick>
Is there an object that acts like a hash but lets you access the keys as method calls?
jrist-mtg is now known as jrist
<Hanmac>
lectrick do you look after a struct or OpenStruct?
minijupe has joined #ruby
<lectrick>
Hanmac: Yes that's an idea I will look at those
snip_it has joined #ruby
yugui_zzz is now known as yugui
oskarth has joined #ruby
sahli has joined #ruby
heftig has quit [Quit: leaving]
trivol has joined #ruby
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
cywill has joined #ruby
C0deMaver1ck has joined #ruby
C0deMaver1ck is now known as Guest97592
dustybrains has joined #ruby
Boohbah has quit [Ping timeout: 276 seconds]
sahli has quit [Remote host closed the connection]
rorymckinley2 has joined #ruby
Guest97592 is now known as C0deMaver1ck
nfk has joined #ruby
C0deMaver1ck has quit [Changing host]
C0deMaver1ck has joined #ruby
luxurymode has joined #ruby
savage- has quit [Remote host closed the connection]
ThatDudeGuy_ has joined #ruby
v0n has joined #ruby
rasbonics has joined #ruby
gtuckerkellogg has quit [Quit: Computer has gone to sleep.]
<hoelzro>
dknight_: you mean what does the realm variable signify?
<oooPaul>
dknight_: Look up "realm" and "basic auth" on Google.
<dknight_>
hoelzro: yeah
<dknight_>
oooPaul: okay
<hoelzro>
dknight_: what oooPaul said.
yugui is now known as yugui_zzz
cyb3r3li0g has quit [Max SendQ exceeded]
visof has joined #ruby
cache_za has quit [Remote host closed the connection]
sparrovv has quit [Ping timeout: 244 seconds]
CheeToS has joined #ruby
bbttxu has joined #ruby
fowl has quit [Ping timeout: 244 seconds]
pablo_ has quit [Ping timeout: 272 seconds]
crankyco_ has joined #ruby
crankycoder has quit [Ping timeout: 255 seconds]
cantonic has quit [Quit: cantonic]
prometheus has joined #ruby
dekroning has joined #ruby
snip_it has quit [Quit: snip_it]
jprovazn is now known as jprovazn_away
tommyvyo has quit [Ping timeout: 244 seconds]
<dekroning>
i'm having something strange happening on CI server that I can't replicate on any other system that I have. I've got a method def sort(obj) ... end which i'm sending something like a = [ { ... }, { ... }, { ... }, { ... } ] and the error message i'm getting is. sort received 4 arguments expected 1 so it looks like the method was called with the splat operator e.g. sort(*a) however, it isn't it's just sort(a)
<dekroning>
is there perhaps so default splatting of array arguments, in a specific version of ruby ?
<apeiros_>
there are places where ruby auto-splats/auto-unsplats. but not when passing arguments to methods.
tommyvyo has joined #ruby
nlc has joined #ruby
<dekroning>
apeiros_: i couldn't find anything like that either, but since i'm really confused how this could happen, I ended up here :-)
zacstewart has quit [Quit: leaving]
<apeiros_>
dekroning: well, debug the code. figure where the exception happens, get the backtrace, inspect the data…
ckrailo has joined #ruby
khakimov has joined #ruby
zacstewart has joined #ruby
<dekroning>
apeiros_: well my issue is that it only happens on CI and only when our Jenkins server runs the code, when I run it on my local machine, or manually on the server it's working correctly
cantonic has joined #ruby
pablo_ has joined #ruby
trivol has quit [Quit: trivol]
ckrailo has quit [Client Quit]
ckrailo has joined #ruby
<apeiros_>
and you can't debug code that runs on your jenkins?
azm has joined #ruby
<dekroning>
yeah now that you mention it, i'm going to try and run this single spec via jenkins... my full suite currently takes 1hour 20 minutes to run /me shame
macer1 has joined #ruby
<macer1>
hey
<macer1>
is there a way to get list of all classes that extends my class?
chimkan has joined #ruby
<shevy>
macer1 hmm tried .ancestors yet?
davidcelis has quit [Quit: K-Lined]
<macer1>
no, will try, wait a sec :P
ananthakumaran1 has joined #ruby
bbttxu has quit [Quit: bbttxu]
<macer1>
grr, I have a small problem. isn't local dir in load path?
fr0gprince_ma has joined #ruby
<macer1>
I am doing require 'class_name'
<macer1>
and the file is class_name.rb
<shevy>
I think in 1.9.x not anymore
mikepack has joined #ruby
<shevy>
I think you can somehow add the current dir
jchauncey_ has joined #ruby
<shevy>
monkeys overrun the ruby core team :(
<macer1>
./class_name
<macer1>
works
<macer1>
;p
<Hanmac>
macer1 its now "require_relative 'class_name'"
ABK has joined #ruby
<Hanmac>
without "
<macer1>
thank you :)
<shevy>
damn long to type
LyonJTill has quit [Quit: Leaving...]
<shevy>
Hanmac we should make a new language!
<shevy>
in C++!
ikaros_ has joined #ruby
ananthakumaran has quit [Ping timeout: 248 seconds]
<ccooke>
Hanmac: the world needs a non-quotable quote character. A universally-understood quoting character that never quotes things indirectly :-)
<workmad3>
shevy: flex and yacc ftw!!!
<shevy>
hmmmm
fr0gprince_ has joined #ruby
ghanima has joined #ruby
fr0gprince_mac has quit [Ping timeout: 244 seconds]
francisfish has quit [Remote host closed the connection]
jchauncey has quit [Ping timeout: 240 seconds]
jchauncey_ is now known as jchauncey
<Hanmac>
shevy if require_relative is to long for you, you chould add a def rr(s);require_relative(s);end;
pushp0p has quit [Ping timeout: 250 seconds]
<macer1>
or just use ./
<macer1>
:P
<shevy>
that would be better, but the problem is, if I were to use that a lot in my projects, when I want to distribute them I'd have to distribute my modifications too and that is too cumbersome
maesbn has quit [Remote host closed the connection]
savage- has joined #ruby
kenperkins has joined #ruby
<shevy>
I once thought I would include EEEEVERYthing in std_includes.rb
tsou has quit [Remote host closed the connection]
ikaros has quit [Ping timeout: 252 seconds]
<Synthead>
I want to run a function that builds a hash so I can run myHash = generateHash. How can I return a hash from a function, generating it with a block?
<shevy>
but that makes it hard to release subcomponents that are supposed to be run stand alone
<shevy>
as for the block ... I am not sure what you want to do with the block? can you give an example?
<macer1>
shevy: ancestors doesn't work
<shevy>
macer1 waaaah!
<shevy>
hmm
<shevy>
you need to get a list of all classes that modify your class?
<arturaz>
i have wrote jruby<->scala integration layer! behold!
<macer1>
Well my class is kind of interface
<shevy>
can you give a specific code example macer1 ?
<macer1>
I have a class LoginChecker
<Hanmac>
macer "./" is bad
<arturaz>
>> a = Set.new([1,2,3]); {3=>a}.to_scala.apply(3).send(:"+=", 5); a => #<Set: {1, 2, 3, 5}>
alexim has joined #ruby
<macer1>
and like AuthmeChecker and OtherChecker
<macer1>
And I need to know what options there are
<macer1>
for user to choose
<macer1>
hanmac: because of windows?
snip_it has joined #ruby
oponder has quit [Remote host closed the connection]
snip_it has quit [Client Quit]
luxurymode has quit [Quit: Computer has gone to sleep.]
ABK has quit [Read error: Connection reset by peer]
<Hanmac>
no, because the file can be called from an other place,
jkarayusuf has quit [Remote host closed the connection]
<macer1>
makes sense
ABK has joined #ruby
<macer1>
shevy: any ideas?
<macmartine>
Is there a way to do something like this: return an array of arrays? @clients.collect([&:first, &:last])
<shevy>
macer1, not really, but I also did not understand it hehehe
<macer1>
understand wut?
<shevy>
your parent is LoginChecker, and you have two subclasses? AuthmeChecker and OtherChecker
<shevy>
what you wrote
<macer1>
yes
<macer1>
correct
<shevy>
"<macer1> And I need to know what options there are"
<shevy>
I dont know what is options
<macer1>
sorry I mean
<macer1>
what options there are for user :>
Targen has joined #ruby
<macer1>
classes that check login and pass
<Synthead>
shevy: well, imagine .map, right? I could build out an array with it. I'm trying to do the same with a hash. suppose I could use a block to build a hash, then "return myHash"
<Synthead>
shevy: but I'm trying to avoid declaring it and returning it when I can just return it
prometheus has quit [Quit: leaving]
<shevy>
hmm
ABK has quit [Read error: Connection reset by peer]
MasterIdler has joined #ruby
hal-j has joined #ruby
BeLucid has quit [Remote host closed the connection]
lkba has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<workmad3>
Synthead: sounds like you want each_with_object({})
<workmad3>
Synthead: with a block :)
ABK has joined #ruby
<Synthead>
shevy: if I could do something like stuff.map { |that| { :my => that } } or something along those lines
<shevy>
my head is a bit confused
<Synthead>
workmad3: what would that look like?
<macer1>
there aren't anything like java interfaces?
<shevy>
I am glad that workmad3 has come to the rescue
<Synthead>
haha
<Synthead>
I've scratched my head at this a few times, have gotten confused, and avoided it so far
<robdodson>
Is it possible for a module to load a file the first time it's used?
<robdodson>
i see #autload but i'm not sure if it's what i want. I need to load a configuration file into my module which it should parse first
fr0gprince_ma has quit [Quit: Leaving...]
mikepack has quit [Remote host closed the connection]
<Synthead>
workmad3: you're defining hash elements to the block variable?
gyre007 has joined #ruby
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
mwyrobek has quit [Quit: Konversation terminated!]
khakimov has joined #ruby
blacktulip has quit [Remote host closed the connection]
ABK has quit [Read error: Connection reset by peer]
<workmad3>
Synthead: I don't follow what you're asking
<Synthead>
workmad3: I'll pastebin something
ABK has joined #ruby
ABK has quit [Read error: Connection reset by peer]
dknight_ has quit [Quit: leaving]
ABK has joined #ruby
mneorr has joined #ruby
BeLucid has joined #ruby
cha1tanya has joined #ruby
cha1tanya has quit [Changing host]
cha1tanya has joined #ruby
<macer1>
how can i make kindof interface?
<shevy>
workmad3 I felt like this the last hour ;)
<shevy>
macer1 and Synthead confuse me a lot
<macer1>
hehe
<workmad3>
:)
<Synthead>
hahaha
schovi has quit [Remote host closed the connection]
<Synthead>
I'm trying to make this a good one :)
<shevy>
Synthead, at least you are not using odd words
ABK has quit [Read error: Connection reset by peer]
<shevy>
but for example, I dont know what is a "kindof interface"
<workmad3>
macer1: java interfaces? as in a declared 'you need to declare you're using this formal interface'? nothing like that in ruby no
ABK has joined #ruby
<macer1>
:(
<shevy>
see, I am so glad for workmad3
<workmad3>
macer1: ruby is duck-typed, so basically any combination of methods can be turned into an ad-hoc interface
<workmad3>
macer1: and anything that implements those methods can be used to fulfil that interface
jhunter has quit [Ping timeout: 260 seconds]
ph^ has joined #ruby
<workmad3>
macer1: for example, the Enumerable module relies on being used in a class that provides a .each method that acts like Array's each method... if you provide that, then you can use Enumerable to add all the extra stuff
ABK has quit [Read error: Connection reset by peer]
<macer1>
makes sense
ABK has joined #ruby
<macer1>
module module.. so like module MyInterface? ;p
jhunter has joined #ruby
<jimeh>
macer1: the closest of what you're thinking about would probably be TomDoc, it's documentation based, and not a large portion of the ruby community uses it, but check it out if you like: http://tomdoc.org/
<workmad3>
macer1: or the Rack library for web services... it requires that a 'rack application' provide a 'call' method that takes the request environment and returns an array of [status_code, {headers}, [body_content] ]
serpa has joined #ruby
showy has joined #ruby
<macer1>
thanks
<macer1>
I think I will do a module
<macer1>
:D
serpa has quit [Client Quit]
Morkel has joined #ruby
<workmad3>
macer1: anything that provides that can be used as a rack application, whether it has a declared 'Rack application' module or interface or not (in fact, Rack doesn't provide any 'interface' modules, so you can't use one :) )
ABK has quit [Read error: Connection reset by peer]
Diranged has joined #ruby
luxurymode has joined #ruby
ABK has joined #ruby
<Diranged>
Can anyone tell me how to setup a super reliable/fast gemrc file.. that is, one that lists several mirrors (or even points to a mirror list?), has good retry/failover settings if one of the mirrors is down, etc..?
<Hanmac>
macer1 you can check for an possible "interface" with obj.respond_to?(method) or obj.is_a?(module)
<Diranged>
It seems like the .gemrc file isnt documented terribly well..
<macer1>
so, anything that has method a, b and c can be my LoginChecker :P?
<workmad3>
macer1: or rather, anything that has method a, b and c and methods a, b and c behave appropriately
zmoazeni_ has quit [Ping timeout: 245 seconds]
<Synthead>
workmad3, shevy: If I could just do a hash.map and splat a hash, I wouldn't need to do "return", but I'm not sure how to do it that way
<macer1>
hmm in the module I will make something like add_to_list(class) that will check if the class has my methods.
rippa has joined #ruby
<Synthead>
shevy: I hope this makes more sense
ABK has quit [Read error: Connection reset by peer]
mikepack has joined #ruby
josefig has joined #ruby
josefig has quit [Changing host]
josefig has joined #ruby
<robdodson>
Is there a way to tell a module to autoload a yaml file when it's first used?
<robdodson>
maybe that's a really bad practice… I'm trying to build a formatter and it needs to run off of a yaml file to know which categories go with which formats
alanp has quit [Read error: Operation timed out]
alanp_ has joined #ruby
davidcelis has joined #ruby
<carloslopes>
robdodson: i don't know your context, but, maybe will be better you use a class
da3d is now known as daed
<Synthead>
robdodson: could do something like @settings = load_the_yaml if @settings.defined?
<Synthead>
or
<Synthead>
! @setttings.defined?
<robdodson>
Synthead: yah that's kind of what i was thinking. I just hate running a check every single time but that might be my only option
<showy>
robdodson: a classes would definitively be a better choice
luxurymode has quit [Quit: Computer has gone to sleep.]
<Synthead>
robdodson: if you don't want to explicitly declare it, you need to check it somehow
<robdodson>
ok thanks guys
luxurymode has joined #ruby
Ontolog has quit [Remote host closed the connection]
kaneda_ has joined #ruby
robdodson has quit [Quit: robdodson]
jeebster has joined #ruby
ananthakumaran1 has quit [Quit: Leaving.]
khakimov has quit [Quit: Computer has gone to sleep.]
headius has joined #ruby
<arturaz>
anybody got a suggestion how to make my custom class to return true on .is_a?(Hash) besides inheriting from it?
khakimov has joined #ruby
cha1tanya has quit [Read error: Connection reset by peer]
thecreators has joined #ruby
<arturaz>
oh, this is ruby... def is_a?(klass); klass == Hash ? true : super(klass); end
<the-newsman>
the best ruby ide is ?
<shevy>
the-newsman please
<deryl>
the one that works best for you
<shevy>
the-newsman the human brain is the name
<jeebster>
eww, ruby and ide together in the same sentence...
<shevy>
the-newsman I use bluefish 1.0.7 because of the default colours :P
<jeebster>
hehe
bluenemo has quit [Remote host closed the connection]
<deryl>
best is subjective. it all depends on who you're talking to. try them all and decide for yourself
codebeaker has joined #ruby
<the-newsman>
wow ! i got many answers. lets analyze them
<Synthead>
shevy: no, but I'm trying to do this http://codepad.org/otg6uCQp without declaring a hash and returning it
<the-newsman>
hello european-guy
<the-newsman>
how is greece nowadays ?
znake has joined #ruby
Eldariof-ru has quit [Ping timeout: 252 seconds]
<shevy>
workmad3, can you help Synthead, it is all somehow over my head
robotmay has quit [Remote host closed the connection]
ABK has quit [Read error: Connection reset by peer]
<shevy>
the-newsman soon the military can move in to "restore order"
<Synthead>
shevy, workmad3: I really appreciate all this help, you guys are great :)
hoelzro is now known as hoelzro|away
ABK has joined #ruby
jackiechan0 has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<codebeaker>
Synthead: what are you trying to do ?
ABK has joined #ruby
<Synthead>
codebeaker: return a hash from a block inside of a function without declaring it
<codebeaker>
where should the block inside the function get the data from ?
Morkel has quit [Quit: Morkel]
ABK has quit [Read error: Connection reset by peer]
visof has quit [Ping timeout: 272 seconds]
<the-newsman>
shevy i think the whole outnry should have some tolerance and suffer lil bit to pass the problems. the spoiled ppl r ruinign everything. i wonder why the greek guys burn their ebautiful coutnry. this is insane
ABK has joined #ruby
schovi has joined #ruby
davidpk has joined #ruby
<the-newsman>
i love greece
<the-newsman>
sample and sympol of old civilization
<Synthead>
codebeaker: that's kinda irrelevant in this case, but here: this is what works (by declaring a hash, building it with a block, and returning it): http://codepad.org/otg6uCQp ...and this is what I'm trying to do, although the syntax isn't right (yet): http://codepad.org/D2ruF7sB
<codebeaker>
Synthead: sorry - I genuinely can't see what you are trying to fo
alex__c2022 has quit [Quit: alex__c2022]
<shevy>
the-newsman well, it's not only greece, the debts are spread throughought europe and the banks
khakimov has quit [Quit: Computer has gone to sleep.]
`brendan has quit [Ping timeout: 252 seconds]
ABK has quit [Read error: Connection reset by peer]
JohnBat26 has joined #ruby
<codebeaker>
expected inputs and outputs, and I could help you
alex__c2022 has joined #ruby
kevinbond has quit [Quit: kevinbond]
jrist-afk is now known as jrist
univers has joined #ruby
<Synthead>
codebeaker: I'll make it a little simpler with another pastie
ABK has joined #ruby
alex__c2022 has quit [Client Quit]
znake has quit [Remote host closed the connection]
znake has joined #ruby
cha1tanya has joined #ruby
iamjarvo has quit [Quit: Leaving.]
cywill has quit [Quit: Quitte]
sbanwart has quit [Ping timeout: 252 seconds]
queequeg1 has quit [Read error: No route to host]
<llaskin>
does anyone know why indians use the word "baba" after their name? is it something special? like a nickname or something?
ABK has quit [Read error: Connection reset by peer]
<Synthead>
showy: I have a large hash declared in my real project that defines what elements in an XML stream is valid for what I'm looking for, then what I can capture, and I want to run a function that is something like data = getData(xmlStream)
<codebeaker>
you want #tap
<codebeaker>
see the article I linked :)
<codebeaker>
the counter-example is exactly what you psoit
<codebeaker>
posted*
<Synthead>
codebeaker: I'm reading it :D I was just halfway done typing my last message when you sent the link so it was just poorly-timed :)
<Synthead>
codebeaker: this looks exactly like what I need! is this 1.8-compatible too?
<codebeaker>
Synthead: no, but there's no good reason to be doing anything on 1.8 at the moment
<codebeaker>
and you can implement a `tap` method in 4 LOC (see the example) for 1.8 if Object doesn't respond_to?(:tap)
<codebeaker>
it really is that simple
gyre007 has quit [Quit: Ex-Chat]
<Synthead>
codebeaker: hmmmmm
<Synthead>
codebeaker: this is where I experiment! hah
pushp0p has joined #ruby
pushp0p is now known as Guest88833
ChampS666 has joined #ruby
banjara has quit [Ping timeout: 260 seconds]
jackiechan0 has quit [Ping timeout: 245 seconds]
banjara has joined #ruby
visof has joined #ruby
jackiechan0 has joined #ruby
<Synthead>
codebeaker: so if I'm reading this right, .tap allows you to change the contents of whatever |variable| is defined for the block, and it naturally returns it?
<codebeaker>
yes
eywu has joined #ruby
<codebeaker>
you do Hash.new.tap { |thehash| ...... something here ..........}
<workmad3>
Synthead: .tap basically executes the block of code and then returns what you called .tap on
pdtpatrick has joined #ruby
<codebeaker>
and because Hash.new.tap is the (first and) last statement in the functyion, it's the implcit return value
<Synthead>
codebeaker: what if you want to build a totally new hash?
<workmad3>
Synthead: and it passes the target for .tap into the block for you to use
<codebeaker>
Hash.new.tap { |the_new_hash| }
jimeh has quit [Ping timeout: 244 seconds]
Guest88833 is now known as midrange
midrange has quit [Changing host]
midrange has joined #ruby
<workmad3>
codebeaker: you could also do {}.tap {|my_hash| ...} ;)
<codebeaker>
workmad3 - sure, but I prefer reading at least one keyword in my methods :)
<codebeaker>
[] and {} look too alike :)
ananthakumaran has joined #ruby
ABK has joined #ruby
jimeh has joined #ruby
<workmad3>
carloslopes: :)
<shevy>
hey
<shevy>
why carloslopes ?
<workmad3>
err, codebeaker even
<workmad3>
shevy: because I suck at tab-complete, ok? :P
<shevy>
oh
<shevy>
and I fail at reading
<shevy>
I thought his nick is "codebReaker"
niku4i has joined #ruby
<Synthead>
workmad3, codebeaker: oooh, this works :o http://codepad.org/pVLdRM5J it shows an error on codepad, but works on my system
<Synthead>
workmad3, codebeaker: is there a cleaner way of writing this function?
ABK has quit [Read error: Connection reset by peer]
Araxia_ has joined #ruby
<burgestrand>
Synthead: codepad runs an old version of ruby :)
<codebeaker>
I prefer to call `result` something more descriptive
<burgestrand>
1.8.6, it’s older than what I’ve been doing ruby for, kinda neat
<codebeaker>
but unless you are really kicking Ruby's ass, that won't matter at your scale
<burgestrand>
Synthead: don’t worry too much about the efficiency, once it matters you should measure it and fix it where it hurts
codebeaker has quit [Quit: codebeaker]
dekroning has quit [Ping timeout: 252 seconds]
brasten has joined #ruby
neersighted|AFK is now known as neersighted
<Synthead>
I love it, you guys
<Synthead>
this has been bugging me for days! thanks so much for all your support!
Neil___ has quit [Remote host closed the connection]
<burgestrand>
Synthead: also, avoid to_sym, you sometimes need it but often it’s better to do it the other way around (take a symbol and to_s it)
neil__ has joined #ruby
<burgestrand>
you should never do it to some input that could potentially be an infinite number of different values, in this specific case it was fine though
eighty4 has quit [Ping timeout: 265 seconds]
mohits has joined #ruby
<workmad3>
burgestrand: well, it's fine to .to_sym something that could potentially be an infinite number of values as long as it only takes one value during program execution ;)
<burgestrand>
workmad3: :trollface:
<burgestrand>
:p
fowl has joined #ruby
fowl has quit [Changing host]
fowl has joined #ruby
d3vic3 has quit [Ping timeout: 244 seconds]
ghanima has quit [Quit: Leaving.]
fahadsadah has quit [Ping timeout: 264 seconds]
Jck_true has quit [Quit: No Ping reply in 180 seconds.]
nopper has quit [Ping timeout: 260 seconds]
schovi has quit [Remote host closed the connection]
d3vic3 has joined #ruby
Whoop has quit [Ping timeout: 272 seconds]
iamjarvo has joined #ruby
sparrovv has joined #ruby
nopper has joined #ruby
visof has quit [Ping timeout: 272 seconds]
ephemerian has quit [Quit: Leaving.]
eighty4 has joined #ruby
n1x has joined #ruby
kuranai|off has joined #ruby
znake has quit [Quit: znake]
Whoop has joined #ruby
thatRD has quit [Quit: leaving]
Jck_true has joined #ruby
<macer1>
hymm
<macer1>
I have a module
<macer1>
and
ABK has joined #ruby
<macer1>
something like enum, result = { :ok =>0, :fail => 1 [...] }
m_3 has quit [Remote host closed the connection]
<macer1>
but the "result" is not avaible when I include module ;/
tatsuya_o has quit [Remote host closed the connection]
ABK has quit [Read error: Connection reset by peer]
<macer1>
I tried using @
ABK has joined #ruby
jrist is now known as jrist-mtg
nlc has quit [Quit: Leaving]
llaskin has left #ruby [#ruby]
<Hanmac>
macer if you want result as a constant you need "Restult" with an uppercase letter
ABK has quit [Read error: Connection reset by peer]
fahadsadah has joined #ruby
stephenjudkins has joined #ruby
ABK has joined #ruby
<macer1>
interesting...
<macer1>
;p
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
banjara has quit [Quit: Leaving.]
kichawa has joined #ruby
kichawa has quit [Quit: leaving]
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
simao has quit [Quit: Lost terminal]
abra has joined #ruby
cbuxton1 has joined #ruby
ABK has quit [Read error: Connection reset by peer]
pu22l3r_ has quit [Ping timeout: 255 seconds]
adamkittelson has joined #ruby
ABK has joined #ruby
zacstewart has joined #ruby
<the-newsman>
shevy
ABK has quit [Read error: Connection reset by peer]
cbuxton has quit [Ping timeout: 244 seconds]
ABK has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<Hanmac>
macer1 but beware in ruby constants are not so const as you maybe thought ... you can change the hash you assigned to the constant
brasten has quit [Quit: brasten]
ABK has joined #ruby
<lectrick>
How do I ask a class if it already included a module?
`brendan has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<workmad3>
Hanmac: hell, you can change the constant itself, all you get is a warning :)=
mdhopkins has quit [Quit: mdhopkins]
ABK has joined #ruby
<workmad3>
lectrick: instance.is_a?(ModuleName)
<lectrick>
workmad3: awesome
<Hanmac>
workmad3 i mean like Constant.replace if its a string
<lectrick>
workmad3: there's also the .ancestors call
<workmad3>
lectrick: or ClassName.ancestors.includes?(ModuleName)
<workmad3>
lectrick: was just getting there :)
<workmad3>
Hanmac: yeah, it's a constant reference, not a constant value :)
d3vic3 has quit [Ping timeout: 250 seconds]
m_3 has joined #ruby
ABK has quit [Read error: Connection reset by peer]
<Hanmac>
lectrick & workmad3 ClassName.include?(ModuleName) works too
alanp_ has quit [Remote host closed the connection]
includex has quit [Remote host closed the connection]
cha1tanya has quit [Quit: Leaving]
shruggar has quit [Quit: Leaving.]
ABK has quit [Read error: Connection reset by peer]
<workmad3>
arturaz: it looks evil
neersighted is now known as neersighted|AFK
<Hanmac>
arturaz if you extend your little gimick so it excepts more then one klass it would more cool :P
alanp has joined #ruby
<workmad3>
arturaz: or at least, I'd consider it evil in production code :)
<arturaz>
no need for that now
<Hanmac>
and maybe in object form like: object.fake_identy(Hash)
<arturaz>
workmad3, ruby is stupid for not having interfaces. I cannot say that this object is a Hash :) And yes, i know of respond_of?, but many things respond to :[]
hynkle has quit [Read error: Connection reset by peer]
hynkle has joined #ruby
kenichi has joined #ruby
azm has quit [Ping timeout: 265 seconds]
Vainoharhainen has joined #ruby
heisenmink has joined #ruby
Vainoharhainen has quit [Client Quit]
jlogsdon has joined #ruby
<heisenmink>
is there an array method that return the firsts value that makes a passed lambda return true, or similar?
PaciFisT has joined #ruby
CannedCorn has joined #ruby
<heisenmink>
I have an array of image nodes and want to return the first that matches a criterion
ronniy has quit [Ping timeout: 250 seconds]
<heisenmink>
(I did search on the array class docs but I didn't find anything)
<CannedCorn>
$stderr << "WAS A HASH!"
<CannedCorn>
whoops
<CannedCorn>
hey guys, if i have an array that is [key, value, key, value] where key is a string and value is a hash, and i want to transform it into a hash where key is an array of values would you use inject?
ABK has joined #ruby
ringotwo has joined #ruby
<heisenmink>
CannedCorn, I would use each_slice
<rippa>
heisenmink: find
ABK has quit [Read error: Connection reset by peer]
ABK has joined #ruby
<heisenmink>
rippa, there is no Array#fin
<rippa>
Enumerable#find
ABK has quit [Read error: Connection reset by peer]
banjara has joined #ruby
<heisenmink>
rippa, does Array inherit Enumerable?
<CannedCorn>
whoops, i actually got that wrong
<CannedCorn>
the array is [[key, value], [key, value]…]
<rippa>
heisenmink: yes
<CannedCorn>
and i want a hash that is {:key => [values], :key => values}
<CannedCorn>
shouldn't that be a groupby
jackiechan0 has quit [Ping timeout: 245 seconds]
<rippa>
group_by
<CannedCorn>
right
<CannedCorn>
but is that what i want
<CannedCorn>
i might be able to use Hash[]
<heisenmink>
thanks rippa!
PigDude has joined #ruby
_md has quit [Ping timeout: 272 seconds]
<PigDude>
Any Rack people here? I was wondering about a way to make directories map to index.html or index.htm
<PigDude>
that is, for Rack::Static
chrismcg is now known as zz_chrismcg
Dan4sure_ has quit [Ping timeout: 244 seconds]
<carloslopes>
PigDude: hmmm if you put /public/dir/index.html and points localhost:4567/dir/index.html it will map the file instead hit the route
Tearan has quit [Quit: Sleepy Badger....]
<carloslopes>
s/points/run
<PigDude>
yep, that is how Rack::Static works
thecreators has quit [Quit: thecreators]
dangerousdave has joined #ruby
<PigDude>
but I would like to have the index.html be optional (I do something similar, and quite simple, with Python's Tornado; I wasn't sure if this too would require me to write custom Ruby code)
<lxsameer>
which version of ruby is suit for a newbie?
<PigDude>
I also was curious about how to run a simple Rack script ... I am using Rack so I can host static files in a simple fashion on Heroku
<PigDude>
I also tried (naiively, of course) ruby -rubygems -rrack config.ru
shruggar has joined #ruby
<workmad3>
PigDude: rackup config.ru
<workmad3>
PigDude: or, as config.ru is the default, just 'rackup'
<PigDude>
workmad3, oh, thanks!
tomb_ has quit [Quit: Computer has gone to sleep.]
kirun has joined #ruby
<carloslopes>
PigDude: did this solve your question?
<Hanmac>
arturaz did you look at my gist ?
jackiechan0 has joined #ruby
<workmad3>
PigDude: also for consideration - https://github.com/adaoraul/rack-jekyll <-- lets you put jekyll sites on heroku (jekyll is a static site generator for ruby)
<workmad3>
although for jekyll, I tend to go through github rather than heroku
<arturaz>
Hanmac, yes
<Hanmac>
and your comment? ;P
<arturaz>
scary
digitalcakestudi has joined #ruby
<PigDude>
Jekyll has far too many dependencies for my liking, but I will consider it for a larger project. This is a small thing I am setting up
<PigDude>
carloslopes, I'm just going to write a custom handler for rack
<workmad3>
np :)
<PigDude>
carloslopes, I am learning how to write rack code now
<PigDude>
I can't imagine Rack::Static being all that complex internally
<Hanmac>
arturaz: how to use: you may have function1_cs_abc and function2_cs_abc you can call both with only cs_abc
statix has quit [Remote host closed the connection]
<PigDude>
osx lion ships with 1.8.7 o.O
statix has joined #ruby
<PigDude>
so I will be using lamdba do :^)
Solnse has quit []
altiouz has quit [Ping timeout: 240 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
h4mz1d has quit [Ping timeout: 244 seconds]
<workmad3>
yeah... having issues getting it to just work, but it's the right idea at least :)
jaystay has joined #ruby
afallows_ is now known as afallows
<workmad3>
ah, having issues because I had another server on the same port
<Hanmac>
imo i hate the "->" form
ZifreCL has quit [Remote host closed the connection]
dekroning has quit [Ping timeout: 244 seconds]
banjara has left #ruby [#ruby]
<workmad3>
Hanmac: yeah, I'm not thrilled with it myself
tvw has quit [Read error: Connection reset by peer]
<workmad3>
Hanmac: but it's shorter and I was golfing :)
tayy has joined #ruby
lllllalexanderll has joined #ruby
<lllllalexanderll>
hi
mucker has joined #ruby
<lllllalexanderll>
i want to programme with ruby
shruggar has joined #ruby
ludo4ka has quit [Ping timeout: 245 seconds]
<lllllalexanderll>
how do i can define a variable as a string ? =)
<Hanmac>
a = "abc"
voodoofish430 has joined #ruby
pablo_ has quit [Quit: Ex-Chat]
<lllllalexanderll>
i have a variable... in the variable is the number "10" ,,, how can i hold the number 10 in the variable and invert the variable to a string ?
niku4i has quit [Remote host closed the connection]
<Spechal>
I am using Net::SSH and trying to change directories on a Linux box ... this doesn't work due to cd being a built in shell command ... I found a mail thread that said to use Dir#chdir, but I am not sure how to implement it as I though it was the the local file system
mneorr has quit [Remote host closed the connection]
anax has joined #ruby
eywu has quit [Quit: Leaving.]
shruggar has joined #ruby
eywu has joined #ruby
kish has quit [Remote host closed the connection]
thecreators has joined #ruby
Synthead has joined #ruby
minijupe has quit [Quit: minijupe]
h4mz1d has joined #ruby
Guest90260 is now known as ZifreCL
kenichi has quit [Remote host closed the connection]
wmoxam has joined #ruby
fayimora has joined #ruby
compara20 has joined #ruby
fayimora has quit [Remote host closed the connection]
fayimora has joined #ruby
berserkr has joined #ruby
stkowski has quit [Read error: Connection reset by peer]
stkowski has joined #ruby
luxurymode has quit [Ping timeout: 260 seconds]
carloslopes has quit [Ping timeout: 252 seconds]
hynkle has quit [Read error: Connection reset by peer]
hynkle has joined #ruby
rorymckinley2 has quit [Ping timeout: 260 seconds]
brasten has joined #ruby
<fayimora>
Hey guys, can i make this code(http://pastie.org/3921703) any simpler? I want an array of entries containing one per day
rorymckinley2 has joined #ruby
Guest83564 has quit [Ping timeout: 260 seconds]
kish has joined #ruby
mikey has joined #ruby
mneorr has joined #ruby
mikey is now known as Guest51338
mneorr has quit [Read error: Connection reset by peer]
<fayimora>
The one below is my solution but apparently I can do better
h4mz1d has quit [Ping timeout: 260 seconds]
<deryl>
fayimora, dude, you've been told so many times that hitting multiple channels at the same time ir flat out rude and in most cases will stop you from getting th ehel you want
<fayimora>
deryl: was never told that :( Anyways sorry bout that.. I didn't know people would be in both ruby channels at the same time..
<fayimora>
shevy: Hmmm I guess ma friend is just toying with me.. Thanks
<deryl>
dude, radar told you, i told you, spaceghost told you, davidcellis told you, how many do i have to name?
<fayimora>
deryl: My brother uses my account.. Some of my friends do too.. Definitely wasn't me..anyways its all good
n1x has quit [Read error: Operation timed out]
<Veejay>
Right now some dude is using your account too
<Veejay>
And he's got some nerve
<Veejay>
Thinking deryl is a fucking idiot
<deryl>
hehe
<deryl>
i can deal with that :)
jjxtsys has joined #ruby
kichawa has joined #ruby
<kichawa>
hi folks
robotmay has joined #ruby
anax has quit [Ping timeout: 256 seconds]
indian has joined #ruby
neil__ has quit [Remote host closed the connection]
neersighted|AFK is now known as neersighted
fayimora has quit [Quit: Busy…..zzzzz]
pu22l3r has joined #ruby
fayimora has joined #ruby
c0rn has joined #ruby
brasten has quit [Quit: brasten]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby
x0F_ is now known as x0F
cjk101010 has quit [Ping timeout: 252 seconds]
banseljaj is now known as imami|afk
brasten has joined #ruby
kaneda_ has quit [Ping timeout: 252 seconds]
kaneda_ has joined #ruby
<geekbri>
How does one take a gem down from rubygems.org?
mengu has quit [Quit: Konversation terminated!]
<Mon_Ouie>
All you can do is yanking the gem AFAIK
<geekbri>
I accidentally made a spelling error in the gemspec so its named improperly... whoops! :X
philcrissman has joined #ruby
h4mz1d has joined #ruby
heftig has joined #ruby
imami|afk is now known as banseljaj
shruggar has quit [Ping timeout: 272 seconds]
tvw has joined #ruby
cjk101010 has joined #ruby
alek_b_ has joined #ruby
ChampS666 has quit []
bbttxu has joined #ruby
LowValueTarget has joined #ruby
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
alek_b has quit [Read error: Operation timed out]
anax has joined #ruby
mohits has quit [Ping timeout: 245 seconds]
mneorr has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
mneorr has quit [Read error: Connection reset by peer]
<lectrick>
So my method takes an *args, right? And those args might be hashes or strings. Should I generally make sure I don't modify whatever args points to? In other words, minimize side effects at the cost of memory?
<kichawa>
i'd like use ruby like virtualenv in python
headius has quit [Quit: headius]
carloslopes has joined #ruby
mneorr has joined #ruby
<kichawa>
so RVM is the best way ?
mneorr has quit [Read error: Connection reset by peer]
<heftig>
lectrick: yes.
<oooPaul>
rvm seems to be the most popular way to have self-contained ruby installations.
mneorr has quit [Read error: Connection reset by peer]
<Spechal>
fowl, I've used gem install net-ssh-shell and now I get Unable to activate net-ssh-shell-0.2.0, because net-ssh-2.3.0 conflicts with net-ssh (~> 2.1.0) (Gem::LoadError) ... is there a file I need to edit to allow net-ssh 2.3?
<shellox_>
i don't get an error message and have no idea why it doesn't connect..
EzeQL has joined #ruby
alek_b_ has quit [Ping timeout: 244 seconds]
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
sebastorama has joined #ruby
mneorr has joined #ruby
mneorr has quit [Read error: Connection reset by peer]
alek_b_ has joined #ruby
bgupta has joined #ruby
jackiechan0 has quit [Ping timeout: 248 seconds]
<fowl>
Spechal, no idea, that repo hasnt been updated in 11 months
beneggett has joined #ruby
vertroa has quit [Read error: Connection reset by peer]
<fowl>
if there are no api changes you can just edit the spec to your version
kenichi has joined #ruby
sebastorama has quit [Read error: Connection reset by peer]
<fowl>
maybe there is a more up to date repo tho
vertroa has joined #ruby
ananthakumaran has left #ruby [#ruby]
azm has joined #ruby
alek_b has quit [Ping timeout: 245 seconds]
sebastorama has joined #ruby
sebastorama has quit [Read error: Connection reset by peer]
sebastorama has joined #ruby
jackiechan0 has joined #ruby
jackiechan0 has quit [Client Quit]
LBRapid has quit [Read error: Connection reset by peer]
shruggar has joined #ruby
jackiechan0 has joined #ruby
blacktulip has joined #ruby
HashNuke has joined #ruby
<HashNuke>
hey everyone.
<HashNuke>
IS the Ruby documentation available is a queryable form? JSON API, etc I want to try creating an experimental interface for the docs.
vertroa has quit [Read error: Connection reset by peer]
<Hanmac>
HashNuke you may want "ri" ?
<HashNuke>
thanks. I'll check it out and see if it's parsable.
snearch has joined #ruby
LBRapid has joined #ruby
cyb3r3li0g has joined #ruby
jjxtsys has joined #ruby
ddv has joined #ruby
prometheus has joined #ruby
cyb3r3li0g has quit [Max SendQ exceeded]
jonathanwallace has joined #ruby
<iamjarvo>
is there a downloadable copy of the bastards book of ruby
minijupe has joined #ruby
CannedCorn has joined #ruby
tayy has quit [Remote host closed the connection]
schaerli has joined #ruby
robacarp_ has joined #ruby
sbanwart has quit [Remote host closed the connection]
davidpk has quit [Quit: Computer has gone to sleep.]
SirFunk has joined #ruby
IPGlider has quit []
dhaskew has joined #ruby
rippa has quit [Ping timeout: 240 seconds]
schaerli has quit [Read error: Connection reset by peer]
schaerli has joined #ruby
king535 is now known as king313
sh1ps has joined #ruby
sh1ps has left #ruby [#ruby]
luckyruby has joined #ruby
<ThatDudeGuy_>
shellox: sorry, i'm not familiar with except lib. are you looking for a way to respond to socket events through a callback-ey mechanism?
emmanuel__ has joined #ruby
pawdro has quit [Remote host closed the connection]
zeromodulus has quit [Remote host closed the connection]
Eldariof59-ru has quit []
noganex has quit [Ping timeout: 272 seconds]
Watcher7 has joined #ruby
gp5st has joined #ruby
vipaca has quit [Quit: Leaving...]
aruntomar has quit [Quit: Leaving]
geers has joined #ruby
Squarepy has quit [Quit: Leaving]
noganex has joined #ruby
<gp5st>
hello. I have a gem that just errors when i try to install it (ERROR: While executing gem ... (NoMethodError) undefined method `call' for nil:NilClass). where can i look for what's wrong? the gem in question is knife-windows
krz has joined #ruby
<carloslopes>
gp5st: paste all error stack in pastebin or something similar, it's better to check what's happening
<gp5st>
actually, i think the problem is em-winrm
<gp5st>
carloslopes: that's the problem, i don't have a stack. what i pasted is all i see
RegEchse has joined #ruby
shellox has quit [Quit: Computer has gone to sleep.]
looopy has quit [Remote host closed the connection]
looopy has joined #ruby
geers has quit [Ping timeout: 244 seconds]
<martman>
when your iterating over something like IO.readlines('/etc/network/interfaces').map do |line|
<martman>
is there anyway way to skip the next 3 lines?
<martman>
like check for a conidtion and if its true skip next 3 lines
Vainoharhainen has joined #ruby
<carloslopes>
gp5st: hmmm it's weird.. :/
bgupta has quit [Remote host closed the connection]
<fowl>
martman, 10.times.map { |x| next if x > 5; x }
<gp5st>
carloslopes: yeah:( so i'm digging through the dependencies, and it seems winrm is the dependency that's causing it?
Jackneill has quit [Read error: Connection reset by peer]
cbuxton1 has quit [Quit: Leaving.]
looopy has quit [Remote host closed the connection]
macer1 has quit [Read error: Operation timed out]
mdw has joined #ruby
fr0gprince_mac has joined #ruby
schaerli has quit [Remote host closed the connection]
macer1 has joined #ruby
mucker has quit [Quit: leaving]
moshee has quit [Ping timeout: 260 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
Kyle__ is now known as Kyle_changing
<gp5st>
so yeah, i installed all the dependencies for winrm and it gives me the undef method call for nil when i try to install it
the-newsman_ has joined #ruby
Kyle_changing has left #ruby [#ruby]
the-newsman has quit [Read error: Connection reset by peer]
the-newsman_ is now known as the-newsman
robotmay has joined #ruby
<gp5st>
does gem keen a detailed error log somewhere?
jmeeuwen has quit [Ping timeout: 272 seconds]
elliot98 has joined #ruby
<gp5st>
or like, what would i do to install a gem by hand?
kylemcgill has joined #ruby
jackiechan0 has quit [Ping timeout: 248 seconds]
macer1 has quit [Ping timeout: 240 seconds]
<jlogsdon>
gp5st: gem install gemname. gems do not keep detailed logs by default, there would have to be support in the gem for it
<jlogsdon>
manual install is not recommended
jackiechan0 has joined #ruby
Telg has quit [Ping timeout: 272 seconds]
<gp5st>
jlogsdon: i'd guess it wouldn't be, but all i'm getting is ERROR: While executing gem ... (NoMethodError) undefined method `call' for nil:NilClass
<gp5st>
as the error
<jlogsdon>
is there a stack trace with the failure?
albemuth has quit [Quit: Leaving...]
albemuth has joined #ruby
<carloslopes>
gp5st: i'm surprised that there are no error stack.. only this message :/
<gp5st>
jlogsdon: no, that's all i see:(
<gp5st>
ditto
the-newsman has left #ruby [#ruby]
ephemerian has joined #ruby
<gp5st>
it's ruby 1.9.2 and gem 1.3.7 all from the debian repos
<jlogsdon>
does the gem support 1.9.2? i dont see any requirements :|
<gp5st>
my guess is that i'm missing a system library prequ
<gp5st>
it says greater than 1.9.1
<jlogsdon>
ok
ringotwo_ has joined #ruby
<jlogsdon>
nah, you'd get an error before that if it was a system library
<jlogsdon>
it seems like gem might be expecting a proc (or the gem instelf, not ruby gems) somewhere
adamkittelson has joined #ruby
<jlogsdon>
do gem install winrm --backtrace
<jlogsdon>
that will give you a full error stack
<gp5st>
% sudo gem install winrm --backtrace
<gp5st>
ERROR: While executing gem ... (NoMethodError)
<martman>
im in a IO.readlines block where the output of my first line in the block is being written out. i do not want this for the first line, only the others
<jlogsdon>
let me see if it fails for me
<gp5st>
is the gemspec file
<martman>
is there anyway to "mark" this
<jlogsdon>
the gemspc looks fine
<jlogsdon>
and it installed fine for me D:
<gp5st>
:(
<jlogsdon>
I also use rbenv and instead of ruby from apt or wahtever
<gp5st>
this is my local machine, so i can't just blow away the vm:-/
h4mz1d has quit [Ping timeout: 245 seconds]
<jlogsdon>
what gem version?
<jlogsdon>
gem --version
<jlogsdon>
rubygems*
jeebster1 has left #ruby [#ruby]
<gp5st>
1.3.7
<jlogsdon>
ahhhhhhhhhhh
<jlogsdon>
no wonder
<jlogsdon>
do gem update --system
<gp5st>
?
<jlogsdon>
1.8.x is the latest
<jlogsdon>
1.3.7 is hella old
<gp5st>
The Debian-supported way to update rubygems is through apt-get, using Debian official repositories.
<gp5st>
If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian.
b1rkh0ff has quit [Read error: Operation timed out]
mrwalker has quit [Remote host closed the connection]
nfk has quit [Quit: yawn]
IrishGringo has quit [Ping timeout: 244 seconds]
hynkle has quit [Quit: hynkle]
b1rkh0ff has joined #ruby
neil__ has quit [Remote host closed the connection]
stephenjudkins has quit [Quit: stephenjudkins]
<Tasser>
Icehawk78, context?
<Icehawk78>
Tasser: I'm trying to figure out whether or not I can create an in statement (ie "select * from table where id in(x, y, z)") without looping over the array of values I want to pass in.
alek_b has joined #ruby
<Icehawk78>
I've tried what seemed obvious to me (db.query('select * from table where id in ?', array_variable) and db.query('select * from table where id in (?)', array_variable)
cyb3r3li0g has joined #ruby
<Icehawk78>
Neither of which worked. And the first few web searches I've done have been fairly fruitless.
schaerli has joined #ruby
<Tasser>
Icehawk78, I suggest a library like sequel
<Tasser>
it's a bit more ruby
oliwer has quit [Quit: Coyote finally caught me]
<Icehawk78>
Oh, huh. Did not know that existed. I'll look into that, thanks.
<Veejay>
Does Ruby have something to the effect of group_and_inject? i.e. combining the grouping and processing of the grouped values?
alek_b_ has quit [Ping timeout: 244 seconds]
<Icehawk78>
Veejay: Grouping how?
cbuxton has joined #ruby
jayrulez has joined #ruby
<Veejay>
Icehawk78: Say you have an array of objects, group_by would group those objects in buckets depending on a grouping block
<Veejay>
Now a common pattern that's emerged in my code is grouping and then reducing/injecting each bucket
<Veejay>
So I was wondering if there's something baked in Ruby that would facilitate that kind of processing for me
azm has quit [Ping timeout: 244 seconds]
<Tasser>
Icehawk78, there are also more sophisticated libraries like activerecord and datamapper
<Veejay>
If there isn't I'll code one
<Tasser>
Veejay, #group_by {}.each {|by, group| }
<Icehawk78>
Tasser: Yeah, I'm familiar with those, but for what I'm working with, that's more overhead than I really need. I've just got a simple 2-3 table sqlite db for data persistence.
zeromodulus has quit [Remote host closed the connection]
<Tasser>
ThatDudeGuy_, sequel probably :-)
<Icehawk78>
So the sequel gem looks like it should work. Thanks!
<Veejay>
Tasser: Yeah that's the pattern I'm already using, I don't know what I was looking for really, it's simple enough
<Veejay>
Thanks a lot man
<Tasser>
Veejay, sometimes people just need to be hit with a bat ;-)
jrbing has quit [Quit: jrbing]
berserkr has quit [Quit: Leaving.]
tsou has joined #ruby
etehtsea has quit []
ubercore has quit [Ping timeout: 245 seconds]
axl_ has quit [Read error: Connection reset by peer]
Guest81769 has quit [Ping timeout: 244 seconds]
axl_ has joined #ruby
ryanf has joined #ruby
brasten has quit [Quit: brasten]
Gavilan has joined #ruby
wvms has joined #ruby
TandemAdam has joined #ruby
jackiechan0 has quit [Quit: Sto andando via]
brasten has joined #ruby
wangr has quit [Remote host closed the connection]
nlc has joined #ruby
ackz has joined #ruby
wmoxam has quit [Quit: leaving]
Dreamer3 has quit [Quit: Leaving...]
greyEAX has quit [Quit: Leaving]
keithcelt has quit [Remote host closed the connection]
greyEAX has joined #ruby
keithcelt has joined #ruby
ddv has quit [Quit: *poof*]
robbyoconnor has joined #ruby
xaq has quit [Remote host closed the connection]
indian has joined #ruby
Ontolog has joined #ruby
headius has quit [Quit: headius]
ackz has quit [Quit: Leaving...]
SQLStud has joined #ruby
BeLucid has quit [Read error: Connection reset by peer]
kuranai|off is now known as kuranai
vitor-br has joined #ruby
robbyoconnor has quit [Ping timeout: 272 seconds]
dankest has joined #ruby
stephenjudkins has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
banjara1 has joined #ruby
bbttxu has quit [Quit: bbttxu]
jimeh has quit [Ping timeout: 265 seconds]
cbuxton has quit [Ping timeout: 240 seconds]
malkomalko has quit [Remote host closed the connection]
amalvagomes has joined #ruby
dangerousdave has quit [Quit: Leaving...]
h4mz1d has quit [Ping timeout: 255 seconds]
cbuxton has joined #ruby
chson has quit [Remote host closed the connection]
yoklov has joined #ruby
mneorr has quit [Remote host closed the connection]
ymasory has quit [Quit: Ex-Chat]
kirun has quit [Quit: Client exiting]
Norrin__ has joined #ruby
delinquentme has joined #ruby
<delinquentme>
so I've just noticed an interesting happening which I'm kind of curious about...
compara20 has quit [Read error: Connection reset by peer]
<delinquentme>
I've got a string in a method which I pass to another method for processing ...
BeLucid has joined #ruby
<delinquentme>
after the called method is finished .. I print out the string once again .. and the string is modified
virunga has quit [Read error: Connection reset by peer]
<UNIXgod>
Plas: it's the concepts that matter most ~ not the syntax
minijupe has joined #ruby
robotmay has quit [Remote host closed the connection]
* UNIXgod
should write a tutorial entitled: A Paradigm a day (●̮̮̃_•̃)
MissionCritical has joined #ruby
mdw has quit [Remote host closed the connection]
* UNIXgod
☺
mrsolo has quit [Quit: Leaving]
mnaser has quit [Ping timeout: 272 seconds]
albemuth has quit [Quit: Computer has gone to sleep.]
digitalcakestudi has joined #ruby
<Plas>
Okay cool, thanks UNIXgod.
<UNIXgod>
Plas: np
QKO_ has joined #ruby
<heph>
is it possible to get an object reference without using ObjectSpace._id2ref(o.object_id)?
QKO has quit [Ping timeout: 272 seconds]
<heph>
it feels like there must be a better way than that
cads has quit [Ping timeout: 255 seconds]
codezombie has joined #ruby
looopy has quit [Remote host closed the connection]
nari has quit [Ping timeout: 244 seconds]
btully has joined #ruby
davidpk has quit [Quit: Computer has gone to sleep.]
oooPaul has quit [Quit: Ciao for now!]
albemuth has joined #ruby
<btully>
anyone know why I keep seeing this when i try to run 'gem': /Users/btully/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse': (<unknown>): couldn't parse YAML at line 1 column 7 (Psych::SyntaxError)
<btully>
i've tried 3 different version of ruby via rvm and all have the same issue :(