punkrawkR has quit [Read error: Connection reset by peer]
stopbit has quit [Client Quit]
CaptainJet has quit []
<A124>
%w{rubygems daemons eventmachine}.each { |x| require x } ?
<A124>
botspot_87: ping
lggr has quit [Ping timeout: 260 seconds]
<botspot_87>
A124: que problem is that still i have to write them all
alvaro_o has quit [Quit: Ex-Chat]
<botspot_87>
A124: my questions is whether was possible to tell ruby to look for all gems that i specified on my gemfile....well, I can read the file for that anyway
v0n has quit [Quit: Leaving]
<A124>
botspot_87: Ah I see. Yes. But. Don't you have to type them into the gemfile anyway?
rabidpraxis has joined #ruby
<botspot_87>
A124: Yeah, that is why...just want to avoid code duplication...if i write them there, why should I write them inside my main.rb file
<A124>
botspot_87: Oh. Well. If you find a way, give me a shout please. I'm not familiar with gemfiles, as my frameworks remain private so far.
<sent-hil>
is it possible to use stalker with ironmq?
xuser has left #ruby [#ruby]
lggr has quit [Ping timeout: 240 seconds]
ph^ has quit [Ping timeout: 245 seconds]
slicslak has joined #ruby
maletor has joined #ruby
maek has joined #ruby
mvangal__ has joined #ruby
<maek>
anyone know how to make Thor print its long_desc for a task?
brianpWins_ has joined #ruby
lggr has joined #ruby
jenrzzz has joined #ruby
tntc has joined #ruby
Coolhand_ has joined #ruby
Chryson has quit [Remote host closed the connection]
Chryson has joined #ruby
jrunning has quit [Quit: leaving]
rakl_ has joined #ruby
GeekOnCoffee has quit [Read error: Connection reset by peer]
Forevernade has quit [Read error: Connection reset by peer]
brianpWins has quit [Read error: Connection reset by peer]
rakl has quit [Ping timeout: 244 seconds]
brianpWins_ is now known as brianpWins
methoddk has quit [Ping timeout: 244 seconds]
Monie has quit [Ping timeout: 244 seconds]
mvangala has quit [Ping timeout: 244 seconds]
GeekOnCoffee has joined #ruby
Coolhand has quit [Ping timeout: 244 seconds]
methoddk has joined #ruby
methoddk has quit [Changing host]
methoddk has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
<Spooner>
botspot_87 : Look at Bundler.require - it allows you to load all Bundled gems at once (or just certain groups).
<botspot_87>
Spooner: thx
wargasm has joined #ruby
sebastorama has quit [Quit: Computer has gone to sleep.]
Spooner has quit []
guns has joined #ruby
lggr has joined #ruby
sebastorama has joined #ruby
Onso has joined #ruby
tvw has joined #ruby
sent-hil has quit [Remote host closed the connection]
digitalcakestudi has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
stephenjudkins has quit [Quit: stephenjudkins]
Onso has quit [Quit: Page closed]
dmiller has joined #ruby
stan_man_can has quit [Quit: stan_man_can]
stan_man_can has joined #ruby
jarred has joined #ruby
lggr has joined #ruby
tvw has quit [Ping timeout: 245 seconds]
ph^ has joined #ruby
mmitchell has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 256 seconds]
Juul has quit [Quit: Leaving]
Juul has joined #ruby
Forevernade has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
hadees has quit [Read error: Connection reset by peer]
<A124>
Spooner: I have sufested the same. Hence no idea why the duplicity.
<A124>
*g
Banistergalaxy has joined #ruby
pfaff has quit [Ping timeout: 268 seconds]
lggr has joined #ruby
ph^ has quit [Ping timeout: 245 seconds]
Juul has quit [Ping timeout: 246 seconds]
CarlB_th_ has quit [Remote host closed the connection]
CarlB_the_great has joined #ruby
CarlB_the_great has quit [Remote host closed the connection]
quest88 has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
hadees has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
dmiller has quit [Remote host closed the connection]
slicslak has quit [Ping timeout: 260 seconds]
lggr has joined #ruby
pfaff has joined #ruby
jarred has quit [Quit: jarred]
Banistergalaxy has quit [Ping timeout: 255 seconds]
AlbireoX`Laptop has joined #ruby
baroquebobcat has joined #ruby
jasonkuhrt has quit [Quit: Leaving...]
Banistergalaxy has joined #ruby
ffranz has quit [Quit: Leaving]
lggr has quit [Ping timeout: 252 seconds]
AlbireoX has quit [Ping timeout: 252 seconds]
jarred has joined #ruby
daniel_hinojosa has joined #ruby
daniel_hinojosa1 has joined #ruby
AlecTaylor has joined #ruby
<AlecTaylor>
hi
pdtpatrick has joined #ruby
moted has joined #ruby
daniel_hinojosa1 has quit [Client Quit]
<maek>
well hello
AlecTaylor has left #ruby [#ruby]
hsbt_away is now known as hsbt
<maek>
o_0
AlecTaylor has joined #ruby
qos has joined #ruby
<AlecTaylor>
Thinking to buy: "Ruby and MongoDB Web Development Beginner's Guide". Your thoughts?
CarlB_th_ has joined #ruby
baroquebobcat_ has joined #ruby
Forevernade has quit [Ping timeout: 246 seconds]
TorpedoSkyline is now known as other_tj
other_tj is now known as tjbarber
tommyvyo has quit [Quit: Computer has gone to sleep.]
lggr has joined #ruby
adkron has joined #ruby
headius has joined #ruby
phantasm66 has quit [Quit: *sleeeeep*]
<maek>
AlecTaylor: it just so happens packt pub is giving away any free ebook until the end of this month to celebrate there 1000th book published http://www.packtpub.com/
<AlecTaylor>
maek: Yeah, that's where I found it
<AlecTaylor>
:P
<maek>
ah
<maek>
its free
<maek>
who cares about thoughts
GeekOnCoffee has quit [Read error: Connection reset by peer]
baroquebobcat has quit [Read error: Connection reset by peer]
GeekOnCoffee has joined #ruby
baroquebobcat_ is now known as baroquebobcat
<AlecTaylor>
Yeah, but it still takes time to read
<AlecTaylor>
And my time is valuable :v
<AlecTaylor>
So want to know if the book is worth it
ken_barber has joined #ruby
twoism has joined #ruby
ph^ has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
maletor has joined #ruby
ruby_noob has quit [Quit: ruby_noob]
pfaff has quit [Ping timeout: 245 seconds]
Nisstyre-laptop has joined #ruby
baroquebobcat has quit [Quit: baroquebobcat]
lggr has joined #ruby
twoism has quit [Remote host closed the connection]
twoism has joined #ruby
yasushi_ has quit [Ping timeout: 255 seconds]
CarlB_th_ has quit [Remote host closed the connection]
ElderFain has quit [Read error: Connection reset by peer]
ph^ has quit [Ping timeout: 245 seconds]
ElderFain_ has joined #ruby
TomJ has quit [Quit: TomJ]
ananthakumaran has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
ryanlecompte has joined #ruby
jrist is now known as jrist-afk
lggr has joined #ruby
chimkan_ has joined #ruby
wargasm has quit [Read error: Connection reset by peer]
jarred_ has joined #ruby
rabidpraxis has quit [Remote host closed the connection]
voodoofish430 has quit [Quit: Leaving.]
pfaff has joined #ruby
jarred has quit [Read error: Connection reset by peer]
ryanf has quit [Quit: leaving]
ryanlecompte has quit [Remote host closed the connection]
jarred has joined #ruby
digitalcakestudi has quit [Ping timeout: 255 seconds]
<SirG>
I often discover I got my fingers from K-Mart too...
lggr has joined #ruby
<deryl>
hehe
<rking>
Is there a more idiomatic way to say foo.sub /a(.)b/ do $1 end #?
<rking>
Kind of ungolfed compared to Perl's $foo =~ s/a(.)b/$1/
hbpoison has quit [Ping timeout: 244 seconds]
Kruppe has quit [Ping timeout: 245 seconds]
ShiintoRyuu has quit [Quit: Computer has gone to sleep.]
ABK has joined #ruby
pfaff has joined #ruby
lggr has quit [Ping timeout: 256 seconds]
hsbt is now known as hsbt_away
<SirG>
rking: foo.sub(/a(.)b/) {$1} ;)
<rking>
SirG: Meh. Six of one, half-dozen of another on that one.
<rking>
That's actually more tokens.
guns has quit [Ping timeout: 245 seconds]
<rking>
But if there's not anything more succinct I'll be more than Ok with either; I just wanted to be sure I wasn't overlooking some other feature.
<bnagy>
surely there is a way to have private functions in a module without having to extend self?
quazimodo has quit [Remote host closed the connection]
Pochacco has quit [Quit: Pochacco]
<Hanmac>
SirG & rking: "a3b".sub(/a(.)b/,"\\1")
<rking>
Ahoy!
<xnm>
rking: foo.sub(/a(.)b/,$1)
<Hanmac>
"a3b".sub(/a(.)b/,'\1')
<rking>
xnm: *Surely* that doesn't work.
hsbt_away is now known as hsbt
tgraham_ has quit [Quit: Leaving...]
lggr has joined #ruby
<xnm>
rking: try it out
<rking>
xnm: I bet it worked because you ran a previous one that set $1
<SirG>
rking: foo.sub(/a(.)b/, $1);
SegFaultAX has quit [Quit: Lost terminal]
lurraca has joined #ruby
<rking>
SirG: Stop that!
<rking>
You guys are being goofy.
<lurraca>
Hello
<rking>
Hanmac: Thank you for being a nongoof. =)
<Hanmac>
Sirg & xnm no your code makes TypErrors for me because $1 is NOT set
<lurraca>
Anyone familiar with web crawling with Mechanize?
<xnm>
oh, damn
<xnm>
you're right
R3dy has quit [Quit: Lost terminal]
<lurraca>
Looking a way to recover from "Error 101 (net::ERR_CONNECTION_RESET): The connection was reset" when fetching a page?
guns has joined #ruby
JohnBat26 has joined #ruby
ken_barber has quit [Remote host closed the connection]
JohnBat26 has quit [Client Quit]
c0rn_ has quit [Quit: Computer has gone to sleep.]
h4mz1d has quit [Ping timeout: 245 seconds]
JohnBat26 has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber1 has joined #ruby
ken_barber1 has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
Pochacco has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<lurraca>
anyone familiar with Mechanize for Ruby?
ken_barber has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
<A124>
lurraca: Yes. The error is from mechanize?
ken_barber has quit [Read error: Connection reset by peer]
answer_42 has joined #ruby
ken_barber has joined #ruby
guns has quit [Ping timeout: 252 seconds]
ken_barber has quit [Read error: Connection reset by peer]
<lurraca>
not sure if the error is from mechanize or from Net::HTTP::Persistent but I'm getting while trying to fetch a website that is broken (http://www.redclaymedia.com/)
dakine has quit [Remote host closed the connection]
bartj3 has joined #ruby
lggr has joined #ruby
<lurraca>
A124: but what I want to do is recover from that error and do something in case I try to do the Mechanize.get() on a broken website.
diegoviola has quit [Ping timeout: 252 seconds]
ken_barber has joined #ruby
fredjean has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<A124>
lurraca: I'm not sure how Mechanize processes page in current version, but it's connexction error, not a Mechanize's. Use begin; rescue; end or just rescue
moshee has quit [Ping timeout: 244 seconds]
moshee has joined #ruby
moshee has quit [Changing host]
moshee has joined #ruby
chendo_ has quit [Ping timeout: 255 seconds]
<lurraca>
A124: I'm using exception handling for responsecodeerror but for some reason this one is not being caught.
chendo_ has joined #ruby
pfaff has quit [Ping timeout: 268 seconds]
<lurraca>
begin
<lurraca>
page = agent.get(@url)
<lurraca>
if exception.response_code == '400' or exception.response_code == '500'
<A124>
This is not a response code error, but a connection error. And as you can see this one is not of a Mechanize class even
hsbt is now known as hsbt_away
<lurraca>
A124: any idea how should I handle it then? thanks for the help btw
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
seoaqua has joined #ruby
Banistergalaxy has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 256 seconds]
Jellyg00se has quit [Remote host closed the connection]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<A124>
lurraca: define one more rescue condition consisting of appropriate exception
jonahR has quit [Quit: jonahR]
lggr has joined #ruby
gabrielrotbart has quit [Remote host closed the connection]
manizzle has quit [Ping timeout: 256 seconds]
Chryson has quit [Quit: Leaving]
SirG has quit [Quit: Leaving]
yoklov has quit [Quit: computer sleeping]
daniel_hinojosa1 has quit [Remote host closed the connection]
rippa has joined #ruby
ZubKonst_ has quit [Read error: Connection reset by peer]
<A124>
lurraca: Got it?
ZubKonst has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
Pochacco has quit [Quit: Pochacco]
arturaz has joined #ruby
<lurraca>
A124: yeah, i think so, i'll you show what I come up with. Thanks btw.
ken_barber has joined #ruby
lggr has joined #ruby
Monie has quit [Ping timeout: 245 seconds]
ken_barber has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
ken_barber has joined #ruby
<lurraca>
A124: I don't know what kind of exception is getting fire so I just catching everything rescue StandardError, I really don't care what the reason that the crawl failed I'm just interested on know if failed or not
ken_barber has quit [Read error: Connection reset by peer]
ananthakumaran has quit [Quit: Leaving.]
bradhe has quit [Remote host closed the connection]
ananthakumaran has joined #ruby
<A124>
lurraca: When the exception is thrown, the class of the exception should be there
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
manizzle has joined #ruby
<A124>
lurraca: Anyway, this is a Windows 7 related error. You are using Win 7 right?
<lurraca>
no
ken_barber has joined #ruby
<lurraca>
macos
<lurraca>
Mac OSX
ken_barber has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 245 seconds]
<A124>
Hm. Interesting. Else it's MTU problem, or a server problem. But the error seems as a link issue.
<lurraca>
A124: why is this a Win 7 related error?
ken_barber has joined #ruby
<lurraca>
its gotta a server problem
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has quit [Read error: Connection reset by peer]
<A124>
AlecTaylor: I'm sorry, no spoon feeding.
margle has joined #ruby
ken_barber has joined #ruby
<A124>
lurraca: Not a good idea though. rescue StandardError = > e; if e.message = "Error 101 (net::ERR_CONNECTION_RESET): The connection was reset" then; <Your Code>; end
ken_barber has quit [Read error: Connection reset by peer]
<A124>
* else raise e
lggr has quit [Ping timeout: 245 seconds]
<bnagy>
rescue rescues StandardError by default
<A124>
bnagy: Oh, ok. That's true, thank you ^^
<bnagy>
by the looks you probably want to rescue Net
ken_barber has joined #ruby
hbpoison has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<A124>
In this case if it's the mentioned error, it will let you handle it else it will raise.
jgrevich has quit [Quit: jgrevich]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<lurraca>
A124: Why rescue everything is not a good idea? In this particular case I'm not concerned about which particular exception was raised. I just want to be able to set a value and return if any kind of exception was raise while doing agent.get
AlbireoX has joined #ruby
lggr has joined #ruby
<A124>
lurraca: It could be perhaps not network related exception. Just don't do it.
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<A124>
lurraca: You never know. And when other error raises you will not know where is problem. And it will punch you in the face. Happened to me once.
<lurraca>
A124: thanks, I will use what you gave me on the pastebin
ken_barber has joined #ruby
<_7894>
Agreed
ken_barber has quit [Read error: Connection reset by peer]
<bnagy>
rescue is ok (StandardError) but rescue Exception is bad
djdb has joined #ruby
baphled has quit [Ping timeout: 256 seconds]
<bnagy>
cause lots of that stuff you can't recover from anyway, SystemError etc
awestroke has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
c0rn_ has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 246 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has joined #ruby
bobbbo has joined #ruby
areil has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
sepp2k has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
bobbbo has quit [Client Quit]
futilegames has joined #ruby
ken_barber has joined #ruby
bradhe has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
Elhu has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has quit [Read error: Connection reset by peer]
<JusticeXC>
It's a bonus question!
<Joel_re>
else whats the point of them :p
<JusticeXC>
I did the main assignment myself.
<JusticeXC>
This I;m having difficulty with.
<JusticeXC>
I came from C and my logic would be to use decision structures.
lggr has quit [Ping timeout: 244 seconds]
<JusticeXC>
I don't see how using round() or abs() would work.
timonv has joined #ruby
futilegames has left #ruby [#ruby]
frogprince_mac has joined #ruby
<bnagy>
abs works
<bnagy>
you just need to think about it
<JusticeXC>
How?
<JusticeXC>
Hrm.
darthdeus has joined #ruby
futilegames has joined #ruby
<JusticeXC>
Let's say the total amount of points is -7 and I abs that.
<JusticeXC>
Now it's 7, no?
<bnagy>
usually, yeah
<bnagy>
in 'conventional' arithmetic
guns has joined #ruby
<JusticeXC>
There is unconventional math?
ken_barber has joined #ruby
<bnagy>
I'm just being sarcastic. Carry on.
<JusticeXC>
:(
<JusticeXC>
I can't carry on, I don't know the answer!
ken_barber has quit [Read error: Connection reset by peer]
<bnagy>
no bonus points for you then I guess
<JusticeXC>
But I love bonus points..
lggr has joined #ruby
Xeago has joined #ruby
<JusticeXC>
Can you lead me in the right direction at least bnagy?
<bnagy>
I did
<JusticeXC>
I legitimately don't see how abs can work.
stephenjudkins has joined #ruby
<JusticeXC>
Let's say total_points comes out to -3.
<bnagy>
well I guess that's why they're bonus points
Xeago has quit [Read error: Connection reset by peer]
<JusticeXC>
We didn't even learn any of this in class.
<JusticeXC>
Not even remotely close.
<bnagy>
HOW DARE THEY
<JusticeXC>
It's a beginner Python course..
<kitofr>
u never learn how to "think" in class.. that's something u have to figure out urself
<bnagy>
encouraging logical thought should be banned
<JusticeXC>
I don't understand your reasoning.
<bnagy>
JusticeXC: I have never written a line of python in my life and I know how to do it
ken_barber has joined #ruby
<JusticeXC>
We haven't so much even heard of a function called abs.
darthdeus has quit [Ping timeout: 248 seconds]
<bnagy>
this is nothing to do with python
ken_barber has quit [Read error: Connection reset by peer]
<kitofr>
bnagy: true
<JusticeXC>
Try using what we've learned so far to come up with a solution.
<bnagy>
it's like maths I learned when I was 10
ken_barber has joined #ruby
cezar has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
gani has joined #ruby
<bnagy>
I think it's reasonable to assume that knowledge
<JusticeXC>
I'm not saying it's unreasonable - I'm saying try doing it with the knowledge we have of Python thus far.
<JusticeXC>
Which is to say, very little.
cezar has quit [Client Quit]
<bnagy>
hence 'bonus points'
ephemerian has joined #ruby
<bnagy>
anyway whit whining and just solve the problem already
<bnagy>
think what you can do with abs
<JusticeXC>
If your answer includes abs(), then it's already beyond the scope.
ken_barber has joined #ruby
<kitofr>
then ask urself... how would u write abs urself?
<JusticeXC>
With a decision structure.
<JusticeXC>
Which I can't use..
elaptics`away is now known as elaptics
<bnagy>
well presumably you're allowed to use points.abs()
<bnagy>
so go from there
lggr has quit [Ping timeout: 244 seconds]
ken_barber has quit [Read error: Connection reset by peer]
<bnagy>
or don't, I'm not a cop
ken_barber has joined #ruby
<JusticeXC>
I tried looking that up in python documentation.
<JusticeXC>
Couldn't find points.abs()
<bnagy>
but I assure you that there is a working solution down this road
ken_barber has quit [Read error: Connection reset by peer]
<kitofr>
JusticeXC: wish u good luck, i'll head back to work
<JusticeXC>
thx
Vainoharhainen has joined #ruby
ken_barber has joined #ruby
seoaqua has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
<RubyPanther>
In most languages you can just say x < 0 ? -x : x
ken_barber has quit [Read error: Connection reset by peer]
justinmcp has joined #ruby
ken_barber has joined #ruby
<JusticeXC>
What I'm saying is that we haven't even been taught such functions.
<JusticeXC>
Somebody's logic could be impeccable and wouldn't know ohw to translate it to python.
<JusticeXC>
Because nobody know anything besides simple simple basics.
ken_barber has quit [Read error: Connection reset by peer]
lggr has joined #ruby
adeponte has joined #ruby
<bnagy>
RubyPanther: that would be a decision structure
<RubyPanther>
I guess in python you'd have to know to write out the if
<JusticeXC>
AFAIK, abs() just returns any value as a positive value.
bobbbo has joined #ruby
<JusticeXC>
Ruby: I can't write an if
<bnagy>
JusticeXC: apparently the syntax is abs(total_points)
<JusticeXC>
That's the problem.
<bnagy>
or bonus points or whatever
<JusticeXC>
bnagy, so if it's -3 it becomes 3
samphippen has quit [Quit: Computer has gone to sleep.]
<JusticeXC>
That's still wrong.
<bnagy>
yeah, you need a couple more steps
<JusticeXC>
I'm hitting brick walls in my head cause I keep using if()
nari has quit [Ping timeout: 256 seconds]
ryanf has quit [Quit: broken pipes |||]
<bnagy>
all you need is simple arithmetic
<RubyPanther>
I used python for the first time in the robot car class, I'm not sure why it should be hard to use a new language. Open up a "cheat sheet" and bang out some code.
<JusticeXC>
First off, how can the interpreter even tell that the total_points is negative
<JusticeXC>
without using when or if
<RubyPanther>
If it is too gross just generate it from Ruby :)
<bnagy>
abs doesn't care, that's the beauty of it
<bnagy>
abs(-3_ => 3 abs(3) => 3
<JusticeXC>
So how can it differentiate between negative scores and positive scores
<JusticeXC>
and which to keep and which to round down to 0
timmow has joined #ruby
<bnagy>
magic!
<bnagy>
or alternatively, arithmetic
ken_barber has joined #ruby
<JusticeXC>
I'm sure I'll hit myself in the head when I see it bnagy, but I'm honestly stumped.
lggr has quit [Ping timeout: 240 seconds]
ken_barber has quit [Read error: Connection reset by peer]
<JusticeXC>
It's embarrassing.
<bnagy>
do some situps
<bnagy>
fap
<JusticeXC>
I just want to sleep :S
<JusticeXC>
By getting this done.
matrixise has quit [Ping timeout: 248 seconds]
ken_barber has joined #ruby
c0rn_ has quit []
horrror has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
adeponte has quit [Remote host closed the connection]
timmow_ has joined #ruby
AndChat- has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
timmow has quit [Ping timeout: 252 seconds]
timmow_ is now known as timmow
xpen has quit [Remote host closed the connection]
Xeago has joined #ruby
<RubyPanther>
JusticeXC: maybe sleep is a better bonus for you
<JusticeXC>
It's due at 9:00 am
<JusticeXC>
Sleep is no option
stephenjudkins has quit [Quit: stephenjudkins]
<JusticeXC>
I don't get why everybody is so conservative
<bnagy>
why can't I have stuff I don't deserve? I just don't understand! fml!
pingfloyd has quit [Quit: pingfloyd]
<JusticeXC>
that's such an exaggerated mentality representation
Xeago has quit [Remote host closed the connection]
<bnagy>
no, you're in an inappropriate channel, asking people to help you cheat on your assignment
matrixise has joined #ruby
<JusticeXC>
I'm really not.
<bnagy>
the fact you got any help at all is amazing
<RubyPanther>
if I write it for you, will you promise to go away?
<JusticeXC>
I don't need you to write it
<JusticeXC>
just explain it
<JusticeXC>
you think i'm asking for shit on a silver platter
<bnagy>
you are
<JusticeXC>
and by mosying around the answer and shit you'll get me to think
<bnagy>
I already told you what you need
<JusticeXC>
it's like kitchen nightmares
<RubyPanther>
It is more keystrokes to explain than to write it, it is that eas
<RubyPanther>
y
<bnagy>
now you're just going to whine like a girl until someone cracks and does it for you because they can't resist showing off
<RubyPanther>
You're just not bonus enough
<JusticeXC>
honestly, i don't get it right now, i've been blunt about it many times
Raimiss has quit [Ping timeout: 246 seconds]
thomas has quit [Quit: Brb]
<RubyPanther>
so why would you deserve bonus points?
<RubyPanther>
who are bonus points for, people who do understand, or people who do not?
lggr has quit [Ping timeout: 246 seconds]
<JonnieCache>
lol
NimeshNeema has quit []
NimeshNeema has joined #ruby
lggr has joined #ruby
<RubyPanther>
in Ruby you could use something like "The total number of points you have is: %d" % [total_points,0].sort.reverse[0]
ken_barber has joined #ruby
<horrror>
I want to be able to make image slideshow online (with transition effects)
ken_barber has quit [Read error: Connection reset by peer]
<Hanmac>
RubyPanther: [total_points,0].max
LouisGB has joined #ruby
<horrror>
that the user may edit (timestamps etc).. OpenCV is the waY?
<RubyPanther>
I was intentionally avoiding that one Hanmac
<horrror>
or something else I don't know?
guns has quit [Ping timeout: 245 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
icole has quit [Remote host closed the connection]
<whowantstolivefo>
hı
imami|afk has quit [Excess Flood]
ken_barber has joined #ruby
<whowantstolivefo>
What does the following ruby code print out? puts ((110.to_s * 2).to_i/2) << because i want to register for ruby-forum.. i think it is 555 ? i type that but it says wrong ?
ken_barber has quit [Read error: Connection reset by peer]
<bnagy>
I dunno if that's the logic you want for assigning the port
matrixise has quit [Ping timeout: 240 seconds]
<bnagy>
cause an empty string is ruby truthy
<nyuszika7h>
oh, it is?
<bnagy>
may not be the issue, but it's a bug for sure
lggr has joined #ruby
<canton7>
'or' is for flow control. So (ports = gets.chomp) or 6667
<bnagy>
you should probably test against empty? instead
<canton7>
so if gets.chomp returns false, ports gets assigned to that falsy value, then the whole expression returns 6667 (but port doesn't get re-assigned)
daniel_- has quit [Ping timeout: 255 seconds]
<bnagy>
I didn't think gets.chomp _could_ return false
<canton7>
^^ and that's a very true point
matrixise has joined #ruby
<nyuszika7h>
also, is there a way to make puts use \r\n?
<nyuszika7h>
for a socket
<canton7>
port = gets.chomp; port = 6667 if port.empty?
<nyuszika7h>
or do I have to print "text\r\n"
paolooo has joined #ruby
Raimiss has quit [Ping timeout: 244 seconds]
Xeago has joined #ruby
<bnagy>
nyuszika7h: ugh... I would probably do it manually
<bnagy>
but I would have to read docs to see if it's even possible
chussenot has quit [Read error: Connection reset by peer]
<nyuszika7h>
okay
gmci has quit [Quit: Computer has gone to sleep.]
<bnagy>
only time puts uses \r\n that I know is windows when you don't use the 'b' flag
<bnagy>
if you do it manually it's clearer what's going on
gmci has joined #ruby
<nyuszika7h>
yep, I'll do that
<nyuszika7h>
though I don't see exactly *why* does the IRC standard have to use \r\n :P
<bnagy>
ancient telnet formatting I guess
<nyuszika7h>
some ircds support just \n (like ircd-seven which freenode runs), but it's best to be RFC-compliant
<bnagy>
JusticeXC: come back tomorrow, I'll tell ya :)
<JusticeXC>
I've already sent it in
<JusticeXC>
I can show you if you are that skeptical
<bnagy>
nyuszika7h: yeah & and - are cool
<bnagy>
sometimes I wish that - didn't remove all matching elems though :/
<bnagy>
some guy was asking about how you would get all _not_ unique items in a list the other day
<JusticeXC>
bnagy, I used >>> total_points = max(total_points, 0)
<JusticeXC>
what would you have done
<bnagy>
and it was really torturous
<bnagy>
JusticeXC: (p + abs(p)) / 2
areil_ has joined #ruby
<Hanmac>
JusticeXC, [total_points, 0].max
PapaSierra has joined #ruby
<JusticeXC>
so let me run it through my head here
areil_ has quit [Client Quit]
<JusticeXC>
hm yea
<Iszak>
what is the recommended way to install ruby 1.9.3 on ubuntu 12.04? I know I can use rvm, however I'm only going to run 1.9.3. Ideally I don't want to compile it, so maybe a PPA? Any recommendations?
<JusticeXC>
see it's simple in retrospect
areil has quit [Ping timeout: 245 seconds]
<JusticeXC>
thanks for being difficult
<bnagy>
Iszak: personally I recommend rbenv
<bnagy>
and NOT installing as root
<Hanmac>
iszak: install the ruby1.9.1-full and than use "update-alternatives --config ruby","update-alternatives --config gem"
<bnagy>
yeah, or you can be a nutcase like Hanmac :)
<Iszak>
hmm, apparently it comes with 1.9.3 now anyway =x
<Iszak>
should have cached apt before I asked.
<bnagy>
JusticeXC: no worries - I told you someone would crack because they can't resist showing off
<JusticeXC>
?
<JusticeXC>
i did it myself
ken_barber has joined #ruby
<nyuszika7h>
my bot works :D
<bnagy>
uh huh
<nyuszika7h>
it connected and sent NICK/USER and stuff
<nyuszika7h>
now to test if the ping-pong works!
lggr has quit [Ping timeout: 260 seconds]
ken_barber has quit [Read error: Connection reset by peer]
<PapaSierra>
i'm using chef, which is written in ruby. i'm getting this error "FATAL: NoMethodError: undefined method `[]' for nil:NilClass". how would i start tracking that down?
<JusticeXC>
don't care if you don't believe me
<JusticeXC>
just know not everybody has a complex
<PapaSierra>
(i.e. it's not giving a stacktrace of a line number)
<bnagy>
tbh using max is a lot nicer than mine
<JusticeXC>
and you don't have to have a pseudo philosophic know it all attitude
<JusticeXC>
"trying to teach u stuff"
<JusticeXC>
but anyway i digress
<JusticeXC>
good night
JusticeXC has quit [Quit: Leaving]
mucker has quit [Ping timeout: 245 seconds]
hbpoison has quit [Ping timeout: 244 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has joined #ruby
<matti>
Ohai
<bnagy>
morning matti
<matti>
Hi bnagy, sup?
<bnagy>
nm, friday beer o clock
<bnagy>
just did a week's work to be able to get one line of code
<matti>
;]
margle has quit [Quit: Computer has gone to sleep.]
<Joel_re>
PapaSierra: you might want to ask the chef guys
ken_barber has joined #ruby
arietis has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 245 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
resure has joined #ruby
resure has joined #ruby
resure has quit [Changing host]
<PapaSierra>
Joel_re yup. i'm busy tracking the error, and yeah it'll be a chef thing. thanks
Hanmac has quit [Remote host closed the connection]
margle has joined #ruby
frogprince_mac has quit [Quit: Leaving...]
lggr has joined #ruby
areil has joined #ruby
paolooo has quit [Quit: Page closed]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
Hanmac has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
josh^ has quit [Ping timeout: 245 seconds]
PapaSierra2 has joined #ruby
PapaSierra has quit [Ping timeout: 245 seconds]
gani has quit [Ping timeout: 255 seconds]
gairola has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 252 seconds]
josh^ has joined #ruby
chendo_ has quit [Ping timeout: 245 seconds]
jasonkuhrt has joined #ruby
lggr has joined #ruby
cantonic_ has joined #ruby
chendo_ has joined #ruby
seoaqua has quit [Ping timeout: 248 seconds]
cantonic has quit [Ping timeout: 248 seconds]
cantonic_ is now known as cantonic
jasonkuhrt has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 248 seconds]
josh_ has joined #ruby
icole has joined #ruby
josh_ has quit [Client Quit]
bobbbo has quit [Quit: bobbbo]
frogprince_mac has joined #ruby
PapaSierra2 has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
jimeh2 has joined #ruby
icole has quit [Ping timeout: 248 seconds]
jimeh has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
jimeh3 has joined #ruby
resure has quit [Quit: Leaving]
ken_barber has quit [Read error: Connection reset by peer]
thunderstrike has joined #ruby
chendo_ has quit [Ping timeout: 255 seconds]
gmci has quit [Quit: Computer has gone to sleep.]
gmci has joined #ruby
jimeh2 has quit [Ping timeout: 255 seconds]
chendo_ has joined #ruby
PapaSierra has joined #ruby
vlad_starkov has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
frogprince_mac has quit [Ping timeout: 255 seconds]
awestroke has quit [Remote host closed the connection]
<bnagy>
guess
<bnagy>
go on...
<bsilwal>
first argument?
ken_barber has joined #ruby
<bnagy>
\o/
alektos has left #ruby [#ruby]
<bnagy>
GOLD STAR
<bsilwal>
if I dont keep first I can still get the argument
ken_barber has quit [Read error: Connection reset by peer]
chussenot has joined #ruby
<bnagy>
well you can do everything with ARGV that you can do with any array
<nyuszika7h>
are there any good yaml parsers for ruby?
hbpoison has quit [Ping timeout: 240 seconds]
<bnagy>
nyuszika7h: there are tons, dunno about 'good' or not
<bnagy>
I just use require 'yaml'
<bnagy>
like... how fast do you need that to be? :P
<nyuszika7h>
is that in ruby itself?
<nyuszika7h>
it's for parsing a few options like nick, user, channels, password for an irc bot
<nyuszika7h>
* I need it for
etehtsea has joined #ruby
<bsilwal>
whats difference between STDIN.gets and gets alone ?
lggr has quit [Ping timeout: 240 seconds]
workmad3 has joined #ruby
<gogiel>
bsilwal: no difference in that case
horrror has quit [Quit: horrror]
ken_barber has joined #ruby
<JonnieCache>
the normal yaml lib is good enough unless you need to parse megabytes of yaml
ken_barber has quit [Read error: Connection reset by peer]
<nyuszika7h>
ok
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
lggr has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
zommi has joined #ruby
slainer68 has quit [Remote host closed the connection]
ando has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
vladyn_ has joined #ruby
lggr has quit [Ping timeout: 246 seconds]
vladyn_ has quit [Client Quit]
ken_barber has joined #ruby
<matti>
:)
ken_barber has quit [Read error: Connection reset by peer]
vladyn_ has joined #ruby
Takehiro has joined #ruby
Takehiro has quit [Remote host closed the connection]
Takehiro has joined #ruby
<matti>
Hi Takehiro
<Takehiro>
hi :o matti
lggr has joined #ruby
<Takehiro>
whats up :D
<matti>
All good :)
<matti>
Writing C and Ruby for fun.
ken_barber has joined #ruby
<matti>
Love the curly braces ']
<Takehiro>
:D
duracrisis_ has quit [Ping timeout: 255 seconds]
ken_barber has quit [Read error: Connection reset by peer]
<clocKwize>
Company I'm working at just hired a new c++ guy
ken_barber has joined #ruby
<matti>
Hi clocKwize
<matti>
C++?
<clocKwize>
Have never actually met one in the flesh, been working in dev companies for past 7 years..
ken_barber has quit [Read error: Connection reset by peer]
<clocKwize>
hey :)
bobbbo has joined #ruby
chussenot has quit [Quit: chussenot]
Mon_Ouie has joined #ruby
haxrbyte has joined #ruby
<clocKwize>
working at AOL at the moment
<matti>
Ah.
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
k610 has joined #ruby
<k610>
i have defined amethod in a : module DB
<matti>
I love Ruby's C API.
<matti>
Feels almost like writing Ruby
<matti>
So awesome.
<matti>
Python's C API is so much pain and gore.
<k610>
in some code i see i have to : DB::amethod
<k610>
while in another amethod sufice
<matti>
Comparing.
lggr has quit [Ping timeout: 245 seconds]
TomJ has quit [Quit: TomJ]
saschagehlich has joined #ruby
<k610>
why is it so ?
SleepN0T has joined #ruby
<clocKwize>
matti, I've only played with it once, it seems pretty nice, but its still C :) also there isn't a huge amount of (accurate/up to date) documentation regarding the C api, I ended up scanning the headers and stuff
<matti>
clocKwize: I am reading Ruby's source to learn.
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<clocKwize>
k610, if the code you are writing is inside an object that includes the module DB, it will be pulled in to that class, so can be accessed directly
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
haxrbyte_ has joined #ruby
lggr has joined #ruby
ando has quit [Remote host closed the connection]
ando has joined #ruby
haxrbyte has quit [Ping timeout: 260 seconds]
ken_barber has joined #ruby
jasonkuhrt has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 244 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
cjs226 has joined #ruby
lggr has joined #ruby
slainer68 has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lkba has joined #ruby
yshh has quit [Remote host closed the connection]
<nyuszika7h>
is there something like stty +echo for ruby?
<nyuszika7h>
basically, I want to read input from stdin without it being echoed
<nyuszika7h>
I mean, -echo
mars__ has quit [Quit: Leaving]
ken_barber has joined #ruby
daniel_- has quit [Quit: WeeChat 0.3.8]
ken_barber has quit [Read error: Connection reset by peer]
vladyn_ has quit [Quit: vladyn_]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
lggr has quit [Ping timeout: 255 seconds]
vlad_starkov has quit [Remote host closed the connection]
lggr has joined #ruby
slainer68 has quit [Ping timeout: 260 seconds]
jasonkuhrt has quit [Quit: Leaving...]
colinbm has quit [Quit: colinbm]
mohits has quit [Ping timeout: 245 seconds]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
<k610>
clocKwize: thx
horrror has joined #ruby
jasonkuhrt has joined #ruby
Squarepy has joined #ruby
<ij>
Has anyone read "Metaprogramming Ruby"? Is it worth the read?
lggr has quit [Ping timeout: 252 seconds]
TomJ has joined #ruby
TomJ has joined #ruby
TomJ has quit [Changing host]
* Hanmac
looks at this imaginary books and find: "the Meta-Book of Metaprogamming"
hbpoison has joined #ruby
colinbm has joined #ruby
<horrror>
is there a way to parse text (1000words) and get the topic that it is about?
mucker has joined #ruby
<horrror>
I guess it relates to NLP but I am not sure how to fetch the subject of the piece. or how their rank works
<bnagy>
horrror: srsly, do some ML / NLP courses
<bnagy>
they're free online
<bnagy>
topic searching is _hard_
<bnagy>
you'll probably find you need to learn some Scheme / Java :S
lggr has joined #ruby
vlad_starkov has joined #ruby
<horrror>
bnagy: i will fetch the keywords of a certain string and then cross it with wikipedia to define topics
robertotauille has joined #ruby
<horrror>
the question is how to find the really KEY words of each string
hbpoison has quit [Ping timeout: 240 seconds]
<bnagy>
yeah it is
<bnagy>
even assuming your basic approach were sound
awestroke has joined #ruby
cjs226 has quit []
<bnagy>
everything is about more than one topic, and this is honestly a complicated area
<awestroke>
hello. I'm trying to create an unique identifier for a network node, and I figure I should use hostname + listeningport. I need it as a number though, and I want to avoid just hashing it. Is there a way to convert a string to a number?
<bnagy>
awestroke: uuidgen is cheap
<bnagy>
but the only way to get well distributed numbers out of strings is with a hash of some kind
<bnagy>
murmur and friends are fast
<awestroke>
bnagy: It doesn't need to be well distributed, just unique.
<awestroke>
Also, it needs to work on vanilla 1.8.7
<awestroke>
without gems
jasonkuhrt has quit [Quit: Leaving...]
<bnagy>
those are not orthogonal requirements
<bnagy>
if it's unix, srsly just use uuidgen
ken_barber has joined #ruby
<awestroke>
isn't uuidgen a gem?
ken_barber has quit [Read error: Connection reset by peer]
<bnagy>
no it's a command
<bnagy>
should be there on almost all *nix
<awestroke>
oh sorry now I get it
<awestroke>
thank you
lggr has quit [Ping timeout: 260 seconds]
<bnagy>
np
<bnagy>
time for beerz and pool
<awestroke>
how sure can I be that there will be no collisions with uuidgen?
<nyuszika7h>
how can I check if a string is in an array?
<bnagy>
because it's a universally unique id :)
<bnagy>
it is unique in time and space
<awestroke>
nyuszika7h: arr.include? str
<nyuszika7h>
thanks
<bnagy>
nyuszika7h: include?
<awestroke>
bnagy: thank you
lggr has joined #ruby
<bnagy>
you can read the manpage if you want deatils
<bnagy>
but it's like lots of random plys macaddr plus timestamp etc
TomJ has quit [Quit: TomJ]
<awestroke>
bnagy: it is not a number, though
aces1up has quit [Remote host closed the connection]
aces1up has joined #ruby
dpk has joined #ruby
ken_barber1 has joined #ruby
ken_barber1 has quit [Read error: Connection reset by peer]
<k610>
can i share a sqlite3 db connection in a module for it's methods : @@db = SQLite3::Database.new( "test.db" )
_love_color_text has quit [Client Quit]
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
Criztian has quit [Remote host closed the connection]
lggr has joined #ruby
<JonnieCache>
OH MY DAYS NEW RED DWARF IN LESS THAN A WEEK!
<awestroke>
bnagy: fantastic. uuid does not exist on the target platform
<awestroke>
uuidgen*
Takehiro has quit [Remote host closed the connection]
<JonnieCache>
awestroke: you cannot be sure that there are no collisions, but they are astronomically unlikely so theres no need to worry about them
horrror has joined #ruby
<JonnieCache>
your hair is many orders of mangitude more likely to set itself on fire than uuids are to collide, and i assume you dont worry about that
horrror has quit [Client Quit]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
Mon_Ouie has quit [Ping timeout: 246 seconds]
Squarepy has quit [Changing host]
Squarepy has joined #ruby
bluenemo has joined #ruby
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
ken_barber has joined #ruby
ken_barber has quit [Read error: Connection reset by peer]
mklappstuhl has joined #ruby
lggr has quit [Ping timeout: 252 seconds]
Raimiss has joined #ruby
pskosinski has joined #ruby
lggr has joined #ruby
frogprince_mac has quit [Quit: Leaving...]
F1skr has joined #ruby
<awestroke>
JonnieCache: that is reassuring :)
larissa has joined #ruby
Raimiss has quit [Ping timeout: 245 seconds]
jeffreybaird has joined #ruby
bartj3 has quit []
Spooner has joined #ruby
<awestroke>
I am running a program with backticks, but it outputs an error to stdout/stderr if the command is not found, how can I avoid it?
kn330 has quit [Read error: Connection reset by peer]
ph^ has joined #ruby
kn330 has joined #ruby
ph^ has quit [Remote host closed the connection]
djdb has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
whitenoise has joined #ruby
ph^ has joined #ruby
lggr has quit [Ping timeout: 255 seconds]
ph^ has quit [Remote host closed the connection]
adeponte has quit [Remote host closed the connection]
und3f has quit [Quit: Leaving.]
ph^ has joined #ruby
ph^ has quit [Read error: Connection reset by peer]
ph^ has joined #ruby
ph^ has quit [Read error: Connection reset by peer]
yshh has quit [Remote host closed the connection]
hbpoison has joined #ruby
TomJ has quit [Read error: Connection reset by peer]
TomJ has joined #ruby
TomJ has quit [Changing host]
TomJ has joined #ruby
kn330 has quit [Ping timeout: 248 seconds]
Kruppe has joined #ruby
jeff_sebring has joined #ruby
lggr has joined #ruby
duracrisis has quit [Changing host]
duracrisis has joined #ruby
malcolmva has joined #ruby
yshh has joined #ruby
hbpoison has quit [Ping timeout: 246 seconds]
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
yshh has quit [Remote host closed the connection]
ltsstar has joined #ruby
triptec has quit [Ping timeout: 252 seconds]
Spooner has joined #ruby
ph^ has joined #ruby
ipoval has joined #ruby
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
ph^ has quit [Remote host closed the connection]
Takehiro has joined #ruby
baroquebobcat has joined #ruby
beneggett has joined #ruby
ph^ has joined #ruby
lggr has quit [Ping timeout: 248 seconds]
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
ph^ has quit [Remote host closed the connection]
mistergibson has joined #ruby
voodoofish430 has joined #ruby
dmiller_ has joined #ruby
ph^ has joined #ruby
kn330 has joined #ruby
ipoval has left #ruby [#ruby]
lggr has joined #ruby
cburyta has joined #ruby
_mak has quit [Quit: Ex-Chat]
Iszak has quit [Quit: User has gone to sleep.]
aganov has quit [Remote host closed the connection]
timmow has joined #ruby
hbpoison has joined #ruby
falieson has quit [Quit: falieson]
linoj has joined #ruby
k611 has quit [Ping timeout: 245 seconds]
stim371 has joined #ruby
matrixise has quit [Ping timeout: 260 seconds]
mengu has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 256 seconds]
tommylommykins is now known as jvkTommy
lggr has joined #ruby
chrishunt has quit [Ping timeout: 255 seconds]
jgrevich has joined #ruby
carloslopes has quit [Quit: Leaving.]
br4ndon has joined #ruby
jtdowney has quit [Remote host closed the connection]
aantix has joined #ruby
yoklov has joined #ruby
noxoc1 has joined #ruby
deadghost has joined #ruby
iamlacroix has joined #ruby
hbpoison has quit [Remote host closed the connection]
iamlacroix has quit [Remote host closed the connection]
br4ndon has quit [Ping timeout: 256 seconds]
iamlacroix has joined #ruby
noxoc has quit [Ping timeout: 248 seconds]
gmci has quit [Ping timeout: 244 seconds]
lggr has quit [Ping timeout: 240 seconds]
brianpWins has quit [Quit: brianpWins]
ananthakumaran has joined #ruby
seoaqua has joined #ruby
swarley has quit [Ping timeout: 245 seconds]
Vainoharhainen has quit [Quit: Leaving...]
krzkrzkrz has quit [Quit: krzkrzkrz]
swarley has joined #ruby
CodeFriar has quit [Quit: Leaving...]
lggr has joined #ruby
vivmbbs has joined #ruby
vivmbbs has left #ruby ["Leaving"]
Dreamer3 has joined #ruby
davidcelis has joined #ruby
peregrine81 has quit [Quit: Goodbye.]
jimeh4 has joined #ruby
yoklov has quit [Quit: computer sleeping]
Raimiss has joined #ruby
elsifaka has quit [Quit: Veloma e!]
RegEchse has joined #ruby
jimeh3 has quit [Ping timeout: 255 seconds]
JonnieCache has quit [Ping timeout: 244 seconds]
berserkr has joined #ruby
deadghost has quit [Ping timeout: 252 seconds]
colinbm has quit [Quit: colinbm]
mucker has quit [Quit: leaving]
kn330 has quit [Ping timeout: 248 seconds]
mikepack has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
pkondzior has joined #ruby
msch has quit [Quit: Coyote finally caught me]
yakitori has joined #ruby
msch has joined #ruby
duracrisis is now known as cypher
kn330 has joined #ruby
Raimiss has quit [Ping timeout: 252 seconds]
Eldariof18-ru has quit []
h4mz1d has joined #ruby
tk__ has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
lggr has joined #ruby
<Sou|cutter>
I'm writing a gem (let's call it 'soul') that has a dependency whose require does not match the gem name. In bundler you can represent this as "gem 'foo', :require => 'bar'" - is there a way to represent this in 'soul's gemspec so that it is properly loaded when projects use the 'soul' gem?
dhruvasagar has joined #ruby
headius has joined #ruby
<Muz>
In the gemspec, spec.add_dependency 'gemname'; in the root rb file in lib/ for your gem, add 'require "blah"'
timmow has quit [Quit: is having a nap]
Eplemosen has joined #ruby
<Muz>
The gemspec'll cause the other gem to get downloaded and installed as a dependancy when they install your gem. The require line will then include it when they include your gem's library.
<Sou|cutter>
Muz: *nod* that makes sense. I guess I was struggling to make it more conformant to bundler or something when that really isn't necessary
h4mz1d has quit [Read error: Connection reset by peer]
<Sou|cutter>
thanks
beneggett has quit [Quit: Computer has gone to sleep.]
Criztian has joined #ruby
bluOxigen has joined #ruby
internet_user has joined #ruby
yshh has joined #ruby
cypher is now known as duracrisis
hadees has quit [Quit: hadees]
nari_ has quit [Ping timeout: 248 seconds]
areil has quit [Remote host closed the connection]
chrismcg is now known as zz_chrismcg
uris has quit [Ping timeout: 252 seconds]
Targen has joined #ruby
lggr has quit [Ping timeout: 240 seconds]
mars__ has joined #ruby
beneggett has joined #ruby
bluOxigen has quit [Ping timeout: 245 seconds]
okapi has quit [Quit: Leaving]
dakine has joined #ruby
ttt has joined #ruby
stan_man_can has quit [Quit: stan_man_can]
lggr has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
mohits has quit [Read error: Connection reset by peer]
alvaro_o has joined #ruby
cakehero has joined #ruby
dmiller_ has quit [Remote host closed the connection]
erichmenge has joined #ruby
saschagehlich_ has joined #ruby
ttt has quit [Ping timeout: 240 seconds]
PapaSierra has quit [Ping timeout: 245 seconds]
slicslak has joined #ruby
PapaSierra has joined #ruby
deadghost has joined #ruby
saschagehlich_ is now known as saschagehlich
erichmenge has quit [Client Quit]
ZubKonst has quit [Read error: Connection reset by peer]
bradhe has quit [Remote host closed the connection]
erichmenge has joined #ruby
ZubKonst has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
h4mz1d has joined #ruby
maletor has joined #ruby
maek has left #ruby [#ruby]
ananthakumaran has quit [Ping timeout: 246 seconds]
axl_ has joined #ruby
jonathanwallace has quit [Remote host closed the connection]
axl_ has quit [Client Quit]
codefyre has joined #ruby
axl_ has joined #ruby
jbw has quit [Read error: Connection reset by peer]
diegoviola has joined #ruby
jbw has joined #ruby
recycle has joined #ruby
mark_locklear has quit [Quit: Leaving]
lggr has joined #ruby
recycle has quit [Remote host closed the connection]
mistergibson has quit [Remote host closed the connection]
hadees has joined #ruby
jenrzzz has joined #ruby
brianpWins has joined #ruby
ryanlecompte has joined #ruby
pfaff has quit [Ping timeout: 268 seconds]
Mon_Ouie has joined #ruby
Synthead has joined #ruby
pygmael has quit [Quit: pygmael]
Raimiss has joined #ruby
_bart has quit [Quit: _bart]
PapaSierra has quit [Ping timeout: 260 seconds]
jtdowney has joined #ruby
saschagehlich has quit [Ping timeout: 255 seconds]
saschagehlich has joined #ruby
lggr has quit [Ping timeout: 245 seconds]
chrishunt has joined #ruby
ananthakumaran has joined #ruby
frogprince_mac has joined #ruby
pfaff has joined #ruby
lggr has joined #ruby
axl_ has quit [Quit: axl_]
Raimiss has quit [Ping timeout: 252 seconds]
bobbbo has joined #ruby
ruby_noob has quit [Quit: ruby_noob]
timonv has quit [Remote host closed the connection]
Spooner has quit [Ping timeout: 255 seconds]
<rabidpraxis>
anyone else getting 500's from bundler, and gem install?
PapaSierra has joined #ruby
axl_ has joined #ruby
answer_42 has quit [Remote host closed the connection]
Rydefalk has quit [Read error: Connection reset by peer]
twoism has joined #ruby
lggr has joined #ruby
twoism has quit [Remote host closed the connection]
bradhe has joined #ruby
msch has quit [Remote host closed the connection]
twoism has joined #ruby
bricker has joined #ruby
msch has joined #ruby
twoism is now known as Guest68031
bobthebuilder has joined #ruby
pfaff has joined #ruby
stepnem has quit [Ping timeout: 252 seconds]
havenn has joined #ruby
bluenemo has quit [Remote host closed the connection]
awarner has quit [Remote host closed the connection]
beit has joined #ruby
arturaz has quit [Ping timeout: 245 seconds]
<nyuszika7h>
how can I lost methods etc. of an object?
<nyuszika7h>
* list
<nyuszika7h>
like Python's dir()
<Hanmac>
object.methods
lggr has quit [Ping timeout: 256 seconds]
hoelzro is now known as hoelzro|away
stepnem has joined #ruby
Mon_Ouie has quit [Ping timeout: 245 seconds]
Fretta has joined #ruby
lggr has joined #ruby
Agis__ has joined #ruby
slainer68 has quit [Remote host closed the connection]
Mon_Ouie has joined #ruby
apok has joined #ruby
JohnBat26 has quit [Ping timeout: 246 seconds]
timonv has joined #ruby
chrisja has joined #ruby
uris has joined #ruby
jonathanwallace has joined #ruby
lggr has quit [Ping timeout: 260 seconds]
timonv has quit [Read error: Connection reset by peer]
niklasb has joined #ruby
Targen has quit [Ping timeout: 260 seconds]
mikepack_ has joined #ruby
timonv has joined #ruby
DebianUT has joined #ruby
mikepack has quit [Read error: Connection reset by peer]
d3vic3 has quit [Quit: leaving]
Mon_Ouie has quit [Ping timeout: 245 seconds]
swarley has quit [Ping timeout: 245 seconds]
seoaqua has quit [Ping timeout: 248 seconds]
tyfighter has joined #ruby
shevy has quit [Ping timeout: 246 seconds]
lggr has joined #ruby
bradhe has quit [Remote host closed the connection]
jrist is now known as jrist-mtg
peter1 has joined #ruby
Raimiss has joined #ruby
bobthebuilder has quit [Quit: WeeChat 0.3.8]
ruby_noob has joined #ruby
notVert has quit [Remote host closed the connection]
Guest68031 has quit [Ping timeout: 246 seconds]
ruby_noob has quit [Client Quit]
Criztian_ has joined #ruby
dnstbr has joined #ruby
Elhu has quit [Quit: Computer has gone to sleep.]
Xeago has quit [Remote host closed the connection]
Criztian_ has quit [Read error: Connection reset by peer]
apok has quit [Remote host closed the connection]
pfaff has quit [Ping timeout: 268 seconds]
Criztian_ has joined #ruby
apok has joined #ruby
vderyagin has joined #ruby
Criztian has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 246 seconds]
Raimiss has quit [Ping timeout: 256 seconds]
rakl has joined #ruby
mmitchell has quit [Remote host closed the connection]
Synthead has quit [Remote host closed the connection]
mmitchell has joined #ruby
lggr has joined #ruby
elderflower has quit [Ping timeout: 240 seconds]
br4ndon has joined #ruby
whitenoise has quit [Read error: Connection reset by peer]
chussenot has quit [Quit: chussenot]
pfaff has joined #ruby
mmitchell has quit [Read error: Connection reset by peer]
mmitchell has joined #ruby
mwilson` has quit [Excess Flood]
havenn has quit [Remote host closed the connection]
ncr100 has joined #ruby
sebastorama has joined #ruby
mwilson` has joined #ruby
aldodelgado has joined #ruby
shevy has joined #ruby
Synthead has joined #ruby
axl_ has quit [Quit: axl_]
sneakyness_wk has joined #ruby
duracris1s has joined #ruby
<davidcelis>
also Class.instance_methods
DeviousDodo has quit [Quit: leaving]
jasonkuhrt has joined #ruby
duracris1s has left #ruby [#ruby]
lggr has quit [Ping timeout: 240 seconds]
TomJ has quit [Quit: TomJ]
bradhe has joined #ruby
elderflower has joined #ruby
Synthead has quit [Remote host closed the connection]
Z0idberg has joined #ruby
moshee has quit [Ping timeout: 245 seconds]
moshee has joined #ruby
arya_ has joined #ruby
deadghost has quit [Ping timeout: 245 seconds]
ncr100_ has joined #ruby
lggr has joined #ruby
ncr100 has quit [Ping timeout: 246 seconds]
PapaSierra2 has joined #ruby
Synthead has joined #ruby
axl_ has joined #ruby
axl_ has quit [Client Quit]
Targen has joined #ruby
slicslak has quit [Ping timeout: 252 seconds]
Spooner has joined #ruby
axl_ has joined #ruby
PapaSierra has quit [Ping timeout: 245 seconds]
axl_ has quit [Client Quit]
burgestrand has joined #ruby
pfaff has quit [Ping timeout: 245 seconds]
mmitchell has quit [Remote host closed the connection]
stephenjudkins has joined #ruby
arya_ has quit [Ping timeout: 240 seconds]
dhruvasagar has quit [Ping timeout: 246 seconds]
lggr has quit [Ping timeout: 260 seconds]
pfaff has joined #ruby
jeff_sebring has quit [Quit: Leaving]
mmitchell has joined #ruby
twoism has joined #ruby
lggr has joined #ruby
twoism is now known as Guest86844
sepp2k1 has joined #ruby
sjuxax has joined #ruby
roadt has quit [Ping timeout: 245 seconds]
sepp2k has quit [Ping timeout: 245 seconds]
scrogson has left #ruby [#ruby]
<sjuxax>
Hi all. I have a "final summary" that I would like to print even if the program receives Ctrl+C. Right now I am doing this with a begin-rescue Interrupt, but in this model I have copied the summary into this rescue block and also immediately under it, which is reached if the program exits successfully. How can I make it so I only have to have this summary written one time?
jrist-mtg is now known as jrist
arya_ has joined #ruby
<sjuxax>
I'm tempted to use GOTO but apparently Ruby doesn't allow that ;)
pfaff has quit [Ping timeout: 245 seconds]
<sjuxax>
I don't want to break it into a function because then I either have to make all the variables it uses global, or I have to make them all parameters that must be passed in
havenn has joined #ruby
elico has joined #ruby
<sjuxax>
Since this is only used in a single spot (when the program exits, successfully or not), I would like not to deal with that. So any suggestions would be helpful.
mikepack_ has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
lkba has joined #ruby
codefyre has quit [Quit: Leaving]
<Hanmac>
sjuxax look for begin ... ensure ... end
axl_ has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
bluOxigen has joined #ruby
nga4 has joined #ruby
pfaff has joined #ruby
<sjuxax>
Hanmac: thanks, that does look like it'll work. :)
Raduwen has quit [Quit: Leaving...]
timonv has quit [Remote host closed the connection]
mikepack has joined #ruby
Takehiro has quit [Remote host closed the connection]
mmitchell has quit [Remote host closed the connection]
lggr has joined #ruby
bencaron has joined #ruby
mmitchell has joined #ruby
dnstbr has quit [Quit: Computer has gone to sleep.]
<DebianUT>
sjuxax, I think there is an event in Ruby for that, I just don't remember withc one it is
PapaSierra2 has quit [Read error: Connection reset by peer]
Criztian_ has quit [Remote host closed the connection]
<gmg85>
what would be the best xml parsing gem/lib for ruby?
lggr has joined #ruby
<havenn>
gmg85: Nokogiri
Mon_Ouie has joined #ruby
sdegutis has quit [Remote host closed the connection]
yshh has joined #ruby
<gmg85>
nice..
<gmg85>
let me check it out
pfaff has quit [Ping timeout: 245 seconds]
Villadelfia has joined #ruby
jbw has joined #ruby
adeponte has quit [Remote host closed the connection]
<gmg85>
Looks good
<gmg85>
way better than xmlsimple
akl has joined #ruby
arubin has joined #ruby
linoj has quit [Quit: linoj]
br4ndon has quit [Ping timeout: 256 seconds]
yigal has joined #ruby
babonk has quit [Quit: babonk]
pfaff has joined #ruby
linoj has joined #ruby
stephenjudkins has quit [Quit: stephenjudkins]
lggr has quit [Ping timeout: 260 seconds]
milestone has joined #ruby
pu22l3r has quit [Ping timeout: 245 seconds]
<milestone>
hi all, i am using rexml to parse an xml document. I am using XPatch to get a concrete Element with lots of subelements, which i would like to copy and rename an attribute
ianblenke1 has quit [Quit: Leaving.]
<milestone>
der Elements Clone Method only does a shallow copy
<milestone>
is there a way to copy the element and all its children together?
lggr has joined #ruby
beit has quit [Quit: beit]
arubin_ has joined #ruby
elaptics is now known as elaptics`away
elaptics`away is now known as elaptics
starship is now known as duracrisis
arubin has quit [Ping timeout: 245 seconds]
arubin_ is now known as arubin
My_Hearing has joined #ruby
Mon_Ouie has quit [Quit: WeeChat 0.3.8]
haxrbyte_ has quit [Ping timeout: 245 seconds]
pu22l3r has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<jmtame>
if i wanted to have a doctor object, and then another patient object, and i wanted a patient's SSN attribute to only be visible to a doctor, would i make the patient inherit from the doctor? that seems off
<jmtame>
trying to get a good grasp on encapsulation in ruby
<Mon_Ouie>
You just wouldn't do it, you'd make the SSN attribute public — if something unrelated like a Doctor object may need, you might potentially need it anywhere you use the patient object
<Mon_Ouie>
Don't forget visibility in code has nothing to do with a person really being able to access certain data
lggr has joined #ruby
RegEchse has quit [Quit: <3 WeeChat (v0.3.9-rc2)]
havenn has quit [Remote host closed the connection]
kpshek has quit []
milestone has quit [Ping timeout: 252 seconds]
heftig has quit [Quit: leaving]
burgestrand has joined #ruby
mengu has joined #ruby
<shevy>
jmtame, it is not logical to make a patient a subclass of a doctor
lggr has quit [Ping timeout: 246 seconds]
elaptics is now known as elaptics`away
rakl has quit [Quit: sleeping]
kpshek has joined #ruby
beneggett has quit [Quit: Computer has gone to sleep.]
<gmg85>
Just installed a gem (nokogiri)...problem is...it is not listed when i run gem list
chrishunt has joined #ruby
Morkel_ has joined #ruby
<shevy>
gmg85, do you use debian
<gmg85>
oh...
<gmg85>
my bad
<gmg85>
its listed
<gmg85>
damn grep's case sensitivity!!
arya_ has quit [Ping timeout: 248 seconds]
Morkel has quit [Ping timeout: 255 seconds]
Morkel_ is now known as Morkel
<asteve>
can you generate an xsd document with nokogiri?
<jmtame>
shevy: that's what i was thinking. any way to make sure i can only grant access to patient's SSN from a doctor?
mengu has quit [Read error: Connection reset by peer]
TomJ has joined #ruby
<jmtame>
shevy: eg if a janitor object tries to access it, it won't work
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
<gmg85>
hmm...just started looking into it a few minutes ago..
havenn has joined #ruby
lggr has joined #ruby
arya_ has joined #ruby
Agis__ has quit [Quit: Agis__]
<gmg85>
it does seem to have an XSD module
<Spooner>
jmtame : Patient and Doctor are logically both Person (an abstract class).
<gmg85>
jmtame:the XSD module does not appear to be well documented
<Spooner>
jmtame As people have said, it doesn't make sense to have it work like as you say.
cburyta has quit [Remote host closed the connection]
<Spooner>
Janitor objects aren't self-aware, so they won't try to access your SSN unless you ask them to.
yekta has joined #ruby
vderyagin has quit [Remote host closed the connection]
yekta has quit [Client Quit]
<shevy>
jmtame simply pass in the information when you access the method
etehtsea has quit [Quit: Computer has gone to sleep.]
w400z has joined #ruby
<Spooner>
Shevy: Say you have module Foo and class Bar::Foo and inside the Bar module, if you use Foo, it refers to Bar::Foo and if you use ::Foo it refers to the module Foo - :: means search for the name in the global namespace first.
_bart has joined #ruby
deadghost has joined #ruby
<Spooner>
*prefix of ::, that is
<workmad3>
:: makes it the equivalent of doing a / absolute path
<Spooner>
Good analogy, yes.
<shevy>
hmm Spooner ... need to think about this first
zommi has quit [Quit: Leaving.]
<workmad3>
what was the original issue, anyway? :)
<Spooner>
However, not entirely, since if you have Foo and Bar::Cheese and ask for Foo in Bar, then it finds the global Foo. Normally it looks in the local namespace, then out to the global one. :: prefix means look in global first.
bwlang has quit [Excess Flood]
bwlang has joined #ruby
<RubyPanther>
burgestrand: you don't even have a :: there lol :)
<burgestrand>
RubyPanther: Baz 5, Baz(5), Foo::Baz 5, ::Foo::Baz 5 all work, but not ::Baz 5. I suppose it makes sense, since it is really a constant lookup, but still.
<shevy>
hmm this example confuses me as well
<RubyPanther>
So when subclassing Numeric with Foo, I would also provide a ::Foo() method
sepp2k1 has quit [Remote host closed the connection]
<RubyPanther>
shevy: :: only searches from the top, it doesn't search from the current module back
lggr has joined #ruby
jenrzzz has joined #ruby
Guedes is now known as Guedes_out
rads has quit [Quit: Computer has gone to sleep.]
acrocity has quit [Ping timeout: 268 seconds]
asteve has quit [Quit: Computer has gone to sleep.]
hvq has joined #ruby
brianpWins has quit [Read error: Connection reset by peer]
c0rn_ has joined #ruby
swarley has quit [Read error: Connection reset by peer]
aantix has joined #ruby
<shevy>
hmm hmm hmm
Targen_ has joined #ruby
Jackneill has quit [Read error: Connection reset by peer]
rads has joined #ruby
<Spitfire>
mhm mhm mhm
Targen has quit [Ping timeout: 245 seconds]
swarley has joined #ruby
acrocity has joined #ruby
msch has quit [Ping timeout: 248 seconds]
brianpWins has joined #ruby
<shevy>
my poor old brain
kpshek has quit []
glyytchy has quit [Quit: Leaving...]
waxjar has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
bluenemo has quit [Changing host]
reisl has quit [Quit: Leaving]
hadees has quit [Quit: hadees]
<shevy>
I think my brain hates to learn new things
<shevy>
I still don't get it :(
<shevy>
perhaps I will get it this way ...
<blazes816>
it's like the / in a url
<hvq>
Hi guys, I am a Ruby beginner. Just wonder if I don't use Rails, can Ruby alone be used for web development? If so, any tutorial for setting up the thing and get it runs on localhost? Thanx :P
<shevy>
when do I have to precisely use ::Foo because there is no other way?
<blazes816>
im/a/relative/path
<shevy>
blazes816 ok tell me more. the leading / I suppose?
<workmad3>
shevy: take the example I constructed
eldariof has quit []
<blazes816>
/im/an/absolute/path
<blazes816>
shevy: yeah, just :: instead of /
<workmad3>
shevy: if I wanted to access the top-level Bar then I *have* to use ::Bar
<burgestrand>
hvq: a good idea would be to check out smaller tutorials like http://tryruby.org/ or even http://rubykoans.com/, depending only on you and your mind.
<shevy>
hmm I get it a little better now
<swarley>
i like sinatra much more than rails. but that's just me
mwillhite has quit [Ping timeout: 240 seconds]
Takehiro has joined #ruby
<burgestrand>
They are different things.
<hvq>
burgestrand: sinatra is a web framework right? is it possible to use Ruby alone for web development?
<swarley>
well, as far as web application programming goes
jasonkuhrt has joined #ruby
<burgestrand>
hvq: yes, a very light framework. And yes, it is possible, and there are many ways.
<swarley>
i'd much rather use sinatra than set up a full rails development environment
arya_ has quit [Ping timeout: 255 seconds]
<burgestrand>
hvq: you could run ruby with CGI, if you really want to, but that’d be a bit crazy starting out, and very few people do ruby web development that way.
<swarley>
there is also monkey bars or something isnt there?
<swarley>
webrick is an option, but that's just working more to get the same thing
<hvq>
burgestrand: I am looking for a tutorial to setup ruby for web development without using any framework. Do you know one?
<burgestrand>
hvq: the standard way for ruby web applications is running them with a ruby web server (thin, puma, webrick, mongrel, etc…) and using rack to interface with the webserver. Rack is also a web framework, but you don’t get much lighter than that without going over from web development to masochism.
ncr100 has joined #ruby
bradhe_ has joined #ruby
recycle has joined #ruby
lggr has joined #ruby
<burgestrand>
hvq: I am not sure you fully understand the scope of your own question.
recycle has quit [Remote host closed the connection]
<burgestrand>
Actually, I’m pretty sure of that. :p
Bosma has quit [Quit: leaving]
<workmad3>
shevy: as I said, the thing to keep in mind with constant lookup is that the lookup uses lexical scoping, so in this modified example: https://gist.github.com/00ff4d00b3098e6bcedf then doing Fizz::Buzz2.new.relative will *still* look up ::Foo::Bar::Buzz (the lexical scope) rather than trying to look for ::Fizz::Buzz2::Bar::Test
<burgestrand>
hvq: have you written web applications in any other languages before?
bradhe has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
<hvq>
burgestrand: hmm, yes but Im totally new to Ruby. Thanx for your help anyway :)
arubin has quit [Quit: arubin]
<mr-rich>
Is there a way to test the ruby version in code?
<hvq>
burgestrand: I will find what I really need.
<burgestrand>
hvq: I’m sidestepping answering your questions to try and figure out what you’re really after. :)
<burgestrand>
mr-rich: RUBY_VERSION
chaplain has joined #ruby
<hvq>
burgestrand: nvm, sorry but it's a bit sensitive ;)
<burgestrand>
hvq: alright. But do have a look at Rack, and Ruby CGI. Those would be your main two options.
<mr-rich>
burgestrand: ty
mmitchell has quit [Remote host closed the connection]
<hvq>
burgestrand: ok, thanx a lot!
<burgestrand>
hvq: I would guess you’d sway towards Rack eventually, so don’t dismiss it just because it is a framework.
<swarley>
why are you looking to avoid a framework?
<hvq>
burgestrand: ok
cakehero has quit [Quit: Computer has gone to sleep.]
maletor has joined #ruby
<workmad3>
rack is more of a micro-framework/interface specification for web server communication
bradhe_ has quit [Ping timeout: 248 seconds]
<workmad3>
rather than being a web app framework
<burgestrand>
Yeah, I just noticed rack does not call itself a framework.
wpaulson has joined #ruby
Vinz_ has quit [Quit: Bye.]
xclite has quit [Remote host closed the connection]
bluenemo has quit [Remote host closed the connection]
Takehiro has quit [Ping timeout: 244 seconds]
<workmad3>
hvq: if what you basically want is to be able to interface a ruby app with a web server, I'd highly recommend you look at rack
Vinz_ has joined #ruby
<hvq>
workmad3, burgestrand: ok, thank you. It seems that Sinatra actually fits my need. Let me check on that before asking you guys further!
<workmad3>
sinatra is basically a lightweight framework built on rack ;)
lggr has quit [Ping timeout: 255 seconds]
cakehero has joined #ruby
<burgestrand>
Hssh. Don’t say framework.
* burgestrand
hides under the covers
<workmad3>
:D
<workmad3>
still, all sinatra really provides is routing and some hooks for templating, everything else you need to add yourself
hadees has joined #ruby
gmg85 has joined #ruby
<workmad3>
it's probably the closest you can get to non-framework territory without using rack directly (but if you used rack directly, what you'd probably do first is write your own version of sinatra ;) )
<rburton->
One day I'll do a meet-up and whenever someone says framework, the entire room must do a shot
sailias has quit [Quit: Leaving.]
<burgestrand>
But um!
<rburton->
The entire room would die
enrique has joined #ruby
<workmad3>
rburton-: we could all talk about libraries
<workmad3>
rburton-: but they aren't as fun :P
<rburton->
Or as cool right!
<hvq>
ok, let's me see what all those things mean first!
<rburton->
The new term will be toolkit because of Akka
<swarley>
what are ruby's functional aspects (in terms of programming style)?
dnstbr has joined #ruby
<burgestrand>
blox.
<swarley>
i can't identify them off hand
<enrique>
hi guys, How can I build the ruby core documentation?. I am not using rvm
<swarley>
ah
<burgestrand>
or, you could call them lambdas for the functional guys.
<burgestrand>
Couple them with ruby’s Enumerable (and similar things) you could have something looking very functional
cakehero has quit [Ping timeout: 248 seconds]
<burgestrand>
But really, it’s all gravy.
<burgestrand>
Ruby is not a functional language. It is a functional language, but it is not a functional language.
lggr has joined #ruby
<burgestrand>
Functions either way, it’s all about which methods you use.
<burgestrand>
I’ll stop now.
<workmad3>
you can write in a functional style, and you can create a functional (as in, lambda calculus) subset of ruby using just procs
<swarley>
puts "hi" isnt reached (if i understand it correctly)
<rcassidy>
i don't necessarily love them *in ruby*
<shevy>
swarley hmm odd
<swarley>
λ
joelsbeard has joined #ruby
<workmad3>
shevy: basically, the whole lambda calculus is exactly as powerful as a more procedural computational model built on the turing machine model
<rcassidy>
where is the bot when you need him? was great for examples on this stuff
<workmad3>
shevy: but it's expressive in different ways
<swarley>
In a lambda-created proc, the return statement returns only from the proc itself
<swarley>
In a Proc.new-created proc, the return statement is a little more surprising: it returns control not just from the proc, but also from the method enclosing the proc!
<swarley>
wait isn't that what i said?
Nisstyre-laptop has quit [Ping timeout: 245 seconds]
mmitchell has joined #ruby
<Spooner>
You said it the other way around.
<swarley>
ah
<swarley>
whoops
<swarley>
my bad
chrishunt has quit [Ping timeout: 244 seconds]
<rcassidy>
i don't think the right term is 'lamda-created-proc' - can we just say 'lambda'? :)
<swarley>
well at least i sort of knew what i was doing
<workmad3>
swarley: lambdas also raise an exception if you get the arguments wrong
<workmad3>
swarley: as in, a = ->(foo, bar) {}; a.call(1) #error
<rcassidy>
wait i take mine back
xclite has joined #ruby
<rcassidy>
i didn't realize that when you use the lambda keyword the thing you get back is named a proc in ruby
<rcassidy>
ew, that's not cool, especially if they act differently
<zombor>
burgestrand: was hoping to eliminate the loop
lggr has joined #ruby
<burgestrand>
swarley: I suppose. Perhaps the plugin statement could be optional. Also, the "on" seems superfluous.
<swarley>
the reason the plugin statement is used is because the Plugin.inherited isn't called until after all of the on statements
<burgestrand>
swarley: it might also be confusing that you can use the object in match and command to reply (or send messages to the same room, I would assume, not just reply), while you cannot do that with all.
<burgestrand>
The hoster used to come in here from time to time to make sure it was up.
manizzle has quit [Ping timeout: 256 seconds]
<burgestrand>
Perhaps he got fed up with it, as many others before him hosting ruby bots.
msch has joined #ruby
<swarley>
burgestrand, what would you do instead of "on"?
<burgestrand>
swarley: I’d probably just use command, match, and all.
<swarley>
ah
rakl has joined #ruby
rakl has quit [Client Quit]
<burgestrand>
swarley: can’t say I have a subjective reasoning for it. Perhaps I’m biased by sinatra?
Takehiro has joined #ruby
mogaj has quit [Quit: Leaving]
<swarley>
i think i'll use "always" instead of all
<swarley>
and then every 5, :seconds or something
<swarley>
for timers
bigkevmcd has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
<swarley>
burgestrand, any suggestions on how i can take out the plugin declaration?
cjs226 has quit []
bradhe_ has joined #ruby
<burgestrand>
swarley: perhaps all the handlers could just add to some kind of list, and once the plugin-call is made, the up-until-now collected list of commands would be registered to that plugin. Perhaps I should explain this reasoning with some code, I realize it can be a bit confusing.
<swarley>
oh no i get it
<burgestrand>
It’s a lot of work for getting rid of the plugin-call though.
<swarley>
like a stack
<burgestrand>
Yeah. And you pop it once you call plugin, in your inherited hook.
<swarley>
yeah that's a good idea
rubious has joined #ruby
<swarley>
the reason it's in a class is because each bot gets an instance of the plugin
jonathan_ has quit [Remote host closed the connection]
<swarley>
i'm aiming to be like cinch, but with easy interface for multiple bots and multiple instances of plugins
<burgestrand>
I don’t understand why you need the plugin call at all though
<swarley>
because on is Plugin.on
<swarley>
err
<swarley>
self.on
sebastorama has quit [Quit: Computer has gone to sleep.]
Takehiro has quit [Ping timeout: 244 seconds]
<swarley>
the code using self.plugin is really dirty and i don't want to show it lol
<dominikh>
swarley: Cinch has been designed around multiple instances of plugins ;)
jmtame has quit [Quit: jmtame]
bradhe has quit [Ping timeout: 246 seconds]
arya_ has joined #ruby
<burgestrand>
swarley: I think I’m asking if you cannot allow anonymous plugins somhow
<swarley>
dominikh, :p well i'm not using it right
<swarley>
you can't as i currently have it
bwlang has left #ruby [#ruby]
milestone has joined #ruby
bradhe_ has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
lggr has joined #ruby
<swarley>
i also have a weird plugin data storage thing i put in there
<swarley>
which i like, i have no idea if anyone else likes it
stephenjudkins has quit [Ping timeout: 260 seconds]
bradhe_ has joined #ruby
stephenjudkins has joined #ruby
<swarley>
ugh
<swarley>
still can't push to rubyforge
bradhe_ has quit [Read error: Connection reset by peer]
<dominikh>
people still use rubyforge?
<burgestrand>
Cool.
bradhe_ has joined #ruby
mohit has quit [Ping timeout: 248 seconds]
<swarley>
i'm thinking of doing per network databases and then plugin cursors
talking has quit [Quit: leaving]
* swarley
needs a break from IRC
<dominikh>
write a jabber bot framework then :P
<swarley>
dominikh, once again sir. i salute you and think you did a wonderful job
zombor has left #ruby ["Leaving..."]
<swarley>
fuck that
<dominikh>
thanks :P
<swarley>
i
<swarley>
i'm going to go do some haskell or something
<dominikh>
lol
<swarley>
maybe something in D
bradhe has quit [Ping timeout: 244 seconds]
<davidcelis>
swarley: how is YAIL going to compare to Cinch
<swarley>
its going to be pretty awful
<davidcelis>
lol
<davidcelis>
i like your honesty
hvq has quit [Read error: Connection reset by peer]
<swarley>
i don't know i like the buffered IO i'm using
<burgestrand>
Huh, when did 2.0 core come onto ruby-doc?
<swarley>
its simple as hell though
tjbarber has quit [Changing host]
tjbarber has joined #ruby
<swarley>
mutex in the IRC instance controlling buffered writes
<swarley>
nothing special
<swarley>
now, i would start programming something else to take a break if my damn dog would get off my keyboard
<dominikh>
tell your dog that he's not a cat.
lggr has quit [Ping timeout: 260 seconds]
yshh has quit [Remote host closed the connection]
milestone has quit [Remote host closed the connection]
milestone has joined #ruby
chimkan_ has joined #ruby
<shevy>
lol
banseljaj is now known as neptunepink`
PapaSierra has quit [Read error: Connection reset by peer]
redpanda has joined #ruby
milestone has quit [Client Quit]
PapaSierra has joined #ruby
neptunepink` is now known as banseljaj
<codebrah>
i cant chose between learning python and ruby :(
lggr has joined #ruby
<shevy>
codebrah did you read the old matz interview
<blazes816>
codebrah: as a developer of both I advise Ruby
kn330 has quit [Remote host closed the connection]
brianpWins has quit [Read error: Connection reset by peer]
<codebrah>
i'm refactoring right now brahs
statbot has joined #ruby
stephenjudkins has joined #ruby
<blazes816>
u already wrote the code brah it's done
<Beoran>
blazes816, what's up with that ho's and bros too? That's just silly.
<blazes816>
arietis: yeah probably. install imagemagick and try running it from irb
<Beoran>
anyway I'm out of here
thaz has joined #ruby
JetAway has joined #ruby
CaptainJet has quit [Disconnected by services]
<blazes816>
peace out home sauce
JetAway is now known as CaptainJet
<[diecast]>
such hip lingo in here
thone_ has quit [Ping timeout: 240 seconds]
<blazes816>
don't worry [diecast] i'm just satiring
<codebrah>
I've got to
<codebrah>
Actionscript 3 I wrote like 6 months ago LOL
<blazes816>
haha
IPGlider has joined #ruby
bradhe_ has quit [Read error: Connection reset by peer]
bradhe has joined #ruby
Jellyg00se has quit [Remote host closed the connection]
jasonkuhrt has quit [Quit: Leaving...]
Axsuul has joined #ruby
stim371 has joined #ruby
rubious has quit [Quit: Leaving...]
lggr has quit [Ping timeout: 252 seconds]
mistergibson has quit [Remote host closed the connection]
thaz has quit [Client Quit]
DrShoggoth has quit [Quit: Leaving]
icole_ has quit [Remote host closed the connection]
PapaSierra has left #ruby [#ruby]
<codebrah>
I'm learning this Ruby and stuff on Codecademy, but I think Python looks more aesthetic
cjs226 has joined #ruby
<davidcelis>
really
<blazes816>
self.laugh()
<davidcelis>
python's unfuckingreadable to me these days
icole has joined #ruby
obryan has quit [Ping timeout: 245 seconds]
<codebrah>
it is? :(
ckrailo has joined #ruby
<davidcelis>
after coding in ruby, yeah
robertotauille has joined #ruby
bbttxu has quit [Quit: bbttxu]
<blazes816>
if __name__ == "__main__":
<blazes816>
is all i need to see before throwing up
GoGoGarrett has quit [Remote host closed the connection]
lggr has joined #ruby
<codebrah>
o :(
alanp has joined #ruby
alanp_ has quit [Read error: Connection reset by peer]
rubious has joined #ruby
bradhe has quit [Remote host closed the connection]
bradhe has joined #ruby
haxrbyte has quit [Ping timeout: 248 seconds]
apok_ has joined #ruby
jonathanwallace has joined #ruby
rubious has quit [Client Quit]
keyvan has joined #ruby
keyvan has joined #ruby
keyvan has quit [Changing host]
<Mon_Ouie>
Java is still worse. How do they not miss the ability to use and define higher-order functions?
lggr has quit [Ping timeout: 260 seconds]
fantazo has joined #ruby
bradhe has quit [Ping timeout: 246 seconds]
Takehiro has joined #ruby
apok has quit [Ping timeout: 245 seconds]
apok_ is now known as apok
<blazes816>
they never knew them in the first place
stim371 has quit [Quit: stim371]
ph^ has joined #ruby
<Mon_Ouie>
I guess; but don't they notice they keep doing the same things over and over?
dobie_gillis is now known as Completely`soake
joshman_ has quit [Ping timeout: 240 seconds]
<blazes816>
i think they enjoy it :s
icole has quit [Remote host closed the connection]
bradleyprice has quit [Remote host closed the connection]
lggr has joined #ruby
Takehiro has quit [Ping timeout: 244 seconds]
stopbit has quit [Quit: Leaving]
<jrajav>
Mon_Ouie: Well, it was a little tricky because Java was never supposed to have functions at all
<jrajav>
Just methods
<jrajav>
Aren't first class functions in the works for Java 8 though?
deadghost has quit [Ping timeout: 255 seconds]
tgraham has quit [Quit: Leaving...]
<Mon_Ouie>
Ruby has only methods yet it still has blocks
_bart has quit [Quit: _bart]
c0rn_ has joined #ruby
<Mon_Ouie>
I think they are. They can also use some trick by using anonymous classes but… that'd usually be more complicated than just copy/pasting the same pattern
deadghost has joined #ruby
<jrajav>
Blocks are blocks, not first class functions
c0rn_ has quit [Client Quit]
<jrajav>
Anonymous classes aren't a trick, they're the ONLY way to accomplish pluggable functionality in Java right now
ph^ has quit [Ping timeout: 245 seconds]
<jrajav>
They're literally everywhere even in standard libraries
<davidcelis>
blox r prox
matrixise has joined #ruby
<davidcelis>
oh java
c0rn_ has joined #ruby
c0rn_ has quit [Client Quit]
BrianJ has joined #ruby
BMF has joined #ruby
awarner has joined #ruby
c0rn_ has joined #ruby
lggr has quit [Ping timeout: 244 seconds]
peregrine81 has quit [Quit: Computer sleeping.]
Targen_ has quit [Ping timeout: 245 seconds]
c0rn_ has quit [Client Quit]
icole has joined #ruby
c0rn_ has joined #ruby
lggr has joined #ruby
redpanda has quit [Remote host closed the connection]
<blazes816>
you should see the crazy python module shit i had hacked up for some OpenStack stuff for work
<blazes816>
it basically took one module and added the load paths of all the other OS projects to it so it was a like a massive global-singleton machine
<blazes816>
it was horrible
lggr has quit [Ping timeout: 245 seconds]
Nisstyre-laptop has joined #ruby
swarley has quit [Read error: Operation timed out]
workmad3 has joined #ruby
internet_user has quit [Remote host closed the connection]
xyzodiac has joined #ruby
<shevy>
hehe
<shevy>
ARE YOU ASHAMED TO HAVE WRITTEN IT blazes816
<blazes816>
more than you know
<shevy>
jrajav everyone is now missing the bot :(
<blazes816>
I added "# Copyright shevy from #ruby" at the top though so it's not too bad
<jrajav>
shevy: Sorry :/
<jrajav>
There was that one guy who offered to host it, but he's been missing for a while now
mikeycgto has quit [Remote host closed the connection]
<jrajav>
Next week I might be able to clean up the virtualbox image and make it available as a torrent so anyone can host it
lggr has joined #ruby
<shevy>
blazes816, lol
<shevy>
jrajav, yeah I think Xeago... he said he could host it but he lacks something
thunders_ has quit [Remote host closed the connection]
k610 has joined #ruby
<shevy>
bash-fu or cojones... something like that
<blazes816>
jrajav: what's the issue? money, or time? or both?
<jrajav>
Neither
<jrajav>
I was hosting on my box at work but that's not an option now
<shevy>
the issue is
<shevy>
people always break it
<shevy>
:>
Completely`soake is now known as Abo`aeuiob
<jrajav>
Nothing bad, it's just that a scale utility runs on my box now which interferes with it
robertotauille has joined #ruby
<blazes816>
hmm
<jrajav>
I can't host it at home currently because I'm behind a private network that has a terrible configuration
<jrajav>
But I don't control it
<jrajav>
In a few months when I move into my own place I could host it again
<carwin>
though maybe that isn't what I want to do, I'm trying to search a file for a multi-line block of text with variable bits -- essentially i'm looking for an array with set keys in a bunch of different php files, so my idea was to just find the line that started that array and add that line to a new ruby array and the next 7 lines
bricker_ has joined #ruby
wallerdev has joined #ruby
alienaut1 has joined #ruby
pu22l3r has quit [Ping timeout: 252 seconds]
alienaut has quit [Ping timeout: 246 seconds]
msch has joined #ruby
bricker has quit [Read error: Connection reset by peer]
jhowarth has joined #ruby
<blazes816>
wat
<carwin>
lol i knew that was coming
<blazes816>
lol, text is hard to decipher sometimes
<carwin>
I need to get a specific 7 lines out of multiple files -- the trouble is, these 7 lines are not always on the same line numbers
<carwin>
additionally, their content changes just a little bit