euclides has quit [Remote host closed the connection]
BombStrike has quit [Read error: Connection reset by peer]
randomnick_ has quit [Read error: Connection reset by peer]
RaCx has quit [Ping timeout: 252 seconds]
Lindrian has quit [Ping timeout: 272 seconds]
Rylee has quit [Ping timeout: 272 seconds]
autumn has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
RaCx has joined #ruby
BombStrike has joined #ruby
jetblack has quit [Client Quit]
Lindrian has joined #ruby
Rylai has joined #ruby
vlad_starkov has joined #ruby
polaco is now known as polaco_zZz
<Rylai>
Hello? Who do I speak to with to get a ban removed? My nick Rylee was banned from here a while ago because of an accidental reconnect flood that's been permanently resolved.
<Hanmac>
ping apeiros about ^^
Arzaga has quit [Quit: Computer has gone to sleep.]
rhunter has joined #ruby
<apeiros>
Rylai: done
<Rylai>
Thank you!
Rylai is now known as Rylee
jeffdb has joined #ruby
nobitanobi has joined #ruby
timonv has joined #ruby
sambao21 has quit [Quit: Computer has gone to sleep.]
<Hanmac>
apeiros: what means "-bbbb" ?;P
<apeiros>
Hanmac: multiple unbans
<Hanmac>
ahhh
subbyyy_ has joined #ruby
dtcrshr has quit [Remote host closed the connection]
timonv has quit [Ping timeout: 264 seconds]
hiyosi has joined #ruby
* Hanmac
thows many ban "seals" on many nicks ;P
newbiehacker has quit [Ping timeout: 252 seconds]
Bosox20051 has joined #ruby
<Hanmac>
oh apei broke all my ban seals ,P
mmcdaris has joined #ruby
<RubyPanther>
the ip4/6 ratio there is kinda depressing
iliketurtles has quit [Quit: zzzzz…..]
kaspergrubbe has joined #ruby
<apeiros>
I find the number of bans depressing :(
hiyosi has quit [Ping timeout: 272 seconds]
Arzaga has joined #ruby
araujo has quit [Read error: Connection reset by peer]
araujo has joined #ruby
culturelabs has joined #ruby
<RubyPanther>
#ruby <3's you all again
drumusician has quit [Ping timeout: 246 seconds]
culturelabs has quit [Max SendQ exceeded]
Megtastique has quit []
<RubyPanther>
See, there is progress in the world
andywojo has joined #ruby
culturelabs has joined #ruby
_Andres has quit [Read error: Connection reset by peer]
<RubyPanther>
anybody have any luck compiling MRI on android?
falood has quit [Remote host closed the connection]
Megtastique has joined #ruby
<andywojo>
Nope. Right now I'm stuck trying to compile MRI on AIX. (Trying without xlc)
<RubyPanther>
I made it through like... 20 or 30 hoops, and I gave up. AIX should be easier, what is the problem?
<RubyPanther>
Wasn't it like 2001 when IBM started asking their AIX customers to switch to linux?
andro6778 has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
robert_ has quit [Quit: Connection reset by traffic clause.]
<RubyPanther>
90% of AIX administration is setting obscure environment variables.[citation needed]
cbetta has joined #ruby
<apeiros>
so, removed ~80% of all bans
timonv has joined #ruby
RaCx has quit [Ping timeout: 246 seconds]
<Hanmac>
tomorrow #ruby will have 20% users more ;P
RaCx has joined #ruby
<andywojo>
Well.. Just not working correctly when compiling it with gcc
<andywojo>
Almost all the binaries floating out there are done with xlc
tenjack has quit [Remote host closed the connection]
euclides has quit [Ping timeout: 245 seconds]
pskosinski has joined #ruby
Ohga has joined #ruby
<Ohga>
Hi, I have multiple instance variables that I want to set to nil at one point in a method. What would be the idiomatic way, "@a, @b, @c = nil"?
Guest59949 is now known as mephux
mephux has joined #ruby
mephux has quit [Changing host]
<cbetta>
Ohga that works
<cbetta>
orI like @a = @b = 0 too
h0rrorvacui has quit [Remote host closed the connection]
amacgregor_ has joined #ruby
<RubyPanther>
[:one,:two,:three].each{|v| instance_variable_set '@'+v.to_s, nil} # if you need to generate the names
jonathanwallace has quit [Ping timeout: 272 seconds]
amacgregor__ has joined #ruby
amacgregor has quit [Ping timeout: 246 seconds]
Megtastique has quit []
amacgregor_ has quit [Ping timeout: 246 seconds]
DecipheredAFK is now known as Deciphered
bootcoder has quit [Quit: Konversation terminated!]
bootcoder has joined #ruby
RaCx has quit [Ping timeout: 260 seconds]
jonathanwallace has joined #ruby
peshalto has joined #ruby
tenjack has joined #ruby
jeaye has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
rjhunter has joined #ruby
<jeaye>
I really like the idea of Ruby's design and I'm looking for a scripting language to interface with C++ in a real-time application. Last I knew, Ruby had a rep for being much slower than Python and Lua in this case; has anything changed?
lfox has joined #ruby
rjhunter has quit [Read error: Connection reset by peer]
havenwood has joined #ruby
rhunter has joined #ruby
RaCx has joined #ruby
havenn has joined #ruby
havenwood has quit [Read error: Connection reset by peer]
timonv has joined #ruby
<bnagy>
how do you want to 'interface'? Like embedding or some messaging interop or wrapping / FFI C++ from ruby?
<bnagy>
perf should be 'vaguely' like python, especially with newer mri, lua I think is a different kettle of fish
St_Marx has quit [Quit: Ex-Chat]
kaspergrubbe has joined #ruby
p4d4w4n has quit [Quit: This computer has gone to sleep]
p4d4w4n has joined #ruby
<bnagy>
there's also mruby you might want to check out
St_Marx has joined #ruby
Deciphered is now known as DecipheredAFK
<jeaye>
bnagy: Preferably embedding.
IceDragon has quit [Quit: Space~~~]
Megtastique has joined #ruby
<jeaye>
I'm looking at something like Rice.
<bnagy>
ok then definitely take a look at mruby
ua_ has quit [Ping timeout: 264 seconds]
morenoh149 has quit [Ping timeout: 265 seconds]
<jeaye>
ah, mruby looks very neat
lmickh has quit [Quit: lmickh]
timonv has quit [Ping timeout: 246 seconds]
peshalto has quit [Quit: peshalto]
moneydouble has quit [Ping timeout: 272 seconds]
morenoh149 has joined #ruby
kaspergrubbe has quit [Ping timeout: 260 seconds]
mikepack has joined #ruby
charliesome has joined #ruby
havenn has quit [Ping timeout: 245 seconds]
Fire-Dragon-DoL has left #ruby [#ruby]
pskosinski has quit [Quit: Til rivido Idisti!]
sparrovv has quit [Quit: sparrovv]
havenwood has joined #ruby
kaspergrubbe has joined #ruby
yfeldblum has quit [Remote host closed the connection]
noob101 has quit [Ping timeout: 250 seconds]
yfeldblum has joined #ruby
moneydouble has joined #ruby
Hanmac1 has joined #ruby
Hanmac has quit [Ping timeout: 245 seconds]
Spami has joined #ruby
p4d4w4n has quit [Quit: This computer has gone to sleep]
nobitanobi has joined #ruby
kofno has joined #ruby
morenoh149 has quit [Ping timeout: 245 seconds]
morenoh149 has joined #ruby
myappleguy has left #ruby ["WeeChat 0.4.2"]
kaspergrubbe has quit [Remote host closed the connection]
RaCx has quit [Ping timeout: 265 seconds]
michael_lee has joined #ruby
hogeo has joined #ruby
hamakn has quit [Remote host closed the connection]
RaCx has joined #ruby
Megtastique has quit []
hamakn has joined #ruby
tntnt has quit [Ping timeout: 245 seconds]
luismiguel has joined #ruby
dhruvasagar has joined #ruby
tntnt has joined #ruby
moneydouble has quit [Read error: Connection reset by peer]
brianpWins has quit [Quit: brianpWins]
jonathanwallace has quit [Ping timeout: 246 seconds]
eka has quit [Quit: Computer has gone to sleep.]
hamakn has quit [Ping timeout: 272 seconds]
nobitanobi has quit [Quit: Leaving]
hololeap has joined #ruby
hamakn has joined #ruby
hogeo has quit [Remote host closed the connection]
gigetoo has quit [Remote host closed the connection]
<RubyPanther>
jeaye: Ruby is fast because we write anything that might be slow in C ;)
gigetoo has joined #ruby
jkhwan has joined #ruby
overfield has joined #ruby
moneydouble has joined #ruby
luismiguel has quit [Ping timeout: 246 seconds]
lmickh has joined #ruby
morenoh149 has quit [Ping timeout: 264 seconds]
jeffdb has joined #ruby
aspires has quit []
mojjojo has joined #ruby
<pontiki>
lol
<pontiki>
well played
<pontiki>
ruby is usually fast enough
<Nilium>
And accurate.
<Nilium>
Ruby: it's C with better syntax.
Banistergalaxy has joined #ruby
morenoh159 has joined #ruby
<pontiki>
isn't lua for embedding in other programs?
<Nilium>
Yes.
<Nilium>
You can use it for standalone stuff, but that's fairly rare outside of things like Cocos or whatever on phones
euclides has joined #ruby
<Nilium>
I think Cocos was Lua.
<Nilium>
Or something else.
hogeo has joined #ruby
fuhgeddaboudit has joined #ruby
duggiefresh has joined #ruby
jkhwan has quit [Remote host closed the connection]
mojjojo has quit [Client Quit]
jkhwan has joined #ruby
tntnt_ has joined #ruby
AndChat| has quit [Ping timeout: 246 seconds]
mojjojo has joined #ruby
timonv has joined #ruby
caesura has joined #ruby
aryaching_ has joined #ruby
tntnt has quit [Ping timeout: 252 seconds]
tntnt_ is now known as tntnt
s2013 has joined #ruby
DecipheredAFK is now known as Deciphered
Kricir has joined #ruby
Megtastique has joined #ruby
aryaching has quit [Ping timeout: 260 seconds]
Hanmac has joined #ruby
jkhwan has quit [Ping timeout: 272 seconds]
ewnd9 has joined #ruby
Hanmac1 has quit [Ping timeout: 246 seconds]
jamesaanderson has joined #ruby
timonv has quit [Ping timeout: 272 seconds]
thesheff17 has joined #ruby
Hanmac1 has joined #ruby
Hanmac has quit [Ping timeout: 265 seconds]
nobitanobi has joined #ruby
mcteapot has joined #ruby
RaCx has quit [Ping timeout: 246 seconds]
<mcteapot>
has anyone used bundle with a ruby project?
lolmaus has quit []
morenoh149 has joined #ruby
morenoh159 has quit [Ping timeout: 272 seconds]
<mcteapot>
or used the command "bundle install"
jcromart_ has joined #ruby
<mcteapot>
sorry if this is a n00b question, it is the first time using Rails
GoodTimes has quit [Ping timeout: 272 seconds]
Deciphered is now known as DecipheredAFK
mojjojo has quit [Quit: mojjojo]
jcromart_ has quit [Client Quit]
RaCx has joined #ruby
tkuchiki has joined #ruby
julweber has quit [Remote host closed the connection]
kaspergrubbe has joined #ruby
<jrobeson>
mcteapot, this isn't the rails room.. that's #rubyonrails
CaptainJet has quit []
intuxicated has quit [Ping timeout: 265 seconds]
<mcteapot>
ty,
<mcteapot>
but just figured out the problem. I had to run it as 'sudo'
<jrobeson>
no..
<jrobeson>
actually never do that
mojjojo has joined #ruby
<jrobeson>
where did you read instructions that told you to do that?
<mcteapot>
no where, it just kept Erroring every time I ran 'bundle install'
<mcteapot>
had to install every gem that was not found by the bundle
mojjojo has quit [Client Quit]
Spami has quit [Quit: This computer has gone to sleep]
DrShoggoth has quit [Read error: Connection reset by peer]
mojjojo has joined #ruby
<Ohga>
with "{'a' => 'b'}.each_with_object [] do |key, value, memo| something end" key should be 'a', value 'b' and memo [], right?
mojjojo has quit [Client Quit]
<bnagy>
try |(k,v), ary|
<RubyPanther>
Matz described mRuby as the result of "lua envy"
<Ohga>
bnagy: ok, that works
<Ohga>
bnagy: and why does that work?
<bnagy>
because eaching a hash gives you an array [k,v] which is one thing, unless you decompose it
Bosox20051 has quit [Quit: Leaving]
<bnagy>
"... but why does it just work when you do each?"
<Ohga>
bnagy: and using just .each splats the array when passed to the block?
<bnagy>
because block args are not as smart as method args
<bnagy>
:)
<Ohga>
that's a yes?
Megtastique has quit []
<bnagy>
if there's only one possible way to splat and have it make sense then it figures it out
<Ohga>
bnagy: yes, alright
rickruby has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
<bnagy>
I think new stuff probably has even fancier block arg handling, but I haven't looked at it / needed it
moneydouble has quit [Read error: Connection reset by peer]
<jrobeson>
mcteapot, why wasn't it found?
<jrobeson>
what error message was there
<mcteapot>
it just stopped at ever gem that was not found
<mcteapot>
every
<jrobeson>
and why wasn't it found?
<mcteapot>
started of install every gem it errored out on, then ran it as sudo and it installed every one it could not find
<jrobeson>
did you have this line at the top of your Gemfile? source 'https://rubygems.org'
<bnagy>
I would do it for you and stop being a whiny girl, but I'm busy doing this disassembler thing
capicue has quit [Quit: Leaving...]
<postmodern>
bnagy, that's the idea
<bnagy>
WTF Y U DOWNLOAD LLVM AGAIN
<postmodern>
bnagy, if macports is still present, use it, otherwise check for brew
<noob101>
Why doesn't my method work when I call it. Any suggestions? https://eval.in/74598
julweber has joined #ruby
freerobby has quit [Quit: Leaving.]
<postmodern>
bnagy, for the headers doge
jerikl has joined #ruby
<bnagy>
noob101: seriously just give up programming. You're not suited.
<kure>
noob101: you can't create methods starting with upcase, try renaming it to 'no'
halfie has joined #ruby
<h0rrorvacui>
noob101 ignore bnagy, we all started somewhere.
<pontiki>
looks like basic
jerikl has quit [Client Quit]
<pontiki>
with a ruby twist
<bnagy>
h0rrorvacui: this nick has been trolling for over a week
<h0rrorvacui>
ohh
<postmodern>
bnagy, pics or it didn't happen/
kaspergrubbe has joined #ruby
<havenwood>
noob101: Capitalization is very important. That first letter, and what case it is, is something vital that the Ruby parser looks at. A method must alway begin with a lowercase letter (and by convention be snake_case_never_with_caps).
<h0rrorvacui>
also we tend to lose the "()"
<h0rrorvacui>
if there are no parameters
julweber has quit [Ping timeout: 260 seconds]
<noob101>
\
<noob101>
Oh thanks that's why maybe.
<kure>
who indents with tabs?
<noob101>
I will not give up on programming, I want to be a computer programmer.
<h0rrorvacui>
also use two spaces instead of tab indents
<havenwood>
+1 two-space soft-tab
sleetdrop has quit [Quit: Computer has gone to sleep.]
jerikl has joined #ruby
<wildharvest>
I'm trying to get a hang of tdd/bdd, starting with a sinatra app. I have three spec folders, models, views, routes. Does that make sense? using minitest. racktest for routes, capybara for views
nobitanobi has joined #ruby
capicue has joined #ruby
endash has quit [Quit: endash]
jerikl has quit [Client Quit]
<h0rrorvacui>
he could also use a here document instead of all the puts
halfie has quit [Ping timeout: 246 seconds]
aryaching has joined #ruby
<h0rrorvacui>
but I'm not sure or ruby convention on multi-line strings tbh
<h0rrorvacui>
on*
kofno has quit [Ping timeout: 264 seconds]
threesome has quit [Read error: Operation timed out]
euclides has quit [Remote host closed the connection]
<havenwood>
wildharvest: seems totally sane to me (might also ask in #sinatra if you haven't already)
<h0rrorvacui>
First glance I thought those were alcohol bottles...
Jetchisel has joined #ruby
<dseitz>
oh god, JS closure challenge 2.4 - why did I submit myself to learning this again?? :S
hiyosi has quit [Ping timeout: 260 seconds]
<h0rrorvacui>
I hate looking at javascript.
robonerd has quit [Read error: Connection reset by peer]
orphanboyk has left #ruby [#ruby]
crus has quit [Read error: Connection reset by peer]
iajrz_ has quit [Ping timeout: 272 seconds]
atal421 has joined #ruby
timonv has quit [Ping timeout: 265 seconds]
<h0rrorvacui>
I think the one thing I regret about Ruby is now everything else looks ugly and annoying to read
<atal421>
anyone know how to not store sessions when building a api using using token authentication with devise? i'd like every request to have the token in it, otherwise the request is rejected... thoughts? is this a bad practice?
<h0rrorvacui>
sounds like a rails question
<h0rrorvacui>
Is that what rails does with forms anyhow?
<akhet>
javascript is just pugfugly
<akhet>
its like someone took java and raped it with c
Spami has joined #ruby
<h0rrorvacui>
atal421 did you ask on #ruby-lang ?
<h0rrorvacui>
I mean #RubyOnRails
<h0rrorvacui>
lol what i get for using tab complete
<atal421>
h0rrorvacui: yup, went there first
<h0rrorvacui>
Yeah I see that now I forgot I was joined.
<atal421>
copy paste :-)
<akhet>
you from queens atal421 ?
tsykoduk is now known as zz_tsykoduk
<atal421>
nope, but i lived there for a while (Astoria)
OdNairy has joined #ruby
<akhet>
i live in astoria atm
<akhet>
:)
<atal421>
akhet: nice
<atal421>
akhet: it's really great there
<akhet>
its ok
<akhet>
i think i have lived in nyc for too long
rjhunter has joined #ruby
<atal421>
akhet: i guess it depends where you live
<akhet>
true
<atal421>
akhet: i'm actually going to leave the city, been here for 4 years-ish
<atal421>
i've heard great things about Austin, Boulder, Denver, Portland, Seattle, and Vancouver ... all are on the list :)
vpretzel has quit [Remote host closed the connection]
iajrz_ has joined #ruby
<akhet>
move to where the cost of living is cheap
vpretzel has joined #ruby
<akhet>
add scottsdale to the list :P
<atal421>
akhet: Middle America?
<akhet>
scottsdale, az
crus has joined #ruby
<atal421>
akhet: really?
<atal421>
is there a tech community there?
<akhet>
ebay/paypal are there
<akhet>
others too
<akhet>
its right on the edge of the desert
<atal421>
i bet the weather is great
zipper has joined #ruby
rjhunter has quit [Ping timeout: 245 seconds]
<h0rrorvacui>
atal421 Atlanta can be cheep cost of living if you get outside of it
<h0rrorvacui>
cheap*
DecipheredAFK is now known as Deciphered
iajrz_ has quit [Ping timeout: 252 seconds]
vpretzel has quit [Ping timeout: 260 seconds]
<atal421>
h0rrorvacui: ATL has never really been on my list... what tech scene is down there?
<atal421>
h0rrorvacui: safety goes into my quality of life calculation. just saying this is probably not idea especially considering that there are so many options
Deciphered is now known as DecipheredAFK
<h0rrorvacui>
I understand. It is why I don't want to work there myself.
RaCx has joined #ruby
<h0rrorvacui>
I'll probably get sucked there though...
<pontiki>
you don't want to look at whole cities, necessarily, since most of the time you'll be in only two or three neighbourhoods most of the time
<h0rrorvacui>
ATL is safe in the right spots. Mostly east of peachtree street
<pontiki>
home, work, play
hogeo has joined #ruby
<h0rrorvacui>
Personally ATL isn't a city where you'll walk much like you do in NYC. You can if you live and work downtown.
<h0rrorvacui>
I just find it better to me to drive there.
<pontiki>
how about public transit?
vlad_starkov has joined #ruby
<h0rrorvacui>
It's scary tbh.
<h0rrorvacui>
No one uses it except some shady characters from what I could tell
dhruvasagar has quit [Ping timeout: 245 seconds]
<h0rrorvacui>
Well, except the buses in the college parts
<pontiki>
also, i had no idea el paso was that large
<h0rrorvacui>
Its probably safe though considering there is a lot of metro police around
Spami has quit [Quit: This computer has gone to sleep]
hogeo has quit [Read error: Connection reset by peer]
hogeo has joined #ruby
<h0rrorvacui>
I'd aim for Arizona.
Vivekananda has quit [Remote host closed the connection]
noop has quit [Read error: Operation timed out]
tharindu has joined #ruby
<pontiki>
tucson is rather pleasant
petey has joined #ruby
hogeo has quit [Read error: Connection reset by peer]
Spami has joined #ruby
<pontiki>
i also liked flagstaff a lot
<pontiki>
haven't been must else
<h0rrorvacui>
scottsdale and tucson is all I've really seen
hogeo has joined #ruby
<h0rrorvacui>
Real nice houses and it was more pricy than Alabama but not much in scottsdale area
<pontiki>
i've spent a few days in some other place, traveling through and what not
<h0rrorvacui>
I liked the modern style homes that are out west
<h0rrorvacui>
I hate homes here in Alabama.
<pontiki>
i've been in a resort in scottsdale, but that's hardly the same as being in scottsdale
<jrobeson>
atl is still too burby ..
<jrobeson>
the transit is weak
<pontiki>
i've only been in alabama twice, and couldn't wait to leave
<jrobeson>
it's getting better tho
vlad_starkov has quit [Ping timeout: 265 seconds]
agjacome has joined #ruby
<jrobeson>
i went to an amazing concert there tho
Jetchisel has left #ruby ["Unfortunately time is always against us -- *Morpheus*"]
<pontiki>
i really really want to move back to the west coast
<jrobeson>
why dont you?
<pontiki>
i'm working on it
<jrobeson>
west coast? or specifically bay area? or california?
<h0rrorvacui>
I don't think I'd like Cali, never been though.
<pontiki>
mainly south bay, where most of my friends and family are
<pontiki>
many people don't likeit
* jrobeson
can't imagine not liking california
<pontiki>
too crowded, expensive as hell, etc
tharindu has quit [Client Quit]
<pontiki>
but it's home to me
<jrobeson>
taxes are the only bad part.. but thems the breaks if you wanna live in such a nice place
petey has quit [Ping timeout: 260 seconds]
<atal421>
might go out to SF... maaaaaybe
<pontiki>
living in SF, the city, is super expensive mostly. my older daughter was in a tiny tiny walkup studio that was > 1200 /mo
<h0rrorvacui>
I'm from Alabama. California is like a foreign country to me.
<jrobeson>
i'm from virginia
<pontiki>
the bathroom was down the hall
<atal421>
ha
Spami has quit [Quit: This computer has gone to sleep]
<pontiki>
she's living in santa clara now, and commutes up to SF for school
<h0rrorvacui>
Sounds like she has the life.
<jrobeson>
h0rrorvacui, california is beautiful .. that's a fact
<atal421>
that's SF, NYC living right here
<jrobeson>
virginia would be nearly as nice.. if it didn't get so cold in the winter..
<h0rrorvacui>
More than Virginia?
<jrobeson>
definitely
<h0rrorvacui>
I don't buy that.
<jrobeson>
virginia is nice.. but not that nice
<pontiki>
how cold does it get??
overfield has quit [Remote host closed the connection]
<pontiki>
i thought it was more south
atal421 has quit [Quit: atal421]
amritanshu_RnD has joined #ruby
<jrobeson>
well.. i'm speaking more like mid to southern california
<jrobeson>
not northern
nebula has joined #ruby
<pontiki>
ah ok
<jrobeson>
basically sf south
<pontiki>
south bay
ambushsabre has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<jrobeson>
i mean sf and south
Spami has joined #ruby
sayan has joined #ruby
<jrobeson>
not sure where hte temperature really changes as one heads up towards oregon
<pontiki>
sf ba has like a dozen microclimates
Barrin6 has quit []
<pontiki>
it's get bugger cold in sf, especially in summer
<jrobeson>
like 50s
<pontiki>
lower
kitak has quit [Remote host closed the connection]
<pontiki>
like parka-wearing weather
<jrobeson>
i don't think it gets freezing does it?
<pontiki>
not quite
<jrobeson>
don't think i've ever heard anybody say that
<pontiki>
but it's super damp with the fog
<jrobeson>
that it gets freezing
<jrobeson>
it definitely gets freezing in virginia
<pontiki>
no, but back in the day, when the giants played at candlestick in the summer, ppl would definitely be wearing parkas in the stands
<jrobeson>
where i lived it'd always get freezing.. but never wet enough to snow.. so it was annoying..
<pontiki>
nod
hogeo has quit [Remote host closed the connection]
<h0rrorvacui>
Parka weather is below freezing
<pontiki>
idk virginia much, really have only been to DC
<pontiki>
more time in maryland, down near chesapeake
zz_tsykoduk is now known as tsykoduk
<jrobeson>
virginia has nice mountains.. but not california nice
<h0rrorvacui>
I'm doubtful.
<jrobeson>
why?
choobie has joined #ruby
<pontiki>
about what?
<jrobeson>
i don't understand why one would doubt such a thing
fgo has quit [Remote host closed the connection]
<h0rrorvacui>
That cali is > virginia in beauty
xue has quit [Ping timeout: 245 seconds]
<jrobeson>
it sure is..
<jrobeson>
i lived near the ocean and went out to the mountains
<pontiki>
cali is a whole lot bigger. the possibility that any specific part is prettier has pretty good odds
<pontiki>
but whether all of cali is prettier than all of virginia, i'd say probably not
<jrobeson>
yeah it encompasses so many different kinds of terrain
<pontiki>
there are some really ugly parts
<jrobeson>
sure.. not the inland empire as they say
<pontiki>
but i am pretty sure virginia doesn't have any fourteeners
<pontiki>
and pretty sure there's nothing like Big Sur in VA
<jrobeson>
sure isn't
<pontiki>
i could be wrong, of course
<jrobeson>
no redwoods either
<jrobeson>
and the beaches are lame
<pontiki>
does VA have shipyards?
iajrz_ has joined #ruby
charliesome has joined #ruby
<h0rrorvacui>
Yeah
<jrobeson>
the biggest naval base in the entire country iirc
romness has joined #ruby
<jrobeson>
newport news and norfolk are huge
<pontiki>
at one point, the navy mothball yards were in the SF bay and Sacto delta
<h0rrorvacui>
Yeah mothball yards
<h0rrorvacui>
Not active vessels
<pontiki>
and there's a fair bit of industrial crap around the bay
<pontiki>
and the central valley can be pretty bad for agrindustrial crap
<jrobeson>
i don't plan on returning to live in virginia beach that's for sure..
<jrobeson>
they still wont' put in the damn light rail
<jrobeson>
it's ridiculous
<pontiki>
and socal has a fair bit of ugly as well
<jrobeson>
i don't miss it
<pontiki>
as well as a fair bit of beauty
<pontiki>
anyway
<jrobeson>
quite a fair bit :)
<pontiki>
the thing i found is that you can choose, for the most part
<h0rrorvacui>
I'm thinking along the lines of what I can afford. Cali isn't beatiful if you can't see it everyday and own it IMO.
capicue has quit [Quit: Leaving...]
<jrobeson>
pontiki, the bald cypress trees and marshes have their own beauty too tho
<pontiki>
yeah, it's spendy by quite a lot
<h0rrorvacui>
I was still thinking in regards to moving and cost of living.
<pontiki>
that, i think, is the biggest turnoff
<jrobeson>
h0rrorvacui, i actually live in portland, or (according to my license anyways)
<pontiki>
i mean, you can always go *visit*
<h0rrorvacui>
I watch house hunters or some property show and I'm screaming wtf at the price of houses in cali
<pontiki>
i love portland as well
<pontiki>
it's my second choice on the west coast
ciampix has joined #ruby
<h0rrorvacui>
For the prices you pay in California you can have mega mansions here in Alabama
<pontiki>
probably a few
dhruvasagar has joined #ruby
<h0rrorvacui>
I even laugh when the shows call some of the houses mansions
<h0rrorvacui>
I'm think small.
<pontiki>
especially down on the coast
<h0rrorvacui>
thinking*
<jrobeson>
i just can't handle the climate in the south or the politics
<jrobeson>
sticky and gross
<h0rrorvacui>
its not as bad as people make it out to be
<jrobeson>
it was bad enough in virginia.. and that's not even that south
<shevy>
jrobeson politics are better in the north?
<h0rrorvacui>
I'm an Atheist, and moderate.
<jrobeson>
shevy, imo
Spami has quit [Quit: This computer has gone to sleep]
<pontiki>
idk
<h0rrorvacui>
I don't even hear politics discussed that much here.
<pontiki>
politics suck everywhere
<jrobeson>
i can't state that as a fact for the people who live there obviously
<pontiki>
i hope we don't start
<jrobeson>
i just don't wanna be a part of it
BizarreCake has joined #ruby
<h0rrorvacui>
Its considered rude tbh.
<pontiki>
nod
<pontiki>
i'm in other channels where politics are discussed, like ALL THE DAMN TIME
<pontiki>
and it's gets dismal
<jrobeson>
i like talking about talking about politics
<pontiki>
heh
<jrobeson>
meta
<pontiki>
yer so meta
<pontiki>
at one point, my folks were talking about moving to cali
<jrobeson>
although i don't find it dismal.. i find it really interesting .. with all the amazing things that are going on everywhere
<pontiki>
when they saw what $200,000 would buy, then freaked out
<pontiki>
or woudn't buy, i should say
dannymaclean has joined #ruby
<jrobeson>
i don't care about spending $200K on an apartment in a nice area
<pontiki>
oh, jr, i was referring to the irc channels that i am in
<jrobeson>
i don't have lots of posessions.. i'm moving for the experience
topher has quit [Quit: leaving]
<pontiki>
$200k won't buy you an apartment
<pontiki>
even a studio
<jrobeson>
not where you're talkin
<h0rrorvacui>
California is just overpriced by all standards. I'm puzzled as to why people want to live there when there are a lot of safer and more affordable locations.
<jrobeson>
h0rrorvacui, because it's not about price
<jrobeson>
it's about what you can do there
<pontiki>
price is not the only factor
<pontiki>
price isn't even a consideration for some
<dannymaclean>
long growing season, favorable weather patterns, limited seasonal disturbances
<h0rrorvacui>
in that case move to florida
<jrobeson>
plus all the neat people
kitak has joined #ruby
<pontiki>
and there are many places in cali where it is extremely safe
<h0rrorvacui>
Cheaper longer growing seasons
RaCx has quit [Ping timeout: 272 seconds]
<dannymaclean>
have you been to either?
<jrobeson>
please no florida
<h0rrorvacui>
No
yfeldblu_ has quit [Remote host closed the connection]
<jrobeson>
nice to visit.. woudln't wanna live there
<h0rrorvacui>
I've been to florida
<pontiki>
florida is too hot and humid
<h0rrorvacui>
Not cali
<h0rrorvacui>
I've been everywhere but cali really
<dannymaclean>
most of florida has uncomfortable humidity
yfeldblum has joined #ruby
<h0rrorvacui>
Everyone is cali fan boys :P
RaCx has joined #ruby
<pontiki>
no one is saying cali is perfect
jkhwan has joined #ruby
<h0rrorvacui>
That state is going to sink into the ocean due to population growth
hiyosi has joined #ruby
<jrobeson>
fan boys is the wrong thing ..
<pontiki>
and you don't even get to move there
<pontiki>
it's off limits to you
<dannymaclean>
i very much enjoy california as a geographic location
<pontiki>
they'll stop you at the border
<jrobeson>
h0rrorvacui, as i said.. i live in oregon .. not california
<jrobeson>
i wouldn't mind living in nyc if i could afford it tho
<dannymaclean>
the people that live there, their politics, etc. far less
<jrobeson>
h0rrorvacui, i just wanna live near a global city.. wherever it is
<h0rrorvacui>
Then that sounds like someone where outside of the US
<pontiki>
california is more diverse in just about anything you can think of than any other state
Spami has joined #ruby
<jrobeson>
h0rrorvacui, no. that's not what i meant. it's actually a specific term
<h0rrorvacui>
When we say global we don't even usually know what that means.
<h0rrorvacui>
Like me
<jrobeson>
los angeles, nyc are two
<pontiki>
when you say "we", we don't know who you mean
relix has joined #ruby
<h0rrorvacui>
I ment me.
ewnd9 has quit [Remote host closed the connection]
<h0rrorvacui>
unfortunate typo
ewnd9 has joined #ruby
<h0rrorvacui>
:P
<jrobeson>
http://en.wikipedia.org/wiki/Global_city - global city (also called world city or sometimes alpha city or world center) is a city generally considered to be an important node in the global economic system. The concept comes from geography and urban studies and rests on the idea that globalization can be understood as largely created, facilitated, and enacted in strategic geographic locales according to a hierarchy of importance to the operation of
<jrobeson>
the global system of finance and trade.
<jrobeson>
that's what i mean by global city :)
<pontiki>
i like cosmopolitan cities
Spami has quit [Client Quit]
<h0rrorvacui>
Okay then ATL, NYC, and L.A.
<dannymaclean>
here is a ruby related question
timonv has joined #ruby
<h0rrorvacui>
?
<jrobeson>
not sure if atl is on the list
<pontiki>
go, danny
<jrobeson>
could be tho
<h0rrorvacui>
omfg
<h0rrorvacui>
ATL has the largest airport
ciampix has left #ruby ["Ex-Chat"]
<pontiki>
from that single paragraph, atl should def be on the list
<dannymaclean>
i'm learning RoR right now - i'm going to build a number of things as learning projects
<pontiki>
cool
<dannymaclean>
in an effort to build up to the project that I have on the backburner
<jrobeson>
yep .. it's on there
<h0rrorvacui>
ATL should be close to the top
<h0rrorvacui>
Its the lifeblood of the whole south.
morenoh149 has quit [Ping timeout: 245 seconds]
<jrobeson>
dannymaclean, #rubyonrails is better for rails questions
<pontiki>
he hasn't asked the question yet, wait for it
<jrobeson>
h0rrorvacui, but the south isn't home to most of the economic activity of the ocuntry
pwh has quit []
<pontiki>
jrobeson: ATL is a super major hub of world economics, travel, industry
<h0rrorvacui>
jrobeson have you been to ATL?
<jrobeson>
yep?
<pontiki>
it's quite distinct from most everything else in the south
<jrobeson>
h0rrorvacui, yep.. a few times
noop has joined #ruby
nobitanobi has quit [Ping timeout: 252 seconds]
<dannymaclean>
I worked on a startup and inherited the coldfusion/m$access site - at what point should I try tackling converting it into a ruby/sql project?
<jrobeson>
i wasn't dissing ATL at all.. except before and saying it's super burby.. and they are still trying to fix their public transit
<pontiki>
NOW
<pontiki>
DON'T WAIT ONE MORE MINUTE
<jrobeson>
the metro is crazy..
<pontiki>
seriously though, does the site you inherited work well enough as is?
<dannymaclean>
not at all
timonv has quit [Ping timeout: 252 seconds]
tsykoduk is now known as zz_tsykoduk
<pontiki>
it's going to be one of those trade-off things, but given it's not working now, now is a good time to start converting
<jrobeson>
yeah.. if it doesn't work.. no good reason to wait
<pontiki>
unless you're already up to your ass in aligators, draining the swamp is the mission
<jrobeson>
pontiki :)
<dannymaclean>
:D
<dannymaclean>
point well taken
wildharvest has left #ruby [#ruby]
<DanBoy>
oh alligators lol
<pontiki>
do you have help, or is it all you?
<DanBoy>
we have kamodo dragons here in south florida
<DanBoy>
iguanas
<DanBoy>
pythons
<DanBoy>
parrots
* jrobeson
wants to go back to new orleans in late april
<h0rrorvacui>
I definately think parrots are the most dangerous.
<pontiki>
well, yeah, but in dannymaclean
<h0rrorvacui>
:P
havenwood has quit [Remote host closed the connection]
<pontiki>
's case, we're talking coldfusion+mssql
<DanBoy>
dude i got like 2 iguanas living in my back yard
<DanBoy>
my dogs attack them
Shidash has quit [Ping timeout: 272 seconds]
<pontiki>
WORSE THAN ANY KOMODO DRAGON
<dannymaclean>
it's all me - there were some other people on the project, but they're not involved anymore
<h0rrorvacui>
Yeah the komodo's are pets in florida
Yan__ has joined #ruby
havenwood has joined #ruby
<DanBoy>
apparently the komodo dragons are on the western coast
<pontiki>
pets that will eat small children
<jrobeson>
well at least one can convert some of the database stuff over. although one should go over the result first
<jrobeson>
err after
<DanBoy>
but if saw one i'd run from it
gasbakid has joined #ruby
<dseitz>
man's worst enemy; armadillos
<jrobeson>
i know mysql workbench tools have some sort of ms access -> mysql thing (but i recommend postgres)
<DanBoy>
we actually have a bounty set up for pythons
<DanBoy>
i believe at least
<h0rrorvacui>
If you've ever seen a parrot attack someone you'll know what I mean by more dangerous
<h0rrorvacui>
You can avoid/outrun the others
<pontiki>
this has become the most surreal out-of-context conversation
<dannymaclean>
"lighthouses rule"
<jrobeson>
h0rrorvacui, i am glad not to have seen that.. but i haven't yet been attacked by crows either.. those bastards remember!
<pontiki>
(Damn, those guys in #ruby have set up a bounty for python programmers!)
<jrobeson>
they will get you later
<DanBoy>
dude its like everyone just let their exotic pet go, now ten years later there all over the place killing the local animal population
<pontiki>
that *is* his backyard, whatteryou talkin about?
zipper has joined #ruby
<jrobeson>
huh?
<DanBoy>
good god
<h0rrorvacui>
birds are vicious
<pontiki>
nothing, jr, just riffing
<dannymaclean>
jrobeson, pontiki, etc. thank you :)
<jrobeson>
dseitz, has an armadillo ever attacked you?
<h0rrorvacui>
jrobeson they are timid
<pontiki>
you may be thanking me now, dannymaclean, but you'll be cursing soon
<jrobeson>
dannymaclean, postgres seriously.. if you can
<DanBoy>
i've been on walks pretty much way out into the woods for exercise, i sat down and 2 armadillos came up and just looked at me from like 3 feet away
<DanBoy>
didn't seem to care
<dseitz>
They have strong, sharp claws
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dseitz>
They do not back down
lyanchih has joined #ruby
<dseitz>
But generally only attack if provoked explicitly
dhruvasagar has quit [Ping timeout: 246 seconds]
<DanBoy>
a raccoon is probably your worst threat
<jrobeson>
i think i'll stick to be worried by crows then
<h0rrorvacui>
I've bumped into one taking the trash out and it just ran away
<DanBoy>
ya and possums
<jrobeson>
they just sit up on power lines and yell at you
<DanBoy>
they will run
<pontiki>
opossums are skittish
<DanBoy>
but a full grown raccoon will attack your dogs/cats
<jrobeson>
who knows when they will decide it's their turn to rule the earth!
<DanBoy>
and kill them quickly
<pontiki>
but they tend to freeze, too
rjhunter has joined #ruby
<jrobeson>
corvids are smart!
havenwood has quit [Ping timeout: 272 seconds]
DecipheredAFK is now known as Deciphered
<shevy>
wtf
culturelabs has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<shevy>
now I know about the killer armadillos, thanks to #ruby
<DanBoy>
i don't even care about gators, i've gone swimming in areas as a kid infested with them
<pontiki>
shevy wakes up and wonders what channel they've been idling in....
wildharvest has joined #ruby
<shevy>
no kidding
<DanBoy>
i'm more worried about snakes when i go get some cardio exercise in, i keep thinking the snakes will hear me comming and leave but they don't budge
<h0rrorvacui>
The snakes here in the south and the spiders are the things to worry about.
<pontiki>
still, nothing like oz :)
<pontiki>
9/10 most deadly snakes
<jrobeson>
yeah.. nothing like oz for real.. :(
<pontiki>
similar for spiders
rickruby has quit [Ping timeout: 272 seconds]
<pontiki>
but i'd still rather be in cali
zipper has quit [Ping timeout: 260 seconds]
<dannymaclean>
9 out of 10 deadly snakes agree, they'd rather be in california too
<pontiki>
lol
<pontiki>
oz has 9/10 deadliest snakes, dannymaclean
<h0rrorvacui>
Not the eastern diamond back
<DanBoy>
i exercise in a pretty much woody area trail and i have to focus right on the ground, i've seen snakes at least 4 times and they didn
<h0rrorvacui>
:p
<DanBoy>
didn't even move when i came near
<DanBoy>
only when i started messing with them did they move and they moved toward me
<DanBoy>
so i left :P
agjacome has quit [Ping timeout: 246 seconds]
<shevy>
lol dannymaclean
<pontiki>
at least you got smarter in the end
osvico has quit [Ping timeout: 245 seconds]
<jrobeson>
DanBoy, that is for the best
<h0rrorvacui>
I don't get the people who capture and keep venomous snakes
<h0rrorvacui>
Maybe its a dump redneck thing here or something.
<jrobeson>
cuz danger is fun
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ckinni has joined #ruby
<DanBoy>
they were brownish red and i've also seen them under water as well when i was on a small dock before
<jrobeson>
why do people do all sorts of ridiculous things everwyhere..
<DanBoy>
i dunno if they're dangerous or just rat snakes
<pontiki>
milking venom is something that needs to be done
<jrobeson>
probably still more dangerous to free climb a rockface than have a snake like that
rjhunter has quit [Ping timeout: 264 seconds]
<h0rrorvacui>
sounds like water moccasins
<jrobeson>
DanBoy, isn't there uhmm.. an app for that?
nilobject has quit [Quit: nilobject]
dhruvasagar has joined #ruby
Yan__ has quit [Ping timeout: 272 seconds]
<DanBoy>
i could apply my own app which comes default
<DanBoy>
my foot stomping on somehting till it dies
<jrobeson>
i meant to identify it.. :)
<DanBoy>
lol oh
<h0rrorvacui>
It could be copper heads too
<jrobeson>
not kill it
<h0rrorvacui>
but they don't like florida
<DanBoy>
ya those are venomous
<DanBoy>
they're around
tenjack has quit [Read error: Connection reset by peer]
<h0rrorvacui>
copper heads are not as common in florida for some reason
<DanBoy>
i just seem to come across black racers
<jrobeson>
i wanna go to miami sometime.. :(
<DanBoy>
or the redish brown ones
<jrobeson>
i've been down to middle florida
<dannymaclean>
any other ruby related #s I should be looking at?
<jrobeson>
and upper
<DanBoy>
which i believe are just rat snakes
<jrobeson>
dannymaclean, #rubyonrails first
tenjack has joined #ruby
<jrobeson>
dannymaclean, otherones will have to wait until you start picking parts you want to make your app with
kitak has quit [Remote host closed the connection]
kitak has joined #ruby
yellow5 has quit [Ping timeout: 248 seconds]
vlad_starkov has joined #ruby
DaZ has joined #ruby
yellow5 has joined #ruby
timonv has joined #ruby
larssmit has joined #ruby
lyanchih has quit [Quit: lyanchih]
<Hanmac>
yeah nobu fixed my bug again ;D
banghouse has quit [Read error: Connection reset by peer]
banghouse has joined #ruby
banghouse is now known as Guest13849
psyl0n has joined #ruby
hogeo has joined #ruby
robonerd has joined #ruby
julweber has quit [Remote host closed the connection]
Guest13849 is now known as banghouse
liamkeily has joined #ruby
<shevy>
Hanmac hehe
pen has joined #ruby
hogeo has quit [Ping timeout: 260 seconds]
wildharvest has joined #ruby
robonerd has quit [Remote host closed the connection]
RaCx has quit [Ping timeout: 260 seconds]
robonerd has joined #ruby
robonerd has quit [Remote host closed the connection]
psyl0n has quit []
psyl0n has joined #ruby
marr has joined #ruby
liamkeily has quit [Ping timeout: 260 seconds]
aryaching has joined #ruby
RaCx has joined #ruby
julweber_ has joined #ruby
<apeiros>
Hanmac - making ruby better by continually breaking it :)
<apeiros>
good work
rjhunter has joined #ruby
<Hanmac>
how troublesome ... now i need another piece of code that makes Segfaults ;P
pen has quit [Remote host closed the connection]
pen has joined #ruby
Jetchisel has joined #ruby
lkba has quit [Ping timeout: 261 seconds]
joesavage has joined #ruby
rjhunter has quit [Ping timeout: 245 seconds]
<apeiros>
Dr. h.c. segv Hanmac
julweber_ has quit [Remote host closed the connection]
noop has quit [Ping timeout: 272 seconds]
coderhs has joined #ruby
<joesavage>
Is there any built-in array method in Ruby that adds the different elements of two arrays respectively? e.g. [1, 2, 3] + [1, 2, 3] => [2, 4, 6]
<lmmx_>
I'm reading about AWS and it keeps mentioning Rails - I still don't get why I would want to use rails, can anyone explain? I manage without it seemingly without problems
lytol has joined #ruby
randomnick_ has joined #ruby
predator117 has quit [Ping timeout: 246 seconds]
mklappstuhl has quit [Remote host closed the connection]
lmmx has quit [Ping timeout: 250 seconds]
rjhunter has quit [Ping timeout: 246 seconds]
lmmx_ is now known as lmmx
Briareos1 has joined #ruby
rjhunter has joined #ruby
yfeldblum has quit [Quit: Leaving...]
lyanchih has joined #ruby
<lmmx>
is Rails a requirement for use of Ruby on the web?
rjhunter has quit [Read error: Connection reset by peer]
BizarreCake has quit [Read error: Connection reset by peer]
dhruvasagar has quit [Ping timeout: 264 seconds]
rjhunter has joined #ruby
<Briareos1>
where in a ruby project hierarchy would i place files that are only "required" ?
<Briareos1>
(by other scripts)
moneydouble has joined #ruby
<shevy>
lmmx you can use ruby in good old .cgi scripts, without rails
<shevy>
lmmx and you can use webrick. or rack standalone. or sinatra... or ramaze...
<shevy>
Briareos1 somewhere inside lib/? lib/requires/ or something like that dunno
failshell has joined #ruby
LexicalScope has joined #ruby
<MrZYX>
Briareos1: what do you mean by only "required" what is a file that is not only "required"?
<Briareos1>
no convention/best practice/recommendation :)
N00D is now known as zz_N00D
<Briareos1>
MrZYX: in the current case it just holds a function that is used be some other scripts in the bundle
rjhunter has quit [Ping timeout: 246 seconds]
<Briareos1>
some logic to handle XML, to be specific
Megtastique has quit []
<Briareos1>
which, in the other scripts are included via "require_relative"
jonathanwallace has quit [Ping timeout: 260 seconds]
<MrZYX>
the standard hierarchy of a gem is bin/ for scripts to be invoked by the user, lib/ for libraries used for the user and/or the scripts in bin/ and spec/ (for rspec) or test/ (for minitest etc.) for tests
moneydouble has quit [Ping timeout: 246 seconds]
shaunbaker has joined #ruby
estebistec has quit [Remote host closed the connection]
<lmmx>
hmm thanks shevy, I've not tried either before (.cgi or Rails), you think .cgi is simple enough to work out ?
<shevy>
.cgi is super simple
<MrZYX>
that said all my scripts in bin/ usually do is setting up the load path (if necessary), require some class in lib and and run it
<shevy>
I still use it
<lmmx>
there was a Sinatra talk at my university but I missed it >_<
<MrZYX>
I then even handle the commandline parsing with a class from lib/
<shevy>
lmmx if you use apache there are only a few things you have to setup, then you can just store your ruby code into .cgi files (ending) and they can be served
<shevy>
lmmx or you just use webrick
kevinykchan has joined #ruby
Mon_Ouie has quit [Ping timeout: 272 seconds]
<lmmx>
shevy this is all entirely new to me - can I just put my Ruby code into a .cgi script and run it "in the cloud"?
<Briareos1>
MrZYX: hm ... might be an idea to put the "required" file into lib an the ones that are executed explicitly into bin/ then
<lmmx>
*shudder*
<havenwood>
Briareos1: just expanding on what MrZYX said, the `lib/` dir should itself have a single dir that share the name of the gem `lib/gem_name_here/` and a file `lib/gem_name_here.rb` that requires any of the files needed in `lib/gem_name_here/*`.
<shevy>
lmmx no idea about the cloud, I guess it depends if they offer you to run scripts like that. check on the feature list of that "cloud" thing
<shevy>
lmmx but if it is all new to you, you should build up slowly
mrsolo has quit [Quit: This computer has gone to sleep]
<lmmx>
shevy indeed, cheers :~)
<MrZYX>
havenwood: Briareos1, well that's given by the fact that everything should be in a module of the gems name anyway
<shevy>
Briareos1 the only convention refers to most simple base directory layout ... ext/ lib/ sometimes bin/ test/ ... hmm that covers about 95%. how you layout things inside of lib/ is up to you really
predator117 has joined #ruby
<shevy>
Briareos1 the reason for foobar/ and foobar.rb is so that you can, in your project, do: require 'foobar', and it will load foobar.rb, which then should load (or point at a file that does so) the other ruby files
<shevy>
*in all projects that make use of your project
<Briareos1>
havenwood, MrZYX: at the current state it's just a collection of 3 scripts and the single XML handler. tried to make the directory layout as much "gem-like" possible for now
<lmmx>
shevy their site seems to advise RESTful code rather than the SOAP protocol, is this relevant to use of .cgi ?
zz_scottstamp is now known as scottstamp
kevinykchan has quit [Ping timeout: 245 seconds]
<havenwood>
Briareos1: `require 'this_gem'` loads `lib/this_gem.rb`, so in in the `bin/this_gem` executable just `require 'this gem'` and g2g.
<Briareos1>
shevy, havenwood: ok
Al_ has joined #ruby
zz_N00D is now known as CripperZ
phansch_ has joined #ruby
<lmmx>
ohhh it's just server-side scripting, phew
<shevy>
lmmx don't think so. I never had to understand REST or SOAP to use .cgi
CripperZ is now known as N00D
<Briareos1>
just put it as "lib/common/xml_handler.rb"
<shevy>
lmmx there is a cgi module in ruby, you can avoid it
<shevy>
I use only the part where you can fetch params
<shevy>
the rest of the ruby cgi module stinks :-)
otherj has joined #ruby
roadt has quit [Ping timeout: 264 seconds]
phansch has quit [Ping timeout: 252 seconds]
threesome has joined #ruby
Guest21125 is now known as banghouse
Kricir has joined #ruby
tsykoduk is now known as zz_tsykoduk
<lmmx>
shevy huh? Why would you have a module? To get the code from a .cgi file stored at a URL..? From my understanding .cgi scripts are just housing a script whose language is identified by the first line e.g. #!/usr/bin/ruby What's the point of a "cgi object" http://www.tutorialspoint.com/ruby/ruby_web_applications.htm
cbetta is now known as cbetta_afk
failshell has quit [Remote host closed the connection]
<shevy>
lmmx can you test it locally on your machine? do you use linux?
<shevy>
if you can, copy paste that simple content into a .cgi, then access it in your browser
<shevy>
then pass params to it like .cgi?tom=jerry
<shevy>
or something like that
<shevy>
I just realized that tom is the cat and jerry the mouse... so assigning the two does not make much sense ;-)
jonathanwallace has joined #ruby
shaunbaker has quit []
<lmmx>
lol they are finally at peace
<lmmx>
i'll keep my eye out for .cgi files online now, thanks
cbetta_afk is now known as cbetta
rickruby_ has joined #ruby
<shevy>
lmmx you could try to learn php
<shevy>
then switch to ruby
<shevy>
:D
<havenwood>
boo hiss
<shevy>
people here did so
<shevy>
like apeiros! he wrote like 70k lines of php before he switched to ruby
<havenwood>
but just learn Ruby :P save yourself!
<lmmx>
there was a php developer came in to speak at a talk at our uni and turned his nose up at ruby, it's basically my 1st language so I was offended lol
<lmmx>
he made out it wasn't very powerful I was like "excuse u"
duggiefresh has joined #ruby
<lmmx>
"rude"
cndiv_afk is now known as cndiv
cbetta is now known as cbetta_afk
<lmmx>
I'm more interested in coding for bioinformatics etc. than anything, I don't think PHP is greatly used for those purposes
root_empire has quit [Ping timeout: 265 seconds]
kaspergrubbe has quit [Remote host closed the connection]
LexicalScope has quit [Ping timeout: 264 seconds]
rickruby has quit [Ping timeout: 260 seconds]
duggiefresh has quit [Remote host closed the connection]
petey has joined #ruby
<shevy>
lmmx there is also bioruby
<lmmx>
a quick search for bio brings up (in order) bioperl biopython biojava and bioruby (biophp does exist from Google but not too sure of how widely used it is)
<lmmx>
shevy yup, I contributed to sciruby the other month :-D
rjhunter has joined #ruby
<shevy>
lmmx ruby is the language with the better design, compared to php
<lmmx>
hehe
<waxjar>
ruby is the language with a design :D
<lmmx>
thanks anyway shevy I've gotta go revise, will come back this at a later date, merci beaucoup
<waxjar>
php is the language without a design :D
<lmmx>
:D
<shevy>
it's more like melting pot design
<shevy>
and TIOBE says that php is better than ruby
<shevy>
wow
<shevy>
TIOBE also says that perl is better than ruby
<havenwood>
shevy: tiobe does a google search for each language, then some janky attempt at normalizing false positives and negatives that utterly fails
<shevy>
we have alias for instance methods
<shevy>
and I think I could do: class << self; and then define an alias for a class method
<shevy>
right?
ringaroses has quit [Ping timeout: 252 seconds]
<shevy>
so my question is... is there a simpler way to create aliases to class methods?
Tuxist has quit [Remote host closed the connection]
<shevy>
something like class_alias or such
<shevy>
havenwood, yeah, it's absolutely silly. COBOL on the rise... man, they can't be serious
<shevy>
though rubymonk has C rated so low
wallerdev has joined #ruby
<havenwood>
shevy: The Ruby television show is dying in popularity, so Tiobe sends Ruby plummeting, lol.
<apeiros>
I think shevy will never cease to celebrate my ancient php achievements…
<havenwood>
Breaking Tiobe news... COBOL up 5 spots, on trajectory to overtake Java. ..>
lmmx has quit [Quit: Page closed]
<havenwood>
shevy: C is pretty high up in the pack on redmonk ranking, no?
<havenwood>
shevy: well, more Github projects than C# and C++ but fewer StackOverflow questions.
<havenwood>
All three neck and neck.
rjhunter has joined #ruby
<shevy>
apeiros well it's a LOT of work... I think I never wrote more than 10.000 lines of php altogether ...
tylersmith has joined #ruby
rjhunter has quit [Read error: Connection reset by peer]
Xaitec has joined #ruby
ckinni has joined #ruby
otherj has quit []
<havenwood>
shevy: you might be surprised how many lines you end up writing, just the root directory of my code spike folder: wc -l *.rb | tail -1 #=> 5798 total
kaspergrubbe has joined #ruby
ambushsabre has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<havenwood>
shevy: mostly mad ravings, but in Ruby nonetheless
<shevy>
how do you cound subdirectories?
<shevy>
I mean .rb files in subdirs there
<shevy>
*count
<waxjar>
**/*.rb
<shevy>
cool
tylersmith has quit [Ping timeout: 246 seconds]
<shevy>
see, I forgot how shell stuff works
tenjack has quit [Remote host closed the connection]
<shevy>
wc -l **/*.rb | tail -1
<shevy>
77996 total
<shevy>
can this be true??
JuanMiguel has left #ruby ["Saliendo"]
robonerd has quit [Quit: ...]
JuanMiguel has joined #ruby
<shevy>
that would mean about 80.000 lines of ruby code right
Jdubs has quit [Remote host closed the connection]
<waxjar>
i have a similar number but i think i have a lot of cloned git repos there :p
fomatin has quit [Quit: Computer has gone to sleep.]
<havenwood>
shevy: yup
<havenwood>
shevy: gist, edit code in editor then back to repl, copy to clipboard, lots of stuff
Monie has joined #ruby
<havenwood>
shevy: gem install pry # and read the `help` command list
<havenwood>
shevy: i swear by it
<shevy>
Hanmac, wheeee slowly I am getting closer to 2.x -> ruby 1.9.3p484 (2013-11-22 revision 43786) [i686-linux]
<havenwood>
gotta run, later
havenwood has quit [Remote host closed the connection]
lyanchih has quit [Quit: lyanchih]
wallerdev has quit [Quit: wallerdev]
havenwood has joined #ruby
mjs2600 has joined #ruby
psyl0n has quit [Remote host closed the connection]
moneydouble has quit [Ping timeout: 264 seconds]
p4d4w4n has joined #ruby
kevinykchan has joined #ruby
mjs2600 has quit [Remote host closed the connection]
failshell has joined #ruby
Arzaga has quit [Quit: Computer has gone to sleep.]
colonolGron has quit [Quit: Lost terminal]
mojjojo has joined #ruby
zz_tsykoduk is now known as tsykoduk
havenwood has quit [Ping timeout: 260 seconds]
N00D is now known as zz_N00D
jamesaanderson has quit [Ping timeout: 246 seconds]
Al_ has quit [Quit: Al_]
nateberkopec has quit [Quit: Leaving...]
lyanchih has joined #ruby
kevinykchan has quit [Ping timeout: 252 seconds]
arietis has quit [Quit: Computer has gone to sleep.]
Guest38577 has quit [Ping timeout: 252 seconds]
mrsolo has joined #ruby
mrsolo has quit [Client Quit]
tvw has quit []
jamesaanderson has joined #ruby
riku has joined #ruby
riku is now known as Guest29280
lukec has joined #ruby
BizarreCake has joined #ruby
psyl0n has joined #ruby
tenjack has joined #ruby
failshell has quit [Remote host closed the connection]
decoponio has quit [Quit: Leaving...]
failshell has joined #ruby
Soda has joined #ruby
rjhunter has joined #ruby
lmmx has joined #ruby
zipper has quit [Ping timeout: 272 seconds]
Kricir has quit [Remote host closed the connection]
failshell has quit [Ping timeout: 246 seconds]
Kricir has joined #ruby
arietis has joined #ruby
<lmmx>
am I right in thinking I can get Booleans and in the case that they're false do something all on one line with something.nil?||something.nil?||"hello" => true or "hello" ?
<lmmx>
basically allowing me to circumvent an else clause ?
hololeap has joined #ruby
jbpros has joined #ruby
aagdbl has joined #ruby
zz_N00D is now known as CripperZ
<lmmx>
or would that not work / be bad code
<lmmx>
?
lyanchih has quit [Quit: lyanchih]
kevinykchan has joined #ruby
<MrZYX>
I'm not sure what you want here, do you have a real example?
rjhunter has quit [Ping timeout: 246 seconds]
Lewix has joined #ruby
zipper has joined #ruby
lyanchih has joined #ruby
<lmmx>
if entry[:message].include("IDP")||entry[:message].include("dry")||"\n"
Kricir has quit [Ping timeout: 252 seconds]
<apeiros>
that condition would always be true
<apeiros>
also it'd raise because it's include?, not include
<lmmx>
ahh grr
<lmmx>
oops yeah I have the q mark
jbpros has quit [Client Quit]
noyb has joined #ruby
bamdad has joined #ruby
<lmmx>
yeah you're right it'd always run true ignore me :-|
<apeiros>
lmmx: clear code >>> clever code
kevinykchan has quit [Ping timeout: 264 seconds]
<shevy>
lmmx you cram a lot of information in such a query
<shevy>
usually ruby code tends to favour things like
<shevy>
if condition
<shevy>
eat_cookie
<shevy>
else
<shevy>
sob_sadly
<waxjar>
if ["IDP", ...].any? { |s| entry[:message].include? s }
St_Marx has quit [Quit: Ex-Chat]
brupeb_ has joined #ruby
Al_ has joined #ruby
Al_ has quit [Client Quit]
St_Marx has joined #ruby
mojjojo has quit [Quit: mojjojo]
brupeb has quit [Ping timeout: 252 seconds]
osvico has quit [Ping timeout: 252 seconds]
bamdad has quit [Client Quit]
<apeiros>
blerp
<apeiros>
wrong, wrong and wrong. write proper classes, use clear methods.
<apeiros>
if entry.whatever_that_idp_or_dry_means? then bla else blubb
<apeiros>
end
havenwood has joined #ruby
<apeiros>
if you just do "entry[:message].include?('something')" then your code does not explain itself. make it a method and it becomes self-explaining.
<waxjar>
that's a fair point
tylersmith has joined #ruby
<lmmx>
hm I'm not great at methods
wallerdev has joined #ruby
<jrobeson>
nows your time to get a little better
predator117 has quit [Ping timeout: 246 seconds]
habanany has quit [Ping timeout: 272 seconds]
havenwood has quit [Ping timeout: 240 seconds]
predator117 has joined #ruby
habanany has joined #ruby
<apeiros>
lmmx: it's just `def namewhatyoudo; do_what_you_would_do_anyway; end
ckinni has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
lmmx: no magic.
nateberkopec has joined #ruby
<apeiros>
the hardest thing about it is naming. don't be afraid using a long name. any sensible editor comes with tab completion.
habanany has quit [Max SendQ exceeded]
bluOxigen has joined #ruby
bluOxigen has quit [Changing host]
bluOxigen has joined #ruby
<lmmx>
apeiros yeah it's just the use of #{var} which the method is put to and all that, just getting my head round it...
<apeiros>
(anybody using one without chose his fate himself and can't blame anybody but himself…)
nisstyre has joined #ruby
<apeiros>
?
pskosinski has quit [Quit: Til rivido Idisti!]
<lmmx>
if I want to do my method on var1, I need to run var1.method after having done
habanany has joined #ruby
<lmmx>
def method
habanany has quit [Max SendQ exceeded]
<lmmx>
puts #{var1}
<lmmx>
end
<lmmx>
lol leave me to it, I'll figure it out, thanks anyway
habanany has joined #ruby
<apeiros>
#{} is for string interpolation…
<apeiros>
I don't think it has a place there
habanany has quit [Max SendQ exceeded]
<apeiros>
you'd add the method to entry's class
lkba has quit [Ping timeout: 265 seconds]
<lmmx>
oh :/
habanany has joined #ruby
havenwood has joined #ruby
<apeiros>
if entry's class is not yours, it depends on other details how/where to place it
timonv has quit [Remote host closed the connection]
timonv has joined #ruby
lmmx has quit [Quit: Page closed]
rjhunter has joined #ruby
LexicalScope has joined #ruby
LexicalScope has joined #ruby
LexicalScope has quit [Changing host]
aagdbl has quit [Quit: Leaving.]
psyl0n has quit [Remote host closed the connection]
drag00n has joined #ruby
mjs2600 has joined #ruby
GoodTimes has quit [Ping timeout: 252 seconds]
timonv has quit [Ping timeout: 246 seconds]
dgfdgf has joined #ruby
rjhunter has quit [Ping timeout: 240 seconds]
`MArceLL` has quit [Ping timeout: 246 seconds]
dgfdgf is now known as `MArceLL`
BizarreCake has quit [Quit: Leaving]
<PPH>
what should I do if I want to use def my_method(hash={}) but still expect at least 1 item in the hash?
<apeiros>
PPH: you verify it in the method
<PPH>
I'd like an error to be raised, what should it be?
<apeiros>
the idea isn't that all your methods logic is in the def line
<apeiros>
PPH: either your own or an ArgumentError IMO
<apeiros>
and if it's your own, you'd probably do good to inherit from ArgumentError
DouweM has quit [Read error: Connection reset by peer]
<PPH>
well i'd like the usual wrong number of argument
<apeiros>
PPH: that'd be wrong.
<apeiros>
a hash is *one* argument.
<PPH>
k
<PPH>
I see
<apeiros>
fuck, out of vodka
havenwood has quit [Ping timeout: 252 seconds]
Monie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<PPH>
I don't really know how to make it inherit from ArgumentError
tenjack has quit [Remote host closed the connection]
arietis has quit [Quit: Computer has gone to sleep.]
<apeiros>
class YourClass < SuperClass; …; end
<PPH>
raise(ArgumentError, ":baz must be a boolean") unless valid_baz?(baz)
sepp2k has quit [Ping timeout: 245 seconds]
<PPH>
wouldn't it be good?
<apeiros>
seems fine
<PPH>
aight thank you
<apeiros>
drop the parens IMO. but that's just style.
<PPH>
yeah i will :)
<apeiros>
more specific exception classes can easier be rescued
dangerousdave has joined #ruby
<PPH>
well for now, to keep my little brain healty, I'll stick with it and do a class later if I feel then need.. lol
ewnd9 has quit [Remote host closed the connection]
mjs2600 has quit [Remote host closed the connection]
djbender has joined #ruby
arietis has joined #ruby
jrd0 has joined #ruby
lyanchih has quit [Quit: lyanchih]
nateberkopec has quit [Ping timeout: 264 seconds]
<PPH>
Ah... you see.. I already feel the need....... lol
fomatin has joined #ruby
<PPH>
apeiros, I will already need it in 3 methods so I think I'll refactor it into a class like you said.. lol
<PPH>
apeiros, thank yout
zipper has quit [Ping timeout: 246 seconds]
CripperZ is now known as zz_CripperZ
brandonhilkert has joined #ruby
brandonhilkert has left #ruby [#ruby]
m8 has quit [Quit: Sto andando via]
<apeiros>
yw
kevinykchan has joined #ruby
iamjarvo has quit [Remote host closed the connection]
lyanchih has joined #ruby
iamjarvo has joined #ruby
<andywojo>
Anyone know how to gsub the first 2 matches in a string? So if my string is "[hey] this is a sentence and this [] is a taco" .. I want to be able to replace the first to brackets, but not any others
banghouse has quit [Remote host closed the connection]
timonv has joined #ruby
kevinykchan has quit [Ping timeout: 245 seconds]
<waxjar>
use sub/sub! twice?
rjhunter has joined #ruby
iamjarvo has quit [Ping timeout: 265 seconds]
dubard has quit [Remote host closed the connection]
p4d4w4n has quit [Quit: This computer has gone to sleep]
<shevy>
supersub!
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rjhunter has quit [Ping timeout: 265 seconds]
* apeiros
wonders whether enum_for :gsub + first(2) would work - maybe with an added .lazy
jibi has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
ruby646 has joined #ruby
zz_tsykoduk is now known as tsykoduk
GoodTimes has joined #ruby
pushpak has joined #ruby
fomatin has quit [Quit: Computer has gone to sleep.]
Lewix has quit [Remote host closed the connection]
dannymaclean has joined #ruby
parus_ is now known as parus
postmodern has joined #ruby
jamesaanderson has joined #ruby
fomatin has joined #ruby
psyl0n has joined #ruby
jamesaanderson has quit [Client Quit]
jetblack has joined #ruby
jamesaanderson has joined #ruby
failshell has joined #ruby
CaptainJet has joined #ruby
<Sthebig>
getting this error when I try to start fargo. any ideas? in `raise_if_conflicts': Unable to activate em-http-request-1.1.1, because http_parser.rb-0.5.3 conflicts with http_parser.rb (>= 0.6.0.beta.2) (Gem::LoadError)
<waxjar>
>> 2.times.inject("hehe") { |x| x.sub "he", "ha" } # not that pretty tho
<lmmx>
there are quite a few net ones, net-ssh and net-http-persistent look most likely?
lkba has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has joined #ruby
Mon_Ouie has quit [Changing host]
ruby646 has quit [Ping timeout: 250 seconds]
<apeiros>
lmmx: net/http is stdlib
<apeiros>
meaning it's part of ruby
<lmmx>
ahh
<lmmx>
so I can't put stdlib in a gemfile?
<apeiros>
core: part of ruby, does not need a require; stdlib: part of ruby, needs require; gems: well, gems, need installation; <any other thing>
<lmmx>
I'm getting an error
jamesaanderson has joined #ruby
GoodTimes has quit [Ping timeout: 246 seconds]
<apeiros>
no, you can't put stdlib in a gemfile.
<apeiros>
they're not gems.
<apeiros>
(yet, that is)
<lmmx>
:/ bundle install is throwing an error
<mrfoto>
what kind of error?
mojjojo has joined #ruby
<lmmx>
sorry not bundle install, I'm using Rubymine for the first time and just made a gemfile so it can use other libraries, but now it's saying there's 1 left uninstalled
rjhunter has quit [Ping timeout: 245 seconds]
drag00n has quit [Ping timeout: 260 seconds]
<lmmx>
Could not find gem 'net/http (>=0) x86-mingw32' in the gems available on this machine
<jrobeson>
because it's not a gme
<jrobeson>
apeiros already said that.
<jrobeson>
just require 'net/http' in your code and it'll work
<lmmx>
ohhh sorry I get it now, yeah I have required it I just realised that's cuz I put it in the gemfile, riiight thanks guys
mojjojo has quit [Client Quit]
<jrobeson>
i have wondered about net-http-persistant though. i need to test that out sometime
k0m has joined #ruby
<jrobeson>
fail spell
<lmmx>
I thought you were telling me it's not a game haha
<PPH>
I would like to be able to say if the attribute of an object is readable by everyone. How can I do this?
<lmmx>
I was taken aback then reread...
<jrobeson>
hah :)
fedesilva has joined #ruby
arietis has joined #ruby
<MrZYX>
PPH: ruby has no concept of protected methods, only public and private. So if you can access from outside, everybody else can too
<mrfoto>
PPH: if it's public it is
<apeiros>
mrfoto: ruby has protected
<apeiros>
gah
noyb has quit [Ping timeout: 272 seconds]
<apeiros>
MrZYX: : ruby has protected
<MrZYX>
mmh, okay never saw it used ;D
<apeiros>
it may not be congruent with "protected" from other languages.
<apeiros>
MrZYX: that is because it's (IMO) mostly useless. even a bit more than private.
manu5 has joined #ruby
<apeiros>
PPH: note that both `private` and `protected` can at best be seen as "an advice to the user of this library"
<apeiros>
since you can circumvent both *easily*.
ambushsabre has joined #ruby
<apeiros>
MrZYX: in ruby, a protected method may be called from another object of the same class (the restriction may even be a bit less strict, not sure - I don't use protected methods)
<PPH>
well in fact, I'm passing an hash of attributes to an object's method. The method should compare these attributes to it's attributes and then return something. I want to be sure that nobody pass erronous attributes names to that method.
havenwood has joined #ruby
tenjack has joined #ruby
raphaelivan has joined #ruby
<MrZYX>
"The second visibility is protected. When calling a protected method the sender must be a subclass of the receiver or the receiver must be a subclass of the sender. Otherwise a NoMethodError will be raised."
<mrfoto>
PPH: whitelisting isn't an option?
lmmx has quit [Quit: Page closed]
<MrZYX>
PPH: go through public_send
<PPH>
mrfoto, maybe. How?
<mrfoto>
PPH: Hash has a .slice method
<PPH>
MrZYX, I'm already doing public_send... Maybe I'm just too parano... lol
<apeiros>
if it's a pattern, move it to its own class:
amoli has joined #ruby
<apeiros>
class InvalidOptionsError < ArgumentError; def self.verify!(options, whitelist); invalid = options.keys-whitelist; raise self, "Invalid options #{invalid.inspect[1..-2]}" unless invalid.empty?; end; end
mengu has quit [Read error: Connection reset by peer]
mengu has joined #ruby
mengu has joined #ruby
mengu has quit [Changing host]
Briareos1 has quit [Remote host closed the connection]
<PPH>
and the answer is.... public_send... lol
CaptainJet has quit []
pskosinski is now known as idkbIaze
iliketurtles has joined #ruby
<PPH>
If I pass by public_send, I don't careif the attribute's name is wrong, an error will be raised :)
<apeiros>
indeed
tsykoduk is now known as zz_tsykoduk
_Andres has joined #ruby
psyl0n has quit [Remote host closed the connection]
CaptainJet has joined #ruby
<mattyohe>
manu5: don't randomly PM people in here.
idkbIaze is now known as idkblaze
idkblaze is now known as pskosinski
<PPH>
I was already using public send but my brain failed when it realized i was about to call it from inside the object...
psyl0n has joined #ruby
psyl0n has quit [Changing host]
psyl0n has joined #ruby
bluOxigen has quit [Ping timeout: 246 seconds]
bluOxigen has joined #ruby
yacks has joined #ruby
endash has joined #ruby
<PPH>
if an other object based on a completely different class tries to send a call to an object using send instead of public_send might it trigger a private method?
phus1on has joined #ruby
<apeiros>
PPH: yes
kevinykchan has joined #ruby
<apeiros>
and since public_send came much later than send, a lot of code still uses send where it should use public_send (sadly mine included)
petey has quit [Remote host closed the connection]
petey has joined #ruby
ambushsabre has joined #ruby
phus1on has quit [Client Quit]
<PPH>
so I think I'm gonna stick to public_send unless I really do what I'm doing.. but I guess using send in any way is considered as a bad practice now
Guest48738 is now known as banghouse
iliketurtles has quit [Quit: zzzzz…..]
<apeiros>
PPH: IMO yes. send should be the exception and public_send the rule. if you need that indirection at all, that is.
<PPH>
cool thank you
kevinykchan has quit [Ping timeout: 246 seconds]
rjhunter has joined #ruby
<PPH>
I think I'm gonna re-read the pickaxe book soon, it might make a lot more sense since I'm starting to understand ruby a lot more
petey has quit [Ping timeout: 245 seconds]
failshell has joined #ruby
skaflem has quit [Quit: Leaving]
zombiebit has joined #ruby
Yan__ has quit [Ping timeout: 260 seconds]
rjhunter has quit [Ping timeout: 245 seconds]
Megtastique has joined #ruby
tenjack has quit [Remote host closed the connection]
mrfoto has quit [Remote host closed the connection]
barratt has joined #ruby
mrfoto has joined #ruby
jalcine has quit [Excess Flood]
chuk has joined #ruby
Arzaga has joined #ruby
timonv has quit [Remote host closed the connection]
tenjack has joined #ruby
Lewix has joined #ruby
depesz has joined #ruby
<depesz>
hi. I have trivial (possibly) question. I have a query that I want to run via DBI, and it has couple of placeholders. Values to the placeholder I normally provide via ->exec( query, param1, param2, ...)
<depesz>
but what if I have all params in an array? I can't ->exec(query, param_array) - it seems to be failing.
pi_ has joined #ruby
benzrf has joined #ruby
<benzrf>
hi
<benzrf>
select : reject :: grep : ???
pi_ has quit [Client Quit]
jbpros has joined #ruby
ambushsabre has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
havenwood has joined #ruby
Mohan has quit [Ping timeout: 252 seconds]
failshell has quit [Remote host closed the connection]
Lewix has quit [Remote host closed the connection]
_Andres has quit [Read error: Connection reset by peer]
chuk has quit [Quit: Leaving]
OdNairy has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
phansch_ has quit [Quit: Leaving]
<benzrf>
thanks
benzrf has left #ruby [#ruby]
<RubyPanther>
RBASIC(obj)->klass = gdkevents[ev->type]; /* hack */ results in rbgdkevent.c:44:14: error: assignment of read-only member ‘klass’
annalena has joined #ruby
mantas322` has joined #ruby
<mantas322`>
Hi guys super basic ruby question plz
brtdv has joined #ruby
<RubyPanther>
trying to get gtk2 working on the new Ruby
<mantas322`>
I have a date object
<mantas322`>
how can I check if its within a particular year and month
<mantas322`>
for example
<heftig>
RubyPanther: can't you use ruby-gir_ffi ?
<mantas322`>
is my date object in January 2013?
Elhu has joined #ruby
<RubyPanther>
heftig: not with any of my legacy software...
<apeiros>
mantas322`: Date#between?(start, end)
<apeiros>
inherited from Enumerable
<RubyPanther>
I'm stuck on 2.0.0-p195
<Hanmac>
apeiros: wrong its from Comparable
<apeiros>
gah
<apeiros>
yes, of course
<mantas322`>
r u sure i need between
<apeiros>
Enumerable is muscle memory…
bluOxigen has quit [Ping timeout: 265 seconds]
<apeiros>
mantas322`: i r sure u need btr lngage
<Hanmac>
RubyPanther: yeah new ruby code does not like to set the klass like that, i didnt find a way to make that better ... but if you are interested my wx binding gets better https://github.com/Hanmac/rwx/
<mantas322`>
seems like i should be able to ask for this simpler
<apeiros>
mantas322`: seriously, only 7y olds talk like that.
<apeiros>
mantas322`: like how?
tenjack has quit [Remote host closed the connection]
<apeiros>
you can also check .year && .month
manu5 has quit []
vlad_starkov has joined #ruby
<mantas322`>
yeah thats probably better
<Hanmac>
thnk y cn ndrstnd m wth t vcls ;P
whunt_ has joined #ruby
<mantas322`>
i cn
<nfk>
probably a common question but is there anything like two-dimensional arrays? i mean in the form of arr[a][b] not array of arrays which sounds like a real PITA to work with
<mantas322`>
oh i see, you guys dont care for txtspeek
<mantas322`>
i understand
Vivekananda has quit [Remote host closed the connection]
<apeiros>
nfk: there is Matrix, other than that, no
<nfk>
apeiros, that sounds very promising
<apeiros>
nfk: nothing stops you from implementing what you want, though.
<nfk>
thanks, i'll check that out
<nfk>
apeiros, apart from my ruby-fu being weak
<apeiros>
nfk: also, array of arrays *are* arr[a][b]
<mantas322`>
okay, yeah thanks, apeiros
<RubyPanther>
Hanmac: does it show how to set the klass now? Or is that just impossible now?
failshell has joined #ruby
GoodTimes has joined #ruby
jalcine has joined #ruby
<apeiros>
mantas322`: no, indeed, we're civilized. thank you.
<nfk>
apeiros, can i access them that way?
<apeiros>
nfk: of course
<apeiros>
if arr[x] returns something which responds to [], you can
<Hanmac>
"\xC1\xEA'\x97+Z\x96Ib\x91\xEBaj"
<apeiros>
doesn't even need to be another array. could be a Proc, a Hash, whatever, you name it.
<mantas322`>
I didnt mean to cause any of you to spill your teas, and burn your pinky fingers which are surely raised elegantly in the air
<nfk>
also do i understand correctly that if i use Array.new(n) {|i| somestuff} then i can't acess the values at other indexes?
* mantas322`
bows and leaves
marr has joined #ruby
<apeiros>
nfk: you can, but it'll return nil
Czupa has joined #ruby
<apeiros>
and nil does not respond to []
<nfk>
then you can't
k0m has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
whunt_ is now known as whunt
Elhu has quit [Quit: Computer has gone to sleep.]
<nfk>
not that much of a problem, though it would have been cool if i could have been that lazy
i8igmac has joined #ruby
<apeiros>
if that's a requirement, then yes, you need something else than nested arrays.
<nfk>
it's not
vlad_starkov has quit [Remote host closed the connection]
brtdv has quit []
vlad_starkov has joined #ruby
monkegjinni has joined #ruby
<apeiros>
would actually be nice if we could set Array's default value like we can set Hash's
jalcine has quit [Excess Flood]
<apeiros>
would allow to implement a NullObject pattern for such things.
randomnick_ has quit [Read error: Connection reset by peer]
pskosinski has quit [Quit: Til rivido Idisti!]
spike|spiegel has quit [Ping timeout: 246 seconds]
mantas322` has quit [Quit: Page closed]
<apeiros>
that combined with being able from NilClass, that is (which is missing too)
_Andres has joined #ruby
<Hanmac>
RubyPanther: it seems it cant be easly done in the new code ... but you can checkout my rwx ... it works with wx-trunk and ruby-trunk
<nfk>
apeiros, actually, how do i define a two dimensional array? Array.new(n) {|i| Array.new(n)} ?
<RubyPanther>
I'm not really interested in non-Gtk, I've been down many of those paths already
<apeiros>
nfk: yes, that'd create one
sepp2k has joined #ruby
<nfk>
feels like a hack, is there a more correct approach?
<apeiros>
nfk: if you want one of a fixed size with empty values, that's a good approach
<nfk>
RubyPanther, Gtk2 is dated and Gtk3 is pretty much making everyone but GNOME-Shell to look for alternatives
<shevy>
when you have "foobar.txt", how is the part .txt called in computer science?
<apeiros>
shevy: file suffix, or file extension
<shevy>
RubyPanther Hanmac wrote wxwidget bindings!
<shevy>
ok
<apeiros>
shevy: see File#extname
Vivekananda has joined #ruby
<nfk>
i think Xfce4 is maintaining/forking Gtk2 and LMDE is joining with Razor-qt to build a new Qt based lightweight DE
Loaft has joined #ruby
<nfk>
and Ubuntu's Unity is also going Qt
<nfk>
i wonder what SailfishOS uses
failshell has quit [Remote host closed the connection]
bricker`LA has quit [Read error: Connection reset by peer]
* apeiros
wants MenuetOS
jamesaanderson has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_Andres has quit [Ping timeout: 264 seconds]
iliketurtles has joined #ruby
rhunter has joined #ruby
monkegjinni has quit [Remote host closed the connection]
iliketurtles has quit [Remote host closed the connection]
zipper has joined #ruby
<shevy>
long live RubyOS!
iliketurtles has joined #ruby
<nfk>
RubyMachines
<nfk>
would be cool
monkegjinni has joined #ruby
jamesaanderson has joined #ruby
<nfk>
imagine Emacs written in Ruby
io_syl has joined #ruby
monkegjinni has quit [Remote host closed the connection]
spike|spiegel has joined #ruby
rhunter has quit [Ping timeout: 272 seconds]
zipper has quit [Ping timeout: 252 seconds]
Steve009 has joined #ruby
<Steve009>
If you have a string that is the exact format of a array, can you confer that string into a array? Example: String = "[1,2,3]"
jalcine has joined #ruby
<RubyPanther>
gtk3 has the exact same bug it turns out
<canton7>
Steve009, turns out you can eval() it, but I wouldn't necessarily recommend that
<Steve009>
for performance reasons?
Jdubs has quit [Read error: Connection reset by peer]
<canton7>
for general sanity :P
<nfk>
probably security
Jdubs has joined #ruby
<canton7>
and that
<RubyPanther>
"#send means never having to say eval STRING"
kevinykchan has joined #ruby
<nfk>
right, i forgot about that
<nfk>
lovely stuff
<nfk>
RubyPanther, though i wonder if it's really that much safer
<RubyPanther>
eval BLOCK is sometimes useful
<Steve009>
JSON.parse() works as well
<Steve009>
string2 = JSON.parse(string1)
<nfk>
eval is only 1 char off from being evil
<RubyPanther>
nfk: it may or may not be empirically better, but it is better separation
<canton7>
Steve009, good point. That would be my preferred approach
<RubyPanther>
I meant, it may or may not be better for security
Jdubs has quit [Read error: Connection reset by peer]
<nfk>
RubyPanther, i mean, can't you still have #{} within the argument which would get evaluated anyway?
Jdubs has joined #ruby
<RubyPanther>
nfk: but the argument is evaluated in caller, before the method is called
<nfk>
so having "[1, 2, 3, #{be evil}]" would still get the job done, no?
<RubyPanther>
Ruby doesn't try to prevent being evil. The point is to enable being good and clean and simple and clear
<nfk>
i mean the evil code could very well be something an attacker injected
<nfk>
not that the general practice is evil
<RubyPanther>
send "@#{evil}", "#{evil}" is fine. Your code is doing it's own evil, and then passing the result to a method.
dannymaclean has quit [Quit: dannymaclean]
zombiebit has quit [Remote host closed the connection]
<RubyPanther>
er, except the @
<RubyPanther>
but even in Ruby it is still true ;)
<nfk>
if that was within RoR does it even matter where it's called as the code can do anything it wants?
kevinykchan has quit [Ping timeout: 264 seconds]
_Andres has joined #ruby
<RubyPanther>
Yes, it matters because the architecture of your code matters.
<Steve009>
Any other thoughts on the String to Array?
<Steve009>
Something maybe that does not require use to pull in the JSON lib
<nfk>
Steve009, #send
<nfk>
it's a lovely thing
<RubyPanther>
The person actually running the code has the power. The program using the library is in charge, the library doesn't need protection.
Czupa has quit [Ping timeout: 272 seconds]
<nfk>
just beware of strings that users can tamper with
Czupa has joined #ruby
<Steve009>
nfk: never used send before
<Steve009>
can you provide simple code sample
<Steve009>
string1 = "[1,2,3]"
<RubyPanther>
separation of concerns matters for lots of reasons, for example if you want to test your code, you need to know where a behavior exists. Or if you (gasp!) have a bug, it helps to be able to find the code.
rjhunter has joined #ruby
<RubyPanther>
with #send you'll always be able to find out from your logs what code was run, and what arguments it got. with #eval you can't be sure of that unless you check all your #evals every time you look at the code, and make sure nobody changed them.
rjhunter has quit [Read error: Connection reset by peer]
<RubyPanther>
if there is even 1 eval STRING in some code, now any trust is misplaced until you've re-checked it.
petey has joined #ruby
Arzaga has quit [Quit: Computer has gone to sleep.]
<nfk>
actually, how do you use send for calls with parameters?
aryaching has quit [Ping timeout: 260 seconds]
rjhunter has joined #ruby
mengu has quit [Remote host closed the connection]
mrfoto has quit []
<MrZYX>
send just passed additional parameters along
<MrZYX>
*passes
rjhunter has quit [Read error: Connection reset by peer]
Krajsnick has joined #ruby
aryaching has joined #ruby
kaspergrubbe has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<nfk>
Steve009, actually, if the string will be provided by a user it's best to use regex to validate and parse every number and then manually add them to the array
popl has joined #ruby
popl has quit [Changing host]
popl has joined #ruby
<Steve009>
Would have to assume the string is much more complex than the example given
<nfk>
yes, slower, harder and as the old saying goes, now you have two problems but still better than blindly executing untrusted code
<nfk>
Steve009, eh?
<nfk>
you do know about regex, right
<Steve009>
yes
<nfk>
if you mean "[a1, a2, a3, .., an-1, an]" then it's not a problem
<Steve009>
but make the assumption that format will be unknown. If i was going to use regex, i would just use JSON.parse() instead
<nfk>
even extra spaces can be easily handled
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
<Steve009>
nested arrays, objects etc. Unknown structure. From a ease of use, would make more sense to use JSON.parse
<RubyPanther>
(1..10).send(:find_all){|v|v%2==0} # you can still pass code in a block, so you can do whatever you want without eval
<nfk>
honestly, i'd take a step back and think if what i'm doing is the right thing if i were you
aryaching has quit [Ping timeout: 272 seconds]
randomnick_ has joined #ruby
<apeiros>
Steve009: note that json parse will only parse valid json structures
aryaching has joined #ruby
<Steve009>
yes fair enough :)
<RubyPanther>
Those parsers are telling a fib, they're often converting a value instead of parsing it
<Steve009>
in my case its json structures for the majority
<Steve009>
fringe cases where something like regex or .split and .map would solve the problem
<Steve009>
(fringe cases are small)
jbpros has quit [Quit: jbpros]
<apeiros>
that's not what I asked ;-)
<apeiros>
what are the other cases (not solutions)?
rjhunter has joined #ruby
<apeiros>
and I guess you've been asked how those strings are created?
peshalto has joined #ruby
<RubyPanther>
Steve009: when I'm in that situation the first thing I ask is, do I really have to parse a string or can I just get a structured data format from my source?
<Steve009>
in these cases the structure is not available. :)
mercwithamouth has joined #ruby
<peshalto>
gem update --system says I don't have write permission for the directory. What is the best option? 1) sudo 2) chown/chmod the directory 3) something else
<peshalto>
newbie
<apeiros>
peshalto: did you install rubygems/ruby globally?
lukec has quit [Quit: lukec]
<apeiros>
if so, you probably need `sudo gem update --system`
Solnse has joined #ruby
<MrZYX>
or if you get rubygems through a package you could try searching for a newer one
threesome has quit [Ping timeout: 240 seconds]
rjhunter has quit [Ping timeout: 245 seconds]
<peshalto>
hmm gotta retrace my steps. I updated ruby (or attempted to) to p353 using rbenv
<peshalto>
did rbenv install 2.0.0-p353
<peshalto>
then rbenv global 2.0.0-p353
fomatin has quit [Quit: Computer has gone to sleep.]
<havenwood>
peshalto: Check where ruby is living?: command -v ruby
<peshalto>
but.. ruby -v is showing me p247
<RubyPanther>
Steve009: you can choose between parsing with a library like JSON and risking security bugs, or parsing it by hand with a regex and split and having the format be brittle
<apeiros>
Steve009: intending on giving an answer to my question? because if not, there's other things I can do.
<peshalto>
/usr/local/bin/ruby
jbpros has joined #ruby
<peshalto>
but gem is in /usr/bin/gem
<havenwood>
peshalto: So rbenv isn't shimming up your env, you're getting system Ruby.
Elhu has joined #ruby
<Steve009>
I would see the risk as minimal
<Steve009>
Thanks for the thoughts
<RubyPanther>
Since important data is already structured, the library is probably the more popular choice.
<peshalto>
I wonder if I need sudo when I do rbenv global 2.0.0-p353
threesome has joined #ruby
Steve009 has quit [Quit: Steve009]
dangerousdave has joined #ruby
zipper has joined #ruby
<havenwood>
peshalto: you can just point `chruby` at your `rbenv` installed Ruby and you'll never, ever have to rehash to get shims again
<peshalto>
is that your project havenwood?
<havenwood>
peshalto: Nope, it is postmodern's.
<peshalto>
what would I be upgrading?
<PPH>
I don't understand how Hash[] works internally is the [] a method?
<peshalto>
oh rbenv, duh
<havenwood>
peshalto: Well, chruby is an alternative tool to rbenv.
<peshalto>
replacing
<havenwood>
peshalto: aye
<RubyPanther>
peshalto: you need to either make sure that you're running the rbenv init thing in your .profile, or else put ~/.rbenv/shims/ in your PATH before /usr/local/bin
<peshalto>
i'd like to use whatever is fairly common
mengu has joined #ruby
<RubyPanther>
rvm is the most mainstream. rbenv is mostly for unix geeks
<postmodern>
PPH, yep it's a class method on Hash
<havenwood>
peshalto: I think `rvm` has the largest existing marketshare but `chruby` is the fastest growing.
<PPH>
postmodern, ok thank you I'll read about it :)
<RubyPanther>
rbenv is for people who are offended by touching the cd shell command
<postmodern>
RubyPanther, ironically, chruby inspired RVM to stop hooking cd, they now use PROMPT_COMMAND/preexec_functions
<RubyPanther>
lol good for them!
<RubyPanther>
that is a less painful hook, for sure
<peshalto>
er misread as shell
<peshalto>
dunno 'cd shell'
<havenwood>
PPH: You can call the #[] method without the sugar even: [1, 2, 3].[](1) #=> 2
<havenwood>
PPH: Same as: [1, 2, 3][1] #=> 2
<RubyPanther>
shell as in /bin/bash
vlad_starkov has joined #ruby
<peshalto>
yeah but where does the cd come in?
fixl has joined #ruby
jetblack has quit [Quit: leaving]
mityaz has quit [Quit: See ya!]
kaspergrubbe has joined #ruby
<postmodern>
peshalto, cd is a built-in function
<peshalto>
postmodern: as is ls
<postmodern>
peshalto, ls is usually an alias to `ls --color=auto`
<RubyPanther>
I guess it doesn't anymore. but in the past rvm altered cd in the shell. rbenv just sets the path and uses symlinks+envs+.files
<peshalto>
ls -G
<qubit>
Is there an app or gem which provides a console interface in a web browser (a la remote pry)? I want to play around with some PaaS providers and the ability to just spin up a console app would make it really easy
<postmodern>
RubyPanther, rbenv uses shims, which you have to add to your PATH
<RubyPanther>
rvm is full featured
kobain has joined #ruby
k0m has joined #ruby
Krajsnick has quit [Quit: Leaving...]
i8igmac has quit [Ping timeout: 240 seconds]
<apeiros>
postmodern: so you helped improve rvm? isn't that great? :)
<postmodern>
peshalto, you have to add them to your PATH in ~/.bashrc
<postmodern>
peshalto, and restart the shell
<RubyPanther>
peshalto: sometimes that doesn't get run, I'd put it in ~/.profile
<postmodern>
peshalto, also run `rbenv rehash` after you install new gems
<peshalto>
oh I thought it was either the path or the init
<qubit>
havenwood: looks like that uses a "DRb" protocol, which doesn't appear to be a superset of HTTP. Meaning it'll likely break with PaaS providers who only provide http
<havenwood>
qubit: DRb is in Ruby's standard library.
<havenwood>
qubit: Ships with Ruby.
<postmodern>
peshalto, chruby might be similar as it just manipulates PATH to point to your ruby
<postmodern>
peshalto, s/similar/simpler/g
Megtastique has joined #ruby
<qubit>
havenwood: yes, but the protocol itself is not http. meaning if the PaaS provider has a proxy sitting in front of your app, it wont proxy the traffic
<qubit>
havenwood: yes, that's what i'm saying :-)
<PPH>
RubyPanther, it will return 'lots' ? lol
<peshalto>
postmodern: i'll look at it, thanks
<MrZYX>
qubit: maybe you can rip out the REPL part of the better_errors gem
<RubyPanther>
PPH: right and for nothing you can do wuzzup?!!!?!
SHyx0rmZ has quit [Ping timeout: 246 seconds]
<peshalto>
"you need to either make sure that you're running the rbenv init thing in your .profile, or else put ~/.rbenv/shims/ in your PATH before /usr/local/bin"
<peshalto>
turns out it's not an either/or
<RubyPanther>
Ruby allows some really awesome WTFs
<peshalto>
I needed the path
colonolG1on has joined #ruby
<qubit>
I might be able to take havenwood's idea, write an app which can upgrade the connection to a websocket, and then pass control over to pry-remote
<peshalto>
names omitted to, you know ;-)
timonv has joined #ruby
<havenwood>
qubit: You can use DRb over ssh, or yeah i guess tunnel tcp to http, but yeah that'd be neat.
Elhu has quit [Quit: Computer has gone to sleep.]
mklappstuhl has joined #ruby
<RubyPanther>
"A sample implementation over HTTP can be found in the samples accompanying the main dRuby distribution."
Arzaga has joined #ruby
colonolG1on is now known as colonolGron
<RubyPanther>
You just swap out the transport layer. <3 <3 <3 DRb
colonolGron has left #ruby [#ruby]
Arzaga has quit [Client Quit]
Lewix has joined #ruby
Tuxist has joined #ruby
dangerousdave has quit [Quit: My Mac Pro has gone to sleep. ZZZzzz…]
kobain has quit [Remote host closed the connection]
<apeiros>
Object#i is `p self; self` (well, the `; self` part is now no longer necessary)
ringaroses has joined #ruby
<apeiros>
I also had ii and y (pp and yaml output instead of plain inspect)
<apeiros>
foo.map { … }.tap { |x| p x }.select { … } # <-- eeeew :D
kofno has joined #ruby
hololeap has quit [Ping timeout: 240 seconds]
<canton7>
yeah, but you can do whatever you like inside that block ;)
ringaroses1 has joined #ruby
<apeiros>
yeah, but inspect I need often
jbpros has quit [Quit: jbpros]
<apeiros>
so I made it easy for myself
<canton7>
no issues there!
<apeiros>
and when I do `p *foo` in irb (which I do often), I don't want inspect *again* after it
aryaching has quit [Ping timeout: 240 seconds]
eka has quit [Quit: Computer has gone to sleep.]
kevinykchan has quit [Ping timeout: 260 seconds]
volty has joined #ruby
ringaroses has quit [Ping timeout: 272 seconds]
rjhunter has joined #ruby
yfeldblu_ has joined #ruby
bricker`LA has joined #ruby
zomgbie has joined #ruby
aryaching has joined #ruby
Czupa has quit [Remote host closed the connection]
havenwood has quit [Remote host closed the connection]
yfeldblum has quit [Read error: Operation timed out]
JuanMiguel has quit [Ping timeout: 265 seconds]
kofno has quit [Ping timeout: 272 seconds]
havenwood has joined #ruby
Solnse has quit [Ping timeout: 252 seconds]
jrhe has quit [Read error: Connection reset by peer]
Tuxist has quit [Remote host closed the connection]
jrhe has joined #ruby
kofno has joined #ruby
pen has quit [Remote host closed the connection]
claymore has quit [Quit: Leaving]
tenjack has quit [Remote host closed the connection]
rjhunter has quit [Ping timeout: 260 seconds]
kaspergrubbe has quit []
barratt has quit [Read error: Connection reset by peer]
<depesz>
hi. if anyone of you had spare 5-10 minutes, I would greatly appreciate review, critique, comments and guidelines regarding https://gist.github.com/depesz/7725870 - I'm learning Ruby, and want to write it as well as I can.
petey has quit [Remote host closed the connection]
eka has joined #ruby
<canton7>
indent with 2 spaces only
Briareos1 has joined #ruby
laphlaw has joined #ruby
petey has joined #ruby
<canton7>
I'd probaby have made a comment class, but that's just m
<canton7>
*me
havenwood has quit [Ping timeout: 272 seconds]
tenjack has joined #ruby
<canton7>
no need for the explicit returns on L25-43
<depesz>
is there a technical reason, or is there a official style guide book for ruby, or your preference?
<depesz>
(indends)
failshell has quit [Remote host closed the connection]
<canton7>
likewise there's some superflous brackets going on there
<canton7>
pretty much every ruby style guide ever says 2 spaces
<depesz>
i know there is no need, but I somehow dislike implicit returns :/
<canton7>
you asked for style critiques :P they're just my opinion, do with them what you will
justsee has joined #ruby
zomgbie has left #ruby [#ruby]
<depesz>
sure - I am not *fighting* . just asking for background.
<depesz>
canton7: can you give me links to style guide(s)?
<depesz>
also - which brackets are superflous ?
<canton7>
personally I'd have parse_command_line_options take the options to pass as an argument - makes testing a bit easier
jrhe has left #ruby [#ruby]
<Briareos1>
hmm ... by chance does anyone know a good mailchimp alternative. something that allows for easy management of mail templates (text-based composal) and good rss-integration?
<MrZYX>
depesz: most rubyiests discourage using things like get in method names
<depesz>
canton7: that's great idea, I just wasn
<canton7>
the ones on line 26 for example. Normally when you're method chaining, you don't use brackets, so they caught me by surprise
<MrZYX>
depesz: not a ruby style thing but I prefer to have keywords and (most) functions consistently uppercase in SQL statements
<depesz>
canton7: that's great idea, I just wasn't sure how to pass it to opt parser later on.
bradhe has joined #ruby
<canton7>
depesz, I'm pretty sure OptionParser has a method which takes the array of args
<MrZYX>
depesz: also I'd probably try to break them up into methods to give the parts a name
<depesz>
canton7: I don't use () when I chain calls, which in itself contain (). like "".something(...).else(...)
<depesz>
but wasn't sure how it will work with blocks, so decides to "play it safe"
<canton7>
(so normally you'd see stuff.map{ ... }.select{ ... }.map{ ... }, not (((stuff.map{ ... }).select{ ... }).map{ ... })
estebistec has joined #ruby
kofno has quit [Ping timeout: 240 seconds]
petey has quit [Ping timeout: 246 seconds]
<depesz>
canton7: will remember. (and fix). thanks.
AzizLight has joined #ruby
<canton7>
that's an awful lot of 'exit's going on in there
<AzizLight>
Hi everybody
<MrZYX>
depesz: your get_db_connection actually doesn't even return one, so name it connect_to_db or something like that
<AzizLight>
What is the correct syntax to pass keyword arguments to `send` please?
<canton7>
I *would* always put brackets around method arguments (e.g. lin 223), but that's a religious war, so take whatever side you like
peshalto has quit [Quit: peshalto]
SHyx0rmZ has quit [Ping timeout: 252 seconds]
<MrZYX>
depesz: another thing I often do is to order the methods in order of first invocation
<depesz>
canton7: how do you put brackets, when you have options, *and* a block?
xcv_ has joined #ruby
<canton7>
depesz, method(arg, arg){ block }
<depesz>
MrZYX: connect/getconnection - good point. thanks.
<canton7>
do method(arg, arg) do \n ... \n end
mengu has quit [Remote host closed the connection]
<canton7>
s/do/or
<depesz>
can you append ".something()" to such do ... end block?
<MrZYX>
depesz: also I'd say decide on one hash style when keys are symbols, don't mix like l. 71 vs ll. 18-21
<canton7>
hmm, not too fond of parse_command_line_arguments actually calling stuff like show_list_of_accounts either
<canton7>
and, on top of that, exiting the entire program in conditions other than bad options
<canton7>
that's really icky
<apeiros>
UI classes should be separated entirely IMO
<MrZYX>
deepy: canton7 I'd probably extract the whole block at 216-231 into a method to replace it with something like check_arguments)"error message") { condition } or whatever makes sense
agunnamdi has quit [Quit: Leaving]
bradhe has quit [Remote host closed the connection]
kofno has quit [Ping timeout: 272 seconds]
<depesz>
canton7: well - it's exiting, so that it will not process anything else.
<depesz>
listing of acconts/queues is special case.
<canton7>
depesz, but that method shouldn't be responsible for processing anything!
<depesz>
MrZYX: please note that I'm de*pesz*. not de*epy* :)
<canton7>
it's called parse_command_line_options, not parse_command_line_options_and_execute_some_actions
<MrZYX>
depesz: argh, tab complete bit me, sorry deepy
<canton7>
indeed, as apeiros says, that entire method shouldn't even be part of your class, probably
Naoe-Kanno has joined #ruby
<depesz>
apeiros: it's small command line tool. it will never be used as part of anything. so not sure if there is reason to split it into "ui" and "model".
<depesz>
also - i need it to be single-file.
SHyx0rmZ has quit [Ping timeout: 252 seconds]
petey has joined #ruby
Naoe-Kanno has quit [Client Quit]
<apeiros>
depesz: a large part of programming is habits
havenwood has quit [Remote host closed the connection]
<apeiros>
it's a good habit to employ proper separation of concerns for small tools too.
<apeiros>
and it often pays of quicker than you'd think.
<depesz>
well, i have years of habits, but i generally work with sql.
<canton7>
and even in something like this, it forces you have introduce proper separation of concerns
<depesz>
apeiros: ok - so how would you split it? multiple files?
<MrZYX>
depesz: with that argumentation you could've made it a long script without any method at alll too
havenwood has joined #ruby
rubyracer has quit [Quit: Konversation terminated!]
<depesz>
MrZYX: i could have. but I wanted to learn oo ruby too
<apeiros>
depesz: splitting into files is a lesser concern
<MrZYX>
so that's why you should break that into more classes ;)
<depesz>
apeiros: so, how would you handle it?
<apeiros>
depesz: mostly I'd move all IO into a separate class
<matti>
depesz: Your Perl background is not helping you ;p I can tell ;p
djbender has quit [Ping timeout: 240 seconds]
<MrZYX>
depesz: @listed is only set but never used
<apeiros>
I've only glanced over your code. since you wanted feedback, here at least one positive: you're using bind variables in the sql, great :) (there are other things which are good too, of course!)
<depesz>
MrZYX: thanks. removed.
<depesz>
apeiros: well, i'm *dba*. not using placeholders is not even an option.
zombiebit has quit [Ping timeout: 272 seconds]
laphlaw has quit [Ping timeout: 265 seconds]
<MrZYX>
depesz: hmm did we have ( sorted_tickets.map { |t| t.min_comment } ).min -> sorted_tickets.map(&:min_comment).min already? note that some people don't like that syntax