apeiros_ changed the topic of #ruby to: programming language || ruby-lang.org || Paste >3 lines of text in http://pastie.org || Rails is in #rubyonrails
abdelrhman has quit [#ruby]
Pikkachu has joined #ruby
<shadoi> becom33: it gets pretty hairy when you can accept a variable # of args, and different types of args.
badelat has joined #ruby
<becom33> shadoi: Im not sure how can I put a varible like "m" in the place test in "self.method(:test).arity"
gtuckerkellogg has joined #ruby
Clordio has joined #ruby
jimmyy111 has joined #ruby
badelat has joined #ruby
<shadoi> method(m.to_sym).arity
GoogleGuy has joined #ruby
ElderFain has joined #ruby
<becom33> thanks it worked shadoi
whitenoise has joined #ruby
<whitenoise> anyone have experience with Cramp?
ScottNYC has joined #ruby
Know1edge has joined #ruby
Know1edge has joined #ruby
wmoxam has joined #ruby
lkba has joined #ruby
aknewhope has joined #ruby
shevy has joined #ruby
philips has joined #ruby
become33 has joined #ruby
pastjean has joined #ruby
bwlang has joined #ruby
seanstickle has joined #ruby
hiten_ has joined #ruby
luckyruby has joined #ruby
Beoran__ has joined #ruby
netrealm has joined #ruby
Nisstyre has joined #ruby
chimkan has joined #ruby
goodieboy has joined #ruby
williamcotton has joined #ruby
wmoxam has joined #ruby
albemuth has joined #ruby
crodas has joined #ruby
ecolitan has joined #ruby
ecolitan has joined #ruby
libertyprime has joined #ruby
CheeToS has joined #ruby
Aaaarg has joined #ruby
c0rn has joined #ruby
mickn has joined #ruby
jimmy has joined #ruby
shevy has joined #ruby
pyreal has joined #ruby
adeponte has joined #ruby
bwlang has joined #ruby
wilmoore has joined #ruby
jesly has joined #ruby
BruceZu has joined #ruby
<jesly> i need to express a char/hex value as \xvalue, say 56 as \x56
Aaaarg has joined #ruby
<jesly> but 56.chr turns it into a char
<jesly> also does '56'.hex.chr
<jesly> any idea to have it as \x56 itself
drake has joined #ruby
rohit has joined #ruby
drake10 has joined #ruby
dv310p3r has joined #ruby
<jesly> shevy: ?
centipedefarmer has joined #ruby
nari has joined #ruby
bwlang has joined #ruby
luckyruby has joined #ruby
Jayvan has joined #ruby
swarley has joined #ruby
banisterfiend has joined #ruby
RORgasm has joined #ruby
frishi has joined #ruby
l00ck has joined #ruby
Sailias has joined #ruby
syamajala has joined #ruby
yoklov has joined #ruby
Kyril has joined #ruby
dbruns has joined #ruby
robkinyon1 has joined #ruby
araujo has joined #ruby
Emmanuel_Chanel has joined #ruby
jShaf has joined #ruby
jShaf has quit [#ruby]
dbgster has joined #ruby
scombinator has joined #ruby
<scombinator> Is there talking in this channel?
<seanstickle> Sometimes
badelat has joined #ruby
<scombinator> When?
<seanstickle> Now, apparently.
<scombinator> Alright then
blueadept has joined #ruby
Vert has joined #ruby
<jesly> have some talking in this channel by helping me
<jesly> i need to represent a string as \xvalue
<jesly> say \x72
<jesly> but 72.chr =>H
<jesly> i need 72.func = '\x72'
<jesly> any ideas?
fungoat has joined #ruby
releod has joined #ruby
releod has quit [#ruby]
cloke has joined #ruby
kvirani has joined #ruby
philcrissman has joined #ruby
blast_hardcheese has joined #ruby
hiten_ has joined #ruby
wefawa has joined #ruby
ed_hz_ has joined #ruby
hiten_ has quit [#ruby]
liluo has joined #ruby
shtirlic_ has joined #ruby
wyhaines has joined #ruby
S2kx has joined #ruby
frontendloader has joined #ruby
Jayvan has joined #ruby
bryricker has joined #ruby
brngardn_ has joined #ruby
S1kx has joined #ruby
bglusman has joined #ruby
ZachBeta has joined #ruby
Jayvan has joined #ruby
otters has joined #ruby
frontendloader has joined #ruby
adamkittelson has joined #ruby
Jayvan has joined #ruby
bwlang has joined #ruby
pygmael has joined #ruby
ghosTM55 has joined #ruby
ryannielson has joined #ruby
philcris_ has joined #ruby
nikhil_ has joined #ruby
<shevy> jesly perhaps with .pack and .unpack
SegFaultAX has joined #ruby
zodiak has joined #ruby
foo-bar- has joined #ruby
johnduhart2 has joined #ruby
deavidsedice has joined #ruby
matti has joined #ruby
matti has joined #ruby
Pikkachu has joined #ruby
eregon_ has joined #ruby
Pikkachu has joined #ruby
Pikkachu has joined #ruby
bryricker1 has joined #ruby
choffstein has joined #ruby
shajen has joined #ruby
JodaZ has joined #ruby
mattp_ has joined #ruby
Aaaarg_ has joined #ruby
Cache_Money has joined #ruby
Dirkpitt has joined #ruby
Sigma00 has joined #ruby
Drewch has joined #ruby
eregon has joined #ruby
deavid has joined #ruby
carlyle has joined #ruby
drake10 has joined #ruby
mrmist has joined #ruby
matti has joined #ruby
matti has joined #ruby
whitenoise has joined #ruby
<whitenoise> hey guys, anyone familiar with Cramp?
<whitenoise> i have written an app, but the on_data handler isn't firing, even though my client-side javascript is sending it data
<whitenoise> if i create a websocket server with eventmachine, that server gets the data.
gift has joined #ruby
Drakx has joined #ruby
Drakx has joined #ruby
cha1tanya has joined #ruby
<whitenoise> i think Cramp may not be doing the websocket handshake
ringotwo has joined #ruby
Cache_Money has joined #ruby
species has joined #ruby
<whitenoise> i found the issue. it would seem the Cramp server is not responding with websocket
<whitenoise> it's sending a Content-type: text/html response
Zolrath has joined #ruby
Clordio has joined #ruby
bryricker has joined #ruby
<whitenoise> yep. Cramp::Websocket doesn't do the handshake of the latest protocol
<whitenoise> i.e., it's broken.
Proggy has joined #ruby
eywu has joined #ruby
pdtpatr1ck has joined #ruby
pdtpatr1ck has joined #ruby
igotnolegs has joined #ruby
Cache_Money has joined #ruby
RORgasm has joined #ruby
JohnBat26 has joined #ruby
Karmaon has joined #ruby
Sailias has joined #ruby
shadoi has joined #ruby
Karmaon has joined #ruby
radic has joined #ruby
mikeric has joined #ruby
fayimora has joined #ruby
zakwilson has joined #ruby
TheTFEF has joined #ruby
yoklov has joined #ruby
ilyam has joined #ruby
frishi has joined #ruby
egrouse has joined #ruby
sam113101 has joined #ruby
TheTFEF_ has joined #ruby
krz has joined #ruby
chimkan has joined #ruby
albemuth has joined #ruby
jbpros has joined #ruby
TheNumb has joined #ruby
gtuckerkellogg has joined #ruby
krz has joined #ruby
krz has joined #ruby
krz has joined #ruby
krz has joined #ruby
shajen has joined #ruby
krz has joined #ruby
krz has joined #ruby
krz has joined #ruby
Banistergalaxy has joined #ruby
matti has joined #ruby
matti has joined #ruby
tommyvyo has joined #ruby
TheTFEF_ has joined #ruby
albemuth has joined #ruby
aantix has joined #ruby
eregon has joined #ruby
TheTFEF_ has joined #ruby
knightMBP has joined #ruby
antillas21 has joined #ruby
rippa has joined #ruby
George_ has joined #ruby
George_ has quit ["Leaving"]
drake10 has joined #ruby
ZachBeta has joined #ruby
jbpros has joined #ruby
adeponte has joined #ruby
looopy_ has joined #ruby
Wrecktum has joined #ruby
gift has joined #ruby
Lady`GirL has joined #ruby
tonini has joined #ruby
Recktum has joined #ruby
ZachBeta has joined #ruby
RapeCoreyTonight has joined #ruby
rushed has joined #ruby
rushed has joined #ruby
rushed has joined #ruby
CoreyRape has joined #ruby
rbrooks has joined #ruby
brianpWins has joined #ruby
Banistergalaxy has joined #ruby
rbrooks_ has joined #ruby
CheeToS has joined #ruby
tommyvyo has joined #ruby
FermentedCum has joined #ruby
FermentedCum has joined #ruby
greenarrow has joined #ruby
sleetdrop has joined #ruby
yoklov has joined #ruby
kevinbond has joined #ruby
looopy_ has joined #ruby
Banistergalaxy has joined #ruby
sam113101 has joined #ruby
CumInsideOfGry has joined #ruby
rohit has joined #ruby
RORgasm has joined #ruby
scientes has joined #ruby
<scientes> how do i uninstall all gems?
gtuckerkellogg has joined #ruby
yxhuvud has joined #ruby
maletor has joined #ruby
crankycoder has joined #ruby
rushed has joined #ruby
rushed has joined #ruby
rushed has joined #ruby
matti has joined #ruby
matti has joined #ruby
ryanf has joined #ruby
heftig has joined #ruby
wmoxam has joined #ruby
Banistergalaxy has joined #ruby
<epitron> type "gem env"
<epitron> then delete everything in the gem dir :D
<epitron> orrr
<epitron> gem uninstall `gem list`
<epitron> err
<epitron> gem uninstall `gem list| awk '{print $1}'`
<hemanth> scientes, ^
nikhil_ has joined #ruby
djdb has joined #ruby
savage- has joined #ruby
akemrir has joined #ruby
x0F_ has joined #ruby
nerdy has joined #ruby
<scientes> how do i make sure that /usr/bin/ruby is used, and not /usr/local/bin/ruby
<scientes> from passenger?
<scientes> i am using
<scientes> passenger_ruby /usr/bin/ruby;
<scientes> but i dont hink it is working by the backtrace i am seeing
amar_key has joined #ruby
mdel has joined #ruby
djdb has joined #ruby
ph^ has joined #ruby
Aaaarg has joined #ruby
schovi has joined #ruby
mdw has joined #ruby
eighty4 has joined #ruby
Aaaarg has joined #ruby
mafolz has joined #ruby
ChampS666 has joined #ruby
nikhil___ has joined #ruby
rohit has joined #ruby
twqla has joined #ruby
twinturbo has joined #ruby
Squarism has joined #ruby
hSATAC has joined #ruby
refriedchicken has joined #ruby
<RubyPanther> scientes: normally it is PassengerRuby not passenger_ruby, dunno if it registers both or not
JNZ` has joined #ruby
emmanuelux has joined #ruby
maletor has joined #ruby
sspiff has joined #ruby
sspiff has joined #ruby
<scientes> hmm passenger itsself told me to use passenger_ruby
<scientes> oh wait, this is nginx
<scientes> that is the difference
<scientes> RubyPanther, ^
<RubyPanther> oh, well, dunno then.
nari has joined #ruby
scalebyte has joined #ruby
robbyoconnor has joined #ruby
trivol has joined #ruby
NeV3r has joined #ruby
zommi has joined #ruby
Houdini has joined #ruby
tewecske has joined #ruby
hSATAC has joined #ruby
<scalebyte> RubyPanther: Nice to see in the #RubyonRails room also :)
sterNiX has joined #ruby
dekroning has joined #ruby
williamcotton_ has joined #ruby
knightMBP has joined #ruby
mdw has joined #ruby
bondar has joined #ruby
RORgasm has joined #ruby
shtirlic has joined #ruby
artm has joined #ruby
fr0gprince_ has joined #ruby
fearoffish has joined #ruby
KL-7 has joined #ruby
blacktulip has joined #ruby
darthdeus has joined #ruby
pi3r has joined #ruby
shtirlic has joined #ruby
KL-7 has joined #ruby
LMolr has joined #ruby
ukwiz has joined #ruby
flou has joined #ruby
<artm> is there a standard way to assign select object fields from a hash, to use in an initializer?
ChampS666 has joined #ruby
shruggar has joined #ruby
mklappstuhl has joined #ruby
mdw has joined #ruby
robkinyon1 has joined #ruby
manizzle has joined #ruby
schovi has joined #ruby
sectionme has joined #ruby
tilde` has joined #ruby
lockweel has joined #ruby
BiHi has joined #ruby
bluOxigen has joined #ruby
sectionme has joined #ruby
bryricker has joined #ruby
emmanuelux has joined #ruby
ephemerian has joined #ruby
ephemerian1 has joined #ruby
timonv has joined #ruby
mdw has joined #ruby
d3vic3 has joined #ruby
Guest97939 has joined #ruby
ohcibi has joined #ruby
liluo has joined #ruby
Guest_ has joined #ruby
waseem_ has joined #ruby
waseem_ has quit [#ruby]
Guest71832 has joined #ruby
roolo has joined #ruby
c0rn has joined #ruby
EzeQL has joined #ruby
trivol has joined #ruby
mdw has joined #ruby
simao has joined #ruby
workmad3 has joined #ruby
francisfish has joined #ruby
<shevy> RubyPanther you should draw more comics
<RubyPanther> shevy: I don't draw comics
schovi has joined #ruby
bier has joined #ruby
<artm> how can I convert a file path to be relative to some other file's directory?
tatsuya_o has joined #ruby
ringotwo_ has joined #ruby
<banisterfiend> shevy: more creepy pictures of RubyPanther doing weird things as a badly drawn cartoon panther?
<prometheus> when I think of RubyPanther, I think of hobbes :P
rbrooks has joined #ruby
emmanuelux has joined #ruby
<prometheus> lol
<heftig> artm: split both paths into components, remove common leading components, prepend as many .. components to the first path as there are directory components in the other path
<banisterfiend> heftig: hey hefty boy
<shevy> yeah we need more comics like that now that _why is gone
<shevy> why isn't here anyone who can draw comics :(
DuoSRX has joined #ruby
<RubyPanther> I dunno, I had to hire an artist for my mascot
<shevy> we suck
<RubyPanther> and then he ran off 2000 miles to meet some chic he met on an MMRPG of some sort, and he disappeared
KL-7_ has joined #ruby
<prometheus> creepy
<prometheus> maybe we should call him help, if he was abducted
jhowarth has joined #ruby
<prometheus> by the "chick" he met ;)
<shevy> some live
<shevy> some die
<shevy> that's the scary nature of reallife
nru has quit [#ruby]
KL-7_ has joined #ruby
parus has joined #ruby
apeiros_ has joined #ruby
ghosTM55 has joined #ruby
<heftig> seems to work well if you provide two absolute, canonical paths
<artm> heftig, thanks. /me was half way there :)
heftig has joined #ruby
tvw has joined #ruby
<heftig> seems to work well if you provide two absolute, canonical paths
nect has joined #ruby
<artm> member:heftig, thanks. /me was half way there :)
fayimora has joined #ruby
affix has joined #ruby
havenn has joined #ruby
<shevy> ok I can access a hash-like object like so
<shevy> def [](i)
<shevy> @hash[i]
<shevy> end
<shevy> but how to make a
<shevy> foo['bla'] = 'lala'
<shevy> ?
<banisterfiend> shevy: sup shev
arturaz has joined #ruby
<RubyPanther> []= duh ;)
Banistergalaxy has joined #ruby
randym has joined #ruby
polysics has joined #ruby
<shevy> hmmmm
<shevy> def []=(i); @hash[i] = ???
<shevy> :(
ChampS666 has joined #ruby
<polysics> hello! this might be a tad tricky, but maybe someone knows
<polysics> i am running Sinatra as an embedded web API for my application
<polysics> and would like to mount Faye on top of it to simplify event handling
<RubyPanther> shevy: def []= i,val ; @hsh[i] = val end
<polysics> i know how to do that using a .ru file, but i am running the Sinatra app directly
<polysics> i know i can use Rack::Handler to run it, but how do I specify the use clause i need in that case?
<shevy> RubyPanther that confuses me to no ends
lobolars has joined #ruby
<arturaz> shevy, def []=(key, value); @hash[key] = value; end
<shevy> hmm
ChampS_ has joined #ruby
<shevy> was it always like that?
<shevy> my brain seems to be in limbo :(
<arturaz> yup
<RubyPanther> shevy: yes. And you can call it foo[bar] = baz or foo.[]= bar,baz # :)
<RubyPanther> class Foo; def []= i,val ; @hash||={}; @hash[i] = val;@hash end end ; Foo.new.[]=(:omg,'Ponies!')[:omg]
<RubyPanther> => "Ponies!"
<shevy> I could swear that this is the first time that I saw
<shevy> def []=(key, value)
become33_ has joined #ruby
<RubyPanther> Not as weird as def -@ though
<shevy> that is legal syntax??
<RubyPanther> yeah that is a unary minus :)
<shevy> I am in the weird part of ruby again
<RubyPanther> and for kicks you can do: def -@ val # and really trip out people who try to do -foo
RORgasm has joined #ruby
<RubyPanther> Then you can't call it as -foo but you can still say foo.-@(val)
davidpk has joined #ruby
falena has joined #ruby
<RubyPanther> You can also leave easter eggs like define_method( :'#' ){"wtf"}
mengu has joined #ruby
<artm> wait, what?
<apeiros_> using define_method, you can define about every method that is a valid symbol
KL-7 has joined #ruby
<artm> but how do i call method called :'#' ?
<apeiros_> send
<apeiros_> hpricot has tons of them iirc
pygmael has joined #ruby
<apeiros_> also some testing frameworks use it for test-method names
<artm> ok, but what makes it 'easter egg' then? it's just a difficult to call method
<apeiros_> I'll leave that question to RubyPanther :)
* apeiros_ off for lunch anyway
Aaaarg has joined #ruby
bluenemo has joined #ruby
fr0gprince_mac has joined #ruby
* artm got method # this far: http://codepad.org/qXuufuua
<artm> still don't see how is it easter
<RubyPanther> artm: it's an easter egg because it doesn't get picked up by doc tools and is only seen when you introspect the class/object and see the extra weird method. More of a goose egg, perhaps.
<artm> oh, i guess terrorists could send messages using it then. rdoc steganography
Natch| has joined #ruby
luckyruby has joined #ruby
<RubyPanther> def ! is another great one, perhaps the king confuser, since it works if you define it... or if you don't!
Woosta has joined #ruby
<RubyPanther> class Foo; def !;"wtf" end end ; class Bar; end ; puts !Foo.new, !Bar.new
Woosta has quit [#ruby]
<RubyPanther> class FalseClass; def !;true end end ; class TrueClass; def !;true end end ; !false == !!false
<RubyPanther> => true
<RubyPanther> !false == !true => true
<lopex> % class FalseClass; def !;true end end ; class TrueClass; def !;true end end ; !false == !!false
<multibot_> true
nikhgupta has joined #ruby
nikhgupta has quit [#ruby]
bluenemo has joined #ruby
banisterfiend has joined #ruby
heftig_ has joined #ruby
eka has joined #ruby
<RubyPanther> sadly we don't have def &@
<banisterfiend> RubyPanther: that calls to_proc
<sente> what are some large non-rails ruby codebases?
<banisterfiend> sente: homebrew, chef, puppet
<sente> banisterfiend: thanks
nari has joined #ruby
lobolars has joined #ruby
codebeaker has joined #ruby
Mchl has joined #ruby
zetm has joined #ruby
mcwise has joined #ruby
Guest__ has joined #ruby
foo-bar- has joined #ruby
pyreal has joined #ruby
JNZ has joined #ruby
Aaaarg has joined #ruby
pi3r has joined #ruby
knopkodav has joined #ruby
<dominikh> sente: Metasploit :)
alup has joined #ruby
foo-bar- has joined #ruby
pi3r has joined #ruby
ChampS666 has joined #ruby
headius has joined #ruby
wefawa has quit [#ruby]
Nathandim has joined #ruby
become33 has joined #ruby
rohit has joined #ruby
nikhil_ has joined #ruby
sbanwart has joined #ruby
gianlucadv has joined #ruby
berserkr has joined #ruby
LMolr has joined #ruby
<scalebyte> rohit: Hai
<rohit> scalebyte: Hello
<scalebyte> rohit: you are from India ?
<rohit> scalebyte: Yup :)
<scalebyte> rohit: me too :)
<scalebyte> rohit: Which City ? Where do you work ?
<rohit> scalebyte: What's your name? Maybe we know each on twitter?
<scalebyte> rohit: no we dont :) My name is Mithun
<scalebyte> rohit: I am there in SO -> http://stackoverflow.com/users/1008222/mithun-sasidharan
<rohit> scalebyte: Oh ok. My twitter handle is @rohitarondekar :)
<rohit> scalebyte: You work in TCS on ruby? Cool :)
<scalebyte> rohit: Yes... RoR mainly. I am there on Twitter -> https://twitter.com/#!/mithun_tweets
<scalebyte> rohit: where do u work ?
<rohit> scalebyte: Freelance atm, just one project
<scalebyte> rohit: ok and you are from Goa ?
RORgasm has joined #ruby
<rohit> scalebyte: Yup
gtuckerkellogg has joined #ruby
<scalebyte> rohit: You have made some 68 commits to rails cool :) Congrats -> http://contributors.rubyonrails.org/contributors/rohit-arondekar/commits
<scalebyte> rohit: thats awesome
<rohit> scalebyte: yeah that was a while back :), hey head into this room http://chat.stackoverflow.com/rooms/9391/brug
<scalebyte> rohit: ok
greywolf` has joined #ruby
patjoh has joined #ruby
tewecske has joined #ruby
<dagobah> Can ruby tell me which column in a line (and file) lead to an exception being thrown?
<Mon_Ouie> I don't think so, but usually the name of the method is enough to make it unambiguous
KL-7 has joined #ruby
Progster has joined #ruby
pu22l3r has joined #ruby
<dagobah> True, was just trying to open my editor at the correct line and column (for an exception) when a test fails.
zeninfinity has joined #ruby
<banisterfiend> dagobah: plymouth can do that (except fro the correct column, but it gets the right line)
<banisterfiend> dagobah: https://github.com/banister/plymouth
BiHi has joined #ruby
<JohnBat26> hello
<JohnBat26> How in ruby 1.9 return value from block ?
<apeiros_> next/break/return
<apeiros_> depending on what context you want to jump back to
<apeiros_> next will return to where yield is called
<apeiros_> break will return to where the method to which you supplied the block is called
Russell^^ has joined #ruby
<apeiros_> and return will return from the method in which the block is lexically located iirc (and is hence not always a valid choice)
<JohnBat26> I want get back_url from nested block
<banisterfiend> Mon_Ouie: i wonder wht Mon_Ouie is up to
kvirani has joined #ruby
<banisterfiend> Mon_Ouie: what u working on these days?
nanderoo has joined #ruby
sspiff has joined #ruby
sspiff has joined #ruby
Natch| has joined #ruby
Maxou56800 has joined #ruby
dkamioka has joined #ruby
iamjarvo has joined #ruby
<banisterfiend> Mon_Ouie: haha
<banisterfiend> Mon_Ouie: how does QT look? is it pretty?
<Mon_Ouie> Looks pretty much like all other GUI apps
<banisterfiend> Mon_Ouie: can i see a screenshot?
<banisterfiend> Mon_Ouie: cool
vipaca has joined #ruby
<banisterfiend> Mon_Ouie: what do u mean by 'fight fire with fire' ? :P
<Mon_Ouie> Fight monkey patch with monkey patch
theRoUS has joined #ruby
<banisterfiend> Mon_Ouie: oh ok, are you not working on larme any more?
<Mon_Ouie> I'm not doing anything
JNZ` has joined #ruby
<banisterfiend> Mon_Ouie: what? i thought u were working on the pry gui? or not really doing that either?
sam113101 has joined #ruby
eldariof has joined #ruby
BruceZu has joined #ruby
davidpk has joined #ruby
sam113101 has joined #ruby
LMolr has joined #ruby
rohit_ has joined #ruby
rohit has joined #ruby
dql has joined #ruby
fmcgeough has joined #ruby
<Tasser> banisterfiend, pry gui? dafuq
minver has joined #ruby
<minver> Is it bad practice to use double bang in ruby? to convert a value to a boolean?
<Tasser> minver, don't overuse it
<Tasser> but it's not that bad
davidd___ has joined #ruby
<minver> Tasser: ok, thanks
<apeiros_> it's imo worse to bleed out internal data structures
yeggeps has joined #ruby
tobym has joined #ruby
dbgster has joined #ruby
looopy has joined #ruby
yoklov has joined #ruby
twinturbo has joined #ruby
strnx has joined #ruby
<Tasser> minver, apeiros_ is usually right
weasels has joined #ruby
twinturbo has joined #ruby
otters has joined #ruby
chimkan has joined #ruby
otters has joined #ruby
KL-7 has joined #ruby
vereteran has joined #ruby
sacarlson has joined #ruby
zetm has quit ["ERC Version 5.3 (IRC client for Emacs)"]
JNZ has joined #ruby
tommyvyo has joined #ruby
jmeeuwen_ has joined #ruby
KL-7 has joined #ruby
LMolr has joined #ruby
badelat has joined #ruby
zeninfinity_ has joined #ruby
badelat has joined #ruby
Eartz has joined #ruby
Jackneill has joined #ruby
LMolr has joined #ruby
td123 has joined #ruby
bwlang has joined #ruby
KillerFox has joined #ruby
bwlang_ has joined #ruby
cha1tanya has joined #ruby
fbernier has joined #ruby
sekretskwerl has joined #ruby
<sekretskwerl> anyone think there would be a data integrity issue with putting 10-15 users on a single Fiber?
jlebrech has joined #ruby
jcromartie has joined #ruby
foo-bar- has joined #ruby
drake10 has joined #ruby
<Tasser> context?
`brendan has joined #ruby
liluo has joined #ruby
<sekretskwerl> something like a telnet server, where there's a text input, server calculates response, sends back
<sekretskwerl> its actually websockets
<sekretskwerl> but with potentially hundreds of users, I don't want to assign a fiber to everyone
<sekretskwerl> i'm afraid it'll use up too much memory
lorandi has joined #ruby
nacengineer has joined #ruby
_null has joined #ruby
_null has joined #ruby
linoj has joined #ruby
zommi has joined #ruby
fayimora has joined #ruby
dv310p3r has joined #ruby
netrealm has joined #ruby
crankycoder has joined #ruby
zommi has joined #ruby
fase has joined #ruby
crankyco_ has joined #ruby
nemesit has joined #ruby
wvdschel has joined #ruby
choffstein has joined #ruby
pastjean has joined #ruby
chico has joined #ruby
theRoUS has joined #ruby
become33 has joined #ruby
snearch has joined #ruby
zommi has joined #ruby
gregorg_taf has joined #ruby
jleitgeb has joined #ruby
sspiff has joined #ruby
sspiff has joined #ruby
cpruitt has joined #ruby
RORgasm has joined #ruby
josephwilk has joined #ruby
fayimora_ has joined #ruby
pu22l3r has joined #ruby
ABK has joined #ruby
wvdschel has joined #ruby
josephwilk has joined #ruby
mikeric has joined #ruby
mrwalker has joined #ruby
jesly has joined #ruby
zommi has joined #ruby
mdw has joined #ruby
Foxandxss has joined #ruby
mcwise has joined #ruby
daniel_hinojosa1 has joined #ruby
Drewch has joined #ruby
polysics has joined #ruby
robkinyon has joined #ruby
drknus has joined #ruby
gidogeek_ has joined #ruby
carlyle has joined #ruby
dv310p3r has joined #ruby
phantomfakeBNC has joined #ruby
bluenemo has joined #ruby
CheeToS has joined #ruby
chimkan_ has joined #ruby
kevinbond has joined #ruby
Sailias has joined #ruby
KL-7 has joined #ruby
nikhil_ has joined #ruby
phantasm66 has joined #ruby
centipedefarmer has joined #ruby
bbttxu has joined #ruby
dhruvasagar has joined #ruby
zommi has joined #ruby
chson has joined #ruby
n1x has joined #ruby
gauloises has joined #ruby
geekbri has joined #ruby
theRoUS has joined #ruby
nikhil___ has joined #ruby
kvirani has joined #ruby
kpshek has joined #ruby
wmoxam has joined #ruby
zommi has joined #ruby
mafolz has joined #ruby
sspiff has joined #ruby
KL-7 has joined #ruby
mr789 has joined #ruby
<mr789> has anyone done the ruby association certification?
wyhaines has joined #ruby
<shevy> mr789 no and never should
chimkan has joined #ruby
<mr789> im wondering if it would help me to get more work as a contractor
<mr789> wondering if its reputable?
<shevy> the real problem is that ruby is not like java
bluenemo has joined #ruby
<mr789> yeah...
<mr789> but neithers php and you got zend certification which counts a lot
csavola has joined #ruby
<banisterfiend> mr789: write a good open source project
<banisterfiend> mr789: that's what gets you noticed, not passing little tests
<banisterfiend> mr789: recruiters in particular look at your github profile
<banisterfiend> mr789: if you have some popular projects, you often get an email telling them they want to offer u a job
<mr789> i actually dont use ruby anymore outside contracts so i dont generate ideas for that anymore
<shevy> see that is the problem
<shevy> it may be easier to stay in phplandia
<shevy> that way only people who use ruby stay in ruby
<banisterfiend> mr789: well come up with some ideas :) something impressive attracts attention and distinguishes you from the generic, mediocre mob
zommi has joined #ruby
<vipaca> I keep getting /usr/lib/ruby/1.8/pstore.rb:349:in `dump` after upgrading from 1.8.4 to 1.8.7
dv_ has joined #ruby
<vipaca> Maybe this is because of old rails see stack at http://pastie.org/3685691
axl__ has joined #ruby
<shevy> cool
<shevy> that you are brave enough to try and upgrade like that :)
dekroning has joined #ruby
Ryougi_Shiki has joined #ruby
<dekroning> what's the difference between Singleton and class with only Static methods ?
strife25 has joined #ruby
<shevy> there are no static methods in ruby, you can change every method at runtime
lateau has joined #ruby
<banisterfiend> shevy: 'static method' is another name for class metho
<banisterfiend> method
<vipaca> shevy: its worth a shot
dkamioka has joined #ruby
<vipaca> shevy I can't really tell if this is a rails issue or a ruby issue
<shevy> vipaca whatever it is, it is calling some rails specific packages
<shevy> actionpack passenger ...
<vipaca> yeah but the exit is in pstore which I figure doesn't work the same as back in 1.8.4
<shevy> if you dont need the old gems, you could always get rid of /usr/lib/ruby/gems/, install the latest rubygem and then the up-to-date gems
<shevy> could be too
<vipaca> So more than likeley Rails assumes pstore
<shevy> TypeError (Trainingtype can't be referred):
lockweel has joined #ruby
WhereIsMySpoon has joined #ruby
<dekroning> shevy: yeah sorry I should have said "class method vs singleton"
<vipaca> functionality form 1.8.4 and kaboom
<WhereIsMySpoon> hey, I have this: https://gist.github.com/2226652 why when i type stuff when prompted I dont get any response?..
alx- has joined #ruby
MrGando has joined #ruby
<WhereIsMySpoon> the main loop is in play()
<shevy> dekroning I think both are more or less the same. but folks use class methods much more often, when they define a module or class, the class method is usually defined at that time too
falena has joined #ruby
mdw has joined #ruby
<dekroning> shevy: reason i'm asking, is that I also thought that they we're the same, but I can't think about what really is the difference
<shevy> well you can modify an object at runtime every time
<shevy> changes are specific to that object
Sailias_ has joined #ruby
<shevy> when you add a class method to class File though, everyone who uses that will benefit (or suffer) from that change
<shevy> WhereIsMySpoon I had a look but this is way too long code.
madh_ has joined #ruby
<WhereIsMySpoon> shevy most of it you dont need to look at
<shevy> WhereIsMySpoon always use pp after input to make sure you have proper input
dv310p3r has joined #ruby
<WhereIsMySpoon> shevy - if i pp input i just get what i typed with "" around it
td123 has joined #ruby
<shevy> yeah now you know you have input
<WhereIsMySpoon> shevy - https://gist.github.com/2226717 i cut out all the code that i dont need you to look at
<shevy> so why is your code not processing it further
<shevy> I would use loop {
<WhereIsMySpoon> i thought there was no difference
<shevy> what did you type
<WhereIsMySpoon> help
bglusman has joined #ruby
<WhereIsMySpoon> and status
<shevy> and it enters the help method?
<WhereIsMySpoon> neither works
become33 has joined #ruby
<WhereIsMySpoon> nothing happens in either case
<shevy> well ok first thing first
<shevy> when you reach case foo
rbanffy has joined #ruby
<shevy> always make sure ALL modifications were already done ok?
<shevy> do not make:
sterNiX has joined #ruby
<shevy> case bla.ble.yada.hahaha {|f| f.strip}
<shevy> that is just terrible
<WhereIsMySpoon> eh
<shevy> var = 5
<shevy> case var
bglusman has joined #ruby
<shevy> nothing else there ok?
<WhereIsMySpoon> oh
<WhereIsMySpoon> ok
<shevy> case input.downcase! <-- ok now you know that you wont do this anymore
<WhereIsMySpoon> ah now i removed that
<WhereIsMySpoon> it works fine
<WhereIsMySpoon> S:
<WhereIsMySpoon> why
<shevy> does not matter, just dont do things like that anymore
<WhereIsMySpoon> okay
<shevy> always keep things so simple that your grandma gets bored looking at them
<WhereIsMySpoon> lol
<shevy> you can use loop do but I like the visual block at {}
<shevy> I usually put the case/when into its own method though
<shevy> and insert that into loop
<shevy> loop {
<shevy> get_user_input
<shevy> }
<shevy> that reads much nicer than do/end imo
<shevy> loop do
<shevy> get_user_input
<shevy> end
<shevy> ewwwwww
<WhereIsMySpoon> *shrug*
<WhereIsMySpoon> makes no difference to me
<WhereIsMySpoon> and i write a lot of shell scripts
<WhereIsMySpoon> so im used to it
fearoffish has joined #ruby
<matti> shevy: I prefer do end
<vipaca> shevy it seems like the class is not loaded when pstore attempts to persist
jbpros has joined #ruby
<shevy> matti ewwww that is too verbose man
<matti> shevy: I know :<
<matti> shevy: I blame my sick brain.
<shevy> do you also like the -> operator
<matti> In Ruby? ;]
<shevy> yeah
<WhereIsMySpoon> there's a -> operator in ruby?
<shevy> yeah
<matti> Yeah
<matti> 3x yeah
<WhereIsMySpoon> yea?
<WhereIsMySpoon> :p
<shevy> matz added it after drinking sake
<WhereIsMySpoon> whats it do
<WhereIsMySpoon> lol
<shevy> it is some shortcut
<shevy> I believe of Proc.new.call or something like th at
<WhereIsMySpoon> sounds handy but very un-ruby-ish
jbpros has joined #ruby
<shevy> before_save :do_awesome, if: -> { its_awesome_time?(Time.now) }
<shevy> yeah
<shevy> I wont use it myself
<shevy> I am also not sure what matz is doing
<shevy> perhaps he finally reached the point where he is outta ideas
<matti> shevy: Its the hipster environment at heroku ;p
<matti> shevy: Messes with his mind.
<shevy> :(
<shevy> we need a younger matz
jgarvey has joined #ruby
grifx has joined #ruby
<grifx> #ruby-fr
<WhereIsMySpoon> that is a channel
<WhereIsMySpoon> ;D
bryricker1 has joined #ruby
<shevy> lol
<shevy> let's all join there and speak english
TheTFEF has joined #ruby
<WhereIsMySpoon> shevy - is there an actual technical reason why case input.whatever wont work?
<Mon_Ouie> shevy: -> is just a literal for lambda-style procs
<WhereIsMySpoon> and you'd have to do input.whatever!; case input
<shevy> WhereIsMySpoon man you modify the variable and act on it
arvidkahl has joined #ruby
<Mon_Ouie> if input.whatever doesn't return input, those two expressions produce different results
<WhereIsMySpoon> ahhh yea
<WhereIsMySpoon> input.whatever! will just modify inout, not return it
<WhereIsMySpoon> makes sense
<WhereIsMySpoon> :)
<vipaca> shevy believe it or not I got
<vipaca> shevy I had to call require explicitly on the model
iocor has joined #ruby
rippa has joined #ruby
philipp has joined #ruby
interopcop has joined #ruby
<interopcop> can someone explain this? https://gist.github.com/2226874 you can't push a hash to an array, but you can push a variable which is a hash to an array?
theRoUS has joined #ruby
theRoUS has joined #ruby
<shevy> interopcop did you try to use with () too?
<interopcop> shevy - no and I shall!
<WhereIsMySpoon> cant you omit () if you dont have any params?
<interopcop> - that works!
<shevy> you must always try to look at ruby code the way the ruby parser tries to
<WhereIsMySpoon> o.o
<interopcop> ok ok I get it I guess
<shevy> WhereIsMySpoon arent you the one who uses () on methods ;)
<shevy> help()
<WhereIsMySpoon> shevy yes because calling a method without () looks ugly
<interopcop> it's not easy for tuby to see that {"a" => "b"} is a hash when it's a param to push
<shevy> hehehe
<WhereIsMySpoon> if i just put help withou tbrackets
<WhereIsMySpoon> what is it?
<WhereIsMySpoon> a method, variable, accidently uncommented comment?
<WhereIsMySpoon> nobody knows
<rippa> methods with empty () are ugly
yoklov has joined #ruby
<shevy> WhereIsMySpoon but the ruby parser can find out
<WhereIsMySpoon> rippa so you prefer to call methods without ()?
<rippa> WhereIsMySpoon: sure
<shevy> the only two things I can think of is:
<shevy> (a) a method
<WhereIsMySpoon> shevy yes but someone who looks at it a few months later cant
<shevy> (b) a local variable
<WhereIsMySpoon> i just think that ruby tries to be explicit
<rippa> and that's where naming comes in
<WhereIsMySpoon> and self-documenting
<WhereIsMySpoon> so i will help it
<WhereIsMySpoon> by not being ambiguous
<deryl> just use a particular style and stick with it
<rippa> and local vars don't have a broad scope
<WhereIsMySpoon> deryl - thats what i intent to do
<WhereIsMySpoon> *intend
<WhereIsMySpoon> :)
<WhereIsMySpoon> we can argue about () and no (), do/end and {} forever
<deryl> and whatever someone else tells you doesn't matter. I personally think that adding () on empty is ugly as well, but not going to shoot someone for making it explicitly clear
havenn has joined #ruby
<WhereIsMySpoon> :)
<deryl> personal style. even the guides say you can decide for yourself, just be consistent.
<WhereIsMySpoon> aye, consistency is good
<canton7> I try and keep by the style of not adding them, but there are times when that results in hopelessly unclear code, so I break style in those cases
tatsuya_o has joined #ruby
<deryl> like i don't add () to puts. I do to printf. if there are params I add, if there aren't ii don't - is that a good style? I don't know but its something I use consistently.
<deryl> but i totally get what you mean about is it a var, a method? what?
lockweel has joined #ruby
<WhereIsMySpoon> aye
<shevy> waaaag
<WhereIsMySpoon> actually thats true i dont add () to puts
<shevy> printf with () !
<WhereIsMySpoon> hmn ^^
<canton7> one bit of advice I read was that if the method's trying to behave like a variable or a language construct (e.g. puts, attr_reader, etc), then no brackets. otherwise add 'em
<WhereIsMySpoon> attr_reader is a method?
<shevy> it creates a method
<WhereIsMySpoon> and the other attr_xs?
<WhereIsMySpoon> hm
<WhereIsMySpoon> i see
<shevy> they create methods too, attr_accessor combines attr_writer and attr_reader
<WhereIsMySpoon> yea
<shevy> there is also attr I think but I never use it
<rippa> they are methods and they create methods
<WhereIsMySpoon> cool
<deryl> shevy: yeah was going to say thats just a meta isn't it?
<deryl> the attr_accessor
<shevy> yeah I am using rippa's sentence
<rippa> public private and protected are methods too
maletor has joined #ruby
<WhereIsMySpoon> eh
<deryl> ehh?
<WhereIsMySpoon> theyre keywords
<deryl> yeah
<rippa> no
<rippa> methods
<WhereIsMySpoon> ..
<WhereIsMySpoon> maybe explain a little?
<WhereIsMySpoon> :)
<rippa> try this
<rippa> method(:private)
<deryl> rippa: can you point to that in the docs? (or nm, i'll take the time to hunt that down)
<rippa> and you get a method object
<WhereIsMySpoon> er
<WhereIsMySpoon> <_>
<deryl> hrmm even ri private is unclear
etehtsea has joined #ruby
joast has joined #ruby
jconnolly has joined #ruby
<deryl> well except for the 2nd line: private(symbol, ...) -> self
<deryl> WhereIsMySpoon: http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Classes see down at Declaring Visibility
<WhereIsMySpoon> deryl i know what visibility is
chimkan has joined #ruby
<deryl> "It is interesting that these are not actually keywords, but actual methods that operate on the class, dynamically altering the visibility of the methods, and as a result, these 'keywords' influence the visibility of all following declarations until a new visibility is set or the end of the declaration-body is reached."
<deryl> no no ya knucklehead
<deryl> I was pointing out the spot to drop to.
<WhereIsMySpoon> oh
<WhereIsMySpoon> hm
<WhereIsMySpoon> interesting
<deryl> yeah, i was believing they were keywords too.
<WhereIsMySpoon> sorr y:D
lkba has joined #ruby
<deryl> methods that 'act' like keywords i guess is the best way to describe what they do (?)
ephemerian has joined #ruby
<WhereIsMySpoon> i wonder if its the same for java
<deryl> no clue personally
<deryl> brb, ciggie time
<deryl> smoker and i HATE the smell of cig in the house
brngardner has joined #ruby
jgrevich has joined #ruby
mwmanning has joined #ruby
<shevy> lol
<shevy> what I hate is that when others smoke, the smell covers my clothes :(
<shevy> and hair
jgrevich has joined #ruby
jgrevich has joined #ruby
rtdp has joined #ruby
arvidkahl has joined #ruby
jgrevich has joined #ruby
jgrevich has joined #ruby
flagg0204 has joined #ruby
chimkan has joined #ruby
<deryl> yeah my mom is like that too :)
<matti> shevy: There is worse.
<deryl> i try to stay outside for a little bit after i smoke to let it air off. doesn't get all of it but it does cut iit down some.
<matti> shevy: Try to kiss a smoker girlfriend.
<deryl> matti: hehe
<matti> shevy: Things like that cause inpotence.
<deryl> matti: what? you don't like kissing ashtrays? :)
<matti> ;p
<deryl> hehe
<shevy> haha
<WhereIsMySpoon> ewwww
<WhereIsMySpoon> apparently in vb.net and c# you can declare keywords as variable names
<WhereIsMySpoon> :S
chimkan_ has joined #ruby
<shevy> there is a lot of insanity in the world
<WhereIsMySpoon> who would ever want to do that
<WhereIsMySpoon> unless they wanted to burn in hell
<WhereIsMySpoon> :L
<shevy> hmm
<shevy> sometimes it is cargo cult
<WhereIsMySpoon> ?
mdw has joined #ruby
<shevy> to try and keep people interested in a language
<shevy> imagine if the bulk of them moves to other languages
<shevy> the Ada effect
<shevy> or the COBOL effect
<deryl> :shudder:
<shevy> lately also called the Perl 6 effect :D
<WhereIsMySpoon> trololo
<WhereIsMySpoon> :p
<shevy> it's nothing but the truth
<deryl> I tried to learn ADA onc a long time ago.. wow thats a scary language. Tried to learn COBOL too because my wife at the time programmed in it. will never ever attempt that again
<shevy> it just takes a long time for programming languages to really die
<shevy> cool
<shevy> a hacker wife
<shevy> does she use ruby?
<deryl> we haven't talked in over 10 years. not a freakin clue
<deryl> if she wasn't the mother of my kids, I'd hope she died.
<shevy> oh man
<deryl> just can't bring myself to think that these days. she gav me two beautiful children
<shevy> do they program?
<WhereIsMySpoon> awwww
<WhereIsMySpoon> :p
<deryl> my son does.
<deryl> found that rather amazing
<WhereIsMySpoon> halfway there then
<deryl> :)
<WhereIsMySpoon> just whip..i mean coerce the othe rone
<shevy> in ruby?
<WhereIsMySpoon> ;P
<deryl> my daughter is the typical 'girl'. dresses, boys (shotgun time!), ect
<deryl> shevy: no, C and C++
<WhereIsMySpoon> shotgun time?
<WhereIsMySpoon> thats quite heavy to start with
<WhereIsMySpoon> but whatever floats yer boat
<deryl> WhereIsMySpoon: she's my daughter. NO ONE is good enough for my little girl
<WhereIsMySpoon> :)
<WhereIsMySpoon> hahaha
<WhereIsMySpoon> i see
<shevy> k your boy is lost I think, perhaps your girl will pick up ruby
<WhereIsMySpoon> rofl
<deryl> shevy: hah!
<deryl> WhereIsMySpoon: i'm the same way with my nieces :)
MasterIdler has joined #ruby
<WhereIsMySpoon> i see ^^ i dont have any nieces or daughters ^^
<shevy> well I guess for programming they need be at least ten years
<deryl> 2 of them are 14, and 1 13 and they have boyfriends. I'd gladly bury the boys in the backyard if they hurt em.
<Stefunel> OMG...just took a look at some cobol code on the wiki page...
<deryl> (my one sister has 5 girls and 1 boy, the other 2 girls)
g0bl1n has joined #ruby
<WhereIsMySpoon> 6 kids?
<WhereIsMySpoon> O.O
<WhereIsMySpoon> that must take some effort
<deryl> she wanted a big family. I thought *I* did at one time. All I have to do is look at the crazy life of my sister with that many kids and realize NO I DON'T!
|RicharD| has joined #ruby
<|RicharD|> hi to all
RORgasm has joined #ruby
blueadept has joined #ruby
<|RicharD|> where i can find a good tutorial that explain me the difference
<deryl> yeah, my sister is a freakin master at organization and scheduling hehe
<|RicharD|> between variable global
<Stefunel> 4.5 years of being pregnant...
<|RicharD|> or variable istance
<|RicharD|> ?
<dagobah> Anyway to get column and line no. of an exception in MRI Or would I have to look at rubinius?
<|RicharD|> i don't have know well the diference :(
<WhereIsMySpoon> |RicharD|, a global variable has the scope of the entire file, an instance variable has only the current scope (i.e. { } or do end )
<WhereIsMySpoon> er wait no
<deryl> |RicharD|: $bar is a global and accessible by anything anywhere. @bar is an instance variable and only accessible by the instance of a class
<WhereIsMySpoon> instance variable is aclass variable
<WhereIsMySpoon> not a local variable
<WhereIsMySpoon> ><
<deryl> WhereIsMySpoon: no @@bar is a class
dcolebatch has joined #ruby
<deryl> @bar is instance
<multibot_> Maybe you meant: arr bf bid bug faq map part yarr
<WhereIsMySpoon> blar
<WhereIsMySpoon> thats what i meant
<deryl> oh hehe
<|RicharD|> wait guys :D
<|RicharD|> so
<|RicharD|> with @var i can use it only when i istance the class
<|RicharD|> right ?
robotmay has joined #ruby
<WhereIsMySpoon> yes
<deryl> right
<|RicharD|> $var everywhere also
<deryl> right
<|RicharD|> if i don't istance the class
<WhereIsMySpoon> $var can be used in any class
<WhereIsMySpoon> or outside classes
<|RicharD|> true ?
<deryl> well even if you instance the class
<|RicharD|> ok also if i don't istance class
<|RicharD|> while
<|RicharD|> @@var ?
<deryl> sec
<WhereIsMySpoon> @@var is a class variable, like static in java
<deryl> whats the link to zenspider's quick ref? thinkt hat decalres it fairly well iirc
<WhereIsMySpoon> i think
<WhereIsMySpoon> zenspider is good
Kichael has joined #ruby
<|RicharD|> umh ok
<WhereIsMySpoon> i wish people wouldnt put symbols in the front of their names
<deryl> gimme a sec. I'm trying to track down something a bit better in explaining
<WhereIsMySpoon> it makes them effort to type
<WhereIsMySpoon> :p
<|RicharD|> very thanks deryl :)
albemuth has joined #ruby
<deryl> i take it english isn't your native language :)
francisfish has joined #ruby
<|RicharD|> i want know and learn well ruby before of learn rails (yes)
<deryl> good call
<WhereIsMySpoon> ^
axl_ has joined #ruby
<WhereIsMySpoon> a good rule for global variables, is, if you think you want to use them, think a couple more times about why you want to use them before just plonking one in
<deryl> WhereIsMySpoon: good point.
gidogeek has joined #ruby
<WhereIsMySpoon> you shouldnt ever *need* a global variable
<|RicharD|> it's very good
<WhereIsMySpoon> that goes for a singleton too
bbttxu has joined #ruby
<|RicharD|> the link of WhereIsMySpoon
<WhereIsMySpoon> singletons are just huge globals
<deryl> I was using a global in one of my projects because I didn't properly understand how to use class vars and thought i HAD to use a global.
arvidkahl has joined #ruby
<WhereIsMySpoon> :D
<deryl> luckily i got taught in here
<WhereIsMySpoon> deryl - im sure you got a telling off here :p
<deryl> ohhhh yeahhhhh
<WhereIsMySpoon> XD
<|RicharD|> anyway i don't think of use global var
<deryl> but it was worth it. :)
<WhereIsMySpoon> its good to know what they are
<|RicharD|> also because i want work with rails
<WhereIsMySpoon> even if you dont use it
<|RicharD|> yeah i know
<|RicharD|> :)
<deryl> richard you can use globalls in rails too. but the same thign applies
jgrevich has joined #ruby
jgrevich has joined #ruby
<deryl> they are available anywhere anytime and can be modified from anywhere. NOT what you want in 99.999% of cases
<WhereIsMySpoon> they can seem to be much less effort than making a proper solution
<deryl> globalls? hah!
<WhereIsMySpoon> but you end up with horribly un-oo code
<WhereIsMySpoon> with class a using a global in class x for no good reason
<WhereIsMySpoon> other than you were lazy
<WhereIsMySpoon> a thing that is ok to do is have globals that you know will never change, if they are actually needed across several classes
<WhereIsMySpoon> if they aren't modified then it's really no biggie to have them as globals
<WhereIsMySpoon> if it saves a lot of effort otherwise
<WhereIsMySpoon> whatcha reckon deryl
<shevy> the thing is this
<deryl> i wouldn't use globals then. I'd use a constant. the problem is that you can't protect the globals by default
<shevy> in ruby, if you dont need something it is almost always better to not use it
<deryl> they're designed TO be modifiable anywhere
brianpWins has joined #ruby
<WhereIsMySpoon> deryl - i mean as in something thats set once then used in other places but not modified
<|RicharD|> (sorry if i don't reply but i'm reading the links :D)
<WhereIsMySpoon> its cool :) we're just rambling
baroquebobcat has joined #ruby
<WhereIsMySpoon> rambleramble
<deryl> WhereIsMySpoon: that to me speaks as a constant
<any-key> anyone ever mess with MacRuby?
<deryl> there isn't a way you can ensure that the global isn't modifiable i don't think
<WhereIsMySpoon> deryl - i mean you know you arent going to changei t
<WhereIsMySpoon> as in it's a user-defined variable thats set at the beginning as a constraint by the user
<WhereIsMySpoon> and then doesnt change
<deryl> i'd really have to think on that.
Indian has joined #ruby
ChampS666 has joined #ruby
jkprg has joined #ruby
<WhereIsMySpoon> oh? i dont think it's that big of an issue, although there's probably some better way to do it
<deryl> i've a healthy fear of globals these days thanks to the channel hehe
<WhereIsMySpoon> it isnt a burning issue
<WhereIsMySpoon> haha
<WhereIsMySpoon> yea
<rippa> and what if someone else reads your code?
<WhereIsMySpoon> what if they do?
<rippa> he has to guess where is that global changed
<rippa> or is it
<deryl> good point
<WhereIsMySpoon> then i can put a documentation piece above them
<WhereIsMySpoon> saying they are set once and never changed
<rippa> then why don't you use a constant?
<WhereIsMySpoon> rippa - because theyre set by the user of the program when they're asked for constraints
<shevy> hmm is it odd that I want a .to_i! method for a string? like:
<shevy> "55".to_i!
refriedchicken has joined #ruby
<rippa> WhereIsMySpoon: if they are set oen time, it's ok
<WhereIsMySpoon> rippa they are
<rippa> that's what constants are for
<rippa> to be set one time
<rippa> Constant = user_data
<any-key> shevy: it's rubyy, create your own!
<WhereIsMySpoon> rippa i think i have a different thing of what a constant is
<shevy> or rather... x = "55"; x.to_i!
<WhereIsMySpoon> what i have at the top of my ruby file is $rows;$cols
<any-key> shevy: crack open String and add it
<WhereIsMySpoon> which are set by the user
<shevy> any-key, I used to have lots of modifications, but you have to bundle these whenever you distribute them, that becomes just cumbersome :(
<WhereIsMySpoon> rippa - what are you suggesting i have instead
<rippa> why not Rows and Cols ?
<any-key> mo $ mo problems
<WhereIsMySpoon> rippa - whats the difference?
<any-key> shevy: email matz
<shevy> hehe
<rippa> WhereIsMySpoon: anything beginning with capital letter is a constant
<rippa> (unless it's a method)
<WhereIsMySpoon> a constant is a type?
<rippa> no
<rippa> but classes are constants
<WhereIsMySpoon> what is constant then
<WhereIsMySpoon> like the final keyword in java?
<rippa> A = 1; A = 2 #you get warning
<WhereIsMySpoon> yea
<WhereIsMySpoon> are constants global?
<rippa> kind of
<WhereIsMySpoon> kind of?
<rippa> you can make sure to use top-level constant
<any-key> constants aren't really enforced, it's just not in your best interests to change them
<rippa> ::Constant
<WhereIsMySpoon> rippa how would i use constants then
chimkan_ has joined #ruby
<rippa> WhereIsMySpoon: if you define constant inside of class/module, it shadows top-level one
<WhereIsMySpoon> if i have my Game class with initialize inside it
<WhereIsMySpoon> in which i want Rows and Cols to be set
dv310p3r has joined #ruby
<deryl> don't you get get an error if you attempt to reassign a const?
<rippa> ::Rows = data; ::Cols = data
<rippa> deryl: a warning
<WhereIsMySpoon> dynamic constant assignment
<WhereIsMySpoon> doesnt run
<deryl> yeah just tried it in pry
<deryl> just got the warning no error
<rippa> what doesn't run?
<any-key> is pry worth learning?
fr0gprince_mac has joined #ruby
<WhereIsMySpoon> def initialize()
<WhereIsMySpoon> ::Rows = 6
<WhereIsMySpoon> ::Cols = 6
<WhereIsMySpoon> ..
<interopcop> how do you know when to use chop and when to use chomp? i.e. "test ".chomp is returning "test " because the last char in that string is a \n. "test ".chop works fine
<Mon_Ouie> You can't assign a constant in a method
<deryl> any-key: *I* believe so. better irb than irb. and with the additional gems like pry-nav, pry-stack_explorer ect it makes an excellent debugger
<rippa> damn, true
<Mon_Ouie> def foo; A = 3; end # SyntaxError
<rippa> forgot all about that
<WhereIsMySpoon> soo
<WhereIsMySpoon> how would i use these constants
<WhereIsMySpoon> or am i better off sticking with my globals
<keymone> ::Rows and ::Cols look outrageously out of scope
<any-key> deryl: yeah, it looks awesome, but it's a lot to learn and I'm not sure if the payoff will be worth it for now :P
<any-key> I heard you can do syntax highlighting in it, though
<deryl> ability to whereami, to cd *into* a var ect is awesome
<any-key> whaaat
pu22l3r_ has joined #ruby
<rippa> WhereIsMySpoon: well, use globals, just be careful
<WhereIsMySpoon> that sounds funky
<WhereIsMySpoon> rippa - they're only set once and never changed ever again, only read
<WhereIsMySpoon> and i have one thread
<WhereIsMySpoon> its pretty safe
<WhereIsMySpoon> :)
chimkan_ has joined #ruby
<become33> whats a good IDE for ruby ? with syntax support ?
<WhereIsMySpoon> gedit
<WhereIsMySpoon> :p
bl4ackde4th has joined #ruby
<WhereIsMySpoon> aptana is good
<any-key> RubyMine is popular, but most people prefer using a text editor + terminal
<any-key> aptana is good if you're a fan of eclipse
<WhereIsMySpoon> isnt rubymine the one that uses tcl and tk?
* any-key shrugs
<WhereIsMySpoon> pretty sure it is
<WhereIsMySpoon> *shudder*
<any-key> it's cross-platform, so I wouldn't be surprised
<any-key> hey, don't be hatin on Tcl
<WhereIsMySpoon> lol
<WhereIsMySpoon> why not
<WhereIsMySpoon> its horrible
<WhereIsMySpoon> as is tk
<deryl> any-key: like this: https://gist.github.com/2227712
<any-key> it's good for what it was designed for...gluing shit together
<WhereIsMySpoon> they need to die out faster ^^^
<become33> Im using aptana , but its not that supportive with syntax it gives syntax but sometime not so much , I want a dedicated ruby IDE
<WhereIsMySpoon> *^^
<WhereIsMySpoon> become33 - netbeans has an eclipse addon in an earlier version
<WhereIsMySpoon> er
<WhereIsMySpoon> netbeans has a ruby addon*
<deryl> notice that 'keys' works because you cd'd into the hash and the keys method is now relative to your location
<any-key> deryl: :O
<keymone> sublime 2
<deryl> netbeans stopped supporting ruby i thought? (officially)
<keymone> sublimetext 2
<keymone> is the king
<WhereIsMySpoon> deryl yes it did
<keymone> of all editors
<any-key> deryl: does the syntax highlighting work well?
<WhereIsMySpoon> become33, im just using gedit and the terminal
<WhereIsMySpoon> works pretty well
<deryl> hardly. TExtMate is definitely better than Sublime2
<any-key> also, mandatory plug for Vim :D
<WhereIsMySpoon> >_>
<deryl> or we can do what we should be doing and state that these are SUBJECTIVE comments
<any-key> lol TextMate will never have splits
<keymone> text mate is not even close to sublime2
<WhereIsMySpoon> become33, there really isn't a "standard" ide for ruby like eclipse is for java
<any-key> Sublime2 looks cool, I'd use it if I weren't a Vim fanatic
<WhereIsMySpoon> or VS is for c++
<deryl> troll elsewhere. you know damned well your comment is subjective opinion.
<keymone> sublime is lightyears faster when doing fuzzymatching file opening
<any-key> the thing about Java is that it somewhat requires an IDE to write effectively
<WhereIsMySpoon> indeed
<rippa> same with C#
<WhereIsMySpoon> its very hard to write java with gedit
<deryl> whatever. go use your king-of-the-hill editor. i'll stick with what works for me (and for a great many others)
<shevy> I want my ruby editor in ruby
<any-key> what with the verbosity and stuff
<rippa> shevy: redcar
<deryl> there is a ruby editor i thought
<deryl> yeah there ya go
<deryl> rippa: uses shoes doesn't it?
<shevy> wants java :(
<become33> shevy: what do u use as ur ruby IDE ?
<shevy> become33, bluefish 1.0.7
davidpk has joined #ruby
<WhereIsMySpoon> hm i havent heard of that
<keymone> deryl: switched to it long time ago and never went back to text mate even though was using ™ all the time. also tried netbeans, aptana, ruby mine and some others. sublime is just perfect
<become33> is for ruby or ruby n rails ?
<rippa> deryl: no
<shevy> I dont use rails, it is also a "html editor" but I dont use it for html. what is also sad is that version 1.0.7 is better than 2.2.x :(
twqla has joined #ruby
Vert has joined #ruby
<become33> old version is good than new version shevy ?
<shevy> sublime does not require java?
<shevy> yeah become33 :(
robkinyon has quit [#ruby]
<shevy> they made so many changes which I hate
<WhereIsMySpoon> bluefish looks like dev-cpp
<shevy> finding now is on-top, used to be a popup box
<any-key> Vim is surprisingly good for rails dev with one or two plugins
species has joined #ruby
chimkan_ has joined #ruby
<any-key> I'm currently working on a giant rails app >.>
<deryl> any-key: i like vim for ruby/rails as well as TM. snipmate goes a long way towards that
<any-key> I haven't used snipmate, but NERDTree + FuzzyFinder + vim-rails makes me happy :D
<any-key> learning about "gf" working for views and other shit blew my mind :O
<deryl> yeah nerdtree is pretty good and useful
<WhereIsMySpoon> shevy you used dev-cpp?
<shevy> no
<WhereIsMySpoon> oh ok nvm then
<any-key> how do I enable syntax highlighting in pry?
<WhereIsMySpoon> shevy bluefish looks cool
<WhereIsMySpoon> ill try it out
<any-key> ah it won't do it as you type
chimkan_ has joined #ruby
ymasory has joined #ruby
<deryl> yeah doesn't do that. don't know of any way to enable taht either
<deryl> err that
<shevy> I am trying out sublime right now
<become33> shevy: how can I config bluefish for ruby syntax ?
ghvandoorn has joined #ruby
<any-key> what are a couple of features I should look into first?
<any-key> oops, class is over
<shevy> become33 dunno, it works out of the box fine for me (the 1.x, they changed something in 2.x which I cant deal with)
nikhgupta has joined #ruby
<shevy> one thing I notice in sublime, I cant seem to redefine key bindings
<shevy> in bluefish I can
<shevy> :/
fluffyPCP has joined #ruby
fluffyPCP has quit [#ruby]
chimkan__ has joined #ruby
<shevy> I forgot how they use the ruby colouring... I think via ctags
francisfish has joined #ruby
<shevy> or perhaps not hmm
bluenemo has joined #ruby
bluenemo has joined #ruby
ringotwo has joined #ruby
antonishen has joined #ruby
ggapol has joined #ruby
heftig has joined #ruby
<canton7> shevy, in sublime text 2, they're under preferences -> key bindings?
artOfWar has joined #ruby
<ggapol> hi
<ggapol> anyone else having this kind of problem: NoMethodError (undefined method `ascii_only?' for nil:NilClass):
nickmabry has joined #ruby
<canton7> ggapol, it means that the object you're calling ascii_only? on is nil, and not the object you were expecting it to be
<ggapol> yes but the thing is there is no line number that says where it was triggered
<shevy> ggapol that cant be. the stack trace always has the line number
apeiros_ has joined #ruby
DrShoggoth has joined #ruby
pastjean has joined #ruby
<ggapol> shevy yes
cloke has joined #ruby
<shevy> in the code, something must have set the object to nil
cloke has joined #ruby
pdtpatrick has joined #ruby
<ggapol> that makes it quite weird bec the error stack has no line number
eywu has joined #ruby
<shevy> that is atypical what you describe
<shevy> you probably have omitted some information, because in typical ruby code, you always get the line number
adeponte has joined #ruby
codezombie has joined #ruby
geekbri has joined #ruby
milkshakes has joined #ruby
_null has joined #ruby
_null has joined #ruby
artOfWar has joined #ruby
adeponte has joined #ruby
nickmabry has joined #ruby
<canton7> ggapol, paste your full error message?
<canton7> (including the whole stack trace)
centipedefarmer has joined #ruby
nect has joined #ruby
zakwilson_ has joined #ruby
schovi has joined #ruby
ABK has joined #ruby
apok has joined #ruby
deception_ has joined #ruby
<deception_> Anyone here have experience with web scraping via Mechanize or something similar?
ABK has joined #ruby
<deception_> I have used Mechanize but now the site has JS and Mechanize can't handle it properly.
<any-key> iirc the creator of Mechanize hangs out around here...or maybe that was #ruby-lang
<shevy> ever since mechanize moved to nokogiri it no longer worked for me :<
<deception_> I've used the Python version of it but i assume it's similar
<deception_> I'll try ruby-lang ty
apeiros_ has joined #ruby
<shevy> hmm inside a class...
io_syl has joined #ruby
<shevy> self.[]=(key, value)
<shevy> that should call the []= method
<shevy> can I omit the "self." ?
<shevy> :\
mcwise has joined #ruby
luckyruby has joined #ruby
greenarrow has joined #ruby
<Mon_Ouie> self[key] = value
<apeiros_> store(key, value)
<apeiros_> for some reason, I prefer that over self[]
jlogsdon has joined #ruby
<any-key> okay so I want to write a silly ruby thingy that displays track information and a progress bar for the currently playing song in itunes or whatever media player
<any-key> what's the best way to "refresh" and handle terminal resizing?
chimkan has joined #ruby
bluOxigen has joined #ruby
<any-key> and saying "use curses" isn't an option :P
<shevy> I'd never say that
<jlogsdon> any-key: i don't know how to get the number of rows for a shell, but you could watch the output of `tput cols` to see if the width updates
<jlogsdon> (that would only work on *nix, and it is techically curses xD)
<jlogsdon> technically*
Norrin has joined #ruby
fayimora has joined #ruby
havenn has joined #ruby
<any-key> yeah, *nix is all I care about
<any-key> jlogsdon: that's not a bad idea, system() will make that easy
apok has joined #ruby
<jlogsdon> literally `tput cols`.chomp would work, too
<any-key> what's the Right Way™ to redraw and update terminal stuffs?
yoklov has joined #ruby
<jlogsdon> curses :P
<any-key> just gratuitous use of \b?
<any-key> well, like say for a status thing similar to what wget does
<jlogsdon> ah, yeah \b or... \r i think
<jlogsdon> \r would reset to the start of the line
<any-key> nice, that's perfect
<jlogsdon> and there are ANSI escape codes to "save" cursor pos and then reset to that pos
king313 has joined #ruby
king313 has joined #ruby
<jlogsdon> \e[s and \e[u
t0mmyvyo has joined #ruby
hadees has joined #ruby
<jlogsdon> oh hey, `tput lines` shows you how many rows there are
<any-key> sweet, thanks!
adamkittelson has joined #ruby
Araxia has joined #ruby
mattg7 has joined #ruby
<mattg7> Anybody here can help with some simple programming?
<any-key> nope, we don't program :P
<mattg7> Nobody programs at all?
<mattg7> Know a place to find some!?
<any-key> just kidding, this whole channel is for ruby programming
ringotwo has joined #ruby
<mattg7> Definately in the wrong place when your living in C!
<any-key> how exactly does one "live" in C?
<shevy> miserably
<shevy> constantly shuffling around pointers
<ggapol> canton7, shevy i found the cause, thanks guys
LMolr has joined #ruby
c0rn has joined #ruby
berserkr has joined #ruby
alfism has joined #ruby
ed_hz_ has joined #ruby
chimkan has joined #ruby
<shevy> my grand work today was
<shevy> to write a Configuration class
madh_ has joined #ruby
flou has joined #ruby
nikhgupta has quit [#ruby]
robacarp has joined #ruby
brngardner has joined #ruby
Guest79708 has joined #ruby
<any-key> damn, doing print "hello"; sleep 1; printf "\033[K" doesn't seem to clear the line
Guest79708 has quit [#ruby]
<denysonique> any yardoc users here?
<any-key> ah, printf "\e[2K" does the trick
blueadept has joined #ruby
blueadept has joined #ruby
maletor has joined #ruby
punkrawkR has joined #ruby
paraiso has joined #ruby
sepp2k has joined #ruby
<rippa> any-key: why printf?
<any-key> dunno
paraiso has quit [#ruby]
<any-key> print works too
shadoi has joined #ruby
bglusman has joined #ruby
<any-key> dunno why this doesn't work though: https://gist.github.com/2228398
<any-key> it draws a new line each time I resize rather than clearing the current one and redrawing
<shadoi> any-key: you're not telling it to clear the current one
Morkel has joined #ruby
<sepp2k> any-key: Because puts prints a newline at the end.
<any-key> my bad, I had changed it to print in the version I'm running right now, it still has issues though
<any-key> I updated the gist
MrGando has joined #ruby
CannedCorn has joined #ruby
pastjean has joined #ruby
<CannedCorn> hey guys how do you store class types in a hash
<CannedCorn> so that if you had an object you could quickly say get me the value for the class of this object
mrsolo has joined #ruby
<any-key> Object.class
<shadoi> CannedCorn: obj.class, not sure what you're asking though
<sepp2k> any-key: \e[2K only clears the line, it does not move the cursor to the beginning of the line (\r does that).
<any-key> sepp2k: after printing the first line the cursor should be at the end of that line, right?
<CannedCorn> i want to essentially do a switch statement
<CannedCorn> it seems odd that you can do case obj
<sepp2k> any-key: Right.
<CannedCorn> and it just automatically assumes its the class
nerdy_ has joined #ruby
<shadoi> CannedCorn: it uses ===
<shadoi> read about Comparable
<CannedCorn> oh right
<any-key> sepp2k: in that case the clearing the current line will clear the "="*cols in theory
<lopex> Comparable is about <=>
<any-key> hmmm yeah doing print "\r\e[2K" doesn't appear to work either
<sepp2k> any-key: Well, actually it will be at the beginning of the next line.
Vert has joined #ruby
<any-key> maybe print "\e[1A" will work
<sepp2k> Because the cursor is one after the last-written character. And if the last written character is the last one in the line, the cursor will be at the beginning of the next line.
<any-key> ah okay
<shadoi> lopex: derp, you're right.
<sepp2k> You can move one up, then clear the current line.
<shadoi> lopex: I always assumed it was in that module…
<lopex> % String === "a"
<multibot_> true
<any-key> that appears to almost work
blooberr has joined #ruby
<any-key> I get some odd wraparound
williamcotton has joined #ruby
become33 has joined #ruby
n3m has joined #ruby
gauloises has joined #ruby
mengu has joined #ruby
<any-key> aha! using puts "="*cols works
<any-key> there we go
dominikh has joined #ruby
RORgasm has joined #ruby
stkowski has joined #ruby
moted has joined #ruby
ascarter has joined #ruby
gianlucadv has joined #ruby
refriedchicken has joined #ruby
aces23up has joined #ruby
<aces23up> any large code base developers here, I have a question, I'm a single developer and getting quite a large code base, and wanted to bring someone on.. What is the normal way of training someone on a whole code base?
<aces23up> seems really impossible.
bluenemo has joined #ruby
bluenemo has joined #ruby
<shevy> hmm it is a lot of work either way
<any-key> give them a reasonable project that involves using pieces from all over the codebase
<any-key> tbh it takes about a full month to bring someone up to speed
<shevy> any-key, the codebase could suck immensely though
<any-key> the best way to learn is getting your hands dirty
<shevy> hehehe
sectionme has joined #ruby
<shevy> and then do a massive rewrite? :)
gauloises has joined #ruby
shruggar has joined #ruby
adeponte has joined #ruby
manizzle has joined #ruby
pastjean has joined #ruby
<any-key> always
eldariof has joined #ruby
<shevy> hmm
<shevy> my current strategy is to
<shevy> rather than make a big rewrite, to make small-ish rewrites you know
<shevy> use a new class here and there
n3m has joined #ruby
gauloises has joined #ruby
davidcelis has joined #ruby
dv_ has joined #ruby
deception_ has quit [#ruby]
shruggar has joined #ruby
dv_ has joined #ruby
pu22l3r has joined #ruby
gauloises has joined #ruby
zodiak has joined #ruby
cha1tanya has joined #ruby
<Tasser> how would you add something to two arrays? @ary0 << @ary1 << something produces strange results
<apeiros_> @ary0.concat(@ary1) ?
<multibot_> Unknown command, try @list
<apeiros_> unless you want a nested array…
<norm> if you want to add the same value to two arrays … [ary0, ary1].each{|a| a << 123}
foo-bar-_ has joined #ruby
hasrb has joined #ruby
<Tasser> norm, yep, kind of
rushed has joined #ruby
lorandi has joined #ruby
arkonova has joined #ruby
MrGando has joined #ruby
ghostlines has joined #ruby
nfluxx has joined #ruby
<ghostlines> hi all, been reading up a lot on almost finished the book I'm busy with. Anyone knows some good resources to use to practice Ruby, or should I just start hacking away at some code?
<pzol> ghostlines: ruby koans
d3c has joined #ruby
<deryl> tryruby.org and pzol's suggestion
<pzol> ghostlines: http://rubykoans.com/
artm has joined #ruby
<robacarp> ghostlines: http://projecteuler.net/
<robacarp> lots of neat puzzles.
<ghostlines> thanks will check them both out!
ThatDudeGuy_ has joined #ruby
cespare has joined #ruby
raj has joined #ruby
MrGando has joined #ruby
<raj> why isn't the (phat + z*z...) line returned? http://paste.ofcode.org/BQzSQeRipC6SCwVHqxyCRJ
ThatDudeGuy_ has joined #ruby
<robacarp> good god man.
havenn has joined #ruby
<robacarp> I'm not going to try and parse that formula but whatever it evaluates to is being returned.
Wizecode4 has joined #ruby
<shadoi> I just threw up a little in my mouth.
<davidcelis> cool math, bro
shruggar1 has joined #ruby
crankycoder has joined #ruby
arkonova has joined #ruby
<shevy> multibot_ die
maletor has joined #ruby
artm has joined #ruby
<davidcelis> @shevy
ehqhvm has joined #ruby
<multibot_> Unknown command, try @list
<davidcelis> lol rly
<shevy> urks
Cache_Money has joined #ruby
<davidcelis> @list
<shevy> wat
<shevy> haskell?
<shadoi> lol
<davidcelis> why is this here
<davidcelis> @dice
<multibot_> unexpected end of input: expecting number
<davidcelis> ಠ_ಠ
<shevy> lol
<shevy> @dice rm -rf /
<davidcelis> @dice 1d20+4
<multibot_> unexpected "r": expecting number
<multibot_> 1d20+4 => 12
stkowski has joined #ruby
<davidcelis> Damnit, I missed
<shevy> so a bot that can roll die
kirun has joined #ruby
<shevy> breathtaking!
chimkan has joined #ruby
<robacarp> @list
pastjean has joined #ruby
ryannielson has joined #ruby
<davidcelis> @dummy eval rm -rf /usr
<multibot_> Come on, let's all slap shadoi
<multibot_> dummy
<shevy> @pretty
<shevy> @pretty davidcelis
<multibot_> davidcelis
<shevy> lol
<shevy> @slap davidcelis
* multibot_ places her fist firmly on davidcelis' jaw
<davidcelis> @eval rm -rf /usr
<davidcelis> COME ONNNN
<robacarp> @free
<davidcelis> DO IT
<multibot_> Pattern match failure in do expression at Plugin/Free/FreeTheorem.hs:54:20-34
<shevy> oh man
<robacarp> o_O
<shevy> .hs files
<ninor> @boner
<multibot_> Unknown command, try @list
<shevy> @eval monad in monad
<robacarp> @karma shevy
<multibot_> shevy has a karma of 0
<davidcelis> @karma+ davidcelis
<multibot_> davidcelis's karma raised to 1.
<davidcelis> owned
<shevy> isn't there a weakness haskell has?
<robacarp> @log
<multibot_> Maybe you meant: bug do let msg yow
* Junebouvier removes the 'David' hilight.
<shevy> @undo eval
<multibot_> eval
<davidcelis> Junebouvier: Hello, David.
<shevy> @undo rm -rf /
<multibot_> (rm - rf /)
<davidcelis> Junebouvier: THERE CAN BE ONLY ONE.
<robacarp> wat
<Junebouvier> davidcelis: how did you know?!
<shevy> hmm why is it using ()
<shevy> @undo "rm -rf /"
<multibot_> "rm -rf /"
<shevy> @undo eval "rm -rf /"
<multibot_> eval "rm -rf /"
<robacarp> @redo rm -rf /
<multibot_> Maybe you meant: do read todo undo
<shevy> hehehe
<shadoi> Someone dig out the ban hammer.
<davidcelis> @undo `rm -rf /`
<shevy> @ban shadoi
<multibot_> Parse error at "-rf" (column 5)
<multibot_> Maybe you meant: bf bid brain bug faq map run wn
<shevy> cool idea davidcelis!
<davidcelis> shevy I GOT IT.
<robacarp> @bug
<davidcelis> OMFGGGG
<shevy> that was quite close lol
<ninor> @eval exit
<davidcelis> @undo `System.exit`
<multibot_> Parse error at end of input
<shevy> davidcelis, do you know haskell?
<robacarp> @pl
<multibot_> (line 1, column 1):
<multibot_> unexpected end of input
<multibot_> expecting white space, "()", natural, identifier, lambda abstraction or expression
<davidcelis> shevy: i'm learning now hahahahha
<shevy> hahaha
<robacarp> @pl exit;
<multibot_> (line 1, column 5):
<multibot_> unexpected ";"
<multibot_> expecting letter or digit, variable, "(", operator or end of input
<robacarp> @pl exit()
<multibot_> exit ()
<davidcelis> @undo `System.exitWith(1)`
<multibot_> Parse error at "(1)`" (column 17)
<davidcelis> uggghhhh
<davidcelis> come no
<davidcelis> come on
<robacarp> @pl System.exitWith(1)
<multibot_> System.exitWith 1
<shevy> @pl exit ()
<multibot_> exit ()
<shevy> @undo `rm -rf /`
<multibot_> Parse error at "-rf" (column 5)
<shevy> hmmm
<davidcelis> @undo `return ()`
<robacarp> @pl e
<shevy> @eval `rm` -rf /
<multibot_> Parse error at "()`" (column 9)
<multibot_> e
<shevy> @undo `rm` -rf /
<multibot_> Parse error at end of input
<shevy> @undo `rm` "-rf /"
<multibot_> (`rm` "-rf /")
workmad3 has joined #ruby
jamesbrink1 has joined #ruby
waxjar has joined #ruby
jamesbrink has joined #ruby
jamesbrink has quit [#ruby]
<robacarp> @eval ☹
<davidcelis> @undo `exit()`
<multibot_> Parse error at "()`" (column 6)
<davidcelis> @undo `exit`
<multibot_> Parse error at end of input
<davidcelis> @undo `putStr "hi"`
<multibot_> Parse error at ""hi"`" (column 9)
<davidcelis> @undo `putStr 'hi'`
<multibot_> Improperly terminated character constant at "'hi'`" (column 9)
<davidcelis> @undo `putStr('hi')`
<multibot_> Parse error at "('hi'..." (column 8)
<robacarp> @undo `putStr "hi"`
<multibot_> Parse error at ""hi"`" (column 9)
<davidcelis> fuck
<robacarp> @bug
francisfish has joined #ruby
luxurymode has joined #ruby
<davidcelis> fuck this bot
<davidcelis> it needs to be more vulnerable
<davidcelis> :(
<shevy> you know what is funny
<shevy> trac is in python, but the haskell bot links to it
PaciFisT has joined #ruby
yxhuvud has joined #ruby
<shevy> programming languages these days have no more pride
voodoofish430 has joined #ruby
MrGando has joined #ruby
<drake10> I have ruby programs that read files and write to files. When the files have accent characters like "é", it is converting to \ufffd. Is there a way to handle this?
<davidcelis> drake10: Is your ruby program set to UTF-8 encoding
sacarlson has joined #ruby
Maxou56800 has joined #ruby
<davidcelis> # encoding: utf-8
<drake10> No how do I set it?
<davidcelis> just like that
<davidcelis> at the top of the file
<davidcelis> it's a magic comment
<davidcelis> full of magic and wonder
<davidcelis> and magic
<drake10> davidcelis: I will try it and let you know how it goes
gauloises has joined #ruby
<shevy> I hate magic
<shevy> it is often synonymous with "nobody knows what is going on"
<shevy> magic is like the arch enemy of an engineer
Wizecode4 has quit [#ruby]
<davidcelis> shevy: lol, rails
<shevy> well
<shevy> designed by monkeys
<davidcelis> @lol
<multibot_> Maybe you meant: do let pl url yow
<shevy> though that may be an insult to monkeys
<shevy> multibot_, DIE!!!
<shevy> @quit
<multibot_> Not enough privileges
<shevy> @exit
<multibot_> Maybe you meant: elite quit
<shevy> wtf
<robacarp> @elite
lorandi has joined #ruby
<multibot_> Say again?
<shevy> @quit eval
<multibot_> Not enough privileges
<davidcelis> @sudo @quit
<multibot_> Maybe you meant: do todo undo
<robacarp> @elite quit
<multibot_> quIT
<davidcelis> @quit sudo
<multibot_> Not enough privileges
<davidcelis> @quit @sudo
<multibot_> Not enough privileges
<shevy> @elite my mama has a pyjama
<multibot_> my mAM4 HA5 4 pYJa/\/\4
<davidcelis> @fuck @you
<multibot_> I know nothing about @you
* marienz raises an eyebrow
<shevy> it's useful for leetspeak :)
<davidcelis> @fuck
<multibot_> I can not handle empty facts.
<davidcelis> what.
<shevy> @elite marienz has eyebrows looking like fat, sick worms
<robacarp> @f
<multibot_> mari3nz HA5 EY3bRowz0rz L00xING lixE fa+, sIcx \/\/OR/\/\z
<multibot_> Maybe you meant: fact fact-cons fact-delete fact-set fact-snoc fact-update faq farber flush foldoc forget fortune fptools free freshname ft . ? @ bf v
<robacarp> @fortune
<multibot_> Couldn't find fortune file
<davidcelis> fortune | cowsay | lolcat
artm has joined #ruby
<marienz> when did this into #bot-playground?
<marienz> turn into, even
<shevy> @elite <marienz> when did this into #bot-playground?
<multibot_> <MaRIENz> wH3n DId 7|-|iS IN+O #8Ot-plAYgR0und?
<davidcelis> marienz: when we found out how to make it get parse errors and tried to get it to rm -rf /
<shevy> having it use rm would be so sweet
<shevy> @undo rm FreeTheorem.hs
<multibot_> rm FreeTheorem.hs
<robacarp> makes me wish I'd learned haskell
<tdubellz> davidcelis: i'm sure that's a positive thing to do, right?
<robacarp> @undo `ls`
<multibot_> Parse error at end of input
<shevy> hmm
<davidcelis> tdubellz: if you bring a spammy bot into this channel, yes
<shevy> at least it tries to parse it
<tdubellz> oh i see, have any idea who's owner it is
Bonkers has joined #ruby
<davidcelis> no, it's not registered under a freenode account
<shevy> dunno
<shevy> someone who uses more haskell than ruby I would assume
<davidcelis> ruby irc bots are better
erratic has joined #ruby
<davidcelis> Cinch FTW
<robacarp> bot is from http://8.17.80.234/
dbgster has joined #ruby
ehqhvm has quit [#ruby]
<lopex> oh, shall I make it leave ?
<shevy> lopex how!
<erratic> resources(:execute => "blah")
<erratic> how does that work
<erratic> what is :execute =>
<robacarp> erratic: its a hash
<lopex> shevy: how or now! ?
<robacarp> How
<shevy> lopex well, both :>
<shevy> erratic it is a hash
<lopex> sure
<shevy> resources({:execute => "blah"})
multibot_ has quit [#ruby]
<shevy> ruby just allows to omit things sometimes
<erratic> I see
<erratic> thank you
<erratic> whats the colon thugh
<erratic> though*
<Mon_Ouie> Specifically, as the last argument of a method call or the last element of a hash
<Mon_Ouie> :foo is a Symbol literal
bbttxu has joined #ruby
<erratic> hmm
<Mon_Ouie> (And I never know what to say when I want to explain what a Symbol is.)
* erratic googles
trivol has joined #ruby
artm has joined #ruby
<robacarp> Mon_Ouie: explaning symbols is a difficult task. I just say, its like the number 1, self defining and always with the same definition.
gidogeek_ has joined #ruby
<yxhuvud> ad hoc enums? :)
<shevy> it sure confuses newcomers
<drake10> davidcelis: It did not work I put exactly # encoding: utf-8 at the top of each ruby file
linoj_ has joined #ruby
<havenn> I like _why's explanation: "You could say a symbol is a bit easier on the computer. It’s like an antacid. The colon indicates the bubbles trickling up from your computer’s stomach as it digests the symbol. Ah. Sweet, sweet relief."
nowthatsamatt has joined #ruby
nowthatsamatt has quit [#ruby]
<erratic> lol
<any-key> so, I just wasted waaaaay too much time writing this: https://gist.github.com/2229326
jhowarth has joined #ruby
<any-key> it displays info on whatever is playing in iTunes as well as a nifty progress bar for the song
<any-key> and it updates in real time
hooper has joined #ruby
<davidcelis> drake10: Sorry it might have to be # encoding: UTF-8
<havenn> any-key: Sick. I like it!
<davidcelis> case-sensitivity
<drake10> davidcelis: trying that, and there is a space between # and e ??
<davidcelis> drake10: Yes
<havenn> any-key: Gunna cut it into a gem?
tobym_ has joined #ruby
nowthatsamatt has joined #ruby
<any-key> havenn: maybe at some point, I want to make it modular so you can set the format for the output easily
<any-key> kind of like how the DateTime to_s thingy works with % substitution
<any-key> and then make it modular so people can add support for other music players
<drake10> davidcelis: Nope, still Français is doing Fran\ufffd\ufffdais
Norrin has joined #ruby
hasrb has joined #ruby
n1x has joined #ruby
axl_ has joined #ruby
<davidcelis> drake10: Try to check what "Français".encoding outputs
<shevy> it outputs a baguette!
<erratic> thats what nikki minaj does
<davidcelis> Expected results: #<Baguette:0xc39d2fb87>
<drake10> davidcelis: ruby-1.9.2-p290 :001 > "Français".encoding
<drake10> => #<Encoding:UTF-8>
nowthatsamatt has quit [#ruby]
<davidcelis> That's not a Baguette
<erratic> sad face
<davidcelis> Français?
<Mon_Ouie> What about your env variables? What's $LANG? $LC_CTYPE?
<drake10> davidcelis: when I pasted Français".encoding in rails console it dit that
<davidcelis> interesting
axl_ has joined #ruby
<drake10> Mon_Ouie: If you are asking me, they both printed nil
<drake10> Mon_Ouie: ruby-1.9.2-p290 :002 > $LANG
<drake10> => nil
<drake10> ruby-1.9.2-p290 :003 > $LC_CTYPE
<drake10> => nil
linoj has joined #ruby
<davidcelis> no
<davidcelis> ENV["LANG"]
<davidcelis> ENV["LC_CTYPE"]
n1x has joined #ruby
<drake10> davidcelis: ruby-1.9.2-p290 :004 > ENV["LANG"]
<drake10> => "en_US.utf-8"
<davidcelis> huh
<drake10> ruby-1.9.2-p290 :005 > ENV["LC_CTYPE"]
<drake10> => "en_US.utf-8"
<davidcelis> mine was Lana
<erratic> Ive got nikki minaj stuck in my head now
Asher has joined #ruby
<erratic> "if I had a dick I would pull it out and piss on em"
<erratic> wow, just wow.
<shevy> very revealing
<erratic> and insightful
<shadoi> any-key: you could get all the properties in one call using https://gist.github.com/2229482
`Kevin has joined #ruby
Norrin has joined #ruby
n3m has joined #ruby
fowl has joined #ruby
<any-key> shadoi: perhaps
shruggar has joined #ruby
<shadoi> any-key: and there's this to simplify the data conversion: http://www.apeth.com/rbappscript/04appobject.html
<shadoi> waste more time! :)
foo-bar- has joined #ruby
ycy_ has joined #ruby
<ycy_> hi there
<ycy_> I am writing a method that cycle on an Array and then returns a value, if found. How can I return a value inside a .each block?
<any-key> shadoi: hah I forgot about that library, I played around with it at one point
dzhulk has joined #ruby
axl_ has joined #ruby
chson_ has joined #ruby
<fowl> ycy_, def whoop(arr); arr.each { |x| yield x if x % 2 == 0 } end
libertyprime has joined #ruby
<fowl> whoop([1,2,3,4,5,6,7,8,9,10]) do |x| puts x end
<ycy_> ok so I have to use yield inside a block, and not return
<rippa> just use #find
<rippa> arr.find {|i| i == x}
<fowl> o yea
<fowl> u just looking for one item do waht rippa syas
<rippa> for several, use #select
<erratic> candy is dandy
denysonique__ has joined #ruby
workmad3 has joined #ruby
<any-key> whoop I updated it to show the time: https://gist.github.com/2229326
<any-key> oops, formatting for current times is wrong
dnyy has joined #ruby
crankycoder has joined #ruby
strife25 has joined #ruby
mengu has joined #ruby
mengu has joined #ruby
Cache_Money has joined #ruby
<shevy> dumdedum
becom33 has joined #ruby
<erratic> pooppooppoop
<becom33> http://pastebin.com/LjsYSauM in this I wanna get the page status . how can I get that /
<becom33> ?
centipedefarmer has joined #ruby
<shevy> becom33, you should look at official docu
<RubyPanther> Somebody should implement Ruby in go
<shevy> there you would see examples:
<shevy> puts res.code # => '200'
<shevy> puts res.message # => 'OK'
<shevy> puts res.class.name # => 'HTTPOK'
<shevy> it's all on that page becom33
<shevy> RubyPanther, I want a RubyOS!
<becom33> but there is no user-agent help in that
<becom33> shevy:
eignerchris has joined #ruby
<shevy> becom33 did you try .code
<RubyPanther> shevy: I'm waiting for mRuby before I try my hand at RubyOS
<shevy> what is mRuby?
<becom33> .code ?
<shevy> response = http.request(req)
<shevy> response.code
<RubyPanther> mRuby is what Matz has been doing the last few years. It is Ruby for embedded systems, with a new bytecode called RiteVM https://twitter.com/#!/nahi/status/165311764337139712/photo/1
<shevy> hmm
dbgster has joined #ruby
<RubyPanther> currently pre-release because it is being funded by the Japanese government, and under the terms only the companies helping to build it (a bunch of manufactures with robots) can see it until they get to 1.0 and submit a business plan. Then when the red tape is finished, we get the public source release.
senj has joined #ruby
<erratic> does chef-client stop syncing when someone is ssh'd into it?
ScottNYC has joined #ruby
jgrevich has joined #ruby
MrGando has joined #ruby
become33_ has joined #ruby
becom33_ has joined #ruby
jcromartie has joined #ruby
tijmencc has joined #ruby
ThatDudeGuy_ has joined #ruby
<erratic> make a joke and I will sigh and you will laugh and I will cry
Houdini has joined #ruby
<becom33_> shevy: . how can I put a user-agent in this ?
ycy_ has quit [#ruby]
flu- has quit [#ruby]
RORgasm has joined #ruby
sebastorama has joined #ruby
Boohbah has joined #ruby
<shevy> becom33_ not sure, you must find the option, a hash I believe
tatsuya_o has joined #ruby
madmax_ has joined #ruby
klyoshlgawa-work has joined #ruby
Casey105 has joined #ruby
twixmix has quit [#ruby]
bawer has joined #ruby
Asher has joined #ruby
kacperix has joined #ruby
wefawa has joined #ruby
<kacperix> Hi
ringotwo has joined #ruby
Bosma has joined #ruby
<kacperix> I have an instance of a class, and some variable with string value. I'm looking for solution how to set attribute of class which name is set under variable.
wilmoore has joined #ruby
ephemerian has joined #ruby
Tijmen has joined #ruby
<ekaleido> offtopic but is there a way in vi to delete duplicate lines in a file?
<any-key> yy yanks the current line, p pastes it
<any-key> so yyp is what you want
<fowl> kacperix, so myobj.some_attr is a class? or the name of a class like :File ?
<robacarp> ekaleido: hmm. I've done that before, but it wasn't trivial.
refriedchicken has joined #ruby
<kacperix> first one. myobj.some_attr
<kacperix> fowl
<kacperix> fowl: and variable = 'some_attr'
<kacperix> wna to do sth like myobj.variable = 'some value'
<ekaleido> :g/\%(^\1$\n\)\@<=\(.*\)$/d
<robacarp> bless you
<wefawa> he is looking to do something like myobj.set_value_of_attribute(variable, "some value")
<fowl> define a method like def variable=(value) @variable = value end
<shevy> he is doomed
<any-key> ekaleido: I totally read what you typed wrong, I thought you wanted to duplicate lines in a file :P
visof has joined #ruby
<robacarp> ekaleido: are the dupped lines necessairly going to be next to each otehr?
<ekaleido> yeah, in this case they all were
dzhulk has quit [#ruby]
bosborne has joined #ruby
<robacarp> oh, that simplifies the problem greatly then.
axl_ has joined #ruby
Bosma has joined #ruby
brianosborne has joined #ruby
kvirani has joined #ruby
<ekaleido> now heres a real rookie question, but i have a file with maybe 320 lines. i need to replace spaces in each line with an underscore
<ekaleido> im pretty sure its a one-liner but i cant brain today at all, and my books are at home
brianosborne has quit [#ruby]
<fowl> gsub /\s/, ?_
<yxhuvud> File.read.tr ' ', ':'
<yxhuvud> well, no, but you get the idea
<robacarp> ekaleido: in vim or ruby?
<ekaleido> ruby
justinmcp has joined #ruby
virunga has joined #ruby
ringotwo has joined #ruby
g0bl1n has joined #ruby
linoj has joined #ruby
skrewler has joined #ruby
havenn_ has joined #ruby
<Boohbah> ekaleido: check out the -p flag
<Boohbah> or -n
mdw has joined #ruby
trivol has joined #ruby
emmanuelux has joined #ruby
lolsuper_ has joined #ruby
lolsuper_ has joined #ruby
xissburg has joined #ruby
xissburg has quit [#ruby]
ameba has joined #ruby
<Boohbah> ekaleido: ruby -pe '$_.tr! " ", "_"' < file
delinquentme has joined #ruby
<delinquentme> how would I redefine how string interpolate works in ruby? specifically I'd like to replace the addition of a line return at the end of an interpolation
shadoi1 has joined #ruby
shadoi1 has quit [#ruby]
shadoi1 has joined #ruby
<Boohbah> try print instead of p or puts?
<Boohbah> maybe chomp?
jlogsdon_ has joined #ruby
stringoO has joined #ruby
StevenR12 has joined #ruby
DrShoggoth has joined #ruby
bbttxu has joined #ruby
Cache_Money1 has joined #ruby
fbernier has joined #ruby
<RubyPanther> gource is amazing, I am watching the history of hobix right now... very entertaining stuff
sdeobald has joined #ruby
raj has joined #ruby
blueOxigen has joined #ruby
<fowl> RubyPanther, how did you get un-ignored
<fowl> its been so quiet and serene these past few months
<RubyPanther> What an impressively impolite character you have.
<fowl> dont get upset, its just the innanet
<RubyPanther> Maybe you should take yourself more seriously.
<fowl> right
<fowl> back on the ignore list you go, you little rascal you
eywu has joined #ruby
jlogsdon has joined #ruby
raj has quit [#ruby]
DrShoggoth has joined #ruby
workmad3 has joined #ruby
katya^ has joined #ruby
<Boohbah> like peas in a pod
<katya^> hello, I have a bit of an issue with 'gem' (1.8.somethingsomethingnotsure), basically, if I run gem install <somegem>, it just hangs, with no output at all, and it's not clear if it's doing anything or not (remote system, so no disk noises or anything)
<katya^> is it _supposed_ to behave like that?
<katya^> i've tried waiting it out but it just takes forever regardless of the gem in question
<Beoran__> katya^, no that's ot how it is supposed to work
blischalk has joined #ruby
<katya^> mmk, so any ideas as to what could cause it?
kpshek has joined #ruby
<workmad3> katya^: try 'gem install <somegem> -V' to get more info about where it's hanging
fbernier has joined #ruby
<Beoran__> hmm what version of truby and gem is this and did it ever work before?
<katya^> thanks, I was looking for something like that
<Beoran__> workmad3, that's handy :)
<workmad3> Beoran__: verbose mode is always good :)
<katya^> ruby 1.8.7, gem 1.3.6
<workmad3> (I had to look up whether it was -v or -V with 'gem install -h' though... that's an even more useful one to remember ;) )
<workmad3> katya^: that's quite an old version of ruby and gem there
<katya^> mm
<katya^> well ruby is hosted on dreamhost, I'm not sure if I can install a totally local copy or not
<katya^> as for gem, I can probably get a newer one
<workmad3> ah, dreamhost...
<workmad3> are you planning on hosting a rails site or similar?
<katya^> yes, but stuck with shared hosting for now at least
<workmad3> if it's a simple app, I'd suggest checking out heroku
Vert has joined #ruby
internet_user has joined #ruby
yoklov has joined #ruby
tatsuya_o has joined #ruby
eph3meral has joined #ruby
timonv has joined #ruby
<eph3meral> is there any major difference between || and "or"
<yxhuvud> precedence
<eph3meral> also between ! and not
<eph3meral> ah
<workmad3> eph3meral: precedence again
froy has joined #ruby
<eph3meral> I'm guessing that || and && have the higher precedence relative to their natural language counterparts?
<eph3meral> shadoi, thanks
lopex has quit [#ruby]
Guedes has joined #ruby
Guedes has joined #ruby
<Boohbah> another perspective
<katya^> i think I see the problem
<katya^> it's just taking forever, that's all
<Boohbah> shared hosting is always a problem :)
<katya^> yes, but so affordable ;p
<shadoi> katya^: depends how much you value your time.
<katya^> mm, I don't disagree
<shadoi> katya^: http://prgmr.com/xen/
<Boohbah> another rails host
<Boohbah> maybe a bit overboard for small things though :)
<katya^> yeah
<shadoi> prgmr is awesome if you know what your'e doing.
<katya^> not looking at moving just yet, but I'll take a note of it
<workmad3> katya^: heroku is a cheap alternative for small sites ;)
<workmad3> (it's free for a single dyno... starts to ramp up costs quickly if you need more than that though)
<shadoi> heroku is nice
<shadoi> sometimes I just want a damn shell though. :)
<katya^> no shell is no good at all
<workmad3> shadoi: you can get to shell-like things with the cedar stack :)
<shadoi> workmad3: not a shell-like thing, A SHELL!
<shadoi> and real root.
<workmad3> shadoi: yeah, nothing like root :) but you don't get that on shared hosting anyway
<katya^> unless you're crafty
<shadoi> workmad3: 'swhy I linked prgmr.com
<workmad3> shadoi: and by 'shell-like' it's a shell, but you can't get an interactive one
scientes has joined #ruby
<workmad3> katya^: yeah... but too 'crafty' and they go and kick you off :P
<workmad3> I don't like rocking the boat on shared hosting...
<shadoi> most have throttling for everything now
mike___ has joined #ruby
<katya^> after you've already made off with personal information and perhaps financial data from a bunch of startup companies databases
<workmad3> katya^: only the crap startups that are still using shared hosting ;)
<mike___> Super basic question. How do I define a boolean method such as def method(param)?
<shadoi> def method?(param)
<katya^> hey, my old company was on shared hosting! still is, actually, I think
<katya^> and they've been a startup for like 20 years
<workmad3> katya^: would you trust them with anything? :)
become33 has joined #ruby
becom33 has joined #ruby
<shadoi> mike___: by convention boolean methods don't take parameters though...
<mike___> thank you
<katya^> nope, but they still manage to be worth enough to let people retire
<shadoi> mike___: nevermind, ignore that. :)
<mike___> shadoi, I wonder why..
<shadoi> I need more coffee.
<mike___> ok
<mike___> :)
<workmad3> katya^: still... back to heroku - it doesn't give you a massive amount of control, but it makes it really easy to deploy rails apps, and you can frequently do a lot more regarding installing gems and getting recent versions than you can on shared hosting :)
wmoxam has joined #ruby
tvw has joined #ruby
<katya^> well I will look at it in a few months, perhaps, but I think I can probably get a local installation of ruby, or maybe nag at them to upgrade or install a second optional version
<katya^> one thing about dreamhost that doesn't suck is their support reps are generally pretty good
shruggar has joined #ruby
become33 has joined #ruby
tweeKula has joined #ruby
geekbri_ has joined #ruby
pdtpatrick_ has joined #ruby
chanakya- has joined #ruby
bengl has joined #ruby
<eph3meral> dreamhost is a lot *less* sucky than they used to be
<eph3meral> that's still not saying much
eph3meral has quit ["Leaving"]
swarley has joined #ruby
thone has joined #ruby
<katya^> lol
<katya^> on the upside at least I don't have to visit them in person like I do with telus to do any maintenance
philcrissman has joined #ruby
jbw has joined #ruby
francisfish has joined #ruby
Muz has joined #ruby
iamjarvo has joined #ruby
DrShoggoth has joined #ruby
banisterfiend has joined #ruby
ascarter has joined #ruby
td123 has joined #ruby
gidogeek_ has joined #ruby
tatsuya_o has joined #ruby
apok_ has joined #ruby
chimkan has joined #ruby
a_meba has joined #ruby
chimkan has joined #ruby
mdw has joined #ruby
<any-key> say I wanted to read keystrokes from the commandline with ruby
<any-key> any suggestions?
<any-key> I've found a few things via google but they all suck
<Boohbah> gets
<any-key> sans-echo
<any-key> aka reading arrow keys, etc
<any-key> and don't say ncurses!! :P
<Boohbah> any-key: getc or get_byte
JNZ` has joined #ruby
<any-key> that will still echo to the screen, though
francisfish has joined #ruby
<any-key> also, getc requires a newline
<any-key> I'll scan through the IO docs though
<Boohbah> any-key: though the way he does it seems like a kludge
RORgasm has joined #ruby
<any-key> yeah, I've run across some similar stuff, I was hoping there was some non-kludg-y way of doing it
<any-key> I don't think there is though
swarley has joined #ruby
<any-key> I don't really need this anyways I guess :P
<Boohbah> any-key: there is the -n flag when calling the interpreter, maybe that will work
eywu has joined #ruby
<any-key> perhaps
<any-key> hmmm I dunno about that
Nss has joined #ruby
<shadoi> I've used it a bunch, works great.
<shadoi> I didn't do anything super advanced though, just simple menus and questions.
<any-key> what I was looking for was just reading raw keystrokes
delinquentme has joined #ruby
centipedefarmer has joined #ruby
<shadoi> getc is what you want then
<any-key> but it's all good, I think I'm going to scrap that feature, it's really not going to be worth it
<any-key> yes and no
<shadoi> it doesn't require newline
williamcotton_ has joined #ruby
souuell has joined #ruby
<any-key> the main issue I realized is blocking...the feature is really silly and adds practically nothing
<any-key> but thanks for all of the suggestions
Vert has joined #ruby
<fowl> any-key, while (chr = $stdin.getch) != ?\C-c; print chr; end
<fowl> oh yeah require 'io/console'
<fowl> if you change it to print chr.ord you can see you capture arrow keys
kf8a has joined #ruby
<any-key> fowl: that's the best I've seen so far, thanks
<erratic> template "#{node[:apache][:dir]}/mods-available/php5.conf" do
<any-key> hmmmm to do that concurrently with updating the screen I'd have to fork
<erratic> what does that # do
<any-key> erratic: string interspersal; whatever is inside of #{} is ruby code that gets evaluated and inserted into the string
<fowl> any-key, better not to fork the process you're getting input from
<erratic> I see
<fowl> console input from anyways, or expect crazyness
<any-key> fowl: one just updates the screen, the other would read keystrokes and call some other thing
<shadoi> fowl: where does io/console come from?
<any-key> it's in ruby 1.9.3 apparently
<fowl> shadoi, its new in 1.9.3 but there is a gem for backporting
<shadoi> interesting
G has joined #ruby
king535 has joined #ruby
<any-key> what would be the best way to do that getch shenanigans without blocking?
<any-key> aka doing it concurrently...I'm thinking a fork or something of that nature
bbttxu has quit [#ruby]
become33 has joined #ruby
havenn has joined #ruby
eignerchris has joined #ruby
nacengineer has joined #ruby
^Mike has joined #ruby
<^Mike> If I want to do SSL in ruby, what library can I use? Does it require a compiler?
<any-key> it doesn't require a compiler, but you have to include a list of acceptable CAs, as it doesn't come with any
<^Mike> that's fine, my main restriction is that it cannot require openssl or a compiler
luckyruby has joined #ruby
<any-key> why can't you use openssl?
tatsuya_o has joined #ruby
<any-key> without openssl I don't think you'll get anywhere in ruby
looopy has joined #ruby
<^Mike> Well, we can ship the openssl code, but we won't be able to compile it
MrGando has joined #ruby
<^Mike> And we can't necessarily ship binaries because we don't have access to machines that we can put compilers on. These systems should probably be in a museum, not production :)
nacengineer has joined #ruby
<any-key> the ruby openssl libs are precompiled I believe
<^Mike> nice
<^Mike> ok, thanks!
^Mike has quit ["Leaving"]
v4n_ has joined #ruby
Azure has joined #ruby
<any-key> np
wefawa has quit [#ruby]
<swarley> i have zero idea of what i want to do
chico has joined #ruby
srnty has joined #ruby
Norrin has joined #ruby
davidcelis has joined #ruby
dwon has joined #ruby
stephenjudkins has joined #ruby
<CannedCorn> does anyone know ssl sockets pretty well?
<swarley> uh, i know sockets
<swarley> not so much about ssl sockets
<Boohbah> CannedCorn: they happen on different layers
Guedes has joined #ruby
Guedes has joined #ruby
froy has joined #ruby
tvw has joined #ruby
MrGando has joined #ruby
apok has joined #ruby
Scin has joined #ruby
<fowl> any-key, i dont think you can fork $stdin.getch without getting weird terminal problems
<any-key> fowl: hmmm I dunno how I'll be able to do that and anything else since it blocks
<any-key> unless I find a way to make it work with select or something similar
<any-key> wait, can ruby do the equivalent of select?
tommyvyo has joined #ruby
<fowl> i dunno what select is
jayne has joined #ruby
<fowl> ruby has Array#select
<any-key> in the posix world you can call select with a list of file descriptors for in and out, it blocks until any of those have data
<shadoi> any-key: yes, socket has select
<any-key> hmmm I wonder if I could get that to work for my purposes :P
<shadoi> in fact any IO object has select
<any-key> BOOM
<CannedCorn> yeah i just did this any-key
<CannedCorn> is select portable?
<CannedCorn> i've just tested on mac os x and windows
<any-key> dunno, but I don't really care about windows for this project :P
<CannedCorn> totally works
<CannedCorn> what are you trying to do
<CannedCorn> i'm trying to get some sockets to timeout
<denysonique> hmm
<any-key> crap, this won't work for my purposes
G has joined #ruby
<denysonique> So ruby doesn't allow me to: https://gist.github.com/2231111
<denysonique> do something like that
Scin has quit ["Leaving"]
FreschFN has joined #ruby
<any-key> I need to use an event-driven model, this is starting to get way too complicated for that stupid thing I posted earlier that displays itunes info in the terminal :P
<denysonique> without having to explecitly use a lambda
<any-key> whaaat is that trying to accomplish
<any-key> what is foo, and what is bar?
<any-key> << is an operator that can have any number of meanings
MasterIdler_ has joined #ruby
bricker88 has joined #ruby
mlue has joined #ruby
<bricker88> What's the method that's like Array#shift but returns the array instead of the removed element?
<fowl> :p
<any-key> fowl: that'd work great if I wasn't updating at the interval I am
<swarley> Array.delete_at(0) ?
<swarley> ope
<swarley> no
<any-key> bricker88: shift modifies the original array
<bricker88> swarley: delete_at also returns the removed element
<fowl> :pp
<swarley> yeah i just checked
<any-key> so 1.9.3p0 :004 > a = [1,2,3]; a.shift; a => [2, 3]
<bricker88> any-key: Yes, I know that, just trying to save myself a step if I can
<fowl> a.shift&&a
<fowl> bricker88, a.drop(1)
<any-key> bricker88: array.drop
<swarley> that returns the drop
<fowl> oz yea
<any-key> drop does exactly what you want
<swarley> oh
<swarley> no it doesnt
<swarley> i thought it did
<bricker88> That will do, thank you fowl
<swarley> wtf
<swarley> my bad
<bricker88> haha swarley
<bricker88> thanks anyways
<fowl> if only drop! existed
keymone_ has joined #ruby
<any-key> heh yeah
<swarley> well
Guest_ has joined #ruby
pu22l3r has joined #ruby
<swarley> just did it
<fowl> any-key, you're probably better off separating input/output all together and program it like a client/server
<swarley> [20] pry(main)> k.drop!(1)
<swarley> => [2, 3, 4, 5, 6, 7, 8, 9, 10]
<swarley> [21] pry(main)> k.drop!(1)
<swarley> => [3, 4, 5, 6, 7, 8, 9, 10]
<any-key> fowl: well, here's the program I'm doing this for: https://gist.github.com/2229326
<any-key> so at this point it's just not worth it and adds almost no value
<any-key> but looking into it has taught me a few tricks :P
<fowl> if you gotta use the terminal set up a basic ncurses
<any-key> uuugh I hate ncurses with a passion
<any-key> one of the worst APIs ever created
<swarley> any-key,
<swarley> cmd = "osascript -e 'tell application \"iTunes\" to player state'"
<swarley> `#{cmd}`
<swarley> just do
<swarley> exec cmd
gregorg_taf has joined #ruby
<swarley> nevermind
<swarley> dont do that
<swarley> lol
<any-key> heh
carloshpf has joined #ruby
keymone has joined #ruby
keymone has joined #ruby
<Sou|cutter> after a long day of fiddling with date and time stuff, I have to ask...
<Sou|cutter> why is this api not better? Clearly it lacks, if you look at all the date/time stuff in Rails
<Sou|cutter> one would think that some of rails' extensions could be pulled directly into the standard library
luckyruby has joined #ruby
<any-key> ruby's date and time libraries are much better than those in other langs, at least in my experience
<any-key> but rails does add some cool stuff
<Sou|cutter> I'm not sure I entirely agree about it being better than other languages
<banisterfiend> Sou|cutter: surely there's a gem out there for u
<Sou|cutter> banisterfiend: I appear to be writing it
<banisterfiend> Sou|cutter: are you sure one doesnt already exist?
<any-key> ActiveSupport :P
TandemAdam has joined #ruby
<Sou|cutter> banisterfiend: I am actually writing a gem dealing with time/date stuff and am realizing how much I want to use the rails stuff
<Sou|cutter> but I don't particularly want my gem dependent on rails
<banisterfiend> Sou|cutter: by rails stuff do u just mean ActiveSupport?
<any-key> steal a function here and there
<any-key> the source is available
<Sou|cutter> I do not have an unsolvable problem, merely a gripe.
Drewch has joined #ruby
havenn has joined #ruby
TheTFEF has joined #ruby
looopy has joined #ruby
Guest23951 has joined #ruby
<shadoi> Sou|cutter: in general stdlib moves _much_ slower than other code, and the trend is to break things out of stdlib into separate gems, especially if they need to change quickly. You'll see this start happening more I think.
joltz has joined #ruby
banisterfiend has joined #ruby
bbttxu has joined #ruby
SolarisBoy has joined #ruby
S1kx has joined #ruby
* Sou|cutter nods
pencilcheck has joined #ruby
robotmay has joined #ruby
<Veejay> Stats has a top-level Stats?
<Veejay> +key
nari has joined #ruby
dagnachewa has joined #ruby
sa125 has joined #ruby
csprite has joined #ruby
diegok has joined #ruby
iocor has joined #ruby
Sailias has joined #ruby
<shadoi> Stats is a struct
<shadoi> but that key is weird
<shadoi> agreed
<shadoi> maybe a conversion from XML or something odd
liluo has joined #ruby
hadees has joined #ruby
helichopter has joined #ruby
looopy has joined #ruby
kevinbond has joined #ruby
<swarley> shadoi, there was an issue in how i was initializing it
<swarley> it was taking everything as the first argument
kevinbond has joined #ruby
Natch| has joined #ruby
<shadoi> looks much better :)
<swarley> yes i thought so xD
mdw has joined #ruby
tomzx has joined #ruby
RORgasm has joined #ruby
elake has joined #ruby
senthil has joined #ruby
joppe has joined #ruby
brngardner has joined #ruby
ErraticSeattle has joined #ruby
choffstein has joined #ruby
startling has joined #ruby
s0ber_ has joined #ruby
y3llow_ has joined #ruby
cafesofie has joined #ruby
ZachBeta has joined #ruby
nikhgupta1 has joined #ruby
two- has joined #ruby
pu22l3r has joined #ruby
Clordio_ has joined #ruby
keymone_ has joined #ruby
Nathandim has joined #ruby
Chryson has joined #ruby