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
<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
<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
<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
<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>
"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>
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>
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
<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
<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?
<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
<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."
<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 ?
<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
<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?
<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
<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
<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
<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.