arooni-mobile has quit [Remote host closed the connection]
akira989 has quit [Ping timeout: 252 seconds]
shyouhei has joined #ruby-lang
jxie_ has joined #ruby-lang
carloslopes has joined #ruby-lang
akira989 has joined #ruby-lang
heftig has joined #ruby-lang
jxie has quit [Ping timeout: 245 seconds]
heftig has quit [Client Quit]
ben_m has quit [Quit: Leaving]
stardiviner has joined #ruby-lang
ryanf has joined #ruby-lang
UNIXgod has quit [Ping timeout: 265 seconds]
umttumt has joined #ruby-lang
neoesque has joined #ruby-lang
dvorak has quit [Remote host closed the connection]
akira989 has quit [Ping timeout: 265 seconds]
wpaulson has joined #ruby-lang
savage- has joined #ruby-lang
VegetableSpoon has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
carloslopes has quit [Quit: Leaving]
Banistergalaxy has joined #ruby-lang
pip has quit [Ping timeout: 245 seconds]
ryanf has joined #ruby-lang
dvorak has joined #ruby-lang
timepilot has quit [Quit: timepilot]
seanstickle has quit [Quit: Nihil sub sole novum]
akira989 has joined #ruby-lang
sepp2k has quit [Remote host closed the connection]
ryanf has quit [Quit: broken pipes |||]
burntbit has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
Banistergalaxy has quit [Ping timeout: 264 seconds]
x0F has quit [Disconnected by services]
x0F_ has joined #ruby-lang
x0F_ is now known as x0F
gsav has joined #ruby-lang
wpaulson has quit [Read error: Connection reset by peer]
wpaulson has joined #ruby-lang
heftig has joined #ruby-lang
woollyams has quit [Read error: Connection reset by peer]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
woollyams has joined #ruby-lang
wpaulson has quit [Read error: Connection reset by peer]
dgs has quit [Ping timeout: 245 seconds]
pip has quit [Ping timeout: 255 seconds]
<tubbo`cloud>
how do i get File.read to start from the nth line down?
savage- has quit [Remote host closed the connection]
arooni-mobile has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
jbsan_ has joined #ruby-lang
jbsan has quit [Ping timeout: 265 seconds]
jbsan_ is now known as jbsan
kanlacism has quit [Quit: leaving]
ryanf has joined #ruby-lang
qpingu has joined #ruby-lang
spurling has joined #ruby-lang
zz_wasnotrice is now known as wasnotrice
Cope has joined #ruby-lang
<Cope>
Hi - I've got an array of strings; I'd like to reject all line before a line which matches a regex, and then keep the lines between that line and another line, matching a different regex, before rejecting the rest.
<bnagy>
tubbo`cloud: you don't, but you can call File.readline n times first
gnufied has joined #ruby-lang
<Cope>
ie I want to create a slice based on a starting regex and ending regex
<Cope>
any suggestions for an elegant way to do this? the array is not large, so memory won't be an issue
<erikh>
maybe scan(/(one)(.*)(two)/) use the first as a token of sorts, follow through to the second index of the array
<bnagy>
Cope: what about ary.drop_while ... keep_while ...
<veex>
Any automation testing channels around IRC?
<erikh>
what kind of automation?
<erikh>
continuous integration?
* Cope
reads about drop_while
vesan_ has quit [Read error: Connection reset by peer]
<veex>
Yes, like Selenium or Coded UI type custom data driven automation.
<tubbo`cloud>
bnagy: so i can do like @file = File.open..., then 8.times { @file.readline }?
<erikh>
veex: check out #trvais
<erikh>
travis
<veex>
RFT, Selenium, Coded UI, Test Complete
<bnagy>
tubbo`cloud: more or less yeah, or just File.readlines.drop(8)
<tubbo`cloud>
oh sweet
<tubbo`cloud>
that looks much easier to read
<veex>
For example, I build custom frameworks for clients using object mapping/factory methods that drive automation scripts for UI testing.
<erikh>
veex: if you're just looking for something you can do locally, check out capybara, selenium-webdriver and cucumber.
<veex>
The problem I run into with Selenium is a lack of object mapping. It's all stored in XML and need to use XPATH to map those objects to actual methods within my factory object.
gsav has quit [Read error: Connection reset by peer]
<erikh>
yeah, so cucumber + capybara use zero xml
<erikh>
or at least, it's all very well abstracted
gsav has joined #ruby-lang
gsav has quit [Client Quit]
Asher has quit [Quit: Leaving.]
<veex>
I need a tutorial how to map objects!
<erikh>
google?
Asher has joined #ruby-lang
stderr_ has joined #ruby-lang
* veex
never heard of this term
vesan has joined #ruby-lang
ramonmaruko has quit [Remote host closed the connection]
<Cope>
bnagy: so looks like I can do drop_while, or slice_before to remove the head of the array, but i'd need a 2nd pass to remove the tail
<veex>
Wow CapyBara is incredible
<Cope>
Ideally want slice_between! :)
<erikh>
yo ucould use that token approach I suggested :)
<Cope>
erikh: i missed that! *reads*
<erikh>
it's not particularly clever, but it should work
<veex>
How do I use Visual Studio to write ruby for Selenium?
<erikh>
veex: good luck.
<veex>
Do I have to load up Eclipse with this?
<erikh>
:)
<veex>
Or Aptana?
ramonmaruko has joined #ruby-lang
<erikh>
you could just use something like notepad++
<Cope>
veex: sublime is really nice
<erikh>
or yeah, that.
mtm3 has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
rippa has joined #ruby-lang
<bnagy>
Cope: doing drop_while / slice_before and the same after is just as efficient
burntbit has quit [Read error: Connection reset by peer]
<bnagy>
because when you chain them it's still O(n) (the tail drop is only operating on the shortened array)
chimkan_ has joined #ruby-lang
<bnagy>
sorry O(2n) my bad
<bnagy>
I just noticed slice_before myself, tbh
<samuelkadolph>
You don't include scalars in O
<bnagy>
you're telling the story
<veex>
Okay, so with CapyBara, is there a way to abstract basic web UI elements like (page title, button, image, etc) and automatically pass in the actual parameters with each new project? So I'm not writing code again and again?
<veex>
Than write a GUI ontop of it for manual testers?
<veex>
So they can drag and drop
* Cope
looks at Enumerable#chunk
<erikh>
ooh you could use strscan
<erikh>
can't believe I didn't think of that.
<erikh>
ri StringScanner. it might be exactly what you need.
brunocoelho has joined #ruby-lang
dhruvasagar has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
<veex>
erik, you're a genius.
<erikh>
I'm really not
<Cope>
erikh: interesting stuff
<samuelkadolph>
He's really not
<samuelkadolph>
:P
<veex>
don't lie to yourself
<erikh>
samuelkadolph: heheheh
<samuelkadolph>
Whoa, when did ruby get a string scanner?
<erikh>
oh 1.4 or so
<samuelkadolph>
Hmm, never seen it before
<erikh>
yeah, you have to require 'strscan'
<erikh>
it hides very welll
<erikh>
there are lots of unsung gems in the stdlib
<erikh>
err, to pun a little.
<samuelkadolph>
"must_C_version"
<samuelkadolph>
return self
<samuelkadolph>
Ahahahaha
<samuelkadolph>
What a stupid method
<erikh>
samuelkadolph: haven't seen you in a while; how have you been?
<samuelkadolph>
erikh: Good, been busy with my new job at Shopify
<samuelkadolph>
How about you?
<erikh>
not bad. doing the devops thing.
<erikh>
no longer @ wildfire but I'm at a smaller shop and am pretty happy.
<samuelkadolph>
Cool
outoftime has joined #ruby-lang
<veex>
shopify? Cool. Do you know much about shopkick samuelkadolph ?
chimkan_ has quit [Quit: chimkan_]
<veex>
congratulations eric!
<bnagy>
Cope: honestly, drop_while / take_while is as efficient as anything else - they both shortcut
<bnagy>
and it's readable
rippa has quit [Ping timeout: 246 seconds]
<samuelkadolph>
veex: Never heard of it
<bnagy>
ary.drop_while {|e| e !~ /foo/}.take_while {|e| e=~/foo/}
<Cope>
bnagy: agree; but fun to play with strscan!
<veex>
that's an implicit block?
<Cope>
will definiely use drop_while and take_while for ease of use
<veex>
Here's an idea for typing with the string scanner. You know how swipe on a mobile device automates word selection? Like IRC, you can press tab to fill out someone's username, why not have that for just general regular typing? Use a File.open (/lib/dictionary.xml) and than use stringscanner methods to match words with the a word that is most likely to be a match?
chimkan has joined #ruby-lang
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
<erikh>
veex: require 'abbrev'
<erikh>
or ri Abbrev
<veex>
what does ri and abbrev do?
akira989 has joined #ruby-lang
outoftime has quit [Quit: Leaving]
<Cope>
veex: ri is like a 3rd generation pi - irrational number, related to chaos theory.
<veex>
oh god
lzhz has quit [Ping timeout: 272 seconds]
pip has quit [Ping timeout: 255 seconds]
<erikh>
veex: 'ri' is a tool to get documentation
<erikh>
it comes with ruby.
<erikh>
you use it at your shell or cmd.exe
<erikh>
Abbrev, well, you should use ri to find out :)
<Cope>
sorry, veex - lack of sleep leads to bad jokes
spurling has left #ruby-lang [#ruby-lang]
msaffitz has quit [Quit: Computer has gone to sleep.]
<veex>
Okay, so let's say erik, that I'm creating that little app. I first open a dictionary file and have error handling, than I have some logic to pick up typing, put it in an array, use the abbrev methods to somehow sort, and than use string scanner to somehow scan the dictionary for closely matching words with the same first few letters.
<veex>
Cope, joking will not be tolerated with Ruby Mining. Only the most serious emotionless discussion is permitted.
* Cope
smiles... seriously.
<erikh>
haha
<erikh>
veex: abbrev does almost everything you want -- no strscan required.
<erikh>
anyhow, I need to get this chef server working
<erikh>
bbl
gsav has joined #ruby-lang
Boohbah has joined #ruby-lang
wmoxam has quit [Quit: leaving]
gsav has quit [Client Quit]
savage- has joined #ruby-lang
_madcoder_ has quit [Ping timeout: 260 seconds]
lzhz has joined #ruby-lang
andrew_ has joined #ruby-lang
zz_chrismcg has quit [Ping timeout: 260 seconds]
VGoff has quit [Excess Flood]
andrew__ has quit [Ping timeout: 260 seconds]
zz_chrismcg has joined #ruby-lang
VGoff has joined #ruby-lang
charliesome has joined #ruby-lang
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
jxie_ has quit [Remote host closed the connection]
pip has quit [Ping timeout: 256 seconds]
perryh_away is now known as perryh
perryh is now known as perry
savage- has quit [Remote host closed the connection]
flowerpot has quit [Remote host closed the connection]
mtm3 has quit [Ping timeout: 245 seconds]
macmartine has quit [Quit: macmartine]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
zmack has joined #ruby-lang
macmartine has joined #ruby-lang
<erikh>
hello
<erikh>
I am full of whisky now
<erikh>
life is good.
<Cope>
:)
gsav has joined #ruby-lang
A1241 has quit [Quit: Leaving.]
brunocoelho has quit [Ping timeout: 256 seconds]
ryanf has quit [Quit: leaving]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
yxhuvud has joined #ruby-lang
andrew_ has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
chuck has joined #ruby-lang
andrew_ has quit [Ping timeout: 272 seconds]
neocoin has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
kitallis has joined #ruby-lang
zmack has quit [Remote host closed the connection]
<erikh>
veex: I think you're going to find most of the users in here don't want anything to do with eclipse
macmartine has quit [Quit: macmartine]
Asher has quit [Remote host closed the connection]
<veex>
I'm fed up with all the errors just in environment settings.
Asher has joined #ruby-lang
<erikh>
also you need quotes around your strings.
<erikh>
puts "Hello Ruby World"
<erikh>
corundum: learn to program?
<corundum>
A good Ruby tutorial for newbies to programming: http://pine.fm/LearnToProgram/. NOTE: For linux installation section (in Chapter 0), the filename presented is just a example.
<erikh>
read that.
kaos has joined #ruby-lang
mytrile has joined #ruby-lang
pip has quit [Ping timeout: 255 seconds]
<veex>
errr....I wish I were a newbie to programming. I'm a blatent disaster who destroys software.
<veex>
I'm like an experienced idiot. Is their a term for that? Sort of a derivative of newbie.
<erikh>
a newbie.
<erikh>
it's ok to be a newbie
<erikh>
the people that are vile are the people who are newbies and don't think they are.
qpingu has quit [Quit: Leaving.]
<erikh>
wahoo matz just tweeted my nginx project
<veex>
Can I be a newbie with a degree in computer science and worked 4 years as a programmer?
* veex
calls myself a newfail
<veex>
Just used to C# and Java
pip has joined #ruby-lang
mtm3 has joined #ruby-lang
Boohbah has quit [Remote host closed the connection]
<veex>
When I was younger, I'd get kicked from every IRC channel within at least a day. I've matured a little.
zmack has joined #ruby-lang
<erikh>
veex: yes. there are lots of fairly green programmers with degrees
<erikh>
don't sweat it, we all grow up sooner or later.
chimkan has quit [Quit: chimkan]
pip has quit [Ping timeout: 255 seconds]
<veex>
I don't feel so stupid then :)
andrew_ has quit [Remote host closed the connection]
<erikh>
veex: the best thing you can do for yourself is learn to teach yourself.
andrew_ has joined #ruby-lang
<erikh>
now that you have a degree and know all those fancy algorithms and data structures, teaching yourself beyond that will obi-wan your shit
<erikh>
"more powerful than you can imagine" and all that.
<erikh>
did I mention I'm drunk?
gouthamvel has joined #ruby-lang
zmack has quit [Remote host closed the connection]
gouthamvel has left #ruby-lang [#ruby-lang]
zmack has joined #ruby-lang
chimkan has joined #ruby-lang
spuk has quit [Ping timeout: 240 seconds]
burgestrand has quit [Quit: Leaving.]
andrew_ has quit [Ping timeout: 276 seconds]
pip has joined #ruby-lang
pip has quit [Changing host]
pip has joined #ruby-lang
kaos has quit [Ping timeout: 245 seconds]
<TTilus>
could it possibly be monday morning for you?
<erikh>
almost
solars has joined #ruby-lang
pip has quit [Read error: Connection reset by peer]
tonni has joined #ruby-lang
<veex>
That's fantastic stuff. I thought you were ALWAYS.uppcase drunk erikh ?
<erikh>
no, I don't drink very often.
<veex>
Early Monday morning is a great time to start.
<erikh>
haha yes.
<erikh>
I need to sleep
<erikh>
later.
<veex>
BJ's in Foster City is always a good place to cure your thirst.
<erikh>
Foster City's a bit of a trek.
dhruvasagar has quit [Quit: Lost terminal]
dhruvasagar has joined #ruby-lang
<veex>
How far is that from you?
<erikh>
I'm in menlo park
<veex>
Rose $ Crown is where I enjoyed.
<erikh>
but I don't drive, so foster city's a bit out of the way.
<erikh>
yeah, that's a nice spot.
<erikh>
crowded though, like the rest of palo alto.
zmack has quit [Remote host closed the connection]
<veex>
I walked in with a group of offshore people. A super hot secretary from Colombia began hitting on me.
<veex>
Said she was head of the house secretary at Facebook.
<erikh>
ha
<veex>
That's the place to go...
<erikh>
I'm married.
zmack has joined #ruby-lang
<veex>
What's the wife about? Bring her for a nice spa out there :)
<NeVeR_>
nope.. if there is a directory called newfile, it will put it in newfile, else it will call the file newfile
<Viliny>
excellent
<Viliny>
quick regexp problem:
<Viliny>
This script was ment to identify files by extension
<Viliny>
now i noticed the files i need to work with have a identifier_ prefix instead
S1kx has quit [Read error: No route to host]
<Viliny>
such as "arrival_1294323.ext"
postmodern has quit [Ping timeout: 272 seconds]
S1kx has joined #ruby-lang
<NeVeR_>
is_arrival =~ /^arrival_/
<Viliny>
filelist = Dir["#{sourced}/*#{filetype}"].to_a; is what i used, can i just do filelist = Dir["#{sourced}/#{ident}_*"].to_a instead?
ohsix has quit [Remote host closed the connection]
<NeVeR_>
should work fine
<Viliny>
excellent, thanks for the help NeVeR_ !
<NeVeR_>
np
ohsix has joined #ruby-lang
<NeVeR_>
I'm very new to Ruby :) I was crazy about perl until recently (3 weeks ago), until I got converted to Ruby
<NeVeR_>
ruby is amazing :D
d3vic3 has joined #ruby-lang
s0ra_h is now known as sora_h
conceal_rs_ has quit [Read error: Operation timed out]
conceal_rs_ has joined #ruby-lang
<Viliny>
hehe, yeah :)
<Viliny>
im trying to open a new file for logging, embedding the timestamp in the filename doesn't seem to as easy as (Time.now) -> should the parenthesis have a # in front of it or something?
<yorickpeterse>
#{Time.now}
<yorickpeterse>
So for example `puts "Hello, the current time is #{Time.now}"
skinny_much has quit [Remote host closed the connection]
qwerxy has quit [Ping timeout: 244 seconds]
skinny_much has joined #ruby-lang
<Viliny>
this actually made it write the exact same thing in the txt file: f.puts '004 #{Time.now} ####'
tjadc has quit [Quit: No Ping reply in 180 seconds.]
tjadc has joined #ruby-lang
CCD has joined #ruby-lang
gix has joined #ruby-lang
sepp2k has joined #ruby-lang
dv310p3r has joined #ruby-lang
kain has joined #ruby-lang
Mon_Ouie has quit [Ping timeout: 265 seconds]
My_Hearing has joined #ruby-lang
gouthamvel has joined #ruby-lang
corecode has left #ruby-lang [":wq"]
jimmy1980 has joined #ruby-lang
brunocoelho has joined #ruby-lang
robotmay_ has joined #ruby-lang
jolasveinninn has joined #ruby-lang
chimkan__ has joined #ruby-lang
yannis has joined #ruby-lang
scampbell has joined #ruby-lang
robotmay has quit [Ping timeout: 246 seconds]
solars has quit [Ping timeout: 240 seconds]
chimkan has quit [Ping timeout: 265 seconds]
chimkan__ is now known as chimkan
DefV has quit [Read error: Connection reset by peer]
umttumt has joined #ruby-lang
gouthamvel has left #ruby-lang [#ruby-lang]
chimkan has quit [Read error: Connection reset by peer]
chimkan__ has joined #ruby-lang
tjadc has quit [Ping timeout: 255 seconds]
neocoin has joined #ruby-lang
tjadc_ has joined #ruby-lang
tommyvyo has joined #ruby-lang
carloslopes has joined #ruby-lang
brushbox has joined #ruby-lang
tjadc_ has quit [Client Quit]
solars has joined #ruby-lang
Fullmoon has quit [Ping timeout: 246 seconds]
futurechimp has quit [Quit: This computer has gone to sleep]
digitalbane has joined #ruby-lang
jolasveinninn has quit [Quit: Leaving]
brunocoelho has quit [Remote host closed the connection]
frem has joined #ruby-lang
andrew_ has joined #ruby-lang
sailias has joined #ruby-lang
andrew_ has quit [Remote host closed the connection]
andrew_ has joined #ruby-lang
kurko_ has joined #ruby-lang
futurechimp has joined #ruby-lang
mistym has quit [Remote host closed the connection]
andrew_ has quit [Ping timeout: 272 seconds]
chimkan__ has quit [Quit: chimkan__]
sailias has quit [Quit: Leaving.]
veex has quit [Ping timeout: 276 seconds]
veex has joined #ruby-lang
outoftime has joined #ruby-lang
heftig has joined #ruby-lang
bglusman has joined #ruby-lang
yannis has quit [Quit: yannis]
yugui_zzz is now known as yugui
zmack has quit [Remote host closed the connection]
neocoin has quit [Remote host closed the connection]
saLOUt has joined #ruby-lang
neoesque has quit [Quit: Bye!]
NeVeR_ has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Changing host]
mistym has joined #ruby-lang
gsav has joined #ruby-lang
kaos77 has joined #ruby-lang
kurko__ has joined #ruby-lang
yannis has joined #ruby-lang
neocoin has joined #ruby-lang
krohrbaugh has joined #ruby-lang
sockmonk has joined #ruby-lang
kurko_ has quit [Ping timeout: 276 seconds]
fgomez has quit [Remote host closed the connection]
hynkle has joined #ruby-lang
agilob has quit [Quit: Reconnecting]
agilob has joined #ruby-lang
bryancp has joined #ruby-lang
gsav has quit [Read error: Connection reset by peer]
WillMarshall has joined #ruby-lang
Fullmoon has joined #ruby-lang
yannis has quit [Read error: Connection reset by peer]
yannis has joined #ruby-lang
bglusman has quit [Remote host closed the connection]
saLOUt has quit [Ping timeout: 245 seconds]
pkondzior has joined #ruby-lang
yugui is now known as yugui_zzz
gsav has joined #ruby-lang
My_Hearing is now known as Mon_Ouie
kaiwren has quit [Quit: kaiwren]
crankharder has joined #ruby-lang
sailias has joined #ruby-lang
wmoxam has joined #ruby-lang
kunsel has joined #ruby-lang
tcopp has joined #ruby-lang
brushbox has quit [Quit: Leaving.]
riffraff has joined #ruby-lang
<Defusal_>
ruby-doc.org is down :(
<matled>
yeah, is there any mirror?
<mistym>
Oh no ;.;
<mistym>
matled: There's also rubydoc.info, which has a different interface
msaffitz has joined #ruby-lang
andrew_ has joined #ruby-lang
gouthamvel has joined #ruby-lang
<yorickpeterse>
Might be me but rubydoc.info doesn't seem to have everything
<yorickpeterse>
Ah it does, I was just overlooking it
Jay_Levitt has joined #ruby-lang
Jon_Brisbin has joined #ruby-lang
j_brisbin has joined #ruby-lang
Jon_Brisbin has quit [Client Quit]
<matled>
I should really check how complicated it is to start such a documentation server locally
kaiwren has joined #ruby-lang
vaelen has joined #ruby-lang
j_brisbin has quit [Ping timeout: 245 seconds]
enebo has joined #ruby-lang
kunsel has quit []
kunsel has joined #ruby-lang
<Mon_Ouie>
yard server -g
kurko__ has quit [Ping timeout: 246 seconds]
kunsel has quit [Client Quit]
kunsel has joined #ruby-lang
<yorickpeterse>
meh, can be done a lot easier for the Ruby doc
<yorickpeterse>
generate it once, let Nginx serve it from that point on
WillMarshall has quit [Quit: Computer has gone to sleep.]
<Defusal_>
is using sysseek(-n, IO::SEEK_END) and rescuing Errno::EINVAL when the file is not large enough the best possible way to seek to n chars from the end of a file?
hynkle has quit [Quit: hynkle]
akira989 has joined #ruby-lang
<matled>
Defusal_: you can find out the total length by seeking to the end and then compute the offset you want to go to ([0, length - n].min)
<Defusal_>
matled, i guess that could work too :)
<Mon_Ouie>
Defusal_: That's good, except you should normally use #seek instead of #sysseek
Skif has quit [Ping timeout: 240 seconds]
kurko__ has joined #ruby-lang
<Defusal_>
well sysseek works and it is what this gem has always used, so i leave it as is
jxie has joined #ruby-lang
kaos77 has quit [Remote host closed the connection]
<matled>
Mon_Ouie: for core and stdlib I have to download the ruby source code?
umttumt has quit [Remote host closed the connection]
sailias has joined #ruby-lang
perryh is now known as perry
gsav_ has joined #ruby-lang
VGoff is now known as VGoff_afk
gsav has quit [Ping timeout: 256 seconds]
VGoff_afk is now known as VGoff
VGoff is now known as VGoff_afk
VGoff_afk is now known as VGoff
futurechimp has joined #ruby-lang
moxie_ has joined #ruby-lang
bryancp has joined #ruby-lang
achiu has joined #ruby-lang
<moxie_>
Just curious. Suppose you have a class with string attributes first_name and last_name… and you have a method #say_hello that tries to concatenate those strings. If one of the attributes is not defined, is it "right" to raise something before it tries?
voker57 has joined #ruby-lang
voker57 has quit [Changing host]
voker57 has joined #ruby-lang
kaiwren has joined #ruby-lang
kaiwren has quit [Client Quit]
elliotcm has quit [Quit: elliotcm]
<andrewvos>
moxie_: Well, dependes
<andrewvos>
depends*
<andrewvos>
Is it an error, or do you instead just want to say "Hello Andrew"
VGoff is now known as VGoff_afk
<andrewvos>
Instead of "Hello Andrew Vos"
carloslopes has joined #ruby-lang
akira989 has quit [Remote host closed the connection]
publicvoid__ has joined #ruby-lang
<moxie_>
the first name, last example was arbitrary… it could be integers… I guess maybe your answer is sufficient though… is there a suitable response even with this missing attributes… if there is, cool, if not, it's going to raise anyways
gianlucadv has quit [Excess Flood]
gianlucadv has joined #ruby-lang
butchanton has joined #ruby-lang
burgestrand has joined #ruby-lang
lsegal has quit [Quit: Quit: Quit: Quit: Stack Overflow.]
tomb_ has quit [Quit: Computer has gone to sleep.]
carloslopes has quit [Quit: Leaving]
<andrewvos>
You could raise an exception
carloslopes has joined #ruby-lang
<andrewvos>
But it doesn't sound right though
<andrewvos>
The object shouldn't be saying "don't use me like this"
<andrewvos>
It should take firstname and lastname as a parameter
<andrewvos>
And if the developer doesn't pass these in, then he/she fucked up.
<andrewvos>
Right beer time
dc5ala has quit [Quit: Ex-Chat]
bfreeman has joined #ruby-lang
akira989 has joined #ruby-lang
akira989 has quit [Remote host closed the connection]