emmanuelux has quit [Remote host closed the connection]
zaychenok has quit [Quit: Konversation terminated!]
<Vainoharhainen>
horseman: Have not had time to read it yet.
zaychenok has joined #ruby
jenrzzz-mac has joined #ruby
greyEAX has joined #ruby
<horseman>
Vainoharhainen: ok oh, when reading occurs pls msg me yet, and tell me not what you dont think about it
<greyEAX>
how do i move data from one object to another?
<Vainoharhainen>
ok
billiamii has joined #ruby
xastion has joined #ruby
nari__ has quit [Ping timeout: 252 seconds]
sixdahs has quit [Ping timeout: 244 seconds]
<shevy>
greyEAX depends. have you defined a way for these objects to exchange any data yet?
<shevy>
usually it is done via methods, assigning to instance variables
<shevy>
attr_writer :foo
<shevy>
object1.foo = object2.bar
emmanuelux has joined #ruby
jenrzzz-mac_ has joined #ruby
xastion_ has quit [Ping timeout: 265 seconds]
jenrzzz-mac has quit [Read error: Connection reset by peer]
jenrzzz-mac_ is now known as jenrzzz-mac
dsa has quit [Ping timeout: 252 seconds]
<greyEAX>
oic
<greyEAX>
erm, well basically, i've got two objects
<greyEAX>
one that connects to an irc server
<greyEAX>
and another that makes a listen server on udp
<greyEAX>
i need to be able to take data parsed from irc, and push it through the udp server
tris has quit [Ping timeout: 246 seconds]
davidpk has joined #ruby
<greyEAX>
i guess the udp server part isnt really just a listen server lol, basically, it 'listens' for connections, then marks down who wants data sent back to them
BMF has joined #ruby
EzeQL has joined #ruby
mockra has joined #ruby
BMF has left #ruby [#ruby]
xastion has quit [Ping timeout: 248 seconds]
yugui_zzz is now known as yugui
frishi has joined #ruby
adamkittelson has quit [Ping timeout: 252 seconds]
amh345 has joined #ruby
amh345 has quit [Changing host]
amh345 has joined #ruby
dnyy has quit [Remote host closed the connection]
horseman has quit [Remote host closed the connection]
Vainoharhainen has quit [Ping timeout: 252 seconds]
<amh345>
I think i've seen something like this before, but i cant recall where or what it's called. i need to pass an arg to a module, but there is a chance that arg will not be defined if a condition is not met. is there a way when passing the arg to allow it to go through if it doesnt exist?
<amh345>
i could define the variable elsewhere and pass a nill to the argument. but im pretty sure there was a cleaner way.
bricker88 has quit [Quit: Leaving.]
* Enekoos
se despide
<Spooner>
amh345 : You mean def frog(a, b = 12) ?
Progster has joined #ruby
<amh345>
@var if something == somevalue var = "blah" end modulemethod(@var) is the way i know. but not nice.
sepp2k1 has quit [Remote host closed the connection]
Enekoos has quit [Remote host closed the connection]
<amh345>
Spooner: so that would mean that if "b" is not defined as something else, it will pass it as 12?
inossidabile has joined #ruby
inossidabile has left #ruby [#ruby]
<shevy>
DEFAULT_VALUE = 10
gebe has left #ruby ["Lämnar"]
zaychenok has quit [Read error: Connection reset by peer]
<shevy>
def foo(a, b = DEFAULT_VALUE)
<shevy>
b = DEFAULT_VALUE if b.nil?
<amh345>
i wonder if modulemethod(a,b,c, @var if @var.exist) would work
zaychenok has joined #ruby
<shevy>
no that will not. but you can check inside the method.
Kn|t3 has quit [Quit: Kn|t3]
trend has quit [Read error: No route to host]
trend_ has joined #ruby
<amh345>
ok. i see. thanks.
robotmay has quit [Remote host closed the connection]
kenperkins has quit [Ping timeout: 248 seconds]
gtuckerkellogg has joined #ruby
crazed has joined #ruby
jtoft has joined #ruby
fbernier has quit [Ping timeout: 244 seconds]
<crazed>
hm, how do you do log base 2 in ruby 1.8.7?
grantbdev has joined #ruby
<Spooner>
amh345: Strictly, it will make b == 12, if b is nil or not specified.
freeayu has joined #ruby
<jtoft>
for gem sources, does the ordering matter in terms of priority? Or how can you enforce that?
<amh345>
ok. i was trying to find a way around writing a bunch of check. i guess i could pass b= nil
<Spooner>
No, if it isn't there, it will be 12 too. You can call frog(1, 2) to specify or frog(1) or frog(1, nil) to default.
<amh345>
def foo(a, b = nil) is no good?
wilmoore has quit [Remote host closed the connection]
<shevy>
crazed, hmm ... this one? Math.log(Math::E) # => 1.0
<Spooner>
It matters if you have multiple defaults, such as frog(a, b = 12, c = 9) and want to do frog(1, nil, 2) defaulting not all params.
<shevy>
or that one Math.log(2) # => 0.6931471805599453
visof has joined #ruby
<Spooner>
amh345: def foo(a, b = nil) doesn't do anything useful :)
g0bl1n has quit [Quit: Ex-Chat]
<amh345>
im just trying to figure out a way around this. heh
<amh345>
if i give 'b' a default value, then in my module i need to check if it's that default. and if it is, ignore it.
perryh_away is now known as perryh
looopy has quit [Remote host closed the connection]
<Spooner>
amh345 : I'm not sure what you mean.
shtirlic has quit [Read error: Connection reset by peer]
shtirlic has joined #ruby
chrismcg is now known as zz_chrismcg
<Spooner>
shevy : Math.log(2, 7) would be how you do it in 1.9 (that is Log2 of 7), but 1.8.7 Math only seems to support LogE and Log10 :(
<amh345>
this is a rails app. so im building some statistics. i pass some args to the module and the module inserts them into the db. but one of those args might not exist should a condition not be met.
<shevy>
hmm
<shevy>
amh345 check inside your method
<amh345>
yeah. that's what ill have to do.
<shevy>
so far you only paste the parameter list but not the content of your method. it would be easier if you show your whole code, at least the one that is specific pertaining to your problem
<shevy>
to pastie.org
shikamaru has joined #ruby
koskoz has joined #ruby
Synthead has joined #ruby
NimeshNeema has quit [Remote host closed the connection]
relix has quit [Remote host closed the connection]
moeSeth has quit [Remote host closed the connection]
MetaCosm has quit [Remote host closed the connection]
notbrent has quit [Remote host closed the connection]
_marvin has quit [Read error: Connection reset by peer]
blooberr has quit [Remote host closed the connection]
si14 has quit [Write error: Broken pipe]
denysonique has quit [Remote host closed the connection]
DavidTiger has quit [Remote host closed the connection]
randym has quit [Remote host closed the connection]
cesario has quit [Remote host closed the connection]
Spaceghostc2c has quit [Remote host closed the connection]
MoMo has quit [Remote host closed the connection]
anildigital_work has quit [Remote host closed the connection]
kapowaz has quit [Remote host closed the connection]
jeremy_carroll has quit [Read error: Connection reset by peer]
dekz has quit [Remote host closed the connection]
SeanTAllen has quit [Read error: Connection reset by peer]
patricksroberts has quit [Write error: Connection reset by peer]
avandendorpe has quit [Remote host closed the connection]
saidin_ has quit [Remote host closed the connection]
ctevie has quit [Remote host closed the connection]
ziyadb has quit [Read error: Connection reset by peer]
Dr4g_ has quit [Read error: Connection reset by peer]
<greyEAX>
oh boy
<greyEAX>
netsplits
lectrick has quit [Remote host closed the connection]
dnyy has joined #ruby
aquaranto has quit [Remote host closed the connection]
axolx is now known as axolx|afk
ciopte7 has joined #ruby
<greyEAX>
so yeah, how should i handle that situation?
L-----D has joined #ruby
<greyEAX>
with the data i mean?
<greyEAX>
i mean, i guess i could make like, a global variable or something
<greyEAX>
and have the one object write every line to it or something
<shevy>
yeah use that
<greyEAX>
oh
<greyEAX>
welp
<greyEAX>
lol
<shevy>
lol
<shevy>
the child of well and help
<greyEAX>
i really need to learn the concept of occams razor
liluo has joined #ruby
pu22l3r has quit [Remote host closed the connection]
<greyEAX>
i always come up with solutions, but i think 'man that sounds really dumb/way too simple, i bet i'm not right about this'
<greyEAX>
then i ask somewhere, and people are like 'yeah, no, do that.'
<eam>
mischief: two factor is orthogonal to plaintext/challenge response issue
mrsolo has left #ruby ["Leaving"]
silentpost has quit [Quit: leaving]
MrGando has quit [Quit: Bye]
Markvilla has quit [Ping timeout: 244 seconds]
mockra has quit [Remote host closed the connection]
<Paradox>
isn't that what 1.9 sample already does?
<bnagy>
try to stay with the program, Paradox
<bnagy>
10:35 < sgronblom> Was just looking for a quick n dirty way to replicate Array#sample in 1.8.6
<Paradox>
oh lol
Karmaon has quit [Ping timeout: 265 seconds]
<mischief>
eam: so?
Progster has joined #ruby
ericcoleman has joined #ruby
<horseman>
bnagy: i would just do: array.shuffle.take(n)
<horseman>
though some babies might say that's less efficient, i think it's cute
d3c has joined #ruby
<Paradox>
horseman, thats a nice one liner
<Paradox>
and not sure if its less efficient…
<Paradox>
erm
<Paradox>
yeah it is
<Paradox>
nvm
<bnagy>
horseman: yours has the advantage of needing a lot less error handling
randym has joined #ruby
eywu has quit [Quit: Leaving.]
fbernier has joined #ruby
akem has quit [Ping timeout: 252 seconds]
horseman has quit [Ping timeout: 248 seconds]
<bnagy>
I hate my isp
BMF has joined #ruby
<bnagy>
I think they use a proxy - I"ma get a google bot to continually search for things like 'nepal telecom customer service center location' and 'how to hide a body' and '7.62mm ammunition'
wilmoore has joined #ruby
horseman has joined #ruby
axl_ has joined #ruby
greyEAX has quit [Quit: Leaving]
Spooner has quit [Ping timeout: 244 seconds]
skinny_much has joined #ruby
<horseman>
bnagy: hey
<horseman>
bnagy: do you often get food poisoning?
mdw has quit [Remote host closed the connection]
skinny_much has quit [Read error: Connection reset by peer]
skinny_much has joined #ruby
Karmaon has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
<Paradox>
bnagy, could be your dns
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
silentpost has quit [Ping timeout: 240 seconds]
<bnagy>
Paradox: yeah it could be, but it's not
<Paradox>
Charter used to do all sorts of stupid dns redirections
<Paradox>
they wouldn't send 404s or whatever
<bnagy>
horseman: no, that was the second time in >2 years
<Paradox>
or DNS errors
Tref has quit [Remote host closed the connection]
<Paradox>
rather they'd redirect you to their shitty bing-powered ad-ridden site
<bnagy>
Aristata: if you have highlighted someone for better or worse they'll answer when they get back
greyEAX has joined #ruby
<jamescarr>
I'll restart unity...
jamescarr has quit [Quit: Leaving]
<bnagy>
Aristata: btu you might have more luck in one of the rails channels eg #rubyonrails
<Aristata>
You do realize that dm-paperclip is not a person right?
<Aristata>
It's a preface
erichmenge has quit [Quit: erichmenge]
neohunter has quit [Quit: Leaving...]
<bnagy>
no, I didn't realise that
Karmaon has quit [Ping timeout: 244 seconds]
dhruvasagar has joined #ruby
billiamii has quit [Ping timeout: 265 seconds]
mrdtt has joined #ruby
hunglin has quit [Quit: Leaving.]
<bnagy>
but regardless of whether you choose to use your own personal shorthand that employs 'prefaces' that look like nicks, a) you don't need to paste the same thing every 10 minutes and b) you might have more luck in a rails channel
uris has quit [Quit: leaving]
shtirlic has quit [Read error: Connection reset by peer]
shtirlic has joined #ruby
Progster has quit [Ping timeout: 240 seconds]
randym has quit [Remote host closed the connection]
krusty_ar has quit [Ping timeout: 244 seconds]
xiaotian has quit [Quit: Computer has gone to sleep.]
azm has quit [Read error: Connection reset by peer]
xiaotian has joined #ruby
chrxn has joined #ruby
<Aristata>
I have been in the rails channel
<Aristata>
I post it when my screen fills with eople coming and going
<Aristata>
That's reasonable, and I will continue
<graspee>
Aristata: it's not reasonable. that's not the way the channel works
<horseman>
Aristata: try posting on stack overflow
alphabitcity has left #ruby [#ruby]
<bnagy>
it's not reasonable because a) this is not a rails channel and b) every 10 minutes is too often
<graspee>
it's not some 1990s cracks and wares channel where people spam the same messages every few minutes until someone bites. think of it as a conversation
simao_ has joined #ruby
<Aristata>
That's news to me that datamapper doesn't work with ruby
<Aristata>
Deal with it
<graspee>
that's overly aggressive talk for a newcomer. i do not see you doing well here
<Paradox>
freeayu, you wanted to completely delete a file and make a new one?
<Aristata>
A newcomer?
<Aristata>
ha
<Aristata>
I have been in this game for 7 years
<graspee>
what game?
<Aristata>
I don't come in here often becasue it's rare I need help
<horseman>
Aristata: reposting the same qustion every 10 mins would get u banned if there was an op here
<aces1up>
array1 - array2 # Remove Any Elements from Array 1 that are contained in Array 2.(Difference)
<aces1up>
=> ["z"] how do I remove elements from array 1 that ARE NOT in array 2?
<graspee>
oh srsly
mvangala_home has quit [Remote host closed the connection]
<Aristata>
so scared
<samuelkadolph>
aces1up: array1 & array2 will give you elements only in both arrays
<offby1>
aces1up: I'd be tempted to turn them both into Sets, then do a set intersection
<Paradox>
just use an &
<aces1up>
does that modify the arrays?
<horseman>
Aristata: diaf
<Paradox>
no
<offby1>
hmm, if a is an array, then a & a eliminates duplicates
<Paradox>
array1 = array1 & array2
<graspee>
Aristata: you seem to neither know nor care what the conventions of the channel are. all you care about is selfishly getting your question answered, no matter who it pisses off. you didn't deserve what banister wrote to you but banister is banister (horseman)
<offby1>
a = a & b
<offby1>
Paradox: d'oh :)
<aces1up>
Paradox thanks.
<Paradox>
offby1, a&a delets a whole array i believe
<offby1>
just tried it -- it merely eliminates dups
pu22l3r_ has quit [Remote host closed the connection]
pting has quit [Ping timeout: 244 seconds]
imami|afk is now known as banseljaj
<Paradox>
ah you're right
<Paradox>
thats a useful little code snippet
<offby1>
which strongly suggests that it's just doing set intersection under the covers. I imagine the docs say so explicitly but I'm too lazy to read them :)
<aces1up>
Paradox your code seems to work for me.
<offby1>
I tell ya, "pry" is handier than reading the dcs.
adeponte has quit [Ping timeout: 244 seconds]
<Paradox>
yah
<Paradox>
cd Array
<Paradox>
show-doc &
<Aristata>
graspee: There was a downtime of about a hundred people coming and going with no conversation what so ever, fuck off.
minijupe has quit [Read error: Connection reset by peer]
minijupe has joined #ruby
chrxn has joined #ruby
eddie has joined #ruby
eddie is now known as Guest68068
koskoz has quit [Ping timeout: 244 seconds]
<Guest68068>
i have configured root :to => "Graphter#home" in route of my rails app
randym has quit [Ping timeout: 248 seconds]
<davidcelis>
Guest68068: #rubyonrails
<Guest68068>
but browser landing at rails index page
Guest68068 is now known as eddie_
<eddie_>
davidcelis: yes
<eddie_>
i am new to web
senny has joined #ruby
c0rn_ has joined #ruby
<Hanmac>
he means that you are in the wrong channel
nilg has joined #ruby
advorak has quit [Remote host closed the connection]
<eddie_>
Oops
<eddie_>
thanks
mdw has joined #ruby
* Hanmac
is going to #rubywithoutrails
krz has joined #ruby
Morkel has joined #ruby
gtuckerkellogg has quit [Ping timeout: 244 seconds]
Liothen has quit [Remote host closed the connection]
Soul_Est has quit [Ping timeout: 246 seconds]
Bonkers has joined #ruby
mohits has joined #ruby
mohits has quit [Changing host]
mohits has joined #ruby
igotnolegs has quit [Quit: Computer has gone to sleep.]
<Bonkers>
what's the really simple markup gem that converts text to HTML by adding stuff like <p> around paragraphs? I can't find it now, but there's somethign much simpler than textile/redcloth
chrxn has quit [Quit: Computer has gone to sleep.]
EskiMag has joined #ruby
visof has left #ruby ["AndroIRC"]
eywu has quit [Quit: Leaving.]
nipra has joined #ruby
the-newsman has joined #ruby
<the-newsman>
hi all
eddie_ has quit [Read error: Connection reset by peer]
<the-newsman>
plz tell me the best ruby IDE . i want an editor that helps me in writing ruby programs.
<davidcelis>
sublime text 2 or vim
bosphorus has quit [Remote host closed the connection]
<the-newsman>
r those for windows or linux ?
<the-newsman>
i need windows
<davidcelis>
i will respectfully advise against windows
<bnagy>
IDEs suck in general, ruby IDEs suck in particular
<bnagy>
just use an editor
<davidcelis>
and suggest a virtual machine running linux; if you are intent on windows, can't help you
fantazo has joined #ruby
<the-newsman>
davidcelis, windows is sueprior in UI. the best ever ide is visual studio editor
<the-newsman>
super marverllous
<the-newsman>
all linux's sux
<davidcelis>
lol...
dhruvasagar has joined #ruby
<rdctnst>
linux's... linii?
<the-newsman>
lenin
chrxn has joined #ruby
<the-newsman>
stalin
AxonetBE has joined #ruby
xiaotian has quit [Quit: Computer has gone to sleep.]
<the-newsman>
anyway. is there Good IDE for ruby under windows ?
<davidcelis>
no
<rdctnst>
no
<billiamii>
rubymine is ok, not great.
<davidcelis>
because there are no good IDEs
becomingGuru has joined #ruby
jprovazn_away is now known as jprovazn
<davidcelis>
rubymine kinda blows
<rdctnst>
^+1
<davidcelis>
it's clunky and slow
randym has joined #ruby
<davidcelis>
and bloated
nilg` has joined #ruby
<rdctnst>
kinda like windows
<becomingGuru>
I am learning Ruby and know Python very well. Which is a good detailed reference?
<Hanmac>
you could use eclipse for ruby
Karmaon has quit [Ping timeout: 265 seconds]
<davidcelis>
becomingGuru: The Well Grounded Rubyist is a good book
<the-newsman>
Hanmac i know. however i wish to use specialy made ruby editor
shtirlic has quit [Read error: Connection reset by peer]
shtirlic has joined #ruby
wilmoore has joined #ruby
sgronblom has quit [Quit: leaving]
banseljaj is now known as imami|afk
bluOxigen has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
ph^ has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
EskiMag has quit [Quit: EskiMag]
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
evoltech has joined #ruby
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
khakimov has joined #ruby
mdw has quit [Remote host closed the connection]
overmind667 has joined #ruby
jbpros_ has quit [Quit: jbpros_]
ph^_ has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
ph^ has quit [Ping timeout: 248 seconds]
MissionCritical has quit [Ping timeout: 240 seconds]
c0rn_ has quit [Quit: Computer has gone to sleep.]
looopy has quit [Remote host closed the connection]
abionic has joined #ruby
r0bby is now known as robbyoconnor
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
billiamii has quit [Quit: Leaving]
Karmaon has quit [Ping timeout: 265 seconds]
allanm has quit [Read error: Connection reset by peer]
evoltech has quit [Read error: Connection reset by peer]
robozahn has joined #ruby
Occult has quit [Ping timeout: 245 seconds]
graspee has quit [Ping timeout: 240 seconds]
Occult has joined #ruby
Occult has quit [Max SendQ exceeded]
Xethron has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
randym has quit [Remote host closed the connection]
zaychenok has joined #ruby
Occult has joined #ruby
werdnativ has quit [Quit: FAMOUS_LAST_WORDS is nil]
zommi has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
Helius has joined #ruby
mikepack has quit [Remote host closed the connection]
MissionCritical has joined #ruby
<Xethron>
Heya, I know nothing about Ruby. Trying to work on a script here and add a MySQL connect. Its a class file, and I've tested my MySQL code in a normal rb file, and it works perfectly. But as soon as I add it to the class file, I don't think the method gets my "my" MySQL variable. I have found out if I put everything in the method, it does, but as this thing will run a few times a second,
havenn has quit [Ping timeout: 248 seconds]
<Xethron>
its not very effective
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
jbpros_ has joined #ruby
<Xethron>
so in the initialize method I got my = Mysql::new(my_host, my_user, my_pass, my_db)
Eldariof-ru has joined #ruby
arturaz has joined #ruby
<Xethron>
but when I try to use it in another method, it doesnt work
<Xethron>
I tried chanigin it to $my and @my and @@my..... but yeah
<Xethron>
Not sure how to pas a a var to another method
<Xethron>
should I move it to the main class? or how do I get it public?
chrxn has quit [Quit: Computer has gone to sleep.]
the-newsman has left #ruby [#ruby]
robozahn has quit [Ping timeout: 252 seconds]
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
randym has joined #ruby
CheeToS has quit [Ping timeout: 248 seconds]
tvw has quit [Remote host closed the connection]
maesbn has quit [Ping timeout: 240 seconds]
ephemerian has joined #ruby
<yoga>
anyone ever using twitter gems on ruby on rails?
<Hanmac>
yoda you asking in the wrong channel
Occult has quit [Ping timeout: 244 seconds]
<yoga>
oh i'm sorry
jimeh2 has joined #ruby
EskiMag has joined #ruby
yoga has left #ruby ["Leaving"]
maesbn has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
dhruvasagar has quit [Ping timeout: 265 seconds]
<Xethron>
meh :/
<Xethron>
no one around?
fantazo has quit [Remote host closed the connection]
kapowaz has joined #ruby
MetaCosm has joined #ruby
emmanuelux has joined #ruby
mayankkohaley has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
impomatic has joined #ruby
zaychenok has joined #ruby
pu22l3r has quit [Ping timeout: 265 seconds]
wilmoore has quit [Remote host closed the connection]
bglusman has joined #ruby
zz_chrismcg is now known as chrismcg
BiHi has joined #ruby
jenglish has joined #ruby
avandendorpe has joined #ruby
blacktulip has joined #ruby
anildigital_work has joined #ruby
[Neurotic] has quit [Quit: Leaving]
relix has joined #ruby
cesario has joined #ruby
moeSeth has joined #ruby
bglusman has quit [Ping timeout: 244 seconds]
timonv has joined #ruby
overmind667 has quit [Ping timeout: 240 seconds]
impomatic is now known as john_metcalf
MoMo has joined #ruby
mockra_ has quit [Remote host closed the connection]
<Xethron>
Dont know much about Ruby. Trying to add MySQL support to a class file. My MySQL code works perfectly in a standard one file script, but not in this class. I don't think the method gets my "my" MySQL variable, becayse if I put everything in the method, it works, but thats not very effective.
coderhut has joined #ruby
<Xethron>
In the initialize method I got: my = Mysql::new(my_host, my_user, my_pass, my_db)
nilg` has joined #ruby
<Xethron>
In my second method I got: my.query("INSERT INTO invites (`email`, `key`, `parent`) VALUES ('" + email + "','" + key + "','" + $user + "')")
andrewhl has quit [Remote host closed the connection]
fixl has joined #ruby
<Xethron>
I tried chanigin it to $my and @my and @@my. Not sure how to pas a var to another method. Should I move it to the main class? Or how do I get it public?
zaychenok has quit [Ping timeout: 265 seconds]
<bigkevmcd>
Xethron: you're defining my as a local variable...you probably want it as @my = ...
<bigkevmcd>
Xethron: oh, and your SQL is insecure, look at preparing statements
qwerxy has quit [Quit: offski]
nilg` has quit [Read error: Connection reset by peer]
<Xethron>
bigkevmcd: I have tried @my, still doesn't work :/
<Xethron>
let me try it again.
<bigkevmcd>
Xethron: paste your code to gist.github.com
<Nitrodist>
lol banisterfiend what are you referring to?
cj3kim has quit [Quit: This computer has gone to sleep]
<banisterfiend>
Nitrodist: trying to view his source code
Gm4n has joined #ruby
Gm4n has quit [Changing host]
Gm4n has joined #ruby
GeekOnCoffee has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
randym has quit [Remote host closed the connection]
<Nitrodist>
yeah, is there a specific thing you're referring to or did you just make that up
<banisterfiend>
Nitrodist: can i view yours too pls
<banisterfiend>
Nitrodist: it's pry syntax :)
ravee has joined #ruby
<Nitrodist>
there we go
nilg` has joined #ruby
mdw has joined #ruby
Vainoharhainen has joined #ruby
robozahn has joined #ruby
rob_ has joined #ruby
<rob_>
hi
qwerxy has joined #ruby
qwerxy has quit [Client Quit]
roolo has joined #ruby
Guest20110 has joined #ruby
<rob_>
if you have two versions of ruby installed on a system (for example in debian precise i have 1.8 and 1.9 installed, 1.8 being /usr/bin/ruby) what is the recommended way to use the second ruby installation (in this case: 1.9) for my apps?
L-----D has quit [Quit: Leaving]
<rob_>
some system packages depend on 1.8 so i can't just remove it
manizzle has quit [Read error: No route to host]
<bnagy>
use rbenv
<bnagy>
or rvm if you must
<rob_>
bnagy: ok, it's not possible to do it without rbenv though?
simao has joined #ruby
c0rn_ has joined #ruby
<bnagy>
it is
<bnagy>
but you'd just end up writing rbenv
<rob_>
ok, thanks :)
<bnagy>
you can compile from source and then link to the binaries
<banisterfiend>
bnagy: have you heard of rbfu?
<Nitrodist>
bnagy: woah, I think I have a good name for that
c0rn_ has quit [Client Quit]
<banisterfiend>
bnagy: apaprently it's even more lightweight than rbenv
<Nitrodist>
I'll call it the mvr - manager of versions of ruby
<Hanmac>
rob_ you could also change the bin/ruby with update-alternatives --config ruby
federic has joined #ruby
<banisterfiend>
Hanmac: hello und :)
d3vic3 has quit [Ping timeout: 246 seconds]
<rob_>
Hanmac: i cant do that due to system packages..
<rob_>
thanks for the advice dudes
cyong has joined #ruby
<bnagy>
the only thing system ruby is good for on debian is.. wait nothing
<rob_>
bnagy: puppet relies on it
<rob_>
in our environment
<bnagy>
unless you use rvm then you need system ruby to bootstrap
d3c has quit [Quit: Quit]
<Hanmac>
bnagy that is not so true ... in the next debian/ubuntu the default ruby is changed to 1.9*
graspee has joined #ruby
burgestrand has joined #ruby
<bnagy>
yeah? It's not even installed by default on xubuntu
d3vic3 has joined #ruby
<bnagy>
they'll probably use 1.9.1 or something though
simao_ has quit [Ping timeout: 265 seconds]
<rob_>
there isn't really a way around it being a dependency
Kn|t3 has joined #ruby
jbpros_ has quit [Quit: jbpros_]
<Hanmac>
bnagy i said in the NEXT ... not in the current
TPFC-SYSTEM has joined #ruby
randym has joined #ruby
<bnagy>
what's more next than quantal?
bosphorus has joined #ruby
<Hanmac>
yeah in quantal ... the ruby-defaults package points now to ruby1.9
<bnagy>
which is great, but I bet they'll still fuck it up and use an old 1.9 version
pk1001100011 has joined #ruby
<bnagy>
I have about as much faith in ubuntu ruby packages as I have in the linux kernel dev team
heftig has joined #ruby
<Xethron>
bigkevmcd: Thanks, I got it working with your info :D
overmind667 has joined #ruby
<Xethron>
banisterfiend: sorry, no need to anymore :P
graspee has quit [Ping timeout: 246 seconds]
francisfish has joined #ruby
graspee has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
<Hanmac>
bnagy currently its 1.9.3.194-1, wich is the latest ruby
anildigital_work has quit [Remote host closed the connection]
kapowaz has quit [Remote host closed the connection]
avandendorpe has quit [Read error: Connection reset by peer]
si14 has quit [Remote host closed the connection]
relix has quit [Remote host closed the connection]
moeSeth has quit [Remote host closed the connection]
cesario has quit [Remote host closed the connection]
MetaCosm has quit [Write error: Connection reset by peer]
MoMo has quit [Write error: Connection reset by peer]
<banisterfiend>
Hanmac: hey i just bought diablo 3, wanna play against me?
fserb has quit [Quit: ttyl]
MetaCosm has joined #ruby
fserb has joined #ruby
fserb has quit [Client Quit]
Shrink has quit [Ping timeout: 244 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
d3vic3 has quit [Read error: Connection reset by peer]
horseman has joined #ruby
<Hanmac>
dont buy it
d3vic3 has joined #ruby
saschagehlich has joined #ruby
<Xethron>
lol
MoMo has joined #ruby
anildigital_work has joined #ruby
kapowaz has joined #ruby
ravee has left #ruby [#ruby]
iocor has joined #ruby
relix has joined #ruby
iocor has quit [Changing host]
iocor has joined #ruby
avandendorpe has joined #ruby
cesario has joined #ruby
dekroning has joined #ruby
<shevy2>
lol
rob_ has left #ruby [#ruby]
ph^_ has quit [Remote host closed the connection]
si14 has joined #ruby
ph^ has joined #ruby
pygospa has quit [Disconnected by services]
TheRealPygo has joined #ruby
neurotech has joined #ruby
Shrink has joined #ruby
ph^ has quit [Ping timeout: 244 seconds]
wubino has joined #ruby
<wubino>
What is the best flickr library?
moeSeth has joined #ruby
tatsuya_o has joined #ruby
jeff_sebring has joined #ruby
DrForr has joined #ruby
tvw has joined #ruby
qwerxy has joined #ruby
d3c has joined #ruby
randym has quit [Remote host closed the connection]
shadoi1 has quit [Quit: Leaving.]
overmind667 has quit [Ping timeout: 245 seconds]
shadoi has joined #ruby
d3vic3 has quit [Ping timeout: 252 seconds]
d3vic3 has joined #ruby
skinny_much has joined #ruby
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
adeponte has quit [Remote host closed the connection]
mfridh has joined #ruby
pp01bit has quit [Remote host closed the connection]
jitesh_shetty has quit [Ping timeout: 244 seconds]
Criztian has joined #ruby
jitesh_shetty has joined #ruby
gianlucadv has joined #ruby
matti has quit [Changing host]
matti has joined #ruby
eurbach has quit [Quit: Leaving.]
overmind667 has joined #ruby
becomingGuru1 has joined #ruby
becomingGuru has quit [Ping timeout: 246 seconds]
TheRealPygo has quit [Quit: leaving]
jitesh_shetty has quit [Ping timeout: 244 seconds]
pygospa has joined #ruby
Siphonblast2 has quit [Quit: Leaving]
<apeiros_>
heftig: hm, I wonder whether github adds to nofollow meta to spoil such efforts…
cantonic_ has joined #ruby
cantonic has quit [Ping timeout: 240 seconds]
cantonic_ is now known as cantonic
Shrink has quit [Ping timeout: 244 seconds]
klj613 has joined #ruby
<klj613>
i got lib/room.rb and test/test_room.rb -- within test_room.rb i got --> require_relative '../lib/room' <-- i also tried using the .rb extension doesnt work
Kn|t3 has quit [Quit: Kn|t3]
robozahn has quit [Quit: leaving]
graspee has quit [Quit: leaving]
<klj613>
nm, done
<Hanmac>
klj613 what was your error?
<klj613>
something basic. on one file i had '.vb' as couple weeks ago i had to do a .net project -.-
<klj613>
and im new to ruby... so habbit kicked in
freeayu has quit [Ping timeout: 252 seconds]
hakunin has quit [Read error: Connection reset by peer]
hakunin has joined #ruby
kungfoo has joined #ruby
jitesh_shetty has joined #ruby
kungfoo has left #ruby [#ruby]
freeayu has joined #ruby
kungfoo has joined #ruby
kungfoo has quit [Client Quit]
alerticus has joined #ruby
iocor has quit [Quit: Computer has gone to sleep.]
Shrink has joined #ruby
liluo_ has quit [Read error: Connection reset by peer]
Drewch has quit [Ping timeout: 246 seconds]
BiHi has quit [Quit: Computer has gone to sleep]
robozahn has joined #ruby
liluo has joined #ruby
d3vic3 has quit [Quit: leaving]
d3c has quit [Quit: Sleep]
freeayu has quit [Ping timeout: 240 seconds]
Beoran_ has joined #ruby
<klj613>
i keep getting "cannot load such file -- zlib" for trying to install gems or "gem update --system" etc
<klj613>
i installed zlib via rvm and via apt-get
Beoran4 has quit [Ping timeout: 244 seconds]
lolmaus has joined #ruby
zinjacoder has joined #ruby
lolmaus has quit [Client Quit]
<Hanmac>
klj613 you need to install zlib and zlib-dev before you install rvm
[Neurotic] has quit [Quit: ttyl!]
lolmaus has joined #ruby
<klj613>
so reinstall rvm
<Hanmac>
i think thats the best way
freeayu has joined #ruby
liluo has quit [Remote host closed the connection]
<apeiros_>
klj613: btw., `lsof -i:4567` if you don't want to grep
<apeiros_>
oh my, I'm writing on of those super-ugly method_missing's :-S
grendlme has joined #ruby
Progster has joined #ruby
pu22l3r has joined #ruby
wvdschel has joined #ruby
wvdschel has quit [Changing host]
wvdschel has joined #ruby
jeff_sebring has quit [Remote host closed the connection]
ken_barber has joined #ruby
nipra has joined #ruby
pu22l3r has quit [Remote host closed the connection]
pu22l3r has joined #ruby
nipra has quit [Read error: Connection reset by peer]
jcromartie has quit [Read error: Connection reset by peer]
neurotech has quit [Remote host closed the connection]
sspiff has quit [Ping timeout: 244 seconds]
clockwize has joined #ruby
frishi has quit [Quit: Leaving...]
frishi has joined #ruby
frishi has quit [Client Quit]
<Xethron>
I'm building an IRC bot, and I want to check something 1 min after someone joins, but the script shouldn't halt. How can I set up a timer like that?
<bnagy>
about a million ways
<Xethron>
bnagy, most effective :P
<bnagy>
build it on an evented framework
* Progster
agrees with bnagy
krz has quit [Quit: krz]
<Xethron>
Hmm, you don't maybe have a link to an example?
<Progster>
you can whip it up yourself, with just a regular producer/consumer queue, where the tcp stream parses input and then converts them to events that are posted on the queue. Your consumer then consumes the events and does what action is needed. You can set up a "delay" event which when the consumer inspects it, if the time hasn't elapsed yet, it just places it back on the queue
<Xethron>
oooh, ok
jeff_sebring has joined #ruby
<bnagy>
a Queue is definitely the easy place to start if you want to build from scratchj
<bnagy>
threadsafe
<Xethron>
Yes, I need something that isn't resource intensive
<bnagy>
then in whatever run loop you have you can just check the queue to look for work, otherwise process as usual
<bnagy>
well I don't think an IRC bot is going to tax your system
<Xethron>
bnagy, thanks :)
<bnagy>
you should still build it on an event framework or something though, it will save rewriting it in a month
<Xethron>
bnagy, shouldn't yes :P unless I do something wrong heh
<Xethron>
ok, will do
tommyvyo_ has joined #ruby
<Progster>
unless you want to learn how to make an eventing framework
<Progster>
I think it's a good exercise to go through personally
grendlme has quit [Quit: grendlme]
<Xethron>
Progster, if you have a link to a tutorial or example I can check it out
grendlme has joined #ruby
digitalcakestudi has quit [Ping timeout: 244 seconds]
<lewis1711>
how do I map between two files? like for each line in file b, I want to run a string transformation then write the transformed result to file b
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<JonnieCache>
im guessing line 2
<lewis1711>
ctojavautil.rb:2:in `convert': undefined method `split' for nil:NilClass (NoMethodError)
<lewis1711>
yeap
<JonnieCache>
ah well that means gsub! is returning nil
<JonnieCache>
and youre trying to call split on nil
<JonnieCache>
so you either need to tweak the regex so it doesnt return nil in that scenario
AxonetBE has joined #ruby
<AxonetBE>
how to check an array is empty? Because I do @brans.empty? but this is doing a count query
<lewis1711>
ahh
<JonnieCache>
or put some conditional in so it doesnt try and call split
<lewis1711>
JonnieCache: did not occur to me about gsub doing it
<lewis1711>
thanks
rob_ has joined #ruby
<JonnieCache>
basically when you see "no method error on nil" look for the method that wasnt found
<JonnieCache>
and work out where it is being called
<JonnieCache>
that object will then be nil, and oyu have to work out what is returning nil when it shouldnt be
<chimkan>
hi
<rob_>
hi, in ubuntu i can install ruby 1.8 and 1.9, can i use rbenv to control which one is used or do i have to install ruby under rbenv?
<JonnieCache>
the second one
<JonnieCache>
rbenv switches between its own rubies
<rob_>
so even though it can see them when i do 'rbenv alternatives', it can't actually create shims for them?
<JonnieCache>
you should probably uninstall the ubuntu ones and just rely on rbenv
becomingGuru has quit [Quit: Leaving.]
<JonnieCache>
oh can it? i might be misinformed then. its not how its supposed to work anyway
<chimkan>
I'm trying to transform a nested form in Rails into multiple image uploader, but I can't figure out how to transform the form to accept multiple upload and showing all the images
<apeiros_>
cek: I assume you want instance_exec(*args, &block)
<workmad3>
cek: you're passing in the block for define method?
<workmad3>
cek: why not do 'define_method &block' in the class?
<heisenmink>
workmad3, what is the difference? Running something on the class is context-free, static methods are context-free
<workmad3>
heisenmink: the class isn't context free
antonishen has joined #ruby
antonishen has quit [Client Quit]
<cek>
self.instance_exec(*args, &block) - yeah
<heisenmink>
can you run instance methods from class methods?
<workmad3>
heisenmink: the class in ruby is itself an object, an instance of the class Class
<workmad3>
heisenmink: no, but that's not the same as context-free
<heisenmink>
free of instance context of that class then
<workmad3>
heisenmink: it's a different context, the context (self) refers to the class
cryptfu has quit [Remote host closed the connection]
<cek>
now i'm wondering why wasn't my version working, the docs are clear that self is passed properly
<apeiros_>
heisenmink: classes are instances too
<workmad3>
heisenmink: but classes are objects in ruby... you can create methods on them, assign instance variables for classes, get the class of the class, etc..
<cek>
oh wait, by block they mean locally defined block, not passed from outside
lolmaus has quit []
<apeiros_>
class Foo; end; Foo.class # => Class
<phreax>
you can use the the method object to copy it into another class
<apeiros_>
they're instance of class Class
<apeiros_>
workmad3 already said the rest
Kn|t3 has quit [Quit: Kn|t3]
<phreax>
suppose you have Duck.quak
<workmad3>
heisenmink: which is a very different situation from a static method in something like java
adambeynon has joined #ruby
nfk has joined #ruby
<apeiros_>
it also means that you can have instance variables in the context of class methods
<phreax>
than in you other class use define_method(:quak,&Duck.method(:quak))
<apeiros_>
nb., those ivars belong to the class
<workmad3>
class instance variables are in fact of more use than class variables :)
<apeiros_>
agreed
<apeiros_>
class variables are a sad topic in ruby :-(
Kn|t3 has joined #ruby
<workmad3>
I wouldn't say they're a sad topic... they are sometimes useful
blacktulip has quit [Remote host closed the connection]
<davidw>
workmad3, yeah, I use them to store the names of all my global variables, and then eval to get at the latter
<workmad3>
however, they are easy to misunderstand in terms of behaviour and it would be nice if they were a bit harder to create and access to stop them being used when a class ivar is actually wanted
daniel_hinojosa has quit [Ping timeout: 245 seconds]
<nullsign>
i suspect there is a negative reason for that.
<workmad3>
Dir['whatever'].each do |list|
Konboi has joined #ruby
<apeiros_>
nullsign: Dir[] already returns an array
<apeiros_>
so you can use the [2..-1] on the result of that
malkomalko has joined #ruby
<nullsign>
Dir isn't what produces the array tho.
akem has joined #ruby
<nullsign>
it's the rrdtool_out command
bosphorus has quit [Ping timeout: 265 seconds]
<nullsign>
thats when im trying to trim.
justsee has joined #ruby
justsee has quit [Changing host]
justsee has joined #ruby
<nullsign>
rrd_out, typo
indian has quit [Ping timeout: 265 seconds]
chson has joined #ruby
<Markvilla>
Somebody's using mruby?
Vainoharhainen has quit [Quit: Leaving...]
Frippe has quit [Ping timeout: 276 seconds]
binaryplease has quit [Read error: Connection reset by peer]
<apeiros_>
nullsign: that'd have been relevant information :-p
<nullsign>
apeiros: sorry..
<apeiros_>
nullsign: you're using ruby 1.8?
<nullsign>
basically, i need to remove lines 1-2, and lastline from whatever is in the rrd_out array
internet_user has joined #ruby
<apeiros_>
rrd_fixed.each is deprecated and won't work in 1.9 (String#each is ambiguous and was replaced by String#each_line and others)
Frippe has joined #ruby
binaryplease has joined #ruby
<apeiros_>
sub(/\A.*\n.*\n/, '') # removes the first 2 lines of a string
daniel_hinojosa has joined #ruby
foofoobar has joined #ruby
yonggu has joined #ruby
yekta has joined #ruby
<JonnieCache>
unorthodox
Vert has joined #ruby
denysonique has joined #ruby
zinjacoder has joined #ruby
the_jeebster has joined #ruby
kenperkins has quit [Quit: Computer has gone to sleep.]
fantazo has joined #ruby
twodollarz has quit [Ping timeout: 240 seconds]
jeremy_carroll has joined #ruby
ph^ has quit [Remote host closed the connection]
billy_ran_away has joined #ruby
<billy_ran_away>
Can anyone explain this error to me? /usr/local/rvm/gems/ruby-1.9.2-p290@maskable_attribute/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `const_missing': uninitialized constant MaskableAttribute::ActsAsMaskableAttribute::ActiveSupport (NameError)
<billy_ran_away>
Is the constant that's missing ActiveSupport?
ph^ has joined #ruby
Morkel has joined #ruby
<billy_ran_away>
Cause it's in my Gemfile.lock...
<JonnieCache>
yes but its a class called activesupport within MaskableAttribute
<JonnieCache>
not the actual ActiveSupport
ozy_work has joined #ruby
lorandi has joined #ruby
<JonnieCache>
im guessing you havent required MaskableAttribute correctly
binaryplease has quit [Quit: WeeChat 0.3.8]
<JonnieCache>
or maybe you need to require things in a different order
<billy_ran_away>
JonnieCache: I have require 'maskable attribute' in there...
<billy_ran_away>
JonnieCache: I have require 'maskable_attribute' in there...
SPYGAME has joined #ruby
<JonnieCache>
i don't know that gem so i cant comment on specifics
<apeiros_>
JonnieCache: I'd assume it is ::ActiveSupport that is missing. but since it is invoked within MaskableAttribute::ActsAsMaskableAttribute, the error is MaskableAttribute::ActsAsMaskableAttribute:: ActiveSupport
<apeiros_>
also billy_ran_away ^
<billy_ran_away>
apeiros_: I saw : ) Thanks
<apeiros_>
so my guess is that you require 'maskable_attribute' before AS is loaded
<billy_ran_away>
apeiros_: awww...
<apeiros_>
and that maskable_attribute doesn't properly require its dependencies.
xaq has joined #ruby
<billy_ran_away>
apeiros_: that could possibly make sense...
<apeiros_>
(probably because it assumes to be required in a rails context, where AS is loaded anyway)
<billy_ran_away>
apeiros_: Do you know where I should put it in my test/dummy Rails app?
<apeiros_>
no
iNerd has joined #ruby
<JonnieCache>
you need to specifically require activesupport in your gem
<JonnieCache>
or is it require 'activesupport' i can never remember
<apeiros_>
JonnieCache: no wonder, they're inconsistent
<billy_ran_away>
JonnieCache: Okay, but will that affect my gem when I'm using it in a real Rails2 project with Gemfile and everything...
ph^ has quit [Ping timeout: 244 seconds]
<JonnieCache>
billy_ran_away: any given file can only be required once
<JonnieCache>
so it wont matter
<JonnieCache>
thats how its meant to work. look at any rails gem, they'll all be explicitly requiring the bits of rails they need
<JonnieCache>
they should be anyway
shevy has joined #ruby
<shevy>
wheeeee and another new hd-install
ken_barber1 has joined #ruby
<billy_ran_away>
So now my name error has moved...
jeff_sebring has quit [Remote host closed the connection]
<shevy>
now I am using konversation, not xchat. and I am confused...
<shevy>
hi billy_ran_away !!!
<billy_ran_away>
shevy: Hi
<iNerd>
join #openemu
hemanth2 has quit [Ping timeout: 244 seconds]
jeff_sebring has joined #ruby
<shevy>
you are all in fancy colours....
<shevy>
it confuses me
<JonnieCache>
irssi ftw
<shevy>
hehe
<shevy>
man JonnieCache I remember you... but you look different too
hemanth2 has joined #ruby
<billy_ran_away>
Same NameError, but different file… http://cl.ly/HN1X
robdodson has joined #ruby
<billy_ran_away>
Now active_support/dependencies is saying uninitialized constant ActiveSupport::Concern
cezar has joined #ruby
ken_barber has quit [Ping timeout: 252 seconds]
cezar has quit [Client Quit]
<shevy>
I tell you, konversation is an annoying client... need to install xchat asap again...
twodollarz has joined #ruby
crankycoder has joined #ruby
<shevy>
ok enough... need to get xchat. this is killing me...
shevy has left #ruby ["Konversation terminated!"]
chimkan has quit [Quit: chimkan]
flip_digits has joined #ruby
snearch has quit [Quit: Verlassend]
Konboi has quit [Remote host closed the connection]
uris has quit [Ping timeout: 246 seconds]
indeterminate has quit [Quit: It's too late. You've awakened the gazebo. It catches and eats you.]
<robdodson>
if anyone has a moment.. I've been trying for about 2 days to make a ruby gem with a CLI. I have a git repo here: https://github.com/robdodson/zerp for some reason whenever I do rake install everything seems to install without errors but typing the command 'zerp' it says 'command not found'
shevy has joined #ruby
<robdodson>
any help is greatly appreciated. this is driving me crazy
shevy has quit [Client Quit]
<rob_>
robdodson: add bin/ to your $PATH
chimkan has joined #ruby
g0bl1n has joined #ruby
<robdodson>
rob_: like ~/bin or just bin/
DavidTiger has joined #ruby
<rob_>
robdodson: well it has to be a valid path :)
<robdodson>
rob_: i've installed other gems with this same structure and never needed to do anything to my path. why would i need to now..?
<robdodson>
it does gem.files then gem.executables
<robdodson>
seems like that should work..
cek has joined #ruby
<cek>
Any quick IPC pipe like library for ruby? I want minimal coding.
yekta has quit [Remote host closed the connection]
hemanth2 has quit [Quit: Leaving.]
yekta has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
indian has joined #ruby
<robdodson>
hmm
<robdodson>
if i do irb -I .
<robdodson>
and try their command: gem.files = `git ls-files`.split($\)
<iNerd>
sigh. this isn't exactly a ruby question, but is there any way to cleanup gems but leave dependencies if they require older versions? getting tired of hitting keep on every single entry
<robdodson>
oh oops nvm..
<llaskin>
iNerd: why bother?
<llaskin>
its not like gems take up a ton of space...
<iNerd>
there's that
<iNerd>
:p
SPYGAME has quit [Ping timeout: 244 seconds]
francisfish has quit [Ping timeout: 244 seconds]
Vainoharhainen has joined #ruby
<JonnieCache>
iNerd: youd have to write a script using the rubygems api
jeer has joined #ruby
<JonnieCache>
maybe theres a config option to stop it pestering you
<iNerd>
i just wondered if there was a flag
<iNerd>
that i was somehow missing
b3nt_pin has joined #ruby
ceej has joined #ruby
gilead_ has quit [Quit: Leaving]
<Hanmac>
iNerd what package is your problem wich still depends on older gems? its pry right? :D
Jake232 has joined #ruby
<iNerd>
i can't even remember now
akem has quit [Ping timeout: 244 seconds]
<iNerd>
but lots of things want older active record etc.
charliesome has quit [Quit: Computer has gone to sleep.]
hunglin has joined #ruby
kevinbond has joined #ruby
<robdodson>
omg such an idiot……………..
classix_ is now known as classix
<robdodson>
i didn't make the file in my bin directory executable
<lectrick>
not sure if such a channel exists already but I just started #ror-advanced FYI
<robdodson>
chmod 755
<robdodson>
dohhhhhhh
oooPaul has joined #ruby
<jeffreybaird>
Is there a way to interact with apple applications without using AppleScript? Trying to write a command line application in Ruby that can create an event in ical
<apeiros_>
jeffreybaird: OSA
<apeiros_>
there's a gem for that
<apeiros_>
it is essentially what AppleScript is built on
<jeffreybaird>
great, thanks
<apeiros_>
i.e., you can do about everything that applescript can.
rob_ has left #ruby [#ruby]
<apeiros_>
there are also cocoa bridges. or use macruby.
Natch| has joined #ruby
ingy has joined #ruby
<apeiros_>
but I think for simple tasks, osa is the easiest.
codora has joined #ruby
ingy has left #ruby [#ruby]
<jeffreybaird>
yeah I just want simple and applescript is pretty awful
<iNerd>
it's sort of clever for what it is
wmoxam has joined #ruby
<iNerd>
i.e. somthing dating to system 7
internet_user has quit [Remote host closed the connection]
fmcgeough has joined #ruby
kvirani has joined #ruby
internet_user has joined #ruby
<cek>
@h = {box: hash_or_value} - no you just look at this
<codora>
heh. i love common lisp, but i'll have more luck getting my friends to learn ruby with me.
octarine has joined #ruby
hunglin has left #ruby [#ruby]
zaychenok has quit [Quit: Konversation terminated!]
prtksxna has joined #ruby
zaychenok has joined #ruby
prtksxna has quit [Remote host closed the connection]
<lectrick>
apeiros_: lol
MasterIdler has quit [Quit: MasterIdler]
lorandi has quit [Quit: Leaving]
eft has joined #ruby
axl_ has joined #ruby
<Hanmac>
i think _lang has less trolls
<lectrick>
actually, what is the algorithm that measures the "distance" between two strings? (i.e. the number of their differences)
<apeiros_>
lectrick: levenshtein is one
<lectrick>
apeiros_: ah yeah, that's the one I've heard of before
<wubino>
how can I split a text file by blank lines?
<apeiros_>
there are others, too. a generic distance algorithm is the hamming distance
<apeiros_>
also soundex
<Prx>
wubino: A blank line is 2 \n in a row
zaychenok has quit [Read error: Connection reset by peer]
alexim has joined #ruby
epitron has quit [Remote host closed the connection]
zaychenok has joined #ruby
<Sigma00>
Prx: would ^$ also match a blank line? >_>
<Prx>
Sigma00: Yes
<Sigma00>
danke, just making sure
Fraeon has quit [Remote host closed the connection]
Prx has left #ruby [#ruby]
alexim has quit [Client Quit]
tomask has joined #ruby
rking has joined #ruby
<lectrick>
apeiros_: is there a way to find a word in a collection that is the nearest distance to a given word without iterating through every word every time?
<lectrick>
apeiros_: Basically I'm asking, is there a way to encode the word to "blur" it so that near matches will match?
<apeiros_>
lectrick: only if you can prepare the data
<lectrick>
apeiros_: I suppose that's basically like a soundex
<JonnieCache>
lectrick: the concept youre looking for is "edit distance:
<lectrick>
JonnieCache: I know but I want to avoid having to re-compare every time
yekta has quit [Remote host closed the connection]
yekta has joined #ruby
<lectrick>
like I have a list of 1000 words and I have a new word and I want to find out if there is an existing word with a levenshtein distance of less than 2 without iterating through 1000 checks
<lectrick>
If I just used soundex they would both just resolve to the same soundex code I guess
mockra has joined #ruby
<JonnieCache>
well if you only need the first word with distance < 2 then best case you only need to do one check
digitalcakestudi has joined #ruby
<JonnieCache>
worst case will always be checking every item
<JonnieCache>
unless you can make very specific assumptions about the dataset but only you can answe that
<lectrick>
JonnieCache: So the average case is still N/2
ckrailo has joined #ruby
<JonnieCache>
lectrick: only if the dataset is not biased
<lectrick>
yeah
<JonnieCache>
if we're talking complexity theory then i guess we're assuming random data so yeah
m_3 has quit [Quit: leaving]
<JonnieCache>
in practice because youre using human words in a human language there will be an optimal algorithm
<workmad3>
lectrick: the best you can do with an unsorted collection is O(N) for searching
<lectrick>
workmad3: yeah I was thinking O(N), guess I was shooting for maybe an NlogN :)
<apeiros_>
o0
<workmad3>
lectrick: you'd need to find a way to sort the collection for that
<JonnieCache>
as long as its not 2^n then youre all good
<workmad3>
:)
<lectrick>
haha
<workmad3>
JonnieCache: or N^N
<Hanmac>
o sorry it was not for you
<lectrick>
Hanmac: Yeah I was like, this looks cool and all but
mockra has quit [Ping timeout: 245 seconds]
<lectrick>
;)
francisfish has quit [Read error: Connection reset by peer]
<JonnieCache>
if you're concerned about anything better than 2^n then youre probably a data engineer or something and youre getting paid enough so its still all good
francisfish has joined #ruby
<workmad3>
lectrick: if you precomputed soundex for each item in the list though, you could indeed sort the collection lexically and then you could do a binary search through it :)
d3vic3 has quit [Ping timeout: 240 seconds]
<apeiros_>
JonnieCache: I think if your average algorithm is 2^n, you suck as a programmer and should change jobs. 2^n is horrible :)
epitron has joined #ruby
<lectrick>
workmad3: yeah that's the fallback position, that would work, just wondering if there is something like that for levenshtein distance
<workmad3>
lectrick: you can't precompute the levenshtein distance though, iirc
<Hanmac>
wubino: there for you: if lines is a array of strings ...: lines.each_with_object([0]).map {|l,i| [l,l.empty? ? i[0] += 1 : i[0]] }.select{|(l,i)| !l.empty? }.group_by {|(l,i)| i}.map {|k,v| v.map {|(a,b)|a}}
<workmad3>
lectrick: makes it a bit more difficult...
<JonnieCache>
apeiros_: that was my point. in practice anything faster than 2^n is fine, and you should spend the time developing another feature
<apeiros_>
JonnieCache: um, no
d3vic3 has joined #ruby
<lectrick>
workmad3: like, you'd precompute the position of a string in an N-dimensional "levenshtein space" and then you'd round the position in that space to maybe the X nearest grid positions and then you could compute that for a test string and then do your search
<JonnieCache>
well yeah i guess it depends hwat youre doing
<apeiros_>
JonnieCache: maybe you mean n^2, but I'd still disagree
<workmad3>
lectrick: is it worth it? :)
<lectrick>
workmad3: wow I am on fire today. go adderall
Sgeo has joined #ruby
<lectrick>
workmad3: It is if someone else could take advantage of it
<apeiros_>
lectrick: first and easiest thing is to index by length
<Hanmac>
lectrick if the list is unquie and orderless you could use Set ...
<JonnieCache>
apeiros_: i think its because im biased as a web developer, where these things dont matter so much a lot of the time
<apeiros_>
if your max distance is 2, then any string with a size ±3 is out already
<workmad3>
good point, I was wondering if some form of bucket-sort would work
<lectrick>
apeiros_: that is a good point
<apeiros_>
JonnieCache: you do realize that there's a shitload of horribly slow O's below O(2^n)?
mnaser has quit [Quit: Computer has gone to sleep.]
<apeiros_>
lectrick: also an index by count of chars could help
<lectrick>
If you create an O(2^N) monster you should just hand in your nerd card and go party with clients at baseball games.
<apeiros_>
but maybe somebody already came up with a better idea of how to index for levenshtein. or soundex.
<workmad3>
apeiros_, JonnieCache: also, big-O notation hides a massive amount of performance... going by big-O then quicksort is no better than mergesort or heapsort
<apeiros_>
(most probably even)
<JonnieCache>
apeiros_: hmmmm. ok maybe i need to revise then. i thought 2^n was the cutoff point where the algorithm is never appropriate and you should throw it away and start again, even if your n is small
<JonnieCache>
better than 2^n, you can get away with it for a small n
<apeiros_>
JonnieCache: whether an algorithm is appropriate depends entirely on the context
lkba has joined #ruby
<apeiros_>
there's no such thing as a generic "up to this is good and beyond just sucks - no matter the context"
<workmad3>
even 2^n is ok for n < about 5, maybe 10 depending on how expensive the operations are
<eam>
if n is small then the O() is much less important than C
<JonnieCache>
apeiros_: yeah. i meant "below this point it may or may not suck depending on n, above this point You Are Definitely Doing It Wrong"
<eam>
where C is the constant time cost unrelated to n
<workmad3>
a literal 2^n is better than 10000n for n up to about 14 :)
<lectrick>
workmad3, apeiros_ ^ interesting link.
<eam>
JonnieCache: no such boundary
iNerd has quit [Quit: iNerd]
<lectrick>
nullsign: string.split.last.sub? :)
<eam>
remember, big-o only relates to algorithmic efficiency at scale
<workmad3>
eam: it isn't just the C, it's the entire rest of the performance calculation.... 10000n is still O(n) and n^2/50000000 is still O(n^2) :)
Morkel has quit [Quit: Morkel]
<JonnieCache>
hmmmm i was just making a general point. i know theres not *actually* a boundry in mathematical terms
<eam>
workmad3: that's exactly what I said
<JonnieCache>
but yes i accept that my knowledge of complexity theory is rusty
<nullsign>
lectrick: hrm. i want to take a array of strings, and remove the last string.
<workmad3>
eam: those aren't constants though
<workmad3>
eam: they're scaling factors
<lectrick>
nullsign: it's unshift or pop, I always have to check
<lectrick>
nullsign: or is it shift or pop
Eldariof-ru has quit [Ping timeout: 246 seconds]
<eam>
workmad3: constant scaling factors
<eam>
but yes
<deryl>
my knowledge of complexity theory is purely cenceptual. so enjoying lurking during these conversations. :)
TubaraoSardinha has joined #ruby
<lectrick>
nullsign: it's pop
Aristata has quit [Read error: Connection reset by peer]
hunglin has joined #ruby
<workmad3>
of course, this is all only time-complexity too... there's also always space-complexity to consider :)
Aristata has joined #ruby
<apeiros_>
and maintenance
<JonnieCache>
they are kind of equivalent though
jrist is now known as jrist-afk
<apeiros_>
and how often the algorithm is used
<JonnieCache>
time and space
<workmad3>
JonnieCache: they're not equivalent
ipoval has joined #ruby
<TubaraoSardinha>
Hello! I am having troubles with the require method! I have a simple sinatra file and want to include a class called UserData (user_data.rb) in it, they are in the same directory, the only way I managed to include the user_data was with a load
<TubaraoSardinha>
Is there a better way?
<JonnieCache>
kind of equivalent. you can exchange one for the other. see: rainbow tables
<apeiros_>
if going from O(n^2) to O(n) means 100LoC become 100KLoC, and the thing is used like once a year, I say: wtf do I care?
<JonnieCache>
memoization etc
<workmad3>
JonnieCache: in fact you tend to find they tend to be tradeoffs... a good algorithm in time-complexity is frequently poor in space-complexity
<workmad3>
JonnieCache: that's not equivalent
<lectrick>
nullsign: string.split.tap(&:pop).join
niklasb has quit [Ping timeout: 245 seconds]
<eam>
JonnieCache: you can't always exchange one for the other
<apeiros_>
TubaraoSardinha: the easy and wrong solution is require_relative. the long and proper solution is managing your $LOAD_PATH properly.
thone_ has joined #ruby
williamcotton has quit [Quit: williamcotton]
<JonnieCache>
hmmmmmm we are quibbling over terms
<lectrick>
apeiros_: hey! I like require_relative!
<workmad3>
JonnieCache: not quibbling... you're getting things wrong and we're correcting you :P
<JonnieCache>
they are equivalent to the extent that you can often use up lots of space to save time and vice versa
<lectrick>
apeiros_: It allows me to run tests directly, for one thing, without any test_helper requires inside them breaking
<workmad3>
JonnieCache: yeah... if you want to redefine what 'equivalent' means, then sure
<JonnieCache>
i forget that equivalent has a specific technical meaning thats indeed my fault
<apeiros_>
lectrick: funny, I don't have require_relative in my tests, yet they *magically* work
thone has quit [Read error: Connection reset by peer]
m_3 has joined #ruby
<JonnieCache>
i dont have any math background at all, only CS
<workmad3>
JonnieCache: it also has a specific english meaning that you're also changing ;)
<apeiros_>
lectrick: maybe it is because I spent my 5min on thinking how to manage the $LOAD_PATH :-p
<TubaraoSardinha>
apeiros_: Sounds painful! I think I will stick with the load for now. Thanks! =)
<workmad3>
JonnieCache: I only have formal CS background too
<lectrick>
apeiros_: so you're cd'd way down into a repo and you run "ruby test/some/test.rb" and that test says "require 'test_helper'" and it magically works? That really is magic.
<apeiros_>
TubaraoSardinha: um, load and require both use $LOAD_PATH
<JonnieCache>
equivalent can mean "can be exchanged one for the other" in normal english! you cant deny that
<apeiros_>
TubaraoSardinha: but sure, whatever
<nullsign>
lectrick: hrm. that doesn't remove the last line, and removes all the \n after each string, so everything goes into a single string..
<eam>
JonnieCache: but they *can't* be exchanged, categorically
<lectrick>
apeiros_: How do you set the $LOAD_PATH for an entire repo AND have it automatically available from anywhere inside the repo?
adeponte has joined #ruby
<TubaraoSardinha>
apeiros_: Strange thing. With a require 'user_data.rb' it doesn't work but when I use load 'user_data.rb' it works!
<workmad3>
JonnieCache: no, equivalent means 'you can put this in instead of that'... what you're searching for is the word 'interchangable'
<apeiros_>
lectrick: I say ruby some/dir/test/runner.rb
<lectrick>
nullsign: ok join("\n")
<workmad3>
JonnieCache: and that's not universally true, just a frequently observed effect :)
<apeiros_>
and test/runner.rb encapsulates the knowledge of setting up the env.
maesbn has quit [Remote host closed the connection]
<JonnieCache>
eam: the fact that i can create a turing complete machine with only one variable, but might take a long time to run, doesnt that imply that time and space are interchangable in some way?
sonkei has joined #ruby
d3vic3 has joined #ruby
<workmad3>
JonnieCache: not in the sense you're trying to state
<eam>
JonnieCache: in particular scenarios yes, but not in the general sense
<lectrick>
apeiros_: is that a parser that does not use eval? :)
<eam>
JonnieCache: you can say they're exchangable for this, or that, but you can't generally replace one with the other
<workmad3>
JonnieCache: it's frequently true that a good time-complexity has poor space-complexity, but it isn't a universal truth and it's also not the case that you can just exchange the values
<apeiros_>
lectrick: yes
<apeiros_>
I used it initially for my toy language, then moved it on to my test framework, then used it for cucumber tests
yekta has quit [Remote host closed the connection]
<apeiros_>
now that I think of it, I should probably mention that it does not use eval…
yekta has joined #ruby
alexim has joined #ruby
<lectrick>
apeiros_: If I'm reading that correctly, you still can't just run "ruby test/runner.rb" from within the project root
<apeiros_>
lectrick: you're not reading it correctly then.
<lectrick>
apeiros_: because it's not requiring your test_runner which mutates the load_path
<workmad3>
hmm, does anyone have a better suggestion than nerdtree for exploring a project layout with vim?
theRoUS is now known as theRoUS|lunch
<lectrick>
apeiros_: crap I meant
<lectrick>
apeiros_: you can't do "ruby test/path/to/unit/test.rb"
<apeiros_>
lectrick: yes. that's what I said.
<shevy>
in his career apeiros_ must have started one thousand projects :)
Guest7650 has quit [Read error: Connection reset by peer]
<apeiros_>
17:29 apeiros_: if course, you can still run it with plain ruby, but then you're the one who needs the knowledge and you pass it to ruby via -I
<apeiros_>
shevy: probably more :(
<apeiros_>
and :( because you shouldn't ask how many I actually finished…
<lectrick>
apeiros_: well, I can agree that using require_relative spreads around repo structure knowledge, but I love the convenience of just running a test directly
<JonnieCache>
i just scrolled up, all i said was "kind of equivalent" i dont know where this idea came from that im trying to claim you can always swap time for space in any algorithm. i never said that.
<lectrick>
apeiros_: it also allows me to run it directly in my editor
<apeiros_>
lectrick: you still can, through the runner
benjammin891 has joined #ruby
<apeiros_>
ruby test/runner.rb some/file.rb
<JonnieCache>
anyway who cares
<_br_>
Hello there fellow Rubyists
<apeiros_>
JonnieCache: I do! keep on arguing!
<shevy>
die _br_
<shevy>
oops wrong channel
<shevy>
hi _br_
<_br_>
lol
<_br_>
:D
<JonnieCache>
shevy: so in another channel you have beef with some other br?
palmfrond has quit [Read error: Connection reset by peer]
<workmad3>
16:25 < JonnieCache> kind of equivalent. you can exchange one for the other. see: rainbow tables <--
baroquebobcat has joined #ruby
palmfrond has joined #ruby
<JonnieCache>
yeah. rainbow tables *are* swapping time for space! you just chose to interpret that sentance in the strongest possible way because that would provide maximum scope for quibbling :)
<JonnieCache>
i meant it in a very weak way
<workmad3>
JonnieCache: :P
<shevy>
JonnieCache not only him with ALL OF YOU!
<shevy>
damn it... wrong channel
<apeiros_>
JonnieCache: so revise the statement and throw in a "sometimes"?
wvms has joined #ruby
<shevy>
what are rainbow tables
<shevy>
is that something for gay parades? :D
<apeiros_>
and all are happy and the unicorn dance again on the rainbow (tables)
<workmad3>
shevy: they're tables for looking up the location of unicorns
<Tasser>
shevy, wikipedia may help ;-)
<_br_>
Precalcuated hashes for passwords
<JonnieCache>
rainbow tables are what they have in gay strip clubs
<shevy>
man, wikipedia sucks. I know because I help make it suck more
robozahn has quit [Quit: leaving]
<workmad3>
_br_: stop being boring :P
<shevy>
erm... less! I meant... suck less!!!
<_br_>
hehe sorry
<apeiros_>
shevy: that's not called "helping" then…
robozahn has joined #ruby
robozahn has quit [Client Quit]
<workmad3>
shevy: I think you got it right the first time ;)
perryh_away is now known as perryh
<shevy>
one day I shall add a new page called RubyOS. Then shevy: "on my todo list"
<apeiros_>
now how were gay strip clubs again related to algorithmic complexity? o0
<workmad3>
shevy: and 10s later it will be flagged '[Citation needed]' ;)
<_br_>
shevy: RubyOS o.O
<JonnieCache>
raindbow tables. as in table dancers.
<workmad3>
apeiros_: it's better for your sanity to not ask...
<JonnieCache>
dancing on tables. thats what they do in strip clubs isnt it?
horseman has quit [Read error: Connection reset by peer]
banisterfiend has quit [Read error: Connection reset by peer]
<_br_>
A crazy^Wgenius mind can connect those two things :D
<workmad3>
JonnieCache: no idea, I don't tend to frequent them
<shevy>
workmad3 yeah
elhu has joined #ruby
<shevy>
workmad3 I'll probably have to write an epic blog article before I create that page ...
<workmad3>
JonnieCache: I certainly couldn't comment on the colour of the tables used for dancing in gay strip joints :P
alcy has quit [Quit: leaving]
<JonnieCache>
tbh i imagine theyre black.
ZachBeta has joined #ruby
<apeiros_>
being sick sucks. it took me 4 days to write what I'd normally write in a day or less :-(
<JonnieCache>
ive been looking at that soundex thingy
<apeiros_>
and it probably even has more bugs than normally…
<JonnieCache>
i cant see how it would work with peoples accents being so different
<apeiros_>
JonnieCache: it doesn't.
wvms has quit [Ping timeout: 265 seconds]
<JonnieCache>
yeah thought that might be it haha
<workmad3>
basic soundex also sucks for non-english iirc
<apeiros_>
it also only works for english
Synthead has joined #ruby
<JonnieCache>
in the UK you can go 20 miles and people have completely different vowels
<JonnieCache>
must be like that to some extent everywhere
<shevy>
young arnold schwarzenegger... that's austrian accent in english
<shevy>
yeah JonnieCache
fserb has joined #ruby
d3vic3 has quit [Ping timeout: 246 seconds]
horseman has joined #ruby
<workmad3>
JonnieCache: you think we need to go 20 miles? cute :)
<apeiros_>
IMO it should be possible to design a language/pronunciation independent soundex algorithm. but it'd still be quite difficult to gather all the data…
rking has quit [Quit: Oops. Didn't start in tmux.]
<JonnieCache>
again with the pedantry lol. yes indeed right here you could go 5 meters and find different vowels because the people in the next office are from elsewhere
<dcope>
JonnieCache: nice name ;)
<JonnieCache>
you know what i meant :P
d3vic3 has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
<apeiros_>
(nb, independent doesn't mean it doesn't need to know which language/pronunciation you want it to use for the comparison…)
rking has joined #ruby
zaychenok has joined #ruby
<workmad3>
JonnieCache: actually, I was thinking that where I grew up there were communities about 5 miles away that as far as I was concerned spoke fecking gobbldeygook
<_br_>
shevy: Best movie ever Commando, violence, weird english and stupid jokes mixed with other random weird stuff. :D
<dcope>
fecking gobbldeygook he says
<shevy>
_br_ hehe
<shevy>
action movies in the 1980s were not thaaaat bad
<JonnieCache>
workmad3: youre a manc arent you? you dont need to tell me that northerners speak funny man. i know,
<_br_>
true true..
<workmad3>
JonnieCache: actually, I came from gloucestershire
<shevy>
all I know is that scots were dresses
<shevy>
*wear
<workmad3>
JonnieCache: 20 miles was as far as I needed to go to get to worsels territory :)
<workmad3>
I assure you... I sound *nothing* like that
PragCypher has joined #ruby
<shevy>
hehe
ben- has joined #ruby
chrismcg is now known as zz_chrismcg
graft is now known as Guest72502
<workmad3>
JonnieCache: but yes, I live in manc now :)
dekroning has quit [Ping timeout: 244 seconds]
<JonnieCache>
im from the west country. in our town most people have relatively generic southern accents, but if you went to a decent pub, or out to the villages, it was full on wurzel times
<shevy>
lol
<shevy>
wurzel
<shevy>
omg
<workmad3>
JonnieCache: you've seen Hot Fuzz, right? you know the farmer with the guns?
<JonnieCache>
vaguely
<shevy>
why do you guys use german words
<workmad3>
JonnieCache: when I worked @ a supermarket, I had people who spoke like that at times...
<shevy>
hah! hot fuzz was great
<shevy>
I understood the farmer better than the rest of the team :P
alexim has quit [Quit: sleep]
JohnBat26 has quit [Remote host closed the connection]
<workmad3>
shevy: the farmer? or the police officer intermediary? :)
<JonnieCache>
I've seen the wurzels. theyre amazing.
nilg has quit [Read error: Connection reset by peer]
<shevy>
workmad3 the farmer!
<shevy>
workmad3 he was growling like I expect from someone in the UK
<workmad3>
heh
<workmad3>
yeah... we don't generally speak like that :P
carloslopes has quit [Ping timeout: 244 seconds]
<JonnieCache>
hot fuzz was meant to be filmed in a village really near where im from... the local people turned it down because they thought it would make the village look bad lol
erikstraub1 has joined #ruby
niku4i has quit [Remote host closed the connection]
<JonnieCache>
thereby confirming their appropriateness for that film
thecreators_ has joined #ruby
niku4i has joined #ruby
<workmad3>
JonnieCache: :)
<elhu>
Hi! I'm having some troubles with the rack/openid middleware and setting it up with google Apps… It should be a fairly simple config.ru, but I can't get it to work. Here's the gist of my config.ru, if anyone has a minute to take a look :)
zommi has quit [Remote host closed the connection]
<ekaleido>
"w" writes a new file every time, whats the flag to append to the file?
manizzle has joined #ruby
<workmad3>
ekaleido: guess ;)
<apeiros_>
ekaleido: a
<ekaleido>
shoulda figured :)
<apeiros_>
ekaleido: also see the docs of IO and IO::open
<WhereIsMySpoon>
Hi, I have this: contents = page.read.gsub(/.*meta name="title" content=/, '').gsub(/\>.*/, '').strip which is reading a youtube page and getting the description, but it isnt working :( what am i doing wrong?
jenglish has quit [Remote host closed the connection]
Karmaon has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
<apeiros_>
you're using a regex to process html
ipoval has quit [Quit: ipoval]
<WhereIsMySpoon>
so? it's just characters
<workmad3>
WhereIsMySpoon: html is not amenable to regex
<apeiros_>
you asked me what you do wrong, I told you.
<WhereIsMySpoon>
why
<workmad3>
WhereIsMySpoon: because HTML is not a regular language
<WhereIsMySpoon>
all it has are characters in it, nothing out of the ordinary, why would it fail
zz_chrismcg is now known as chrismcg
sailias has quit [Ping timeout: 244 seconds]
<WhereIsMySpoon>
im not disagreeing that what you're saying is the truth
<JonnieCache>
because of the opening and closing tags, and the nesting, its impossible to parse html in regex
<WhereIsMySpoon>
im just curious
<apeiros_>
you should also note that . does not match newlines without the //m flag.
<wmoxam>
WhereIsMySpoon: you've got a problem, then you decided to use regex to solve it. Now you have two problems
<WhereIsMySpoon>
you so funny
<workmad3>
WhereIsMySpoon: because a regular expression can't handle nesting, and it gets horrendously complex if you want to allow for the fact that attributes don't have to be ordered
<WhereIsMySpoon>
wait
simao has quit [Ping timeout: 265 seconds]
macmartine has joined #ruby
<WhereIsMySpoon>
workmad3: ok then, ill try and look for a html parser or somesuch
<Tasser>
workmad3, they can handle nesting... :-)
<WhereIsMySpoon>
im sure there's thousands
<apeiros_>
nokogiri
<wmoxam>
WhereIsMySpoon: try Nokogiri
simao has joined #ruby
Ammar01 has quit [Quit: Leaving]
fantazo has quit [Remote host closed the connection]
fayimora has joined #ruby
heftig has joined #ruby
chimkan has quit [Quit: chimkan]
<JonnieCache>
quite apart from anything else, regexs are a pain. whereas nokogiri almost makes xml fun
jrist-afk is now known as jrist
<workmad3>
Tasser: really? write me a regex that will give me the contents of the outer div of '<div> <div> </div> <div></div></div>' ;)
blacktulip has joined #ruby
<workmad3>
Tasser: and then generalise it to arbitrary nesting ;)
<apeiros_>
Nokogiri.HTML(string).at_css('meta[name=title]')['content'] should do it
DanBoy has joined #ruby
<WhereIsMySpoon>
regexes are lovely
<Tasser>
workmad3, well, as soon as you can make references in regexp, they're not regular anymore...
savage- has joined #ruby
<JonnieCache>
what they do is lovely. using them is often a pain
timonv has quit [Remote host closed the connection]
<workmad3>
WhereIsMySpoon: they are... but there are certain classes of problem where they are provably not adequate
<Tasser>
apeiros_, at_css? why not css? :-)
<apeiros_>
workmad3: perl actually has extensions to its regex engine that lets it process non-regular expressions too. afaik.
andrewhl has joined #ruby
Yarou has quit [Quit: Leaving]
MasterIdler has joined #ruby
<WhereIsMySpoon>
workmad3: i was talking to JonnieCache
<apeiros_>
Tasser: because at_css gives a single node (the first) instead of a node set.
bluenemo has quit [Remote host closed the connection]
<Tasser>
apeiros_, oke
<WhereIsMySpoon>
JonnieCache: it only takes learning the syntax
<WhereIsMySpoon>
:)
<workmad3>
Tasser: oh sure... at that point you're getting into pushdown-automata, just wrapped up in 'regex' syntax :)
<JonnieCache>
yeah even then they are confusing. i guess it depends on how your mind works
imami|afk is now known as banseljaj
mrdtt has quit [Quit: Leaving]
<Tasser>
workmad3, indeed
rhalff has joined #ruby
Targen has joined #ruby
xclite has joined #ruby
<rhalff>
anybody uses facebook ?
<workmad3>
rhalff: no... it's a barren wasteland that is devoid of any users...
<workmad3>
oh wait, that's wishful thinking :)
<apeiros_>
rhalff: last I heard it was close to 1 billion who use FB
<JonnieCache>
i think technically, a RegEx is not the same as a Regular Expression. RegEx is the perl variant where they added loads of stuff that allows you to parse html and so on
<WhereIsMySpoon>
well you already did it
williamcotton has joined #ruby
<WhereIsMySpoon>
so i dont see why you asked
<WhereIsMySpoon>
:S
<rhalff>
dunno just irritated, that a guy like that just gets pushed away.
<workmad3>
apeiros_: can I tell this guy to foad? :)
<apeiros_>
foad?
<WhereIsMySpoon>
fck off and die
<apeiros_>
oh
<WhereIsMySpoon>
l2internet :p
<WhereIsMySpoon>
(jks)
<rhalff>
I can imagine all IRC traffic being banned later on. and nobody will ever know what irc was
<WhereIsMySpoon>
banned
<apeiros_>
workmad3: sure. but preferably in his pm.
axl_ has quit [Read error: Connection reset by peer]
<workmad3>
rhalff: nah, we'll just tunnel it through tor
axl_ has joined #ruby
<rhalff>
and linux will be removed from history also, it will just be googles creation. Before there where operation systems there was nothing, and then android was born.
<deryl>
irc will never die. especially when we learn telepathic capabilities!
<WhereIsMySpoon>
o.o
<WhereIsMySpoon>
who is this guy
<JonnieCache>
hmmm except that google is built on linux.
<workmad3>
wmoxam: when they're out to get you, paranoia is really just good sense
<deryl>
workmad3: hahaha
bricker88 has joined #ruby
alexim has joined #ruby
<wmoxam>
workmad3: then it's not paranoia
<rhalff>
how come I have the sense I'm just in an isolated box of retarded people
eywu1 has joined #ruby
<workmad3>
rhalff: biased perceptions
<deryl>
rhalff: because your box is made of mirrors
<rhalff>
anyway, you convinced me local is the way to go, so thanks for that
<workmad3>
rhalff: people hate to think of themselves as moronic, so it colours their perceptions of those around them
AxonetBE has joined #ruby
<wmoxam>
rhalff: everyone thinks that when they're 16
<wmoxam>
the golden age when one knows EVERYTHING
<JonnieCache>
and theyre indestructable. *sigh* those were the days
<rhalff>
people who are 16 don't know better, they just assume that's the way it is.
<rhalff>
unless they are intelligent, in which case they will be silenced
<wmoxam>
I totally knew everything there is to know when I was 16. I've know a little less each year since
<JonnieCache>
haha
<wmoxam>
now I'm pretty damn stupid
<deryl>
good tune! Indestructable by Disturbed
<deryl>
at least the band name is right on the money hehe
<workmad3>
wmoxam: sounds like the reason given for universities being accumulations of knowledge
<workmad3>
wmoxam: students go in thinking they know everything and come out knowing they know nothing... obviously all that knowledge is kept in the university :)
<JonnieCache>
clever
<workmad3>
JonnieCache: iirc, it's a prachettism
<deryl>
universities are called brain trusts are they not? ;)
<deryl>
probably more accurate to call them a brain drain hehe
red-panda has quit [Remote host closed the connection]
* rhalff
*so shut up*
punkrawkR has joined #ruby
<wmoxam>
rhalff: like a European should talk about debt
<deryl>
rhalff: who cares. go pay it off. make it zero. until then the number is useless
<deryl>
wmoxam: hahahahahaha
<workmad3>
wmoxam: hey, it's not all of europe that's broke
<JonnieCache>
workmad3: have you read the discworlds where they invent the internet
<workmad3>
wmoxam: some of us are just being 'austere'
<bricker88>
How would you find all classes that have a certain method defined? Is it generally okay to have that method push into an array defined in a global variable?
koskoz has joined #ruby
<workmad3>
JonnieCache: you mean the clacks? :)
<JonnieCache>
yeah
* deryl
chokes on his coffee
eywu has quit [Quit: Leaving.]
<JonnieCache>
the bit where he describes huffman coding using flags is AMAZING
<workmad3>
:)
<wmoxam>
workmad3: it's my understanding the western europe minus Germany and the Nordic countries are pretty much fucked
n1x has joined #ruby
hydrozen has joined #ruby
<rhalff>
yeah, anyway assange should be sentenced to death, so #ruby becomes nothing more than a filth channel.
<workmad3>
wmoxam: probably
<wmoxam>
rhalff: probably
nfk has quit [Quit: yawn]
<workmad3>
wmoxam: but hey, at least here in the UK, we're not going to be dragged down by the euro going bust
<wmoxam>
workmad3: hehe
<workmad3>
wmoxam: just the fact that the rest of euroope will be
<JonnieCache>
workmad3: unfortunately it sucks anyway
<JonnieCache>
i must remember to move to germany before they shut the borders
<rhalff>
oh forgot, the real ruby channel is #ruby-lang
<workmad3>
rhalff: yeah, go there... see how long before you get kickbanned
<deryl>
hehe you'll last a LOT shorter in there
<workmad3>
rhalff: we'll take bets on the time ;)
* workmad3
checks if zenspider is around right now
<workmad3>
ok, I'm going to bet on 2 minutes
ben_alman has quit [Excess Flood]
<shevy2>
hehehe
<wmoxam>
rhalff: yer pathetic
shevy2 is now known as shevy
<wmoxam>
slacktivism at it's worst
bigoldrock has joined #ruby
<shevy>
rhalff except, we have +100% people here, and dont require +v on the channel :P
<JonnieCache>
innit. go outside and glue yourself to something mate then you might get some respect
<codora>
hehe
AxonetBE has quit [Quit: Leaving.]
DrShoggoth has joined #ruby
timonv has joined #ruby
<JonnieCache>
the head of the student union when i was studying glued himself to the prime minister
<JonnieCache>
go and do that
Yarou has joined #ruby
Yarou has quit [Changing host]
Yarou has joined #ruby
overmind667 has joined #ruby
<JonnieCache>
that guy was such a legend
<tamaska>
sounds like fun
<shevy>
ewww
<wmoxam>
12:49 < rhalff> wmoxam, no, but 10 years from now there are no ruby questions to answer.
<wmoxam>
lololol
_md has quit [Quit: Leaving...]
<shevy>
why would anyone want to glue himself to a politican
<workmad3>
JonnieCache: student unions are hotbeds of craziness
ananthakumaran has quit [Quit: Leaving.]
<JonnieCache>
to draw attention to their pressure group
manizzle has quit [Read error: No route to host]
<JonnieCache>
in this case it was an environmental thing
<workmad3>
JonnieCache: the student union @ manchester got transgender toilets a bit after I graduated
ben_alman has joined #ruby
<JonnieCache>
also it enabled him to talk to the PM for some time
n1x has left #ruby ["Ex-Chat"]
<JonnieCache>
workmad3: hahaha quality
manizzle has joined #ruby
<JonnieCache>
that kind of thing is basically what student unions are for
<wmoxam>
JonnieCache: they've been trashing Montreal for months
<workmad3>
JonnieCache: 'with urinals' and 'without urinals' rather than male and female... the newspaper even reported on it... I loved the response of the person who got the toilets in
<JonnieCache>
wmoxam: yeah saw that. pretty mad. the same thing happened in the UK, they trashed some government buildings and had a couple of riots back in 2010
BiHi has quit [Quit: Computer has gone to sleep]
<JonnieCache>
but it didnt carry on like in canada
<workmad3>
JonnieCache: when the reporter asked 'isn't this political correctness gone mad' she said 'that phrase is disablist'
<JonnieCache>
THATS AMAZING.
mohits has quit [Read error: Connection reset by peer]
<tamaska>
lololol
shadoi has joined #ruby
<shevy>
when I have a module called Foo
<shevy>
what would be the best way to include it, the moment when it is required?
<wmoxam>
JonnieCache: well, it's in Quebec, and students there are far more radical than in the rest of the country
BiHi has joined #ruby
<JonnieCache>
down here someone complained because you have to mark bus tickets as Male or Female when you buy them (to stop people selling them) and someone complained because of transgener discrimination
<JonnieCache>
they didnt get listened to though
mockra has joined #ruby
<deryl>
JonnieCache: which carry on in canada do you refer to? the vancouver student riots, or the stanley cup riots? ;)
<shevy>
JonnieCache odd mechanism... so you can sell the ticket to other male ones, if you are male. but not to female ones???
rhalff has quit [Quit: Leaving]
<JonnieCache>
shevy: i guess it stops enough selling to be worth it, with minimal complexity
<JonnieCache>
deryl: the student riots
<wmoxam>
awww
<wmoxam>
he left
<JonnieCache>
the hockey riots were HILARIOUS. canada should be so ashamed of that as a country
<shevy>
he was not man enough for #ruby
<wmoxam>
JonnieCache: that wasn't the first time
<JonnieCache>
as the rest of the world rioted for bread, votes etc, they rioted for hockey. i laughed so hard
<tamaska>
needs moar balls of steel
<deryl>
JonnieCache: and trust me, the major population is
<wmoxam>
JonnieCache: and really no worse than Soccer riots in Europe
<shevy>
depends where in europe
<wmoxam>
JonnieCache: one of which happened in Poland this week
<deryl>
wmoxam: exactly true
<shevy>
we always here of dangerous hooligans in... poland, russian and the UK!
<JonnieCache>
i dont mean ashamed of rioting at all, but simply the contrast with egypt
<shevy>
*hear
<shevy>
*russia
<JonnieCache>
that was what mademe laugh
<shevy>
god, it's too hot here...
<deryl>
isn't the poland team the one told that if their fans riot again, the TEAM will be fined?
<JonnieCache>
my friend wins £200 if ANY game in the euros is stopped because of fan unrest
<deryl>
i only heard of the fining in passing on the news.
<JonnieCache>
he only bet £10 or something.
<tamaska>
fanboiz
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
TPFC-SYSTEM has joined #ruby
schovi has joined #ruby
mischief has quit [Read error: Connection reset by peer]
<mjb2k>
any body ever use Ruby in an ESB or any type of messaging bus/cache?
nari has quit [Ping timeout: 244 seconds]
malkomalko has quit [Read error: Connection reset by peer]
c0rn_ has joined #ruby
lorandi has joined #ruby
malkomalko has joined #ruby
AxonetBE has joined #ruby
shtirlic has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 244 seconds]
Vainoharhainen has quit [Ping timeout: 244 seconds]
timonv has quit [Remote host closed the connection]
<tamaska>
hey guys, i have a question. is it possible to use eventmachine on top of zeromq?
<jtoft>
If you have a bunch of gems you've created, what's the best way to manage them + ruby gems separately? Can you setup another gem sources, and set priorities? Or what would be the suggested way?
mikepack has quit [Remote host closed the connection]
<Muz>
jtoft: running your own gemserver is trivial. It involves having an HTTPD sat somewhere, just place your gems into a folder named /gems, and run `gem regenerate_index -d /path/to/the/folder/containing/the/gems/folder`
Markvilla has quit [Ping timeout: 265 seconds]
<lorn>
Hi, does anyboe use emacs with ruby-mode or enhanced-ruby-mode? I'm got a 'encoding : utf-8' error everytime i open a.rb :/
tomask has quit [Quit: Quit]
<jtoft>
Muz: sure, but that only gets the gems you have specified, can you passthrough to ruby gems? And how do your organize priority?
<Muz>
E.g, creating a folder named /var/www/gemserver/gems, placing your .gem files into there, and then running gem generate_index -d /var/www/gemserver
<Muz>
gems takes a --source argument
<Muz>
As for priority, not sure if gems respects that natively. If you're using bundler, you can order your Gemfile to indicate priority
fantazo has quit [Remote host closed the connection]
mockra has quit [Remote host closed the connection]
nfk has joined #ruby
Eldariof-ru has joined #ruby
overmind667 has quit [Ping timeout: 252 seconds]
jenrzzz-mac has joined #ruby
madscientist_ has joined #ruby
zaychenok has quit [Ping timeout: 244 seconds]
madscientist_ has quit [Client Quit]
horseman has quit [Read error: Connection reset by peer]
overmind667 has joined #ruby
mnaser has quit [Ping timeout: 240 seconds]
ZachBeta has joined #ruby
<Paradox>
scumbag python: claims to be object oriented…isnt
horseman has joined #ruby
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
jtoft has left #ruby [#ruby]
tds has joined #ruby
bluOxigen has joined #ruby
<tds>
is it not possible to use bare hashes with setter methods? i want to have a method foo=(arg) and pass in a bare hash
<Hanmac>
what is a "bare" hash?
<tds>
when you pass a hash to a method with braces surrounding it
<tds>
without
Guest41174 is now known as fred
fred has quit [Changing host]
fred has joined #ruby
Criztian has joined #ruby
AxonetBE has quit [Quit: Leaving.]
<Sigma00>
you mean foo(this=>that,there=>then) ?
<tds>
yes
<tds>
except i want to do
MrGando has joined #ruby
<tds>
foo = this=>that, there=>then
Markvilla has joined #ruby
<tds>
if the method was just foo i could do
<tds>
foo this=>that, there=>then
<Paradox>
i think you can, but not sure of how
Xethron has quit [Ping timeout: 252 seconds]
mrdtt has joined #ruby
<bricker88>
here's a general question that doesn't really have anything to do with Ruby: Should I be populating my factories with *all* attributes for a model, or just the required ones?
<Paradox>
up to you and your dev team
<Paradox>
and also probably a better question for #rails
Xethron has joined #ruby
<bricker88>
probably
kevinbond has quit [Quit: kevinbond]
vmatiyko has joined #ruby
<Paradox>
:)
<Paradox>
(づ。◕‿‿◕。)づ
<lorn>
Hi, does anyboe use emacs with ruby-mode or enhanced-ruby-mode? I'm got a 'encoding : utf-8' error everytime i open a .rb file :/
<Paradox>
well there's your problem
<Paradox>
"…use emacs…"
<Paradox>
:p
olrrai has joined #ruby
<lorn>
Paradox: :D
mnaser has quit [Ping timeout: 246 seconds]
tris has joined #ruby
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
<mjb2k>
bricker88: I don't believe there is an overall right answer to that, whatever fits your situation the best (as is as "future proof" as you can make it)
<shevy>
I dont know what is a factory other than that it produces things
<mjb2k>
exactly
<shevy>
sounds quite java-ready though
<shevy>
Factory.assemble :donut
<shevy>
hmm ok
<shevy>
donuts arent made in factories?
<bricker88>
mjb2k: Thanks for the input
<mjb2k>
Ruby is object oriented and could use factories just the same
AxonetBE has joined #ruby
cbuxton has joined #ruby
<nullsign>
all dontus are classes
cespare has quit [Quit: WeeChat 0.3.5]
<nullsign>
donuts/
<nullsign>
sugar is the method
<Paradox>
the only time i've ever seen factories used is in rails
looopy_ has joined #ruby
<Paradox>
and even then i find that what i want usually doesn't fit the factory
<Paradox>
but still
<Paradox>
factorygirl saves a lot of time
mdw_ has quit [Remote host closed the connection]
zaychenok has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
jenrzzz-mac has quit [Quit: jenrzzz-mac]
alfakini has joined #ruby
<mjb2k>
with Ruby classes not being "sealed" and the ability to use mixins, it seems many creation patterns get ignored
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
looopy has quit [Ping timeout: 244 seconds]
<shevy>
well java won't be like ruby ever!
randomautomator has joined #ruby
zaychenok has quit [Client Quit]
hadees has joined #ruby
<shevy>
do java hackers actually use scripting languages?
<wmoxam>
shevy: some do
zaychenok has joined #ruby
<mjb2k>
shevy: ?? I dont understand the question
<wmoxam>
just as some Rubyists use compiled languages
zaychenok has quit [Client Quit]
<wmoxam>
mjb2k: he's trolling
zaychenok has joined #ruby
<mjb2k>
Java is 80% of my day job
MasterIdler_ has joined #ruby
mnaser has quit [Ping timeout: 248 seconds]
<wmoxam>
mjb2k: many rubyists view 'patterns' as a workaround for a language's inflexibility
* tamaska
manufactures donuts
<mjb2k>
I'm actually in the early stages of a long term plan to push out PHP in favor of Ruby and Rails
<Paradox>
honestly, i never understood why java or other languages sealed classes
<Paradox>
is it for security?
<Paradox>
if someone has access to your source
<wmoxam>
Paradox: safety scissors
tatsuya_o has joined #ruby
<Paradox>
they can just override your classes anyway
<Paradox>
i gtg
<tamaska>
see ya
<wmoxam>
Paradox: on large teams some member won't be reasonable
jlogsdon has joined #ruby
<wmoxam>
"lets change how the '+' method works, it's a great shortcut!"
<mjb2k>
I think some patterns are just to work around a languages inflexibility, but some are just simply the tried and true best general solution to a common problem
sailias has joined #ruby
<wmoxam>
mjb2k: such as?
<lectrick>
TIL that \A and \Z are not the same as ^ and $ with regards to regexen
<shevy>
mjb2k well if you write java code daily, do these guys also write in scripting-languages in addition to that?
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
MasterIdler has quit [Ping timeout: 246 seconds]
ph^ has joined #ruby
<erichmenge>
Is there any equivalent to #respond_to? or defined? that doesn't go up the ancestor chain?
MasterIdler_ has quit [Ping timeout: 248 seconds]
<Mon_Ouie>
You can check if instance_methods(false) includes your method
<mjb2k>
well Java has a really broad range of applied uses, in my group specifically Java and PHP are our main 2, and of course all the typical web stuff comes along too
<erichmenge>
Mon_Ouie: Ah, of course, instance_methods, thanks.
zenom has joined #ruby
hemanth2 has quit [Quit: Leaving.]
<shevy>
k mjb2k so that question is answered. I count php into the scripting languages family too
<wmoxam>
mjb2k: patterns are pretty language specific though
<shevy>
ruby should kill php
alfakini has quit [Quit: Leaving]
<wmoxam>
shevy: why?
<jlogsdon>
php will never die, sorry
<zenom>
anyone here use rbenv and know of an automated way to install bundler via a script? I have tried rbenv shell 1.8.7-p358 && rbenv exec gem install bundler
<shevy>
wmoxam because less competition means more users
<zenom>
but using puppet it doesn't work, wondering if there is another way
<jlogsdon>
it's far to easy to get started with, and it's pretty much ubiquitous with hosts now,
<wmoxam>
shevy: why do we want more users?
<mjb2k>
on the other side of the building where their jobs are more focused on the main product (written in Java), I know Python is popular of there for infrastructure and integration type stuff
<shevy>
jlogsdon not any time soon, but look at perl5
<shevy>
wmoxam because no young blood means a language will die
<jlogsdon>
perl does not have the 'ease of use' that php has, though
<wmoxam>
shevy: I don't think Ruby has that problem :p
<jlogsdon>
ruby is getting lots of young blood?
<jlogsdon>
(like, all of it)
<shevy>
jlogsdon more than perl5 for sure, less than python though. and probably less than php, though I am not sure about that lately
<shevy>
I think the www is very appealing, so php will profit from that a lot, more than other languages
<wmoxam>
mjb2k: "Language advances kill patterns-as-recipes. Back in 1998, Peter Norvig argued that most of the original GOF patterns were invisible or simpler in Dylan or Lisp. Since then, Greg Sullivan has made the same point for Scheme. Jan Hannemann demonstrated the same for Java+AspectJ. Design patterns do not perform well as recipes. They are seasonal at best."
mdw has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
<pabloh>
how can u test for a deprectaion warning?
<pabloh>
deprecation*
<shevy>
9.23% for the scripting languages only :(
mxweas_ has joined #ruby
<mjb2k>
wmoxam: I certainly agree patterns are language specific, I realize that certain aspects of Ruby negate certain patterns, but I don't think the entire idea of patterns should be thrown out the window
<tamaska>
hey yall, is ruby a good prototyping language?
<shevy>
pabloh I dont think you can test for it, you only get warnings
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
notbrent has joined #ruby
Shamgar has quit [Changing host]
Shamgar has joined #ruby
mdw has quit [Ping timeout: 246 seconds]
<shevy>
hmm
zaychenok has quit [Client Quit]
<shevy>
or perhaps there is a "treat warnings as error" flag
<bricker88>
Sorry for asking this twice, didn't get an answer the first time: Is it a no-no to have a bunch of classes that each adds something to a global variable that is an array? For example, I want to know all classes that respond to the "administrate" method, so I thought to put "ADMINISTRATABLE.push self.name" at the top of each of those classes… is there a better way?
<shevy>
Kernel.warn
<pabloh>
shevy: i recall reading rails code that was testing for a deprecation warning...
<pabloh>
shevy: maybe i'm wrong
<shevy>
pabloh no idea, first time I heard this :)
looopy_ has quit [Remote host closed the connection]
zaychenok has joined #ruby
<shevy>
bricker88 anyway, you can add to constants if you must. I dont really know of a much better way when you want to keep data from modules, without classes
<bricker88>
shevy: anywhere
Markvilla has quit [Quit: Markvilla]
<pabloh>
shevy: it should be possible even by monkey patching the 'warn' method
<shevy>
bricker88 but not in the code you showed hahaha :D
<bricker88>
shevy: I know I can, it's the "if you must" that concerns me
<pabloh>
pabloh: not in a nice way, but posible...
<bricker88>
shevy: eh, this is just all swirling around right now, just planning really
coderhut has joined #ruby
tewecske has joined #ruby
<shevy>
bricker88 well, if you can use classes then this may be better. if you cant, well then you would have to use a global variable anyway. or a constant in that case, though it is a bit weird
jcromartie has quit [Quit: jcromartie]
<shevy>
in one project I am using a $use_colours variable
<shevy>
I hate it so much that I want to remove it though
ciopte7 has joined #ruby
ciopte7 has left #ruby [#ruby]
Markvilla has joined #ruby
mrbrdo has joined #ruby
<mjb2k>
every time I think to make a global variable, I right away re-evaluate my class structures and relationships
<mrbrdo>
is there a way I can compile ruby code inside irb and show YARV bytecode for it?
<bricker88>
shevy: I could use a constant too… Really I just need a place to store an array that anything can access, so that I can do something like ADMIN_CLASSES.each ...
<mrbrdo>
I've seen someone use VM::InstructionSequence.compile but it seems I need to require something to get access to VM?
<mjb2k>
in most cases, if you think you need a global, there is something else wrong
horseman has quit [Read error: Connection reset by peer]
<shevy>
bricker88, well then use a constant there
<bricker88>
shevy: thanks!
<shevy>
I do the same btw ;)
<shevy>
this is the first time that I like Pathname actually
<shevy>
Pathname(__FILE__).dirname.realpath.to_s
horseman has joined #ruby
roams has quit [Ping timeout: 248 seconds]
ken_barber1 has quit [Remote host closed the connection]
ken_barber has joined #ruby
nopolitica has quit [Ping timeout: 244 seconds]
Axsuul has joined #ruby
<shevy>
whoa
<shevy>
almost as many people on #rubyonrails as are here on #ruby
ben_alman has quit [Excess Flood]
<jlogsdon>
Well, RoR "launched" ruby into the scene
fayimora has quit [Ping timeout: 265 seconds]
<mjb2k>
that's where I first heard of Ruby from, Rails, now I use Ruby for a handful of different uses
<mjb2k>
rails being the least, haha
ben_alman has joined #ruby
Targen has joined #ruby
<shevy>
hmm
schovi has quit [Remote host closed the connection]
roams has joined #ruby
PaciFisT has joined #ruby
flak has joined #ruby
hadees has quit [Quit: hadees]
flak is now known as Guest49415
cj3kim has joined #ruby
jmuniz has joined #ruby
mockra has joined #ruby
cj3kim has quit [Client Quit]
Bosma has joined #ruby
ringotwo has joined #ruby
<mjb2k>
anybody have any experience packaing ruby apps into a Windows executable?
<mjb2k>
or even in a Mac app?
bosphorus_ has quit [Remote host closed the connection]
<jlogsdon>
mjb2k: like, a desktop app?
rippa has quit [Ping timeout: 244 seconds]
<Hanmac>
mjb2k google for "ruby orca"
<Guest49415>
ocra
<mjb2k>
yes, I have a handful of ruby-GTK utility apps
<advorak>
mjb2k, hotcocoa (mac) or even macruby's xcode additions ..
Guest49415 has quit [Client Quit]
* Hanmac
used my own wx port :P
rippa has joined #ruby
afallows has quit [Read error: Connection reset by peer]
<shevy>
mjb2k \o/ so you use ruby-gtk too
<shevy>
Hanmac, isn't wx dead
ben_alman has quit [Excess Flood]
<Hanmac>
only wxruby is dead ... wx itself is not
icooba has quit [Quit: icooba]
<mjb2k>
shevy: yep, nothing too advanced, but I have a handful of little utilities for easy point and click automation
mxweas_ has quit [Quit: Computer has gone to sleep.]
<shevy>
:)
<shevy>
Hanmac, ok but that's not ruby code then? :(
<nullsign>
ruby to replaced by new language - emerald
<shevy>
nullsign if it ain't on github, it aint exist!
<nullsign>
i like that linkedin profiles link to github projects ;)
<Hanmac>
shevy i rewrote the wxruby stuff ... so you could still use ruby code to make an wx app
<shevy>
"Emerald is a window decorator for beryl."
<shevy>
Hanmac really?
<Hanmac>
jeah
<Hanmac>
but its not finish yet
<shevy>
:-)
<shevy>
like my projects!
MasterIdler has joined #ruby
schovi has joined #ruby
vitoravelino`afk is now known as vitoravelino
vitoravelino is now known as Guest48162
<mjb2k>
so would ocra wrap the gtk gem in the app, but the app would still rely on Windows to have GTK installed. right?
ben_alman has joined #ruby
<Hanmac>
yeah
Criztian has quit [Remote host closed the connection]
jmuniz has left #ruby [#ruby]
<lectrick>
Is there something like .irbrc, except for the "ruby" command itself?
jitesh_shetty has quit [Read error: Connection reset by peer]
jitesh_shetty has joined #ruby
jcromartie has joined #ruby
darthdeus has joined #ruby
timonv has joined #ruby
duder has joined #ruby
trend has joined #ruby
xastion has quit [Ping timeout: 244 seconds]
Nies has joined #ruby
chrxn has joined #ruby
mnaser has quit [Quit: Computer has gone to sleep.]
Yarou has quit [Ping timeout: 246 seconds]
hadees has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
TPFC-SYSTEM has quit [Quit: TPFC-SYSTEM]
schaerli has joined #ruby
<shevy>
lectrick dont think so... though there are some ruby FLAGS
<shevy>
like $RUBYOPT
<apeiros_>
lectrick: alias ruby=ruby -rsomething
centipedefarmer has joined #ruby
PragCypher has quit [Ping timeout: 244 seconds]
theRoUS has quit [Ping timeout: 260 seconds]
Spooner has joined #ruby
kirun has joined #ruby
<shevy>
hehe
jenrzzz-mac has joined #ruby
ph^ has quit [Remote host closed the connection]
advorak has quit [Remote host closed the connection]
francisfish has joined #ruby
Dr4g_ has joined #ruby
jcromartie has quit [Quit: jcromartie]
ph^ has joined #ruby
mdhopkins has quit [Quit: mdhopkins]
mockra has quit [Remote host closed the connection]
advorak has joined #ruby
c0rn_ has quit [Quit: Computer has gone to sleep.]
jenrzzz-mac has quit [Ping timeout: 244 seconds]
ph^ has quit [Ping timeout: 244 seconds]
LBRapid has quit [Quit: Farewell...]
nathanstaines has joined #ruby
ZachBeta has quit [Quit: Computer has gone to sleep.]
mdw_ has quit [Remote host closed the connection]
Dreamer3 has quit [Quit: Computer has gone to sleep.]
advorak has quit [Remote host closed the connection]
xastion has joined #ruby
<lectrick>
apeiros_: I got it to work in a fairly clean way doing this: https://gist.github.com/2932330 Now I can require 'test_helper' from any test in my project and it works right from anywhere
<lectrick>
No test_runner required
<lectrick>
And my editor also runs it fine (sublime text 2 via command-B when the test is open)
Criztian has joined #ruby
theRoUS has joined #ruby
theRoUS has quit [Changing host]
theRoUS has joined #ruby
<apeiros_>
lectrick: :-/
<lectrick>
what's wrong?
<apeiros_>
I'll get back at you. cooking & eating…
<lectrick>
I thought that would be a slick way of making ruby aware of any project-specific paths unobtrusively. The only 'gotcha' is dependence on RVM
fserb has quit [Quit: ttyl]
koskoz has quit [Ping timeout: 240 seconds]
carbncl has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
luxurymode has joined #ruby
zaychenok has joined #ruby
john_metcalf has joined #ruby
EskiMag has joined #ruby
fserb has joined #ruby
PragCypher has joined #ruby
Guest48162 is now known as vitoravelino`
fserb has quit [Client Quit]
carbncl has quit [Client Quit]
francisfish has quit [Remote host closed the connection]
carbncl has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
carloslopes has quit [Quit: Leaving]
hemanth has quit [Read error: Connection reset by peer]
hemanth has joined #ruby
dekroning has joined #ruby
blacktulip has quit [Remote host closed the connection]
mrdtt has quit [Remote host closed the connection]
jcromartie has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
<lectrick>
apeiros_: crap it's buggy if I cd out of the dir and back in.
<lectrick>
apeiros_: i fixed it but now I just don't include any existing RUBYLIB into the new RUBYLIB.
john_metcalf has left #ruby [#ruby]
duder has quit [Ping timeout: 245 seconds]
zaychenok has quit [Client Quit]
foofoobar has quit [Quit: bb]
Siphonblast has quit [Ping timeout: 246 seconds]
zaychenok has joined #ruby
zaychenok has quit [Client Quit]
<lectrick>
granted that this is information that should be part of the repo (without having to add the .rvmrc to it)
zaychenok has joined #ruby
Siphonblast has joined #ruby
zenom has quit [Read error: No route to host]
udante has joined #ruby
axiak has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
<mrbrdo>
what does putiseq do in YARV VM?
<lectrick>
apeiros_: holy crap. running a ruby script with the -W option is amazing
<mrbrdo>
warning level?
<mrbrdo>
why is that amazing? :)
d3c has joined #ruby
chrxn__ has joined #ruby
dfr|work has quit [Remote host closed the connection]
graspee has joined #ruby
chrxn has quit [Ping timeout: 244 seconds]
chrxn__ is now known as chrxn
xiaotian has joined #ruby
<apeiros_>
lectrick: I stopped using -W the moment I started using 3rd party code.
<lectrick>
apeiros_: yeah, that's the amazing part lol
<apeiros_>
it's also the reason why i say ruby's warning system is broken.
<lectrick>
some warnings are kind of silly (using an @attribute before it's set), I wish it was configurable
<apeiros_>
it's useless the way it currently works.
<apeiros_>
using @attribute before set is not silly.
g0bl1n has quit [Ping timeout: 246 seconds]
<apeiros_>
it's a potential bug
<lectrick>
apeiros_: well, a lot of stuff does that, let's just say
fserb has joined #ruby
mdw has joined #ruby
<apeiros_>
sure
vmatiyko has left #ruby [#ruby]
<apeiros_>
but since you can't flag where you know that @ivar might be nil…
zaychenok has quit [Read error: Connection reset by peer]
Siphonblast has quit [Ping timeout: 240 seconds]
zaychenok has joined #ruby
yoklov has joined #ruby
qwerxy has joined #ruby
axl__ has joined #ruby
axl__ has quit [Read error: Connection reset by peer]
mvangala_home has joined #ruby
coderhut has quit [Quit: Page closed]
PragCypher has quit [Read error: Connection reset by peer]
chienpo has joined #ruby
PragCypher has joined #ruby
fserb has quit [Quit: ttyl]
axl_ has quit [Ping timeout: 248 seconds]
axl_ has joined #ruby
koskoz has joined #ruby
enriclluelles has quit [Remote host closed the connection]
jeff_sebring has quit [Quit: Leaving]
workmad3 has joined #ruby
carbncl has quit [Quit: carbncl]
<mrbrdo>
does anyone remember which gem it was that you could execute C code in ruby with?
<mrbrdo>
like it compiled on the fly and executed it
<Hanmac>
"inline c" ?
<mrbrdo>
thanks
<cek>
%x{gcc a.c}
<mrbrdo>
it's rubyinline
<cek>
jelaous
jenrzzz-mac has joined #ruby
<shevy>
yeah, the warnings have become quite odd
zinjacoder has quit [Read error: Connection reset by peer]
<shevy>
and they dont allow enough fine tuning
daniel_hinojosa has quit [Ping timeout: 246 seconds]
<shevy>
like that ruby always warns when a variable is not used afterwards
<shevy>
x = do_something
<shevy>
it will warn if x is not used at all
axl__ has joined #ruby
<shevy>
the problem then becomes for this:
<nullsign>
so why is strata good?
<shevy>
x,y,z = do_something
fayimora has joined #ruby
<shevy>
when y is not used, it will warn ... but perhaps the author does not care about y, only about x and z
niklasb has joined #ruby
<billy_ran_away>
I see a lot of methods where elements of an array used as a method argument can be either a symbol or a hash, I'm trying to do the same thing, is there a better way then this to get all the (element || element.keys.first?) http://cl.ly/HNSK
Targen_ has joined #ruby
dennda has left #ruby [#ruby]
zinjacoder has joined #ruby
EskiMag_ has joined #ruby
Targen has quit [Ping timeout: 246 seconds]
Siphonblast has joined #ruby
<cek>
you need to fix the caller
axl_ has quit [Ping timeout: 244 seconds]
<billy_ran_away>
cek: Me?
chrxn has quit [Quit: Computer has gone to sleep.]
cek has quit [Quit: жопа диридай диридиридай]
EskiMag has quit [Ping timeout: 244 seconds]
EskiMag_ is now known as EskiMag
axl_ has joined #ruby
<jlogsdon>
billy_ran_away: i dont think there's a better way, outside of shortening it to `mask.is_a?(Hash) ? mask.keys.first : mask`
<billy_ran_away>
Yea, inline if...
bosphorus has joined #ruby
<jlogsdon>
ternary*
<billy_ran_away>
jlogsdon: Thanks for looking
<billy_ran_away>
jlogsdon: Never heard it called that...
<billy_ran_away>
ternary |ˈtərnərē| adjective composed of three parts.
whitequark has joined #ruby
whitequark has left #ruby [#ruby]
<jlogsdon>
Yup. Part 1 is condition, part 2 is TRUE result, part 3 is FALSE result
axl__ has quit [Ping timeout: 265 seconds]
mnaser has joined #ruby
mnaser has quit [Changing host]
mnaser has joined #ruby
jenrzzz-mac_ has joined #ruby
red-panda has joined #ruby
jrist has quit [Ping timeout: 252 seconds]
jenrzzz-mac has quit [Ping timeout: 240 seconds]
jenrzzz-mac_ is now known as jenrzzz-mac
ZachBeta has joined #ruby
jamiemill has joined #ruby
Targen_ has quit [Ping timeout: 246 seconds]
canton7 has joined #ruby
habib has joined #ruby
<habib>
Hi Everyone
uris has quit [Ping timeout: 245 seconds]
ukd1 has quit [Quit: ukd1]
fbernier has joined #ruby
<digitalcakestudi>
how would I format a number to something like 000001 from 1 ?
<eam>
sprintf
<digitalcakestudi>
where 0 fills in the empty place
<digitalcakestudi>
thanks eam
enriclluelles has joined #ruby
visof has joined #ruby
visof has quit [Changing host]
visof has joined #ruby
williamcotton_ has joined #ruby
jenrzzz-mac_ has joined #ruby
williamcotton has quit [Ping timeout: 246 seconds]
williamcotton_ is now known as williamcotton
MrGando has quit [Remote host closed the connection]
Siphonblast has quit [Ping timeout: 248 seconds]
<digitalcakestudi>
so I have it figured out to encode to a number such as sprintf("%06d", 1) being 000001 but is there a way to revers that such as sprintf("%-06d", 000001) ??
<jlogsdon>
digitalcakestudi: or String#rjust
<jlogsdon>
try just %d?
sam113101 has quit [Remote host closed the connection]
<jlogsdon>
if that doesn't work I dont think sprintf can handle that case
<digitalcakestudi>
nice it works
<jlogsdon>
:)
jenrzzz-mac has quit [Ping timeout: 244 seconds]
jenrzzz-mac_ is now known as jenrzzz-mac
<eam>
000001 is 1 already
<digitalcakestudi>
trying to make my invoice ids look good
<digitalcakestudi>
eam yeah if its an int but what about a string?
<digitalcakestudi>
jk
<eam>
that would be "000001" :)
<eam>
and .to_i will turn it into 1
Kn|t3 has joined #ruby
kvirani has quit [Remote host closed the connection]
<digitalcakestudi>
nice I will need that
<digitalcakestudi>
thanks
<digitalcakestudi>
going to be using as slugs in urls
schovi has quit [Remote host closed the connection]
Kn|t3_ has joined #ruby
sam113101 has joined #ruby
mdw_ has joined #ruby
Kn|t3 has quit [Ping timeout: 244 seconds]
Kn|t3_ is now known as Kn|t3
mdw has quit [Read error: Connection reset by peer]
nilg` has quit [Read error: Connection reset by peer]
Eldariof-ru has quit []
Xethron has quit [Ping timeout: 240 seconds]
davidw has joined #ruby
Xethron has joined #ruby
nilg has joined #ruby
davidw is now known as Guest3628
cespare has joined #ruby
c0rn_ has joined #ruby
teh4 has quit [Quit: Leaving]
akem has joined #ruby
akem has quit [Changing host]
akem has joined #ruby
jmartin has quit [Quit: Leaving]
netogallo has joined #ruby
sepp2k1 has joined #ruby
xastion has quit [Ping timeout: 252 seconds]
nilg has quit [Remote host closed the connection]
jenrzzz-mac_ has joined #ruby
yankov has joined #ruby
jenrzzz-mac has quit [Read error: No route to host]
jenrzzz-mac_ is now known as jenrzzz-mac
sepp2k has quit [Ping timeout: 246 seconds]
xastion has joined #ruby
yoklov has quit [Quit: bye!]
neto_gallo has joined #ruby
neto_gallo has quit [Client Quit]
yoklov has joined #ruby
netogallo has quit [Client Quit]
netogallo has joined #ruby
<habib>
what if interpreter says "couldn't load SDL"?
enriclluelles has quit [Remote host closed the connection]
nanderoo has quit [Quit: Leaving.]
geekbri has quit [Remote host closed the connection]
jamiemill has quit [Ping timeout: 240 seconds]
Siphonblast has joined #ruby
jrist has joined #ruby
khakimov has quit [Quit: Computer has gone to sleep.]
federic has quit [Remote host closed the connection]
rippa has quit [Ping timeout: 244 seconds]
jimeh2 has joined #ruby
v0n has quit [Quit: Quitte]
yxhuvud has quit [Ping timeout: 244 seconds]
Bosma has quit [Quit: leaving]
visof has quit [Ping timeout: 244 seconds]
nilg has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
silentpost has joined #ruby
jimeh has quit [Ping timeout: 252 seconds]
bosphorus_ has joined #ruby
enriclluelles has joined #ruby
saschagehlich has quit [Quit: saschagehlich]
zaychenok has quit [Read error: Connection reset by peer]
Guest3628 is now known as davidw
davidw has quit [Changing host]
davidw has joined #ruby
zaychenok has joined #ruby
bosphorus has quit [Ping timeout: 265 seconds]
fmcgeough has joined #ruby
Progster has quit [Ping timeout: 244 seconds]
enriclluelles has quit [Remote host closed the connection]
mengu has joined #ruby
netogallo has quit [Quit: Leaving]
cek has joined #ruby
<cek>
bidirectional communication over a socket, please
<cek>
blocking
nilg has quit [Read error: Connection reset by peer]
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
Siphonblast has quit [Ping timeout: 246 seconds]
<apeiros_>
cek: is that a question?
<cek>
apeiros_, depends on your answer
fantazo has joined #ruby
kvirani has joined #ruby
<cek>
zaychenok, хуй!
nopcoder has joined #ruby
<cek>
It seems like i can't get it working. I'm getting broken pipe, resouce unavail and all sort of errros.
enriclluelles has joined #ruby
<cek>
all those examples on internets are ass sided one way implementations
<cek>
who needs one way?
<habib>
Просто интересно сколько русских на канале
<ukd1>
hi guys, I'm having some minor issues with pretty url's not working. They work fine with the inbuilt server, but don't work using apache + passenger - requests just 404 from apache. Any suggestions?
<shadoi>
So, I'm profiling a TFTP server I wrote in ruby, it's (not surprisingly) very slow for file transfers.
__main__ has quit [Read error: Connection reset by peer]
<shadoi>
Anyone have and good pointers on optimizing UDP socket file transfers?
<apeiros_>
TFTP? /me googles
nopcoder has quit []
<apeiros_>
shadoi: I heard EM was fast for IO…
_main_0 has joined #ruby
pu22l3r_ has joined #ruby
<apeiros_>
also, I don't know, but maybe there's something like sendfile for udp?
<heftig>
i don't think so
<heftig>
UDP is message-based, not stream-based. and connection-less, too
<apeiros_>
oh, seems sendfile works over udp too
<cek>
udp is datagram based
<apeiros_>
before 2008 only for files <64KB, though :)
<shadoi>
I have to encode each packet, so… unless I move all of that code out to C, I'm stuck using ruby's sockets.
<cek>
okay, so what about 2way comm over unix socket?
<apeiros_>
shadoi: did you profile?
pu22l3r has quit [Ping timeout: 240 seconds]
yoklov has quit [Quit: bye!]
<shadoi>
yeah
yoklov has joined #ruby
<shadoi>
48% of the time it's in UDPSocket.recvfrom
<shadoi>
in the server...
yoklov has quit [Remote host closed the connection]
<shadoi>
which confused me a bit
<heftig>
cek: datagram or stream?
pu22l3r_ has quit [Ping timeout: 244 seconds]
Synthead has quit [Remote host closed the connection]
hynkle has quit [Quit: hynkle]
<apeiros_>
shadoi: recvfrom blocks, no?
chrxn has joined #ruby
<apeiros_>
in the server, try a select loop with nonblocking IO?
<cek>
heftig, doesn't matter as long as it works. i need 2way on unix socket, blocking. thats all
<shadoi>
I used recvfrom_nonblock as well
mdw_ has quit [Remote host closed the connection]
hemanth has quit [Read error: Connection reset by peer]
<apeiros_>
btw., what's the difference between recvfrom and read
<shadoi>
I'll try an eventmachine version and see how big of a difference it makes
Tricks has quit [Read error: Connection reset by peer]
dekroning has quit [Ping timeout: 265 seconds]
<shadoi>
and maybe a celluloid::io version
hemanth has joined #ruby
Tricks has joined #ruby
S1kx has quit [Quit: Leaving]
axiak has quit [Remote host closed the connection]
zaychenok has quit [Read error: Connection reset by peer]
medik has joined #ruby
zaychenok has joined #ruby
Natch| has quit [Ping timeout: 248 seconds]
<billy_ran_away>
Anyone know a good way to take a hash like { :default_formats => [], :formats => [], :format => [], :something_else => nil } and collect all the keys that include? "format" returning them as a hash, and modifying the original hash at the same time?
centipedefarmer has quit [Ping timeout: 248 seconds]
<billy_ran_away>
select! I guess...
v0n has joined #ruby
zaychenok has quit [Client Quit]
<cek>
did you know that you can retry the begin/rescue/end block on exception?
<cek>
okay, so it looks like you can open a socket 2 times in the same process. the 2way example is at http://apidock.com/ruby/v1_9_3_125/UNIXServer/accept . you can interchange the accept_nonblock for server and client flawlessly
mnaser has quit [Ping timeout: 252 seconds]
hakunin has quit [Remote host closed the connection]
hakunin has joined #ruby
hakunin has quit [Remote host closed the connection]
<apeiros_>
I don't know cek, but do you actually *read* the stuff people write you?
<cek>
why would you need to make an echo server? internets are full of echo servers.
ph^ has joined #ruby
miles32 has joined #ruby
* apeiros_
facepalms
<cek>
you just take any page and that's echo server right there
<cek>
even national los alamos labaratory runs an echo server
<apeiros_>
cek: dude, you asked for 2 way sockets. that's demo code for just that.
ben_alman has joined #ruby
<cek>
i'm just wasting my time with all these echo servers. I need real solutions for real people.
schaerli has quit [Ping timeout: 245 seconds]
schaerli has joined #ruby
<apeiros_>
but hey, it's nice how thankful you are towards heftig. I find it great that you took your time to say 'thank you'
<Sigma00>
lawl what
cyong has joined #ruby
* apeiros_
puts his mental ignore hat on…
ringotwo has quit [Remote host closed the connection]
dsa has joined #ruby
<Sigma00>
no no wait, this could get good
<apeiros_>
no, it'd end in a kick and eventually a ban. I know how those things escalate.
ringotwo has joined #ruby
miles32 has quit [Remote host closed the connection]
<cek>
That would be a fork!
bglusman_ has joined #ruby
<heftig>
so we've provided a solution for the wrong problem, it seems
schaerli has quit [Remote host closed the connection]
EzeQL has quit [Ping timeout: 260 seconds]
<apeiros_>
heftig: no, he doesn't articulate his problem. it's endemic with him. see his first "question".
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
wallerdev has quit [Quit: wallerdev]
hugoxrosa has quit [Quit: Saindo]
bglusman has quit [Ping timeout: 244 seconds]
horseman has quit [Read error: Connection reset by peer]
wallerdev has joined #ruby
wallerdev has quit [Client Quit]
pk1001100011 has quit [Quit: Burn your gods and kill the king; Subjugate your suffering; Dead heart, in a dead world]
ph^ has quit [Ping timeout: 265 seconds]
andrewhl has quit [Remote host closed the connection]
Gavilan is now known as Gavilan2
vlad_starkov has quit [Remote host closed the connection]
<shadoi>
Usually boils down to "Do my job for me!"
tscolari has quit [Remote host closed the connection]
<cek>
it looks like it's impossible to do that wiht unixsocket classes
<lectrick>
hey apeiros_ hope you had a delicious meal. did you already mention your opinion on https://gist.github.com/2932330 yet? (I may have missed it)
skinny_much has quit [Remote host closed the connection]
horseman has joined #ruby
uris has joined #ruby
<apeiros_>
cek: odd, heftig disproved that statement with his demo code.
fserb has joined #ruby
<apeiros_>
lectrick: whoops
<cek>
he's not using unixsocket /unixserver
S1kx has joined #ruby
g0bl1n has joined #ruby
<apeiros_>
lectrick: I feel uneasy with putting the env setup knowledge there
<cek>
that's plain system calls there
<apeiros_>
cek: yes he does.
<apeiros_>
and yes, of course those result in system calls. like so much in programming. that's why you have a system…
<lectrick>
apeiros_: Well there's no ideal place to put it, it has to land somewhere lol. But at least this allows me to have project-specific load paths "without even thinking"
<apeiros_>
lectrick: yes, it's always a tradeoff
<apeiros_>
but with that, you rely on rvm
<lectrick>
apeiros_: Of course, when distributing a project, that knowledge is no longer there so you'd still need a test_runner that adds to the load_path
axolx has left #ruby [#ruby]
<apeiros_>
the tradeoff with the runner.rb is that you can't just use the ruby executable. but it doesn't introduce additional dependencies.
<lectrick>
apeiros_: In my case I'm just dealing with rails apps so it works
cgag has joined #ruby
<lectrick>
cek: OALA
<apeiros_>
lectrick: personally I think the test framework should actually do that. baretest was designed with that in mind.
joshman_ has quit [Ping timeout: 244 seconds]
udante has quit [Quit: Leaving...]
<apeiros_>
unfortunately I'm stuck at rewriting it :(
vlad_starkov has joined #ruby
ph^ has joined #ruby
<lectrick>
cek: by which I meant "opinions are like assholes... everybody's got one" because I know some prefer rbenv :)
fbernier has quit [Ping timeout: 265 seconds]
<cek>
rvm is very unstable. they introduce bugs and change interfaces
<cek>
amateurs
zaychenok has quit [Quit: Konversation terminated!]
<lectrick>
yeah i've noticed lol. but our team uses it
zaychenok has joined #ruby
grendlme has quit [Remote host closed the connection]
<lectrick>
don't get my started on how $HOME/.rvmrc is expected to be a completely different type of file than $project_dir/.rvmrc
horseman has quit [Read error: Connection reset by peer]
workmad3 has joined #ruby
<lectrick>
me, not my
jenrzzz-mac has joined #ruby
<lectrick>
cek: does rbenv have gemsets?
zaychenok has quit [Client Quit]
<cek>
no idea, never tried, but I think we'll switch to it.
zaychenok has joined #ruby
<lectrick>
I don't think it does. have to say that is a nicety of rvm even if rvm does it by making "gem" a function :O
horseman has joined #ruby
<workmad3>
rbenv has a plugin for gemsets iirc
mengu has quit [Read error: Connection reset by peer]
hajoco has joined #ruby
<lectrick>
ah ok.
pnbeast has joined #ruby
mjb2k has left #ruby ["Leaving"]
brian- has quit [Quit: Changing server]
<lectrick>
So rbenv works by putting ruby commands ahead in your PATH via 'shims' so they grab them first.
brian- has joined #ruby
vlad_starkov has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 245 seconds]
<lectrick>
I suppose commands like 'ruby' and 'gem' resolve to /shims/ and those are scripts that determine your current Ruby version and then set the right things and run it
chson has quit [Remote host closed the connection]
alesguzik has joined #ruby
eurbach has quit [Quit: Leaving.]
yoklov has joined #ruby
`brendan has quit [Quit: - nbs-irc 2.39 - www.nbs-irc.net -]
<heftig>
still the same. just with more class and less parameters
<cek>
heftig, yeah, but you're too late. the trick here is not to open 2 servers accidentally or it won't work
<apeiros_>
it's really sad that github didn't implement the commit view of the normal github service for gists.
wvdschel has joined #ruby
wvdschel has quit [Changing host]
wvdschel has joined #ruby
havenn has joined #ruby
sailias has joined #ruby
<cek>
that is, unixserver creates the socket, but you must not #accept it, they you connect from "remote" via unixsocket, then you accept it on server if you want to listen and there you go with 2way
ph^ has quit [Remote host closed the connection]
ph^ has joined #ruby
<apeiros_>
cek: where are you coming from?
Frippe has quit [Ping timeout: 244 seconds]
<heftig>
cek: what.
<heftig>
of course you run #accept first thing
sspiff has quit [Ping timeout: 244 seconds]
uris has quit [Ping timeout: 265 seconds]
ph^ has quit [Ping timeout: 240 seconds]
fserb has quit [Quit: ttyl]
wvms has joined #ruby
internet_user has quit [Remote host closed the connection]
fayimora has joined #ruby
Criztian has quit [Remote host closed the connection]
fayimora has quit [Client Quit]
suborbital has joined #ruby
dv310p3r has quit [Ping timeout: 244 seconds]
tcopp has quit [Quit: Lost terminal]
billy_ran_away has quit []
horseman has quit [Read error: Connection reset by peer]
Frippe has joined #ruby
fayimora has joined #ruby
<digitalcakestudi>
anyone here feel like helping me out with a cancan ability issue I'm having?
horseman has joined #ruby
wmoxam has quit [Quit: leaving]
bglusman_ has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 246 seconds]
<cek>
heftig, well, i wish i could get that working with https://github.com/pbosetti/SimpleIPC . i managed to get 2way locally, but this lib is giving me all the problems.
<digitalcakestudi>
trying to can :read, Quote, user_ids.include?(user.id) where Quote habt user
<cek>
all those assumptions because #accept and order of calls was because of that lib
<cek>
it uses sockets in somewhat drastic way
mvangala_home has quit [Remote host closed the connection]
horseman has quit [Read error: Connection reset by peer]
balki has quit [Ping timeout: 245 seconds]
red-panda has quit [Remote host closed the connection]
DrShoggoth has quit [Quit: Leaving]
cgag has quit [Remote host closed the connection]
camilo has quit [Remote host closed the connection]
<cek>
thanks!
cek has quit [Quit: жопа диридай диридиридай]
red-panda has joined #ruby
zaychenok has quit [Quit: Konversation terminated!]
zaychenok has joined #ruby
<apeiros_>
wow. he… he said "thanks". that was unexpected.
horseman has joined #ruby
sailias has quit [Quit: Leaving.]
jimeh2 has quit [Quit: bye]
cyong has quit [Quit: Leaving.]
DMKE has quit [Ping timeout: 244 seconds]
zaychenok has quit [Client Quit]
khakimov has joined #ruby
koskoz has quit [Ping timeout: 265 seconds]
roams has quit [Ping timeout: 240 seconds]
zaychenok has joined #ruby
the_jeebster has quit [Quit: Leaving.]
carlyle has quit [Remote host closed the connection]
Monofu has joined #ruby
virunga has quit [Read error: Connection reset by peer]
Monofu has left #ruby [#ruby]
stockholm has joined #ruby
ceej has quit [Read error: Connection reset by peer]
Gavilan2 has left #ruby [#ruby]
ceej has joined #ruby
banseljaj is now known as imami|afk
jlogsdon has quit [Remote host closed the connection]
brian- has quit [Quit: leaving]
fantazo_ has joined #ruby
brian- has joined #ruby
ceej has quit [Remote host closed the connection]
yannis has quit [Ping timeout: 246 seconds]
jrist is now known as jrist-afk
tewecske has quit [Quit: Leaving.]
fantazo has quit [Ping timeout: 246 seconds]
havenn has quit [Remote host closed the connection]
Banistergalaxy has quit [Ping timeout: 265 seconds]
Banistergalaxy has joined #ruby
PaciFisT has quit [Quit: Leaving.]
jgarvey has quit [Quit: Leaving]
mnaser has quit [Quit: Computer has gone to sleep.]
DMKE has joined #ruby
Helius has joined #ruby
fserb has joined #ruby
fayimora has quit [Ping timeout: 244 seconds]
wangr has quit [Ping timeout: 244 seconds]
niklasb has quit [Ping timeout: 246 seconds]
etehtsea has quit []
qwerxy has quit [Quit: offski]
suborbital has quit [Ping timeout: 244 seconds]
jcromartie has quit [Read error: Connection reset by peer]
jcromartie has joined #ruby
jcromartie has quit [Read error: Connection reset by peer]
adeponte has joined #ruby
g0bl1n has quit [Ping timeout: 246 seconds]
qwerxy has joined #ruby
hajoco has quit [Quit: hajoco]
billiamii has quit [Read error: Connection reset by peer]
DrForr has quit [Ping timeout: 248 seconds]
hadees has quit [Quit: hadees]
EskiMag has quit [Quit: EskiMag]
PragCypher has quit [Read error: Connection reset by peer]
neersighted is now known as neersight[d]
PragCypher has joined #ruby
cyong has joined #ruby
neersight[d] is now known as neersighted
ZachBeta has quit [Quit: Computer has gone to sleep.]
hasrb has quit [Remote host closed the connection]
cbuxton1 has joined #ruby
crankycoder has quit [Remote host closed the connection]
qwerxy has quit [Client Quit]
Helius has quit [Ping timeout: 252 seconds]
emmanuelux has joined #ruby
cbuxton has quit [Ping timeout: 244 seconds]
suborbital has joined #ruby
mnaser has joined #ruby
d3c has quit [Read error: Connection reset by peer]
red-panda has quit [Remote host closed the connection]
indian has quit [Quit: Leaving]
red-panda has joined #ruby
havenn has joined #ruby
red-panda has quit [Remote host closed the connection]
d3c has joined #ruby
pk1001100011 has joined #ruby
<shevy>
let's say I have a file called "foo.txt"
<shevy>
can I require that and have it run as ruby code?
<shevy>
require 'foo.txt'
<shevy>
:P
hunglin has quit [Quit: Leaving.]
red-panda has joined #ruby
cyong has quit [Quit: Leaving.]
azaq23 has joined #ruby
bosphorus_ has quit [Remote host closed the connection]
<shevy>
eval File.read('foo.txt')
<shevy>
hmmmmmmmmm damn you eval
<hoelzro>
shevy: you should write a sandbox module using mRuby =)
<hoelzro>
I was thinking about that, but I don't have nearly enough experience with Ruby
<shevy>
I got ruby code in some .cgi pages right now
<shevy>
and now trying to turn them all out
<havenn>
shevy: load 'foo.txt'
<shevy>
wheeeee
<shevy>
that seems to work just fine
<shevy>
thanks
eywu1 has quit [Quit: Leaving.]
pu22l3r has joined #ruby
red-panda has quit [Remote host closed the connection]
chrismcg is now known as zz_chrismcg
red-panda has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
kvirani has quit [Remote host closed the connection]
DanBoy has quit [Remote host closed the connection]
pen has joined #ruby
piotr_ has joined #ruby
ken_barber1 has quit [Remote host closed the connection]
eywu has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
theRoUS has quit [Ping timeout: 260 seconds]
xastion has quit [Ping timeout: 252 seconds]
xastion_ has joined #ruby
simao has quit [Ping timeout: 265 seconds]
hadees has joined #ruby
xaq has quit [Read error: Connection reset by peer]
xaq has joined #ruby
nopolitica has joined #ruby
zaychenok has quit [Read error: Connection reset by peer]
zaychenok has joined #ruby
<digitalcakestudi>
is it possible to use cancan to prevent a user from calling a controller? vs a resource/model?
nfk has quit [Quit: yawn]
cyong has joined #ruby
cyong has quit [Max SendQ exceeded]
simao has joined #ruby
cyong has joined #ruby
punkrawkR has quit [Read error: Connection reset by peer]
cyong has quit [Client Quit]
<digitalcakestudi>
for example I have a role :client were that use can :read Quote but I have two controllers where one is namescaped to client and that other admin. Now the client is for the clients and the admin is for the admins but a client and still call the controllers for the admin because the client can read
<digitalcakestudi>
user*
cyong has joined #ruby
<digitalcakestudi>
blaaa, I cant type today
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
S1kx has quit [Quit: Leaving]
iocor has quit [Ping timeout: 252 seconds]
tatsuya_o has quit [Remote host closed the connection]
greyEAX has quit [Ping timeout: 240 seconds]
dhodgkin_ has joined #ruby
dhodgkin has quit [Ping timeout: 252 seconds]
mockillo has quit [Ping timeout: 252 seconds]
Caius has quit [Ping timeout: 252 seconds]
dhodgkin_ is now known as dhodgkin
mockillo has joined #ruby
davidw has quit [Ping timeout: 248 seconds]
elrond255 has joined #ruby
explody has quit [Remote host closed the connection]
iocor has joined #ruby
<elrond255>
can I write methods in a module and then access the method from a class within the same module? what is the syntax? are there pointers where to get that information?
<apeiros_>
elrond255: methods either must be defined on self's singleton class, self's class or any of self's class' ancestors. that's the whole rule about methods in ruby. in all other cases, you must provide an explicit receiver for the method.
qwerxy has joined #ruby
<apeiros_>
getting methods into self's singleton class can be done by a) def obj.foo; end, or b) obj.extend SomeModule
<elrond255>
so if I create a method in the module ebook called process_foo I can call it from a module class my_process as ebook.process_foo?
nari has joined #ruby
<apeiros_>
the only other speciality is that a module included into a class becomes part of that class' ancestry
<apeiros_>
your module can't be called ebook. do you mean Ebook?
<apeiros_>
and yes, if you define it on Ebook's singleton class, you can call it by Ebook.process_foo
<elrond255>
yes, I forget the rules for casing of names some times
Caius has joined #ruby
stockholm has quit [Ping timeout: 245 seconds]
ziyadb has joined #ruby
horseman has quit [Remote host closed the connection]
ephemerian has quit [Quit: Leaving.]
kaneda__ has quit [Remote host closed the connection]
<elrond255>
thank you
pu22l3r has quit [Remote host closed the connection]
minijupe has joined #ruby
elrond255 has quit [Quit: elrond255]
explody has joined #ruby
TorpedoSkyline has joined #ruby
kaneda has joined #ruby
kaneda is now known as Guest14217
EzeQL has joined #ruby
qwerxy has quit [Quit: offski]
kirun has quit [Quit: Client exiting]
Spaceghostc2c has joined #ruby
billiamii has joined #ruby
dsa has quit [Ping timeout: 260 seconds]
fserb has quit [Quit: ttyl]
zaychenok has quit [Quit: Konversation terminated!]
williamcotton has quit [Quit: williamcotton]
zaychenok has joined #ruby
zaychenok has quit [Client Quit]
zaychenok has joined #ruby
<minijupe>
how do I access aggregate data with AR? Purchase.successful.select("sum(transactable_price) as total").on_day(Date.today-1.month).total >> undefined method `total'
xastion_ has quit [Ping timeout: 246 seconds]
<apeiros_>
minijupe: #rubyonrails
<icy`>
hi, what's a good way of storing multiple items which have a string (like a price), and a timestamp with that price? Could have many prices and timestamps per item
<minijupe>
apeiros_: tried and failed there :(
<apeiros_>
minijupe: that doesn't make this the right channel to escalate.
<minijupe>
apeiros_: many ruby apps use active record, tho, not just rails.
<apeiros_>
minijupe: not the point and I'm not going to argue about it.
<apeiros_>
icy`: so the price and the timestamp belong together? Struct.new(:price, :timestamp), then have an array (or other collection) of these stored in your item.
zaychenok has joined #ruby
d3c has quit [Quit: Quit]
<icy`>
apeiros_, ah, i forgot about structures =) ty.
alesguzik has quit [Quit: leaving]
<apeiros_>
icy`: just a cheap way to create a class. creating a "full" class is perfectly reasonable too.
chrxn has quit [Ping timeout: 245 seconds]
chrxn has joined #ruby
g0bl1n has joined #ruby
<apeiros_>
meh, I should finish that gist on cross-posting and restart kicking cross-posters.
<icy`>
apeiros_, i was originally just going to have an array of the form [price, time, price2, time2...] and then step or w/e through it
adeponte has quit [Remote host closed the connection]
<Tasser>
icy`, if it's semantically a struct, make it a struct ;-)
<Tasser>
apeiros_, y u no sleep? :-)
<icy`>
might be more overhead
<apeiros_>
Tasser: sickness fucks up sleep schedule.
<icy`>
if one item is holding an array of like 10 structs o.O
<apeiros_>
icy`: never be afraid to create a class
<Tasser>
icy`, so what?
wubino has quit [Quit: Leaving]
<apeiros_>
icy`: oh noes! 10 structs! omg I think the ruby interpreter will burst in flames! :-p
<icy`>
=)
Tref has quit [Quit: Tref]
<icy`>
yes, i definitely miss ruby
<apeiros_>
start worrying about such things when they actually become a problem.
suborbital has quit [Quit: WeeChat 0.3.9-dev]
<apeiros_>
premature optimization yadda yadda…
Targen has joined #ruby
wangr has joined #ruby
<Tasser>
apeiros_, ...
suborbital has joined #ruby
<Tasser>
the perl yadda-yadda operator
suborbital has quit [Client Quit]
<Tasser>
kinda equivalent to ruby raise NotImplementedError
<apeiros_>
why am I not surprised that perl has a yadda-yadda operator?