Topic for #ruby is now Ruby programming language || ruby-lang.org || RUBY SUMMER OF CODE! rubysoc.org/ || Paste >3 lines of text in http://pastie.org || Para a nossa audiencia em portugues http://ruby-br.org/
<SullX>
I have no idea how to define that function but thats how I have it running, not as a function
<baniseterfiend`>
SullX: that's weird code
<baniseterfiend`>
you shouldn't really be taking advantage of ivars in main (toplevel) unless it's a really really small script
asobrasil has quit [#ruby]
<SullX>
yes I know, I don't know what I'm doing with functions
<baniseterfiend`>
IMO anyway
<baniseterfiend`>
why not design your program in a more OOP way
<SullX>
can you give me an example?
<SullX>
not sure what you mean
choffstein has joined #ruby
<baniseterfiend`>
SullX: using classes and objects, etc
jonom has joined #ruby
<baniseterfiend`>
rather than using 'functions' at top level with ivars on main ;)
igaiga has joined #ruby
<baniseterfiend`>
SullX: Mon_Ouie will tell u how
igaiga has joined #ruby
jakky has joined #ruby
<SullX>
know of any good reading I could do on this?
ascarter has joined #ruby
<baniseterfiend`>
SullX: you need to learn about 'object oriented programming' so just google that for a fuck tonne of hits :)
kah has joined #ruby
burns180_ has joined #ruby
ryannielson has joined #ruby
x0F__ has joined #ruby
jakky has joined #ruby
<SullX>
baniseterfiend`: wait, I did exactly this. I created my own class "class Monitor" with object @instance = Monitor.new()
<SullX>
??
zakwilson has joined #ruby
Teomari has joined #ruby
<baniseterfiend`>
SullX: but @instance = Monitor.new happens at top level right?
Danielpk has joined #ruby
<SullX>
if that is the same as saying class Monitor is not a subclass of another class then I think so
<baniseterfiend`>
SullX: heheh, get yourself a ruby book :))
<SullX>
I know I need one, but my issue is I get along just fine. I have some fairly complex programs written, albeit I am sure it was done in an ugly way, but they work and do exactly what I need. so I am trying to learn things as I go. any good ruby reference books you can think of?
<td123>
reference? the ruby programming language is a good one imo
kah has joined #ruby
<lectrick>
When you set an @attribute in a class method, is that essentially a class attribute?
<shadoi>
in a class method, it's a class instance variable, which are usually not used.
<shadoi>
because it's confusing. :)
bwlang has joined #ruby
<baniseterfiend`>
SullX: it's important you understand OOP and i dont think that's osmething you can learn just by writing code, i think u need to read at least one overview of teh general ideas
shevy has joined #ruby
gen0cide_ has joined #ruby
lkba has joined #ruby
<SullX>
baniseterfiend`: ok, thanks for your guidance
tommyvyo_ has joined #ruby
sarmiena_ has joined #ruby
caiges has joined #ruby
<sarmiena_>
i'm using ActiveSupport::Concern to create a mixin, but for some reason it's not overriding class methods as i'd expect http://pastie.org/3537640
<sarmiena_>
i know ActiveSupport::Concern is a rails thing, but maybe I can still get some insight
<cout>
steampunkey: of course lambda is a method, and you can call it with empty () if you want
<cout>
steampunkey: but lambda() returns a Proc object
<cout>
and objects are not methods
<steampunkey>
cout: what's that?
<cout>
steampunkey: what's what?
<steampunkey>
Proc
jergason has joined #ruby
<cout>
it's the class of the object that is returned by lambda() and by proc()
<steampunkey>
cout: -_-
shadoi has joined #ruby
<fowl>
cout: you can't call a lambda with (), use .() or [] or .call
sbanwart has joined #ruby
<steampunkey>
cout: yeah, cout. don't be a noob. you can't call it with ()
end3r- has joined #ruby
<steampunkey>
cout: it returns a Proc object, which is an object which it returns
<fowl>
lol wut
<cout>
fowl: I think you need to re-read what I wrote.
tayy_ has joined #ruby
<steampunkey>
fowl: that's how he explained it to me. i was asking the Q
<fowl>
o my bad
<steampunkey>
fowl: a joke on both me and him
j3r0m3 has joined #ruby
Liothen has joined #ruby
sbanwart has joined #ruby
<defendguin>
does anyone know how i can remove the version of ruby that comes with osx? it's causing issues
sacarlson has joined #ruby
end3r- has joined #ruby
technel has joined #ruby
jcromartie has joined #ruby
c0rn has joined #ruby
cloke_ has joined #ruby
<steampunkey>
every other language I know which supports lambdas returns a function(in rubylang that's a method): javascript: (function(x){return x;})(1); l(1); python: (lambda x: x)(1); scheme: ((lambda (x) x) 1)
<steampunkey>
*would be a method
danderson has quit [#ruby]
<steampunkey>
so... what's the deal?
<baniseterfiend`>
steampunkey: that's becuase those languages have a concept of function, ruby does not
<baniseterfiend`>
steampunkey: in python for example, a 'method' is really just a special kind of function (afaik)
ryh has joined #ruby
Knodi has joined #ruby
<steampunkey>
baniseterfiend`: well in rb there's a method. why would lambda be a method?
<steampunkey>
*wouldn't
drbawb has joined #ruby
krz has joined #ruby
artOfWar has joined #ruby
<steampunkey>
it's definition is an anonymous function/closure
<baniseterfiend`>
steampunkey: because a lambda is not bound to an object in the same way a method is, a lambda is closer to being a free function
<baniseterfiend`>
though it closes over its definition context
Knodi has quit [#ruby]
robbyoconnor has joined #ruby
burns180_ has joined #ruby
munx has joined #ruby
mikeric has joined #ruby
robbyoconnor has joined #ruby
technel has joined #ruby
jergason has joined #ruby
SolarisBoy has joined #ruby
<steampunkey>
baniseterfiend`: i don't see your point. what obj is a method bound to? it can be stand-alone. i don't see why lambda can't simply be an anonymous method.
<baniseterfiend`>
steampunkey: how can a method be stand-alone?
<steampunkey>
there must be a better explanation.
ryh has joined #ruby
<baniseterfiend`>
steampunkey: can u give an example
drbawb has joined #ruby
Synthead has joined #ruby
<steampunkey>
baniseterfiend`: if you define it outside of an object/class/module/whatever
<baniseterfiend`>
steampunkey: that's not stand-alone, it get implicitly defined as a private instance method of Object, in that case
looopy has joined #ruby
CheeToS has joined #ruby
<steampunkey>
baniseterfiend`: so what constraints does that have and aren't imposed on lambdas? mate, i need to pull answers from you .-)
ickmund has joined #ruby
<baniseterfiend`>
steampunkey: basically the reason is this (IMO) methods are not objects in ruby, but lambdas/procs are. In so far as lambdas/procs are objects their associated must be invoked by calling a method, the method to call in ruby is .call()
<baniseterfiend`>
steampunkey: yeah they're not :)
jonom has joined #ruby
<steampunkey>
son, i am disappoint
ckrailo has joined #ruby
timonv has joined #ruby
<baniseterfiend`>
steampunkey: you can think of an object as a tree structure, with ivars being other nodes on the tree, but with methods being the leaves
artOfWar has joined #ruby
<baniseterfiend`>
well that's how i think of it anyway :)
<steampunkey>
baniseterfiend`: in a tree structure leaves are still nodes ;-)
<baniseterfiend`>
steampunkey: but they dont have children
<steampunkey>
baniseterfiend`: but they do, other methods
<steampunkey>
*can have
ryh_ has joined #ruby
<baniseterfiend`>
steampunkey: those arent methods on the method itself, as the method is not an object
<steampunkey>
baniseterfiend`: lol. so.. umm.. what's a method? :-D
<baniseterfiend`>
and doesnt have methods
<baniseterfiend`>
steampunkey: it's a method, just that. It's not an object
i8igmac_ has joined #ruby
dbgster has joined #ruby
dlam has joined #ruby
<steampunkey>
ok. how about this: *Why* is lambda an object? Why couldn't it simply be a non-object method/function
<steampunkey>
what's the point really?
sacarlson has joined #ruby
<baniseterfiend`>
steampunkey: cos they could implement it as an object i guess so they didnt need to create a new thingy. Whereas with methods i think it's an important part of the object model that methods are not objects, iirc smalltalk takes the same approach
<steampunkey>
o.O
* steampunkey
googles about smalltalk
<baniseterfiend`>
steampunkey: ah yeah i remember not, it's part of the message passing OO system
<baniseterfiend`>
steampunkey: basically methods are the messages, and objects are teh receivers/senders
<baniseterfiend`>
but the messages themselves are not to be objects, they're just the messages. I think that was the distinction
<baniseterfiend`>
steampunkey: because they're anonymous functions, how can an object/receiver respond to an anonymous function? a message is something that is understood by the receiver/sender
<baniseterfiend`>
and it's clearly delineated in that object's public interfact
<baniseterfiend`>
face*
Drewch has joined #ruby
<baniseterfiend`>
steampunkey: and in reality, objects never respond to anonymous functions
philcrissman has joined #ruby
<baniseterfiend`>
anonymous functions are passed as parameters to a method, they aer never passed to an object directly
<baniseterfiend`>
so an anonyous function can constitute part of a message, the payload for a message if u will, but never the message itself
<steampunkey>
good point. nice deduction ;-)
<steampunkey>
baniseterfiend`: wait. that won't cut it
badabim_ has joined #ruby
mikepack has joined #ruby
<steampunkey>
baniseterfiend`: actually, it might. considering that, as you said, methods implicitly belong to some object (don't remember the name)
<steampunkey>
baniseterfiend`: timed out, i'm afraid, lemme see if it's in google's cache
mikeric has quit [#ruby]
neurodrone has joined #ruby
<steampunkey>
baniseterfiend`: thanks for the link, and for the chat.
<wefawa>
Any idea how to deploy my changes to heroku? I misteriously managed to deploy the initial version, which is running... Now, I've modified a controller and a view, and I need to upload my changes (I'm on Ubuntu)... Any ideas? :)
ascarter has joined #ruby
<steampunkey>
wefawa: Stanford free SaaS class?
<wefawa>
BTW: is there any way to attach a debugger or something to "rails server"? I'm using Aptana Studio
<wefawa>
steampunkey: yeah...
<steampunkey>
XD yeah, i don't know. didn't reach that point yet.
jonom has joined #ruby
<wefawa>
I hate having to do it on linux :(
<steampunkey>
i'm at yield()
<fowl>
steampunkey: yield is an awesome thing
<steampunkey>
wefawa: that's all I use, so I'm happy. Btw. the web is *nix.
<fowl>
are you a girl btw, whats up with the -ey on your name
<wefawa>
steampunkey: I'm at hardvard() (?)
<baniseterfiend`>
fowl: yeah, i think they're a chick
<wefawa>
steampunkey: Azure Rulz!
<baniseterfiend`>
fowl: i get a feeling
<steampunkey>
fowl: baniseterfiend`: wrong
<baniseterfiend`>
fowl: all the cutesy emoticons too
<fowl>
boring
<steampunkey>
baniseterfiend`: hope i didn't break your heart
thecreators has joined #ruby
<wefawa>
so comming back to my point, any idea how to "upload" my changes?
<steampunkey>
i wondered why you were so nice. but it's naive to think that any girl would pick up programming ;-)
<steampunkey>
;-) <-- this means i'm kidding, not that i'm a girl
<fowl>
heroku is for punks, true ruby nerdz run webrick servers from holiday inn wifis
superguenter has joined #ruby
<steampunkey>
wefawa: there might be #heroku or other appropriate place
ryanf has joined #ruby
burns180 has joined #ruby
Tearan has joined #ruby
<wefawa>
I think i've just found my problem!
philcrissman has joined #ruby
sohocoke has joined #ruby
<steampunkey>
bastard google doesn't allow cache downloading, wth.
<wefawa>
cache downloading? what do you mean?
<deryldoucette>
they cache pages (last revision) but its more like a static sheet than the actual assets
sroy2_ has joined #ruby
Drewch has joined #ruby
albemuth has joined #ruby
nricciar_ has joined #ruby
<steampunkey>
wefawa: i don't know how, but they know if it's viewing the page or downloading (I'm guessing user agent string, but it'd take Wireshark to check that). They disallow downloading via Chromium (their browser) as well as wget. Luckaly, loading the thing in epiphany allowed me to save the page, since E. doesn't re-download, it just copies from its cache afaik.
<wefawa>
? you need to download the page to view it...
<steampunkey>
wefawa: yeah. i don't know either.
<wefawa>
what page for example?
<wefawa>
I mean, you view it, you put save as... and it works :)
<steampunkey>
wefawa: no, save-as re-downloads in Chromium and Mozilla based browsers
<steampunkey>
that's why it's not instant.
<wefawa>
i can try it on mozzilla
<steampunkey>
wefawa: well i haven't tried it on Mozilla. If it's the user agent string like I think, it might work. If you try Chromium/Chrome or wget, you should get what I get.
<steampunkey>
(timeout for C, forbidden for W)
Corey_ has joined #ruby
tdubz has joined #ruby
<wefawa>
with firefox it worked... and chrome crashed xD
<steampunkey>
XD
<steampunkey>
weirdness
<wefawa>
and it only sent a single request
<wefawa>
(with firefox)
<steampunkey>
wefawa: perhaps it checked if the site changed
<steampunkey>
either that, or it re-downloaded html, and you don't have the media
<wefawa>
i'm catching all the http requests, and it doesn't show anything more
defendguin has quit [#ruby]
<steampunkey>
idk mate, i couldn't get it without epiphany. now plz excuse me, got some work to do.
macabre has joined #ruby
Squarism has joined #ruby
blueadept has joined #ruby
looopy has joined #ruby
colinwd has joined #ruby
jlebrech has joined #ruby
<steampunkey>
cya
cloke has joined #ruby
steampunkey has quit [#ruby]
snip_it has joined #ruby
duard has joined #ruby
sarmiena_ has joined #ruby
genlog has joined #ruby
<wefawa>
How to select only some fields with ActiveRecord::Base?
genlog has joined #ruby
wyhaines has joined #ruby
genlog has joined #ruby
burns180_ has joined #ruby
radic has joined #ruby
Spaceb0y has joined #ruby
mikepack has joined #ruby
genlog has joined #ruby
btfriar has joined #ruby
genlog has joined #ruby
genlog has joined #ruby
<fowl>
shevy: you here?
genlog has joined #ruby
pdtpatr1ck has joined #ruby
Spaceb0y has joined #ruby
t0lkman has joined #ruby
derefed has joined #ruby
thecreators_ has joined #ruby
nricciar_ has joined #ruby
genlog has joined #ruby
wmoxam has joined #ruby
pp01bit has joined #ruby
baniseterfiend` has joined #ruby
<wefawa>
How to do SELECT blah WHERE field = 'G' or field = 'DF' or field = 'lalal'? without using or?
elephants has joined #ruby
BrokenCog has joined #ruby
macmartine has joined #ruby
cloudgeek has joined #ruby
redgetan has joined #ruby
superguenter has joined #ruby
BrokenCog has joined #ruby
<gate>
wefawa: (this is from memory) field IN ('G', 'DF', 'lalal')
superguenter has joined #ruby
mezzagis has joined #ruby
baniseterfiend` has joined #ruby
BrokenCog has joined #ruby
genlog has joined #ruby
blueadept has joined #ruby
a1ph4g33k has joined #ruby
<a1ph4g33k>
Anybody familiar with the redis gem?
<a1ph4g33k>
... guess not.
a1ph4g33k has quit [#ruby]
<deryldoucette>
one would think you'd ask a specific question with specific intent rather than guru hunting.
<deryldoucette>
ask and if someone knows they'll answer.
rippa has joined #ruby
philcris_ has joined #ruby
redgetan has joined #ruby
BrokenCog has joined #ruby
cmasseraf has joined #ruby
<td123>
also, waiting for more than a minute might be beneficial
<deryldoucette>
td123++ "-)
<deryldoucette>
wow way to fsck up a smiley face deryl
undersc0re has joined #ruby
shevy2 has joined #ruby
shevy has joined #ruby
stephenjudkins has joined #ruby
<deryldoucette>
nate_h: are you able to kill a job there? got a hung job thats not timing out on travis. (sorry about that)
<deryldoucette>
that current build is stuck trying to contact a server that isn't responding. (my mistake caused the hang. forgot to add [ci skip] to the commit msg. knew it wouldn't respond)
blueadept` has joined #ruby
sacarlson has joined #ruby
<deryldoucette>
damn it. how the hell did i manage to so utterly fuck up which channel i was talking to?
<deryldoucette>
my apologies folks. i meant that for the travis channel.
dv310p3r has joined #ruby
chimkan has joined #ruby
<Azure>
Eh?
<Azure>
Oh, highlight.
albemuth has joined #ruby
BrokenCog has joined #ruby
adeponte has joined #ruby
pu22l3r has joined #ruby
rohit has joined #ruby
chessguy has joined #ruby
<Drewch>
Isn't there something in ruby that lets you do something like "break if myNumber < 1 puts "your number is less than one"
<Drewch>
in a while loop
<Drewch>
I want to break on a condition, and print out a message at the same time
ZachBeta has joined #ruby
<rippa>
if myNumber < 1; puts "herp derp"; break; end
BrokenCog has joined #ruby
baniseterfiend` has joined #ruby
<fowl>
rippa: he wants to do it at the same time though
<rippa>
he can't
<deryldoucette>
didn't know you could do those simul
<deryldoucette>
ah ok i was right then
<rippa>
ruby can't magically do two things at one time
<rippa>
well, maybe using jruby and threads
DrShoggoth has joined #ruby
macmartine has joined #ruby
BrokenCog has joined #ruby
<Drewch>
sorry I just meant in a way that "reads like english"
<Drewch>
I normally use C and I read parts of the pigment ruby book or something
rohit has joined #ruby
<Drewch>
and it made it seem like you could do this kina stuff with a magical ruby wand
<baniseterfiend`>
Drewch: pigment lol
<Drewch>
I didn't literally mean at the same time, I just meant in a format that reads like that
thecreators has joined #ruby
<Drewch>
baniseterfiend`Textual auto correct :P
<Drewch>
I tried to type poigment
<Drewch>
I guess that's not that much better =\
<Drewch>
lol
<Drewch>
I usually google it and google tells me where it is :)
sacarlson has joined #ruby
<fowl>
Drewch: ruby has plenty of that already
<fowl>
fun things like postfix until
<Drewch>
whats that
<fowl>
similar to postfix while, but also different
BrokenCog has joined #ruby
<fowl>
Drewch: if you really wanted to, you could do (puts "your number is less than one."; break) if myNumber < 1
<Drewch>
hmm i kind like that
<Drewch>
:)
thebastl has joined #ruby
flingbob has joined #ruby
BrokenCog has joined #ruby
eldariof has joined #ruby
Pikkachu has joined #ruby
thecreators_ has joined #ruby
<Pikkachu>
test
Pikkachu has quit [#ruby]
kah has joined #ruby
kah has joined #ruby
hadees has joined #ruby
senthil has joined #ruby
ZachBeta has joined #ruby
blueadept has joined #ruby
BrokenCog has joined #ruby
badabim has joined #ruby
manizzle has joined #ruby
blueadept has joined #ruby
BrokenCog has joined #ruby
burns180 has joined #ruby
nfluxx has joined #ruby
ed_hz__ has joined #ruby
tyman_ has joined #ruby
BrokenCog has joined #ruby
stephenjudkins has joined #ruby
yxhuvud has joined #ruby
chimkan_ has joined #ruby
tyman has joined #ruby
tyman has quit [#ruby]
sacarlson has joined #ruby
btfriar has joined #ruby
BrokenCog has joined #ruby
snip_it has joined #ruby
redgetan has joined #ruby
macmartine has joined #ruby
JohnBat26 has joined #ruby
colinwd has joined #ruby
BrokenCog has joined #ruby
nat2610 has joined #ruby
<nat2610>
how to you find the local variable from a command line in ruby (ie foobar=yes ./myscript.rb), I tried ENV['foobar'] but it doesn't seem to be there
macmartine has joined #ruby
<shadoi>
really?
<shadoi>
foobar=yes ruby -e "puts ENV['foobar']"
<shadoi>
yes
greenarrow has joined #ruby
ZeepZop has joined #ruby
x0F_ has joined #ruby
KL-7 has joined #ruby
Morkel has joined #ruby
robbyoconnor has joined #ruby
djdb has joined #ruby
Synthead has joined #ruby
Quirrell has joined #ruby
Quirrell has joined #ruby
gayasentinel has joined #ruby
bluOxigen has joined #ruby
baniseterfiend` has joined #ruby
JohnBat26 has joined #ruby
ryanf has joined #ruby
mikeric has joined #ruby
adeponte has joined #ruby
_adeponte has joined #ruby
adeponte has joined #ruby
thecreators has joined #ruby
philcris_ has joined #ruby
sgmac has joined #ruby
krz has joined #ruby
QKO has joined #ruby
Dre has joined #ruby
sgmac has quit [#ruby]
looopy has joined #ruby
rockasdkj\ has joined #ruby
<robert_>
is there any way to see outside of a block in ruby?
Keva161 has joined #ruby
<baniseterfiend`>
robert_: explain more what u mean or i bet yo candy ass
<robert_>
I'm inside a block that's inside a class; I need to access said class's instance variables/methods
<robert_>
baniseterfiend`: haha. :p
<robert_>
er wait
<robert_>
I'm inside a BLOCK that's inside yet another block
<robert_>
that's inside a class, sorry.
<fowl>
do binding.pry
nemesit has joined #ruby
<fowl>
`ls`
<robert_>
hm binding.pry?
burns180 has joined #ruby
Kaell has joined #ruby
<robert_>
I see.
wmoxam has joined #ruby
cook1es has joined #ruby
<robert_>
fowl: what would I gain by using binding.pry?
<Kaell>
My first question is: why is "attr_name" not inside a #{} in all places?
* robert_
throws a rotten banana at baniseterfiend`
<robert_>
:p
<Kaell>
Shouldn't "@attr_name" not be defined, it should be "@#{attr_name}"?
<robert_>
are they using it in a string context?
<wmoxam>
/quit
<fowl>
robert_: you would be inside the block, able to navigate around it like a shell interface to the matrix
<Kaell>
Second question is how would I access count? In my attempt here: http://pastebin.com/D0SDXrdp it does not work.
tolland has joined #ruby
<tolland>
what is the "(?:" that appears in ruby regex some places indicate?
<baniseterfiend`>
robert_: i dont undersatnd your question sorry
<robert_>
okay, let's see if I can't explain this better
<robert_>
I'm using prawn to generate a possibly multi-paged PDF, okay?
<robert_>
and Prawn's Prawn::Document.generate takes a block.
<fowl>
this is the ruby channel
<robert_>
inside said block, I'm attempting to 2.times { something-inside }
<fowl>
nvm :P
<robert_>
something-inside is failing because Ruby can't find where the object is located. :p
<robert_>
:p
<robert_>
fowl: I'm simply expanding on what my issue is. :p
<robert_>
I guess I'm failing to see how blocks work.
io_syl has joined #ruby
gayasentinel has joined #ruby
tonini has joined #ruby
<fowl>
blocks generally run in the context they're defined in, not that they can't do more
<fowl>
see in irb/pry: x = 0; 2.times { 3.times { x += 1 }}; puts x #=> 6
<robert_>
it's failing to find the object in Prawn::Document, so I guess I need to runtime-hax Prawn::Document.initialize or something
<fowl>
you could use instance variables there too
<baniseterfiend`>
robert_: maybe there's an instance eval going on
<baniseterfiend`>
robert_: try assigning it to a local
<robert_>
yeah, there is.
<robert_>
hm
<baniseterfiend`>
then assign it to a local before trying to access it in the block
<robert_>
so does include simply mean copy+pasta code by the interpreter?
MrCheetoDust has joined #ruby
ph^ has joined #ruby
burns180_ has joined #ruby
snearch has joined #ruby
<baniseterfiend`>
robert_: i want to fight u, answer: not quite
<baniseterfiend`>
robert_: that's 'require'
<baniseterfiend`>
it's common to confuse include/require when you're starting out but they're very different
<robert_>
yeah
<robert_>
I figured that out.
<robert_>
I can pass back to the scope my other code is in
<robert_>
so it's all good
<robert_>
I just pass self around like it's a cup of hot chocolate, lmao
thecreators_ has joined #ruby
prtksxna has joined #ruby
friskd has joined #ruby
workmad3 has joined #ruby
zommi has joined #ruby
chimkan_ has joined #ruby
MK has joined #ruby
shruggar has joined #ruby
iband has joined #ruby
ph^ has joined #ruby
KL-7 has joined #ruby
sleetdrop has joined #ruby
mklappst_ has joined #ruby
KL-7 has joined #ruby
m0rt3st has joined #ruby
zakwilson_ has joined #ruby
sspiff has joined #ruby
mikewintermute has joined #ruby
nachtwandler has joined #ruby
burns180 has joined #ruby
mafolz has joined #ruby
mafolz has joined #ruby
iMe has joined #ruby
Squarism has joined #ruby
somazero has joined #ruby
eugynon has joined #ruby
<sarmiena_>
so i want to contribute back to karmi/tire project, but quite embarrassingly I'm having a tough time figuring out how to run their test suite (i've only ever tested using tools for rails projects)
<sarmiena_>
how would i go about running these things?
LowKey has joined #ruby
Nss has joined #ruby
KL7 has joined #ruby
andrewhl has joined #ruby
workmad3 has joined #ruby
rushed has joined #ruby
<banisterfiend>
sarmiena_: start with a bundle install
<banisterfiend>
sarmiena_: then running 'rake' or 'rake test' should do it
<sarmiena_>
okiedokie
LMolr has joined #ruby
urbino_ has joined #ruby
sohocoke has joined #ruby
<sarmiena_>
banisterfiend: fancy
<sarmiena_>
also, duhhh haha thanks
<banisterfiend>
sarmiena_: what's fancy
odinswand has joined #ruby
<sarmiena_>
that doing what i do in my rails projects also works for these standalone libraries
nemesit has joined #ruby
<sarmiena_>
but i didn't try it because i'm a dope :X
<sarmiena_>
haha
<banisterfiend>
;)
<A124>
A lil question: What is the best way to shuffle an array?
<banisterfiend>
alindeman: array.shuffle
<banisterfiend>
A124:
<A124>
banisterfiend: Snap. Seems like I failed twice. In Ruby and in searching. Thank you xD
bier has joined #ruby
pi3r has joined #ruby
twqla has joined #ruby
jakky has joined #ruby
ly- has joined #ruby
godfrey999 has joined #ruby
burns180_ has joined #ruby
jakky has joined #ruby
BrianE has joined #ruby
Danielpk has joined #ruby
InBar has joined #ruby
eddie has joined #ruby
banisterfiend has joined #ruby
alup has joined #ruby
somazero has joined #ruby
keymone has joined #ruby
<banisterfiend>
cout: u here?
<rippa>
cout << endl;
flippingbits has joined #ruby
cyri_ has joined #ruby
odinswand has joined #ruby
wuwoot has joined #ruby
ukwiz has joined #ruby
wuwoot has quit [#ruby]
igaiga has joined #ruby
johndbritton has joined #ruby
<shevy>
cout << die
igaiga_ has joined #ruby
tyman has joined #ruby
etehtsea has joined #ruby
jwang has joined #ruby
gokul has joined #ruby
banjara has joined #ruby
mdw has joined #ruby
burns180 has joined #ruby
adamjleonard has joined #ruby
sohocoke has joined #ruby
omry_ has joined #ruby
shruggar has joined #ruby
simao has joined #ruby
ephemerian has joined #ruby
ccapndave has joined #ruby
mengu has joined #ruby
mdaisuke has joined #ruby
mdaisuke has quit [#ruby]
snearch has joined #ruby
arguser has joined #ruby
<arguser>
hello, im having this issue /home/arch/le/.gem/ruby/1.9.1/bin
<arguser>
on my system ruby and my rvms rubies.
<shevy>
always the rvm
<arguser>
I mean
<arguser>
WARNING: You don't have /home/arch/le/.gem/ruby/1.9.1/bin in your PATH, gem executables will not run.
<shevy>
I guess rvm stores things somewhere in your home dir, I dont know enough about rvm to help you though, sorry
cha1tanya has joined #ruby
bhavesh_a_p has joined #ruby
thecreators has joined #ruby
mby has joined #ruby
<arguser>
np
mdw_ has joined #ruby
wvdschel has joined #ruby
prtksxna has joined #ruby
gyre007 has joined #ruby
mdw has joined #ruby
dennda has joined #ruby
Helius has joined #ruby
Spaceb0y has joined #ruby
TaTonka has joined #ruby
Vadim2 has joined #ruby
nari has joined #ruby
waxjar has joined #ruby
danfo has joined #ruby
Spockz` has joined #ruby
francisfish has joined #ruby
mxweas has joined #ruby
burns180 has joined #ruby
tatsuya_o has joined #ruby
rohit_ has joined #ruby
t0lkman has joined #ruby
<t0lkman>
what the difference between rdoc and ri, every gem installs both
<t0lkman>
what the difference between rdoc and ri, every gem installs both
mdaisuke has joined #ruby
rohit has joined #ruby
srji has joined #ruby
zxiest has joined #ruby
<zxiest>
Hello everybody :-)
<zxiest>
I am trying to require a file but some classes were previously defined and I wanted to overwrite them. I tried setting the class name to nil and re-requiring the file. The problem now is that the class is nil and requiring the file isn't affecting the environment at all.
srp_ has joined #ruby
<zxiest>
What can I do? (I do not wish to restart the environment)
Talvino has joined #ruby
tommyvyo has joined #ruby
prtksxna_ has joined #ruby
TheDeadSerious has joined #ruby
rippa has joined #ruby
LowKey has joined #ruby
kidoz has joined #ruby
robertjpayne has joined #ruby
robertjpayne has joined #ruby
workmad3 has joined #ruby
thecreators_ has joined #ruby
fr0gprince_mac has joined #ruby
ikaros has joined #ruby
burns180_ has joined #ruby
bluenemo has joined #ruby
bluenemo has joined #ruby
QKO_ has joined #ruby
robertjpayne has joined #ruby
jayant has joined #ruby
luoluoluo has joined #ruby
tatsuya__ has joined #ruby
<jayant>
do you have any work in railsany body can share the ruby on rails work
<banisterfiend>
jayant: jeez, i hope for your sake english is not your first language ;)
pdelgallego has joined #ruby
tk__ has joined #ruby
<jayant>
rails work
Vadim has joined #ruby
kidoz_ has joined #ruby
dhruvasagar has joined #ruby
burns180 has joined #ruby
glosoli has joined #ruby
<jayant>
anybody working in ruby on rails
shruggar has joined #ruby
wefawa has quit [#ruby]
jayant has quit [#ruby]
trivol has joined #ruby
eldariof has joined #ruby
tatsuya_o has joined #ruby
Molfar has joined #ruby
<Molfar>
hi. is there any gem for using headless browser in ruby?
jlebrech has joined #ruby
<heftig>
mechanize?
<Molfar>
mechanize - does it execute javascrips?
<heftig>
no
<heftig>
i don't think so
<Molfar>
I need javascript execution
iocor has joined #ruby
mklappstuhl has joined #ruby
somazero has joined #ruby
KL-7 has joined #ruby
tayy has joined #ruby
MrGando has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
tayy_ has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
cha1tanya has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
liluo has joined #ruby
dbgster has joined #ruby
rohit has joined #ruby
burns180_ has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
ksinkar has joined #ruby
HektoR has joined #ruby
jsaak has joined #ruby
fearoffish has joined #ruby
randym_zzz has joined #ruby
ElderFain has joined #ruby
emocakes has joined #ruby
bluenemo_ has joined #ruby
gianlucadv has joined #ruby
flippingbits has joined #ruby
fearoffish has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
<Tasser>
why won't " Für den Bereich der Kultur sind die Kantone zuständig.".strip delete the whitespace on the left?
flippingbits has joined #ruby
<banisterfiend>
Tasser: because it's too terrified by the german language
flippingbits has joined #ruby
<Tasser>
wtf is up with ruby today? already crashed three times
<banisterfiend>
Tasser: mri 1.9.3?
<Tasser>
yep
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
BrianE has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
eldariof has joined #ruby
flippingbits has joined #ruby
_adeponte has joined #ruby
flippingbits has joined #ruby
flippingbits has joined #ruby
<Tasser>
banisterfiend, oh, it's a freaking unicode char
<bubuz>
Hi guys, am using RVM in my production env, installed locally to a user as opposed to globally. I want to run the whenever gem but I need to edit my ~/.rvmrc file as stated here: https://github.cin/javan/whenever/blob/master/README.md ....only this is that I dont have ~/.rvmrc doesnt exist....
<banisterfiend>
Tasser: yeah that had the segv bug
<banisterfiend>
i remember fixing it :)
bluOxigen has joined #ruby
<bubuz>
anybody know where I can find my .rvmrc file after installing rvm under a specific user?
<Tasser>
bubuz, ~/.rvmrc
<bubuz>
doesn't exist...
<bubuz>
i have ~/.rvm Tasser
looopy has joined #ruby
looopy has joined #ruby
<bubuz>
nor do I have an /etc/rvmrc dir
Redjack1964 has joined #ruby
Karmaon has joined #ruby
Ferdev has joined #ruby
glosoli has joined #ruby
jeffsmykil has joined #ruby
<jeffsmykil>
Is there a reason why this would have a line break after #{randomEquip} ?
<lofic>
ypeError: wrong argument type Symbol (expected Proc)
<matled>
lofic: then write the .inject the long way
<lofic>
ok
dr_bob has joined #ruby
Chickenninja has joined #ruby
<lofic>
matled : perfect, the array injects in all cases, thanks
cantonic has joined #ruby
burns180_ has joined #ruby
<cantonic>
hey guys. I need to debug a script. Is there a way to print every current line in the command shell without putting "puts __LINE__" into each line?
srp__ has joined #ruby
<cantonic>
so can I define it in some way to print "__LINE__" for every line of the code?
<cantonic>
dr_bob: i just put that on top of my script?
<dr_bob>
right
<cantonic>
dr_bob: you make my day ;) thank you
<cantonic>
dr_bob: WOAH! My Terminal looks like the Matrix :D
<dr_bob>
YWC
<dr_bob>
Well, you can reduce the output by just writing some of the values
ksinkar has joined #ruby
<dr_bob>
e.g. a[1] and a[2]
<dr_bob>
Btw, you're IN the matrix anyway. :-)
<cantonic>
dr_bob: looks like we have the same religion :P
<dr_bob>
ngh
<dr_bob>
:-)
<cantonic>
ngh?
<dr_bob>
just a sound
<cantonic>
ah ok :)
<cout>
banisterfiend: I am now
<banisterfiend>
cout: heya
simao_ has joined #ruby
`brendan has joined #ruby
<`brendan>
good morning
iMe has joined #ruby
johndbritton has joined #ruby
urbino has quit ["Leaving"]
adurity_ has joined #ruby
Sailias has joined #ruby
<dr_bob>
cout << "hi!";
boonedocks has joined #ruby
<banisterfiend>
cout: im still having probs with LD_PRELOAD :P
<cout>
:(
wyhaines has joined #ruby
<bubuz>
anybody know where I can find my .rvmrc file after installing rvm under a specific user? cant find it in ~/.rvmrc or /etc/rvmrc ....
tomzx has joined #ruby
bglusman has joined #ruby
mephux has joined #ruby
ben_alman has joined #ruby
QaDeS has joined #ruby
neurodrone has joined #ruby
burns180_ has joined #ruby
looopy has joined #ruby
tayy has joined #ruby
xeno_ has joined #ruby
pu22l3r has joined #ruby
ElitestFX has joined #ruby
LBRapid has joined #ruby
MasterIdler__ has joined #ruby
JonSchuff has joined #ruby
v0n has joined #ruby
cantonic has joined #ruby
cantonic has quit [#ruby]
linoj_ has joined #ruby
reitelles has joined #ruby
dr_bob has joined #ruby
fr0gprince_ has joined #ruby
ryannielson has joined #ruby
boonedocks has joined #ruby
nemesit has joined #ruby
reitelles has quit [#ruby]
randym_zzz has joined #ruby
burns180_ has joined #ruby
randym_zzz has joined #ruby
MrGando has joined #ruby
trkemist has joined #ruby
fr0gprince_ has joined #ruby
simao has joined #ruby
EvanR has joined #ruby
macabre has joined #ruby
<Tasser>
anyone defined their own assert/expectation for minitest?
tayy has joined #ruby
EvanR has joined #ruby
alup has joined #ruby
notjohn has joined #ruby
nixmaniack has joined #ruby
davidpk has joined #ruby
husel has joined #ruby
tayy_ has joined #ruby
geekbri has joined #ruby
A124 has joined #ruby
AxonetBE has joined #ruby
cantbecool has joined #ruby
<AxonetBE>
what do I wrong here, I want to make a config variable accessible from everywhere in the module : https://gist.github.com/1993428
<AxonetBE>
I get always the error NoMethodError: undefined method `config' for SoColissimo:Module
<canton7>
I might be wrong, but doesn't self.included only get run when the module is included somewhere?
sbanwart has joined #ruby
<canton7>
when not to something like module SoColissimo; def config; @@config ||= YAML.load.....; @@config; end; end
johndbritton has joined #ruby
<AxonetBE>
canton7: Ok thanks will try that
dv310p3r has joined #ruby
vraa has joined #ruby
<AxonetBE>
canton7: Do I have to use then self.config then?
<canton7>
oops, yeah, def self.config not def config
timonv has joined #ruby
Seisatsu has joined #ruby
polysics has joined #ruby
KL-7 has joined #ruby
crankycoder has joined #ruby
Sailias has joined #ruby
<A124>
How can I define a method for an class instance, instead of the class itself?
Redjack1964 has joined #ruby
adambeynon has joined #ruby
<polysics>
hello
LBRapid has joined #ruby
<polysics>
got any idea why i have code based on Celluloid failing randomly?
<polysics>
where does one start investigating such an issue?
axl_ has joined #ruby
bluOxigen has joined #ruby
bluOxigen has joined #ruby
KL-7 has joined #ruby
phantasm66 has joined #ruby
drknus has joined #ruby
KL-7_ has joined #ruby
<polysics>
i basically have no idea of how even to explain the issue
R3dy has joined #ruby
<polysics>
basically, on a Mac Snow Leopard machone with XCode 4.2 installed, code based on FFI, Celluloid included, has threading issues
<polysics>
i was pointed to libev, but the trail stops there
<A124>
polysics: This is Celluloid specific. Not all people familiar here are familiar with it, and the rest might be away. Also, you are very geneal.
<polysics>
on a Debian VM everything runs fine
NotMyself has joined #ruby
<polysics>
A124: not looking for a solution right now, but at the moment just for a trail to start
<A124>
polysics: In your case maybe even MacOS specific
Azure has joined #ruby
<A124>
I'm not familiar with Celluloid, sorry.
jgarvey has joined #ruby
<polysics>
others with Snow Leopard installed but no XCode 4.2 ( and thus LLVM) have no issues
hashpuppy has joined #ruby
<polysics>
is it possible to pass paths for the libraries that have native extensions to Bundler?
<A124>
polysics: I'm not a mac pro also, consider tryng respective channels.
Drake_mac has joined #ruby
<hashpuppy>
i have someone on os x lion trying to install ruby via rvm, but he gets "The provided compiler ‘/usr/bin/gcc’ is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`." He wants to install 1.9.2 (not sure why). How should he install this on OS X Lion? rvm install 1.9.2 --with-gcc=clang, upon which he gets some strange lib-yaml warning. Or is there a recommended way to do this?
asobrasil has joined #ruby
burns180 has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
jlebrech has joined #ruby
<polysics>
i'll bet a beer our issues are related
iocor has joined #ruby
fr0gprince_ has joined #ruby
<polysics>
more ruby related: does anyone know how i can pass shared libraries paths to a gem?
<polysics>
such as --with-libev
cantbecool has joined #ruby
nachtwandler has joined #ruby
<diago>
is anyone familiar with server? I'm trying to get slim to pretty print but anywhere I put the Slim::Engine mod it is ignored
<diago>
serve*
<diago>
gem serve
Drewch has joined #ruby
<bubuz>
anybody know where I can find my .rvmrc file after installing rvm under a specific user? cant find it in ~/.rvmrc or /etc/rvmrc ....
andrewhl has joined #ruby
vipaca has joined #ruby
vipaca has joined #ruby
polysics has joined #ruby
MrGando has joined #ruby
polysics has quit [#ruby]
LMolr has joined #ruby
runa has joined #ruby
<runa>
heyas. yesterday I saw a snippet to restart a Unicorn worker after a number of requests; but I cannot find it. anyone?
mdw has joined #ruby
mezzagis has joined #ruby
n1x has joined #ruby
sbabiy has joined #ruby
dhruvasagar has joined #ruby
bbttxu has joined #ruby
<gyre007>
anyone here uses rest-client gem ?
ceej has joined #ruby
chson has joined #ruby
internet_user has joined #ruby
igaiga has joined #ruby
bbttxu has joined #ruby
Molfar has joined #ruby
<Molfar>
i'm trying to install selenium-webdriver gem and get `require': no such file to load -- mkmf (LoadError)
<shevy>
Molfar are you on debian?
<Molfar>
ubuntu
<shevy>
yeah pretty much the same
<shevy>
they cripple the ruby package
<shevy>
you have to somehow uncripple the shit they did
<Molfar>
what is cripple?
logic has joined #ruby
<shevy>
when you have two healthy legs and someone breaks your legs, that someone crippled you
<shevy>
that's the ubuntu philosophy - to split up everything until nothing works anymore
<shevy>
what ruby version btw?
Vert has joined #ruby
<shevy>
try to search in aptitude or whatever shit ubuntu uses how to get mkmf
<Molfar>
sudo apt-get install ruby1.8-dev - I have already tries it
<Molfar>
ruby1.8-dev is already the newest version.
<shevy>
well
wmoxam has joined #ruby
<shevy>
that just shows you that ubuntu is a giant pile of shit
tatsuya__ has joined #ruby
<shevy>
if I were you I would ask the #ubuntu guys why they are such big idiots
<shevy>
:D
tvw has joined #ruby
tatsuy___ has joined #ruby
emocakes has joined #ruby
rippa has joined #ruby
mmokrysz has joined #ruby
rippa has joined #ruby
mmokrysz has quit [#ruby]
<deryldoucette>
ask debian, they created the packages. ubuntu pretty much just recompiled with different options but kept the same packages, if anything they're guilty of not redoing the packaging
<deryldoucette>
s/redoing/consolidating/
<shevy>
you know
<shevy>
I have not seen that problem yet with fedora
<shevy>
I mean on IRC
<deryldoucette>
different paradigm
<deryldoucette>
oh
<shevy>
do they not split up the ruby package as much?
bbttxu has joined #ruby
<deryldoucette>
idk, i haven't used redhat/fedora in years
<deryldoucette>
think the last time i used fedora was when redhat initially created that offshoot
emmanuelux has joined #ruby
<shevy>
hehe
<shevy>
I think I last used redhat 6 years ago
macmartine has joined #ruby
philcris_ has joined #ruby
glosoli has quit [#ruby]
tatsuya_o has joined #ruby
elephants has joined #ruby
TaTonka has joined #ruby
burns180_ has joined #ruby
clockwize has joined #ruby
<clockwize>
guys, i have the following regex: /[0-9]{2} [0-9]{3} [0-9]{3} ([0-9]{13})/
<clockwize>
and this string: 03 500 631 1610010345477, 04 511 091 1610010345486
<clockwize>
it matches the 1610010345477, but not the 1610010345486
<clockwize>
any ideas why?
<canton7>
clockwize, are you calling string#match instead of string#scan, or something? Basically, it is only looking for one match?
<clockwize>
yes!
* clockwize
is stressed and tired
<clockwize>
thanks
<clockwize>
>.<
<canton7>
heh
axl_ has joined #ruby
mikepack has joined #ruby
j3r0m3 has joined #ruby
duard has joined #ruby
tuxaddicted has joined #ruby
ysiad has joined #ruby
enherit has joined #ruby
choffstein has joined #ruby
BrianE|mobile has joined #ruby
waxjar has joined #ruby
simao_ has joined #ruby
Sailias_ has joined #ruby
<Azure>
I have a string with delimited text that I replace with other text (a basic templating language), and I wish to have a way to control uppercasing/lowercasing of certain parts of text.
albemuth has joined #ruby
<Tasser>
Azure, mustache? ^^
maltray has joined #ruby
<Azure>
I tried using 'v' and '^' for delimeters, however that also poses the problem of making 'v's disappear (like have -> hae)
<Azure>
hmm
sacarlson has joined #ruby
bragh has joined #ruby
KJF has joined #ruby
<Azure>
Will it work fine with YAML? :p
BrianE|mobile has joined #ruby
interlocutor has joined #ruby
Sulkyrobot has joined #ruby
simao has joined #ruby
linopolus has joined #ruby
mocker has joined #ruby
drizz has joined #ruby
<Azure>
I did write my own templating gem for basic string-based uses, before knowing about Mustache. :p (Doesn't have the upper/lowercase functionality though.)
sonkei has joined #ruby
<robacarp>
Azure: ++ for writing your own gems!
bitrot has joined #ruby
Pheen has joined #ruby
clockwize has joined #ruby
zphobic has joined #ruby
ckrailo has joined #ruby
drbawb has joined #ruby
drbawb has joined #ruby
burns180 has joined #ruby
jergason has joined #ruby
Sailias_ has joined #ruby
banisterfiend has joined #ruby
kenperkins has joined #ruby
Targen has joined #ruby
<Azure>
robacarp: haha, thanks
kpshek has joined #ruby
cgk has joined #ruby
nru has joined #ruby
<nru>
is there a way to combine lazy eval (with Enumerators) with recursion?
adamjleonard has joined #ruby
booginga has joined #ruby
spanner has quit [".... do you expect me to talk?"]
tewecske has joined #ruby
lkba has joined #ruby
BrianE|mobile has joined #ruby
eywu has joined #ruby
<nru>
well, one way would be def lazy n; Enumerator.new { |e| e << n; yield.each { |x| e << x } } ; end
<shevy>
I dont even know what that means
<nru>
shevy: in Haskell, you could do something like
<nru>
count_from n = n : count_from (n + 1)
<nru>
in Ruby, you can have lazy evaluation too, with Enumerators
<nru>
count_from would be implemented as follows:
<nru>
def count_from n; Enumerator.new { |e| loop { e << n; n += 1 } }; end
mengu has joined #ruby
<nru>
I'd like to be able to implement it in a recursive style, like in Haskell
maletor has joined #ruby
<shevy>
I never managed to get into haskell
<shevy>
it is too difficult
cgk has joined #ruby
<nru>
one other way that I just thought off would be
<nru>
class Enumerator; def concat e; e.each {|i| self << i }; end; end
caiges has joined #ruby
<nru>
and then you can implement count_from in a more ruby-like way
<nru>
def count_from n; Enumerator.new { |e| e << n; e.concat count_from(n+1) }; end
<shevy>
aha
<shevy>
I am glad that ruby is so adaptable because I still have no idea what is going on
sleetdrop has joined #ruby
<nru>
well, anyways, I managed to answer my own question :)
blueadept has joined #ruby
j3r0m3 has joined #ruby
j3r0m3 has joined #ruby
MasterIdler_ has joined #ruby
gen0cide_ has joined #ruby
bragh has quit [#ruby]
seoaqua has joined #ruby
jcromartie has joined #ruby
<seoaqua>
is there any site similar with tryruby.org?
rippa has joined #ruby
baroquebobcat has joined #ruby
friskd has joined #ruby
friskd has joined #ruby
LMolr has joined #ruby
cloke has joined #ruby
caiges has joined #ruby
clockwize has joined #ruby
<Molfar>
what does it mean: You have to install development tools first ?
MrGando has joined #ruby
Nss has joined #ruby
ascarter has joined #ruby
daniel_hinojosa has joined #ruby
francisfish has joined #ruby
telling has joined #ruby
telling has joined #ruby
jergason has joined #ruby
apeiros_ has joined #ruby
LMolr has joined #ruby
badabim has joined #ruby
genlog has joined #ruby
burns180_ has joined #ruby
iocor has joined #ruby
superguenter has joined #ruby
mikepack has joined #ruby
jgrevich has joined #ruby
i8igmac has joined #ruby
io_syl has joined #ruby
mmercer has joined #ruby
artOfWar has joined #ruby
eldariof has joined #ruby
bier has joined #ruby
nru has quit [#ruby]
nfluxx has joined #ruby
RichGuk has joined #ruby
iocor has joined #ruby
nfluxx has joined #ruby
Jay_Levitt has joined #ruby
LMolr has joined #ruby
arch_adam has joined #ruby
AxonetBE has joined #ruby
<arch_adam>
hi, I'm currently looking to deploy my php projects with capistrano. there are some articles on the web but they are not so clear.
artOfWar has joined #ruby
SegFaultAX|work has joined #ruby
Eiam has joined #ruby
Denys117 has joined #ruby
mikewintermute has joined #ruby
<Denys117>
hi
jesly_ has joined #ruby
timonv has joined #ruby
Denys117 has quit [#ruby]
tobago has joined #ruby
<bubuz>
anybody know where I can find my .rvmrc file after installing rvm under a specific user? cant find it in ~/.rvmrc or /etc/rvmrc ....
headius has joined #ruby
nobitanobi has joined #ruby
Sailias__ has joined #ruby
<nobitanobi>
Anyone who has used Spreadsheet gem? When generating a file with it, I am able to open it different versions of Excel, except MS Excel 2010, where I get " the file is corrupted". I'm using the following to generate the XLS -> https://gist.github.com/1994530
glosoli has joined #ruby
A124 has joined #ruby
iband has joined #ruby
any-key has joined #ruby
runa has quit [#ruby]
colinwd has joined #ruby
tatsuya_o has joined #ruby
greenarrow has joined #ruby
gmci has joined #ruby
adeponte has joined #ruby
pdtpatr1ck has joined #ruby
DDAZZA has joined #ruby
banjara has joined #ruby
johndbritton has joined #ruby
t0mmyvyo has joined #ruby
apok has joined #ruby
<dbgster>
i tried creating a 'static class variable' in ruby ilke @@table_name = "blah"
<dbgster>
but I get initialized class variable.
codespectator has joined #ruby
voodoofish430 has joined #ruby
cyri_ has joined #ruby
burns180 has joined #ruby
adamkittelson has joined #ruby
Tearan has joined #ruby
codezombie has joined #ruby
Cheshire has joined #ruby
xiaotian has joined #ruby
demian`_ has joined #ruby
nfluxx_ has joined #ruby
boonedocks has joined #ruby
Cheshire has joined #ruby
carlyle has joined #ruby
everton has joined #ruby
sbanwart has joined #ruby
minijupe has joined #ruby
jonom has joined #ruby
Araxia has joined #ruby
sacarlson has joined #ruby
MrGando has joined #ruby
bwlang has joined #ruby
Guest__ has joined #ruby
undersc0re has joined #ruby
mrsolo has joined #ruby
<bwlang>
wtf: "invalid byte sequence in UTF-8" from syntax gem if I have '•C' in a file with # encoding: UTF-8 at the top... • is valid unicode no?
<apeiros_>
if you have it indeed encoded in unicode
<apeiros_>
i.e., not accidentally saved it as iso-latin-8859-1 or something
<apeiros_>
if you remove it, you don't have the error anymore?
<apeiros_>
I mean, the ° sign
munx has joined #ruby
<bwlang>
apeiros: yep - i put in ° and it's gone
<bwlang>
had a problem with another file- and µM on one specific line... on another line µL goes by just fine.
xiaotian has joined #ruby
KL-7 has joined #ruby
pu22l3r has joined #ruby
Helius has joined #ruby
dotemacs has joined #ruby
jeffsmykil has quit [#ruby]
bwlang_ has joined #ruby
ascarter has joined #ruby
<Molfar>
Im using rvm. and I get "You have to install development tools first" while installing gem. what is this?
ed_hz_ has joined #ruby
<undersc0re>
Molfar: are you on OS X?
<Molfar>
yes
<undersc0re>
download XCode
glosoli has joined #ruby
danishkhan has joined #ruby
<Molfar>
I have already installed command tools separatly and I have g++ i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)
<undersc0re>
Molfar: It's known to work if you install XCode..
<Molfar>
ok, thanks
shadoi has joined #ruby
burns180_ has joined #ruby
lampe2 has joined #ruby
davidpk has joined #ruby
Prezioso has joined #ruby
<lampe2>
hey i got a problem with bundler i installed it with: "gem install bundler" and when i make "gem list" i see it installed but when i wanne do something with bundler the prompt says:"ERROR: Gem bundler is not installed, run `gem install bundler` first.
<lampe2>
"
mdw has joined #ruby
Keva161 has joined #ruby
<shevy>
on #ruby there are only two problems:
<shevy>
(1) RVM
<shevy>
(2) Bundler
MrGando has joined #ruby
bwlang_ has joined #ruby
MrGando has joined #ruby
wallerdev has joined #ruby
<davidcelis>
lampe2: are you using rbenv?
<davidcelis>
lampe2: if so, you may need to $ rbenv rehash
<lampe2>
davidcelis, iam uesing RVM
Spockz has joined #ruby
n3m has joined #ruby
kpshek has joined #ruby
hooper has joined #ruby
waxjar has joined #ruby
<shevy>
:D
KL-7 has joined #ruby
Jakee` has joined #ruby
amesha has joined #ruby
Spockz has joined #ruby
ikaros has joined #ruby
vaneda has joined #ruby
trivol has joined #ruby
KL7 has joined #ruby
kevinbond has joined #ruby
tayy has joined #ruby
luckyruby has joined #ruby
Vsg21 has joined #ruby
trivol_ has joined #ruby
Vsg21 has quit [#ruby]
sarmiena_ has joined #ruby
stephenjudkins has joined #ruby
n3m has joined #ruby
sacarlson has joined #ruby
ringotwo has joined #ruby
bier has joined #ruby
sdwrage has joined #ruby
dzhulk has joined #ruby
amesha has joined #ruby
savage- has joined #ruby
hadees has joined #ruby
shruggar has joined #ruby
gianlucadv has joined #ruby
bwlang_ has joined #ruby
cmasseraf has joined #ruby
russel_brand has joined #ruby
<aef>
has anyone here used the gem childprocess before? does anyone know why AbstractIO#_stdin= is part of the private interface. I don't realize how else I could stick in my pipe to send the childprocess stuff to stdin
withnale has joined #ruby
burns180 has joined #ruby
<withnale>
Hello. Whats the difference in code when you are trying to tail STDIN, or a constantly written logfile. I've tried using ARGF.each, ARGF.lines, $stdin.each_line and running a script with ruby -n and they all only pick up the first line written to stdout/stdin and not the subsequent lines.
fr0gprince_mac has joined #ruby
shruggar has joined #ruby
Keva161 has joined #ruby
tyman has joined #ruby
tyman has quit [#ruby]
danishkhan has joined #ruby
jonom has joined #ruby
jonom has joined #ruby
mdw_ has joined #ruby
kW_ has joined #ruby
trivol_ has joined #ruby
virunga has joined #ruby
virunga_ has joined #ruby
theRoUS has joined #ruby
theRoUS has joined #ruby
jonom has quit [#ruby]
justinmcp has joined #ruby
DrShoggoth has joined #ruby
R3dy has joined #ruby
<R3dy>
are there any gems/projects currently using ruby for digital forensics?
brjannc has joined #ruby
brjannc has joined #ruby
sbabiy has joined #ruby
krainboltgreene has joined #ruby
krainboltgreene has quit [#ruby]
Ferdev has joined #ruby
rippa has joined #ruby
<Eiam>
I want to have select return multiple values in one case, but not treat the multiple values as an array
Guest__ has joined #ruby
<shevy>
Eiam return 1,2,3,4,5,6
<shevy>
vs
<Eiam>
hmm let me think this through
<shevy>
return [1,2,3,4,5,6]
DuoSRX has joined #ruby
<Eiam>
shevy: well I'm enumerating through a bunch of hashes and right now i say .select { |x| x["team"] == "Some Name" }
<Eiam>
but i have a weird case where i need to say .select { |x| x["team"] == "Name 1" || x["team"] == "Name 2" } but i don't want t osay 'return either value'
amesha has joined #ruby
<Eiam>
i want to say 'return BOTH of these values for this case'
atmosx has joined #ruby
<Eiam>
like a double select
<shevy>
x if x['team'] == 'Name 1' && x['team'] == 'Name 2'
krainboltgreene has joined #ruby
<shevy>
hmm
<shevy>
both values? what both values?
<Eiam>
x
<Eiam>
all X where the team is A or B
<Molfar>
while installing gem i get Failed to build gem native extension
<Eiam>
eh
<Eiam>
let me write some code
<Molfar>
and then You have to install development tools first
conor_ireland has joined #ruby
<Eiam>
see what falls out, then ill coem back
<Molfar>
I have xcode installed already, but I cant install gem
nfluxx has joined #ruby
luckyrub_ has joined #ruby
macabre has joined #ruby
allan_wind has joined #ruby
kevinbond has joined #ruby
<allan_wind>
Does anyone know if a minor apache (2.0.52-41 to 2.0.52-49) upgrade requires passenger to be reinstalled?
sdeobald__ has joined #ruby
emocakes has joined #ruby
IamTrying has joined #ruby
Sailias has joined #ruby
<IamTrying>
Hello Guys. Do you have source codes in Github?
<ggolin>
suppose i load a gem. is there a way to find out which version i have loaded?
<apeiros_>
IamTrying: no
<apeiros_>
ggolin: most provide a Version or VERSION constant
<IamTrying>
apeiros_, i know it sound stupid, but it was Ruby and Rails make this hack in the broadcast now. Somewhere hackers were not happy with Ruby/Rail
<apeiros_>
IamTrying: it helps having a full picture.
<IamTrying>
apeiros_, Yea have a look in Github you got C/ Java/ Php nothing happend on those
bosborne has joined #ruby
<apeiros_>
IamTrying: all it proves is a) that mistakes are being made (everywhere), b) that you shouldn't ignore warnings about vulnerabilities, and c) that almost everything is hackable.
<IamTrying>
O n l y R u B y R a i L was highlighted
<apeiros_>
IamTrying: you don't seem to have understood what happened.
<IamTrying>
Kind of Hack trick for marketing.
<bosborne>
Does anyone know why `pp @<hashname>` in the ruby debugger wouldn't actually pretty print?
<ggolin>
apeiros_, so, suppose i require 'somegem', how do i access that constant? i tried somegem::Version or ::VERSION
<bosborne>
it's spitting everything on one line
<IamTrying>
apeiros_, Why C or Java code was not hacked?
<apeiros_>
IamTrying: go, read a security focused blog. you'll see that there's plenty of vulnerabilities in plenty of frameworks and languages.
<IamTrying>
apeiros_, why only Ruby and Rail was in the news?
<ggolin>
IamTrying, because of the way it was done.
<apeiros_>
IamTrying: because in a single hack you usually don't go around and hack 20 different things?
<ggolin>
period
<shevy>
C?
<shevy>
IamTrying, what webframework do you know in C?
<apeiros_>
IamTrying: if the bank of england gets robbed, you don't go out and ask "why wasn't bank of america in the news?!?!?" that's just being stupid.
<apeiros_>
IamTrying: also, it's still github that got hacked. not ruby. not rails.
<shevy>
hello IamTrying
<shevy>
think he died :(
<apeiros_>
but it got hacked in a way that many rails apps are probably vulnerable against, as - surprise - you need to put a lot of work into your app to make it secure.
<IamTrying>
apeiros_, yes make sense in that
<apeiros_>
and - also surprise - you need to put a lot of work into your app no matter the language or framework you write it in. languages/frameworks can only protect you so and so far.
<IamTrying>
shevy, i think some hate was involved on Ruby/Rail because many just want C/Java/Php lives.
<apeiros_>
IamTrying: google "php vulnerability"
rippa has joined #ruby
<IamTrying>
It was to me like news of marketing.
<apeiros_>
or google "symphony vulnerability"
<apeiros_>
replace php with any other language
<apeiros_>
replace symphony with any other framework
Prezioso has joined #ruby
undersc0re has joined #ruby
amesha has joined #ruby
<IamTrying>
apeiros_, But is this not Github.com itself fault not really matter Ruby/Rail issues? Because Github.com is reponsible to secure it no!
<IamTrying>
apeiros_, from your example. If you put your money in Bank who is responsible?
<apeiros_>
it's githubs fault. but rails makes it easy to make the mistake.
tvw has joined #ruby
<apeiros_>
IamTrying: the bank analogy was to your "why's it only rails is in the news?!?!?!"
<apeiros_>
it doesn't fit otherwise.
<IamTrying>
apeiros_, well if you take bank analogy. Then both is faulty. Because if you decide wrong bank such as Ruby/Rail without knowing there security etc. Then the programmer or the bank account holder is nonsence/idiot/stupid.
<apeiros_>
*eyeroll*
stephenjudkins has joined #ruby
<apeiros_>
IamTrying: it seems I can't explain it to you in a way you understand it.
sabooky has joined #ruby
<IamTrying>
Thanks a lot, much clear why and what went wrong. I was misunderstanding.
<ggolin>
IamTrying, ты задрал уже
kidoz has joined #ruby
<sabooky>
In a class, to call othermethod from method... is this syntax correct?: self.othermethod
<apeiros_>
ggolin: depends entirely on the gem :-/
<sabooky>
it's behaving right.. just want to make sure I'm doing the right thing
<ggolin>
apeiros_, it's all good, was jsut trying to find out if there was an obvious way. thanks.
<apeiros_>
ggolin: e.g. with rails, it is Rails::VERSION::STRING
allan_wind has quit [#ruby]
minijupe has joined #ruby
odinswand has joined #ruby
Synthead has joined #ruby
emocakes has joined #ruby
MrGando has joined #ruby
K3ler has joined #ruby
bwlang_ has joined #ruby
Gekz has joined #ruby
Gekz has joined #ruby
kW has joined #ruby
rippa has joined #ruby
TheNumb has joined #ruby
robertjpayne has joined #ruby
ilyam has joined #ruby
dhruvasagar has joined #ruby
Liothen_ has joined #ruby
krainboltgreene has joined #ruby
mephux has joined #ruby
shruggar has joined #ruby
dlam has joined #ruby
ephemerian has joined #ruby
amesha has joined #ruby
tatsuya_o has joined #ruby
bglusman has joined #ruby
TaTonka has joined #ruby
mikepack has joined #ruby
jrist has joined #ruby
Seisatsu has joined #ruby
akem has joined #ruby
akem has joined #ruby
amesha has joined #ruby
jayne has joined #ruby
andrewhl has joined #ruby
DrShoggoth has joined #ruby
neurodrone has joined #ruby
neurodrone has joined #ruby
burns180_ has joined #ruby
mikeric has joined #ruby
jbw_ has joined #ruby
belak has joined #ruby
<belak>
Is there a way to use an alternate c/c++ compiler with rake?
KL-7 has joined #ruby
amesha has joined #ruby
sgmac has joined #ruby
andrewhl_ has joined #ruby
`brendan has joined #ruby
andrewhl__ has joined #ruby
n1x has joined #ruby
sbabiy has joined #ruby
m0rt3st has joined #ruby
artOfWar has joined #ruby
dominikh has joined #ruby
thecreators has joined #ruby
jellosea has joined #ruby
macmartine has joined #ruby
bwlang_ has joined #ruby
mezzagis has joined #ruby
timonv has joined #ruby
atmosx has joined #ruby
<atmosx>
hello
<atmosx>
does this make sense? -> (@wordlist << word && word_count += 1) unless @wordlist.include?(word)
RLa has joined #ruby
sdeobald__ has joined #ruby
glosoli has quit [#ruby]
sbabiy has joined #ruby
<apeiros_>
it's ugly
<Mon_Ouie>
You don't have to write it in one line
<Mon_Ouie>
Also using a Set would negate the need to do any of that
<atmosx>
how can I write this one? I'm afraid that if I write this in 2 lines, it will make 2 loops
<atmosx>
Mon_Ouie: explain the 2nd statement further plz
<Mon_Ouie>
Because you can just do @wordlist << word and @worldist.size if @wordlist is a set
<atmosx>
Although I came up with an easier way to calc the word_count, I'm interested heh
<apeiros_>
loops?
<apeiros_>
what loops?
<apeiros_>
unless @wordlist.include?(word); @wordlist << word; word_count += 1; end
<apeiros_>
there's no looping in your code at all
<atmosx>
apeiros_: that's inside an .each loop
<apeiros_>
(notice: you can replace ; with newlines)
<apeiros_>
atmosx: errr, and why'd it be affected at all?
<nobitanobi>
I am consuming from an API dates as strings like this: 2014-11-20 -- I need to do a comparison with the actual Date. How should I do that? Converting that string into a date?
<atmosx>
apeiros_: hmm the 'end' keyword, closes the 'unless'?
adambeynon has joined #ruby
senthil has joined #ruby
davidcelis has joined #ruby
<apeiros_>
atmosx: yes
<atmosx>
wow awesome, didn't knew that was possible
<apeiros_>
just as with `if`
<atmosx>
this explains a lot hmm
* atmosx
loves ruby so much and doesn't even know how to use it
<Mon_Ouie>
unless condition is just if !(condition)
<Mon_Ouie>
(well, except in 1.9 there is a way to make those two behave differently by redefining #!)
IamTrying has quit ["Nothing"]
<apeiros_>
actually, …
<apeiros_>
grrr :)
<apeiros_>
I wonder… does it?
<apeiros_>
yupp, unless does not invoke !
<Mon_Ouie>
I'm pretty sure I already tried doing that, and unless wasn't affected by changing #!
<apeiros_>
I wonder whether that should be considered a bug…
<apeiros_>
I'd tend towards qualifying it as a bug…
AxonetBE has joined #ruby
<nobitanobi>
how can I get a date from the actual date (Time.now) plus 14 days?
<Beoran__>
nobitanobi, add the time in seconds
<apeiros_>
nobitanobi: Time#+ adds seconds
<Beoran__>
so 14 * 3600 * 24
<apeiros_>
(or use activesupport, then do 14.days)
<nobitanobi>
alright
<nobitanobi>
thanks guys
<apeiros_>
Beoran__: odd order of factors :)
nemesit has joined #ruby
<Beoran__>
well, 14 *24 * 3600 then
<Beoran__>
or 14 * 24 * 60 * 60 if you like :)
<apeiros_>
I'd probably have written Fortnight = 14*86400
<apeiros_>
and used that in the actual whatever
burns180 has joined #ruby
<Beoran__>
sure igf you want to go that way you should do SECONDS_PER_DAY = 86400 , to define a constant, in case that changes ;)
jbw_ has joined #ruby
dbgster has joined #ruby
<apeiros_>
Beoran__: it's more to a) not have magic numbers in code, and b) not have a static calculation executed all the time
<apeiros_>
naming stuff++
Gesh has joined #ruby
RLa has quit ["Leaving"]
sheila has joined #ruby
<wroathe>
If I'm to understand correctly is it that Fibers don't run in parallel and threads do? According to Wikipedia: "fibers yield themselves to run another fiber while executing"
marcuspat has joined #ruby
theRoUS has joined #ruby
king313 has joined #ruby
king313 has joined #ruby
<apeiros_>
wroathe: correct
<apeiros_>
the basic difference is that threads are scheduled by the interpreter/OS, while fibers schedule themselves.
<Beoran__>
apeiros_, fibers rock
<Beoran__>
I use them to control a robot at work
<wroathe>
So are race conditions a concern then when using Fibers to access external data?
<td123>
I don't know if this is proper, but could fibers be considered program-level threads?
<apeiros_>
race conditions are unrelated to the tools you use
<apeiros_>
if you have concurrent access to a resource, you've got a potential race condition.
<wroathe>
Ahh.
bwlang_ has joined #ruby
<apeiros_>
sry, s/resource/mutable resource/
<Beoran__>
wll, my experience is that with fibers you don't get "tre" races since it's not really concurrent, but some unexpected behavior can arise
<apeiros_>
(if your resource is immutable, there's nothing to worry about :-) )
<wroathe>
apeiros_: Thanks for the help :)
<apeiros_>
Beoran__: you can code yourself into a race condition with fibers just fine
<apeiros_>
just yield during a mutation…
<Beoran__>
anyway, the advantage of fibers for me is the explicit yielding
somazero has joined #ruby
<wroathe>
I'm having trouble wrapping my head around when it's appropriate to use fibers vs non-threaded programming
<Beoran__>
fibers are great for making event-basd programmin gpalatable
<apeiros_>
wroathe: if you can avoid it, don't use concurrency.
<Beoran__>
for programming my robots for example, I have to poll cetain inputs until the robot gives a reply
<Beoran__>
however, at the sme time I have to check other inputs from the io island as well, which I also need to poll
Azure has joined #ruby
<apeiros_>
Kernel#select :-)
<Beoran__>
so during plling with select, if nothing appears, the fiber jumps in a round-robin fashin betseen the available inputs
<apeiros_>
o0
<Beoran__>
and, between that and the logic thread
<apeiros_>
you know you can select on an array?
<Beoran__>
sure
<apeiros_>
ok
<wroathe>
If Fibers yield to allow eachother to resume then one Fiber hanging will prevent other Fibers from executing, correct?
mikewintermute has joined #ruby
<Beoran__>
yes, so best not do blocking io
rbennacer has joined #ruby
<rbennacer>
hey guys
i8igmac has joined #ruby
amesha has joined #ruby
<rbennacer>
how can i select a specific apps from my heroku account
<wroathe>
Basically the issue I'm running into is we use delayed jobs for sending out mass emails. If the email blast contains more than 750 emails we chunk the total emails into separate workers and store them for execution later. Say we have 18 works queued with 250 emails each waiting to execute
<rbennacer>
i am getting ! No app specified.
<rbennacer>
plz help
glosoli has joined #ruby
coucher has joined #ruby
<wroathe>
The logic inside of the method that's waiting to execute uses a transaction to edit the message row and update the number of workers completed. If the number of workers completed equals the total number to execute then it sets the is_pending field to false
sheila has joined #ruby
<wroathe>
In some cases we have two workers that try to update the message object's row at the same time
<wroathe>
and we wind up with 17 out of 18 workers completed
<wroathe>
and is_pending true
<wroathe>
even though all of the emails have been sent.
<wroathe>
So I'm trying to get an idea of how concurrency works
<Beoran__>
wroathe, could you not beforehand limit the workers to only work on those e-mails they wareassigned to work on
<wroathe>
I should back up. The emails themselves are separate from the message object
<wroathe>
The message is just there as a parent object to contain details about the entire mass email
<wroathe>
a message has_many email_messages
<wroathe>
and message contains the number of workers completed
<wroathe>
so each worker might have 250 email_messages
<Beoran__>
if that is the case, then every worker should be allowed to set it's own status reposr, an it's onw only
<Beoran__>
don't use one field with the amount completed, calculate that
<apeiros_>
or if you want to nail it to a specific class (i.e. even in case of subclassing): YourClass.class_method
xgkkp has joined #ruby
stephenjudkins has joined #ruby
<dbgster>
apeiros_: yeah I'll do that, YouClass.class_method
burns180_ has joined #ruby
<apeiros_>
dbgster: usually, the self.class.class_method variant is to be preferred
<apeiros_>
exactly due to subclassing
<dbgster>
and I want to init these class variables during app startup, is there any convention for doing that? Or just pass in a hash to any class method? (there is no convention like 'initialize' is for newing up a class)
<xgkkp>
I keep getting "warning: Insecure world writable dir /some/random/dir/i/dont/control"; why is this coming up, and how can I turn it off (I don't control the path it is referencing). It seems to happen when using backticks?
<apeiros_>
dbgster: well, the "initialize" for a class is the `class Classname` part
<apeiros_>
i.e. class Classname; @class_ivar = "initial value"; def self.class_ivar; @class_ivar; end; end; Classname.class_ivar # => "initial value"
<apeiros_>
remember, class bodies are just plain code
<Beoran__>
xgkkp, you're flying into fire. It's risky to run a script from a world writable directory
<xgkkp>
I'm not running it from there
<Tasser>
Beoran__, come on, how many people install rvm via bash <( curl ... )
<Tasser>
xgkkp, what do you do within that dir?
<xgkkp>
Tasser, Beoran__: It's a user-global folder several levels above a subdirectory on my PATH (which I need)
<xgkkp>
It's not directly on PATH
<Tasser>
xgkkp, do you execute a script ther?
<xgkkp>
Tasser: No, I don't
<Beoran__>
well, maybe the backtick operator is hard coded to check for such cases and give warnings. Probably for your case spawn or fork and friends are better, give you more control.
<xgkkp>
Beoran__: That's theoretically possible, except that I get it with lots of different ruby packages
pu22l3r_ has joined #ruby
<xgkkp>
so, you'd have to change every single package in the world that uses backticks?
<xgkkp>
?
lie2815_ has joined #ruby
<xgkkp>
Why is it complaining anyway, the directory isn't in my path, it wouldn't be able to load modules from it, would it?
<lie2815_>
hello. how can i configure my apache server to point a subdomain to a ruby app that is running on port 3000?
<Beoran__>
xgkkp, well it's weird, but if you're not running the script from ther, I'm clueless, sorry :p
<dbgster>
apeiros_: but class vars start with @@ not @. confused.
<apeiros_>
dbgster: that's why I called it class_ivar and not class_var ;-)
<Beoran__>
dbgster, in ruby we often uset he member variables of the class in stead of class variables
amesha has joined #ruby
<apeiros_>
on your level of knowledge, and even with more knowledge, you do NOT want to use class vars
<Beoran__>
a class in ruby is also an object, so it also has memer (or instance) variables
<apeiros_>
they're potentially dangerous as they don't work the way you probably think they would
<dbgster>
i see.
<Beoran__>
yes, it's actually rare to need class variables in Ruby. Normaly you wil use the instance/member variables of the class in stead.
<xgkkp>
So, is there a way to disable ruby warnings?
rickmasta has joined #ruby
<Tasser>
shoot the messenger?
supergiantrobot has joined #ruby
<apeiros_>
great stratagey
lie2815_ has quit [#ruby]
igaiga has joined #ruby
havenn has joined #ruby
nilved has joined #ruby
virunga has joined #ruby
steampunkey has joined #ruby
<steampunkey>
rake db:migrate tells me that it can't "find rake-0.9.2.2 in any of the sources". it's the right version, so what's the deal? complete ruby autotools noob here.
Quirrell has joined #ruby
Quirrell has joined #ruby
statix has joined #ruby
philcrissman has joined #ruby
HektoR has joined #ruby
liluo has joined #ruby
td123 has joined #ruby
davidpk has joined #ruby
<HektoR>
Hello guys. How can I use join function of array when array itself contains only integers ? [1,2,3,4,3,2].join this returns this error : can't convert Fixnum to String
daniel_hinojosa has joined #ruby
cableray has joined #ruby
burns180 has joined #ruby
<HektoR>
can anyone help me ?
fowl has joined #ruby
<Eiam>
HektoR: what do you want
booginga has quit ["Leaving"]
<HektoR>
Eiam: How can I use join function of array when array itself contains only integers ? [1,2,3,4,3,2].join this returns this error : can't convert Fixnum to String
<Eiam>
it works fine for me
<Eiam>
002 > [1,2,3,4].join
<Eiam>
=> "1234"
<arch_adam>
can anyone help me set up this damn capistrano lol?
amesha has joined #ruby
h4mz1d has joined #ruby
Asebolka has joined #ruby
<steampunkey>
rake db:migrate tells me that it can't "find rake-0.9.2.2 in any of the sources". what does that mean?
i8igmac has joined #ruby
QaDeS has joined #ruby
skrewler has joined #ruby
tayy has joined #ruby
<Eiam>
it can't find that version of rake
tommyvyo has joined #ruby
<Eiam>
try bundle install
c0rn has joined #ruby
<Eiam>
and then bundle exec rake db:migrate
<steampunkey>
Eiam: says something about "undefined symbol: ruby_current_thread"
<Eiam>
are you using ruby-debug19?
<dbgster>
what's the best ruby object to use to convert to a yaml file?
<dbgster>
I tried a hash, but when calling my_hash.to_yaml I get output like:
<dbgster>
"\"---\\n:a: abc\\n:b: 5\\n\""
<dbgster>
for a hash that looks like: {:a=>"abc", :b=>5}
<Mon_Ouie>
So? That's YAML syntax
<Eiam>
steampunkey: I see atleast 3 viable answers to your question on google.com btw
mmokrysz has joined #ruby
savage-_ has joined #ruby
mmokrysz has quit [#ruby]
zakwilson has joined #ruby
<steampunkey>
Eiam: i thought you were going somewhere. if i knew about bundle exec rake db:migrate, i'd google the string.
amesha has joined #ruby
<Eiam>
steampunkey: googling your error string would have led you to bundle exec
nari has joined #ruby
<Eiam>
googling undefined symbol: ruby_current_thread will tell you how to solve that problem too
<Eiam>
first three hits, all with the same solution.
<dbgster>
Eiam: i have the same issue, haven't sorted it out yet myself.
<Eiam>
update linecache19
<Mon_Ouie>
Why would it work? YAML is for marshalling object
<Mon_Ouie>
If you want to access your objects directly, you don't need to convert them to YAML
randym_ has joined #ruby
eywu has joined #ruby
jergason has joined #ruby
iamjarvo has joined #ruby
<wroathe>
How do you run just one single test file with rake?
<Eiam>
dbgster: hopefully one of those lines I just provided will help you out then
DuoSRX has joined #ruby
<iamjarvo>
what is this called? group_by(&:day)
<wroathe>
I basically want to do ruby -Itest but with the setup and teardown of the testing database
<Beoran__>
iamjarvo, it's the same as group_by { |a| a.day }
<Eiam>
whats the name of the operator
xgkkp has quit [#ruby]
<Beoran__>
in this case I call it the pass-block operator
<Beoran__>
it also works obn variables that contain a block
<Eiam>
unary ampersand
<Beoran__>
yes, that too, I don't know how the Ruby devs call it.
<dbgster>
Mon_Ouie: ok this is what I am doing, I am passing a yml file to a class to init some vars, and I will be loading this from a .yml file. In my rspec tests, I need to mimic a yml object so I thought I could create a ruby hash and then call to_yaml and pass it to my class
bbttxu_ has quit [#ruby]
<iamjarvo>
Beoran__: you call it the pass-block operator?
<Beoran__>
since it's used to pass blocks to a function :p
<Beoran__>
the &:foo notation is a shorthand for block-passing too.
<iamjarvo>
o ok
<Beoran__>
(in a sense)
<iamjarvo>
thanks guys
<Beoran__>
welcome
axl_ has joined #ruby
Mon_Ouie has joined #ruby
mattp_ has joined #ruby
Sailias has joined #ruby
matti has joined #ruby
<dbgster>
how can I write to a ivar from a class method?
nixmaniack has joined #ruby
Sigma00 has joined #ruby
ilyam_ has joined #ruby
ilyam_ has joined #ruby
steampunkey has joined #ruby
<steampunkey>
Eiam: sry, got disconnected. so i tried to do what your link suggested, but I got "linecache19 requires Ruby version >= 1.9.2."
hadees has joined #ruby
burns180_ has joined #ruby
xgkkp has joined #ruby
undersc0re has joined #ruby
undersc0re has joined #ruby
pupoque has joined #ruby
PaciFisT has joined #ruby
amesha has joined #ruby
mutewinter has joined #ruby
<shadoi>
dbgster: new.ivar = "foo"
<shadoi>
dbgster: assuming you used attr_accessor for your ivar.
<shadoi>
or attr_writer
Oog_ has joined #ruby
Boohbah has joined #ruby
<Oog_>
im oing through rails tutorial and am seeing that it puts code right in a class definition class User < ActiveRecord::Base \n attr_accessible :name, :email, :password, :password_confirmation \n end
<deryldoucette>
#rubyonrails
<Oog_>
how can you put code in a class outside of a method? when is it executed? when the class is loaded?
cdabba_ has joined #ruby
<deryldoucette>
not are just creating accessors to name, email, password and pass conf
<deryldoucette>
and please direct the rails stuff to the rails channel. they get a bit pissy over rails stuff in here as its not straight ruby (as in not part of ruby itself) rightfully so since it has its own channel
<Oog_>
deryldoucette: but i think this is a ruby question right?
<deryldoucette>
no. thats a rails convention
<Oog_>
im asking how can you just call functions in a class definition