TheNet has quit [Remote host closed the connection]
TheNet has joined #ruby
edwinvdgraaf has quit [Remote host closed the connection]
Igorshp has quit [Remote host closed the connection]
Igorshp has joined #ruby
tmtwd has quit [Ping timeout: 244 seconds]
devdazed has quit [Quit: Computer has gone to sleep.]
frem has quit [Quit: Connection closed for inactivity]
Rollabunna has joined #ruby
Igorshp has quit [Remote host closed the connection]
_blizzy_ has quit [Ping timeout: 255 seconds]
phutchins has quit [Ping timeout: 240 seconds]
sevenseacat has joined #ruby
athos_diddy has joined #ruby
atomi has quit [Quit: brb settings updates]
<athos_diddy>
hey everyone i need to buy my first SSL cert for a blog then later a customer facing web appp
<athos_diddy>
Comodo is selling EV SSL for 99 as a summer special. the banner on the site says it's a summer sale.. is that for real? is 99$ super cheap?
<Ox0dea>
dogcan: A new Logger is only instantiated when @logger is nil.
markholmes is now known as mark-away
yfeldblum has quit [Ping timeout: 248 seconds]
<Ox0dea>
It'll only be nil the first time MyLog.log is invoked.
bungoman has joined #ruby
<dogcan>
Ox0dea: couldn't we make new instances of MyLog.log though? I think I understand the difference between class and instance methods.
CloCkWeRX1 has quit [Quit: Leaving.]
<Ox0dea>
dogcan: MyLog.log is not a class, so how could you make new instances of it?
<dogcan>
instance-2 = MyLog.new; instance-2.log
<dogcan>
something like that maybe
malcolmva has quit [Ping timeout: 244 seconds]
<Ox0dea>
No, log is a class method here.
<Ox0dea>
You won't be able to call it on instances.
<dogcan>
so if it were an instance method we could
MasterPiece has quit [Ping timeout: 252 seconds]
oo_ has quit [Remote host closed the connection]
<Ox0dea>
Well, yes, but then your class would be called MyLogger, and you'd start reinventing the wheel.
<dogcan>
I guess I am confused since I am reading instance methods apply to the specific instance while class methods are like theblueprints for the class and don't apply to specific instances
crwilcox has joined #ruby
<SirFunk>
So... MRI ruby.. threads or no?
<Ox0dea>
SirFunk: Switch to Elixir.
<SirFunk>
hehe
<SirFunk>
Ox0dea: I've been tempted
<Ox0dea>
There's much good to be said of it.
nateberkopec has joined #ruby
dom__ has joined #ruby
<SirFunk>
I thought MRI had real threads but they are crippled by the GIL. Someone I work with was asserting MRI has no threading
<SirFunk>
a few minutes of googling didn't yield much information
Lucky_ has joined #ruby
peeja has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oo_ has joined #ruby
<dom__>
ldzf
ndrei has quit [Ping timeout: 264 seconds]
<centrx>
SirFunk, I thought they were real threads but they are locked by the GIL to maintain consistency
ndrei_ has quit [Ping timeout: 240 seconds]
<centrx>
SirFunk, The GIL isn't a big problem for most applications because of I/O
maletor has quit []
<SirFunk>
centrx: IO happens concurrently.. but only 1 thread of ruby executes at a time?
<SirFunk>
what is the advantage to having native threads if only one executes at a time vs green threads?
zz_barkerd427 is now known as barkerd427
<SirFunk>
And how do Puma and Sidekiq get any advantage on MRI... or do they not?
shinnya has quit [Ping timeout: 260 seconds]
ZeeNoodleyGamer has joined #ruby
atomi has quit [Quit: leaving]
bruno- has quit [Ping timeout: 260 seconds]
nateberkopec has quit [Quit: Leaving...]
<centrx>
SirFunk, Most apps are waiting on I/O such as the Database, Disk, or Network
sdothum has quit [Ping timeout: 244 seconds]
baweaver has joined #ruby
atomi has joined #ruby
malcolmva has joined #ruby
<SirFunk>
centrx: right. I'm just trying to better understand what Threading does or doesn't do in MRI
<centrx>
Yeah I don't that much about it. Try again later (or earlier)
<SirFunk>
hehe
dseitz has joined #ruby
nofxx has joined #ruby
mikeric has joined #ruby
baweaver has quit [Ping timeout: 246 seconds]
mikeric has quit [Max SendQ exceeded]
junegunn has joined #ruby
d1n has quit [Read error: Connection reset by peer]
mark-away is now known as markholmes
bungoman has quit [Remote host closed the connection]
TheHodge has quit [Quit: Connection closed for inactivity]
<eam>
SirFunk: with green threads, two threads can't do disk i/o at the same time
Rollabunna has joined #ruby
bungoman has joined #ruby
<eam>
a green thread system might multiplex socket i/o and make it concurrent, but disk interaction will suffer
havenwood has joined #ruby
Tamae has quit [Ping timeout: 244 seconds]
eggoez has quit [Ping timeout: 244 seconds]
<eam>
and with real threads you don't have to deal with the somewhat-broken edge cases in a multiplexed fake-thread engine, you can use a real thread and get precise interactions with your sockets
TheNet has joined #ruby
<eam>
eg a read() really is a read()
centrx has quit [Quit: Shutting down, Please wait...]
peeja has joined #ruby
choke has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
TheNet has quit [Client Quit]
leat3 has quit [Remote host closed the connection]
Igorshp has joined #ruby
leat3 has joined #ruby
davedev2_ has joined #ruby
choke has quit [Read error: Connection reset by peer]
symbol has quit [Ping timeout: 252 seconds]
choke has joined #ruby
haraoka has joined #ruby
hahuang65 has joined #ruby
dom__ has quit [Ping timeout: 240 seconds]
davedev24 has quit [Ping timeout: 248 seconds]
duderonomy has quit [Ping timeout: 248 seconds]
Igorshp has quit [Ping timeout: 256 seconds]
charliesome has joined #ruby
<dogcan>
In python there's pyflakes. What's a good lexical analyzer for ruby
<Ox0dea>
dogcan: Rubocop sees fairly widespread use.
<dogcan>
neat thanks
<Ox0dea>
It's not quite the same thing, of course, but analyzing Ruby is quite a tall task.
ramfjord has quit [Ping timeout: 252 seconds]
symbol has joined #ruby
<dogcan>
I bet
Azure has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
santana has joined #ruby
zrowe007 has quit [Ping timeout: 255 seconds]
tmtwd has joined #ruby
atomi has quit [Quit: leaving]
podman has quit [Quit: Connection closed for inactivity]
Pupeno_ has joined #ruby
Pupeno has quit [Read error: Connection reset by peer]
atomi has joined #ruby
Azure has joined #ruby
eggoez has joined #ruby
casadei_ has quit [Remote host closed the connection]
symbol has quit [Quit: WeeChat 1.1]
tmtwd_ has joined #ruby
allomov has joined #ruby
dseitz has joined #ruby
<tmtwd_>
yo
tmtwd_ has quit [Client Quit]
Channel6 has joined #ruby
braincrash has quit [Quit: bye bye]
dogcan has quit [Quit: Page closed]
allomov has quit [Ping timeout: 264 seconds]
desigx has joined #ruby
cpruitt has joined #ruby
shadoi has quit [Quit: Leaving.]
bronson has quit [Remote host closed the connection]
braincrash has joined #ruby
cpruitt has quit [Read error: Connection reset by peer]
barkerd427 is now known as zz_barkerd427
cpruitt has joined #ruby
devbug has quit [Ping timeout: 255 seconds]
m4rCsi has quit [Quit: No Ping reply in 180 seconds.]
m4rCsi has joined #ruby
j4cknewt has joined #ruby
fabrice31 has joined #ruby
haraoka has quit [Ping timeout: 256 seconds]
bungoman has quit [Remote host closed the connection]
willywos has joined #ruby
m4rCsi has quit [Excess Flood]
m4rCsi has joined #ruby
davedev2_ has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 244 seconds]
davedev24 has joined #ruby
zacstewart has quit [Remote host closed the connection]
davedev24 has quit [Client Quit]
desigx has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
leat3 has quit [Remote host closed the connection]
<flaf>
Ok, I see. At least, is it possible to ensure that the instance variable is unreachable outside of the object itself?
mary5030 has quit [Remote host closed the connection]
<Ox0dea>
flaf: No, never.
bungoman has joined #ruby
<sevenseacat>
nope.
<sevenseacat>
Ruby's awesome like that :)
<flaf>
Ok. Thx sevenseacat and Ox0dea for your (fast) help. ;)
<Ox0dea>
Sure thing.
<sevenseacat>
np
charliesome has quit [Quit: zzz]
bronson has joined #ruby
<Ox0dea>
flaf: Just as a bit of evidence for our claim, there is a secret class in Ruby called FrozenCore that has purposely been made very difficult to access, but ObjectSpace nevertheless lets us get to it if we really want to.
<sevenseacat>
oh yes I've seen some odd things be done with FrozenCore *looks in charliesome's direction*
<sevenseacat>
who isnt here anymore but anyway
zz_barkerd427 is now known as barkerd427
yfeldblu_ has quit [Read error: Connection reset by peer]
yfeldblum has joined #ruby
<flaf>
Ok, *on this point*, Ruby is like Python if I understand well.
<Ox0dea>
On which point?
<flaf>
The protection of a instance variable.
<Ox0dea>
Both languages give you a great deal of access to their internal mechanisms.
<sevenseacat>
no idea about Python.
bronson has quit [Ping timeout: 256 seconds]
<flaf>
Ah, sorry, just a last question: how can I get a class variable (@@var) via an instance?
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
finisherr has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
barkerd427 is now known as zz_barkerd427
brianpWins has joined #ruby
<zenspider>
who's the crystal (the language, you dorks) freak here?
konsolebox has joined #ruby
* apeiros
points fingers at jhass
<apeiros>
anybody is
tkuchiki has quit [Remote host closed the connection]
tkuchiki has joined #ruby
arooni-mobile has quit [Ping timeout: 248 seconds]
sindork has joined #ruby
Karpah has joined #ruby
casadei_ has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
yardenbar has quit [Quit: Leaving]
finisherr has quit [Quit: finisherr]
sevenseacat has quit [Ping timeout: 248 seconds]
Violentr has joined #ruby
redlegion has quit [Ping timeout: 246 seconds]
Karpah is now known as sevenseacat
arup_r has joined #ruby
Timba-as has joined #ruby
darkf has quit [Quit: Leaving]
redlegion has joined #ruby
darkf has joined #ruby
lele is now known as Guest24
joonty has joined #ruby
rfv_ is now known as rfv
<dubkoidragon>
herro
crwilcox has quit [Ping timeout: 246 seconds]
leat3 has quit [Ping timeout: 240 seconds]
st0mar has joined #ruby
tmtwd has quit [Remote host closed the connection]
bmurt has joined #ruby
Rollabunna has joined #ruby
rubie has joined #ruby
bmurt has quit [Client Quit]
<dubkoidragon>
hey, so I've just downlaoded the ruby installer, and so i still dont know how to run one of my block fo code
DoubleMalt has quit [Remote host closed the connection]
<dubkoidragon>
:/
tjbiddle has joined #ruby
Rollabunna has quit [Ping timeout: 248 seconds]
<sevenseacat>
did you run the ruby installer?
leat3 has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
casadei_ has joined #ruby
<dubkoidragon>
what do you mean
oo_ has quit [Remote host closed the connection]
<dubkoidragon>
theres nothing to run other than the uninstall exe
codecop has joined #ruby
<sevenseacat>
err
<sevenseacat>
you said you downloaded the installer, did you use it to install ruby?
casadei_ has quit [Remote host closed the connection]
<dubkoidragon>
like I installed yes, and saved my file to .rb, and went to the ruby 21 folder and wrote ruby x.rb
<dubkoidragon>
and it tells me it doesnt recognize ruby
Azure has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
leat3 has quit [Ping timeout: 248 seconds]
kham has joined #ruby
oo_ has joined #ruby
rdark has joined #ruby
rdark has quit [Client Quit]
krz has joined #ruby
rdark has joined #ruby
fgo_ has quit [Read error: Connection reset by peer]
guyz has quit [Ping timeout: 264 seconds]
fgo_ has joined #ruby
<dubkoidragon>
i have no idea why its not working
Violentr has quit [Ping timeout: 260 seconds]
<sevenseacat>
you likely didn't check the checkbox that said "add Ruby executables to your path" when you installed Ruby
moshee has joined #ruby
<sevenseacat>
try installing it again, and make sure to check that box? :)
markholmes has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<dubkoidragon>
ok ill try that but how do i start over now uninstall??
digifiv5e has joined #ruby
digifiv5e is now known as Guest66988
revath has joined #ruby
schaerli has quit [Remote host closed the connection]
<sevenseacat>
sure.
joonty has quit [Quit: joonty]
MoltenBosnia has quit [Read error: Connection reset by peer]
allomov has joined #ruby
bosma has joined #ruby
schaerli has joined #ruby
<dubkoidragon>
ok I fuigured it out after install, you also have to open cmd with ruby to use
<dubkoidragon>
like much harder than python
<dubkoidragon>
lol
<dubkoidragon>
yo I wanted to say thanks for the help man
<dubkoidragon>
I appriciate
<Ox0dea>
dubkoidragon: sevenseacat is a woman.
acke has joined #ruby
<flughafen>
morning
<dubkoidragon>
I didnt mean man as what it means lol, just slang
<[k->
flughafen!
<sevenseacat>
I'm not sure what 'you have to open cmd with ruby' means, but okay.
<sevenseacat>
glad I could help.
<dubkoidragon>
tyty
lessless has quit [Max SendQ exceeded]
<sevenseacat>
'I didnt mean man as what it means' :/
Rollabunna has joined #ruby
schaerli has quit [Ping timeout: 260 seconds]
kp666 has joined #ruby
roolo has quit [Remote host closed the connection]
<flughafen>
[k-: !
<[k->
me!
<flughafen>
flughafen: you!
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<[k->
:>
<dubkoidragon>
tyty
<dubkoidragon>
sry wrong window
<awk>
blah, i'm really struggling to find a way to use rsync (incremental) pulls from a remote ssh server and doing this the 'right' way in ruby.. i'm a ruby noob.. I wrote the script using scp, however I have a problem because scp doesn't have incremental options
<dubkoidragon>
if I may, could someone explain why sometimes I have to end my loops with $end instead of end. It seems to be when i run var.each loops and use {} instead of 'do'
<sevenseacat>
you never have to use $end.
<dubkoidragon>
I have to use it right now on this very small bit of code i have
<Ox0dea>
dubkoidragon: Please post it.
<dubkoidragon>
in fact if i dont use the $ it tells me too
GeissT has quit [Quit: Bye!]
<dubkoidragon>
odds = [1,3,5,7,9]
<dubkoidragon>
odds.each { |x|
<dubkoidragon>
puts x * 2 }
<dubkoidragon>
$end
<Ox0dea>
Remove the $end and see what happens.
<[k->
how do you implement a sort :(
<Ox0dea>
[k-: Quicksort is super-easy.
<dubkoidragon>
it tells me that i need to put an $end or it wont work in cmd
i-blis has joined #ruby
i-blis has joined #ruby
<dubkoidragon>
and when i do it owrks
revath has quit [Ping timeout: 246 seconds]
<[k->
but I have to pivot and my head goes spinning
<Ox0dea>
[k-: Any element can be the pivot.
<Ox0dea>
Median-of-three is statistically best, though.
<[k->
I wonder if a bubblesort is easy to implement
<sevenseacat>
dubkoidragon: thats not the whole code.
<sevenseacat>
please gist the whole code.
<dubkoidragon>
yea it is lol
<dubkoidragon>
its from a syntax tutorial im doing
<tejasmanohar>
how do i get sinatra to remove the default http headers
<dubkoidragon>
if i dont have the $ then itt ells me that it wont work til i do
<tejasmanohar>
like web server thin etc etc
<tejasmanohar>
i need to test something w/o them ;)
<[k->
you don't need the end!
<dubkoidragon>
o
<dubkoidragon>
oooo
<[k->
since you start the block with {
<dubkoidragon>
OHHH
<[k->
you end the block with }
<dubkoidragon>
I LOVE YOU
<dubkoidragon>
it was driving me mad
<[k->
:3
<sevenseacat>
err
<dubkoidragon>
pardon my excitment
eGGsha has joined #ruby
fabrice31 has joined #ruby
<dubkoidragon>
that was not explained to me at all
<sevenseacat>
what wasn't?
<dubkoidragon>
and i really prefer to use the {} over do
allomov has quit [Remote host closed the connection]
<sevenseacat>
that your code was fine and didn't need the end?
<dubkoidragon>
that the $ was like acomment
joonty has joined #ruby
<sevenseacat>
it's not
<dubkoidragon>
oh
<sevenseacat>
# is for comments
<dubkoidragon>
what is it
<dubkoidragon>
ok then what is it
<Ox0dea>
It's a global variable.
<tejasmanohar>
strange that i can't find something online for this, i'd guess it'd be something standard
leat3 has joined #ruby
<sevenseacat>
$end typically means end-of-file in error messages.
demoph01n has joined #ruby
<dubkoidragon>
oh ok
<sevenseacat>
you'll sometimes see unexpected $end, or expecting $end
demoph01n has quit [Remote host closed the connection]
<dubkoidragon>
i see
<[k->
keyword_end means Ruby expected "end"
<Ox0dea>
dubkoidragon: You can't combine {} with end; it's either {} or do/end. You were inadvertently fixing your syntax error by referring to (but not doing anything with) a global variable called $end.
<dubkoidragon>
sry for the newbie question, I'm from a python backround(not a pro yet at that either) and this is day 3 of ruby
TomyWork has joined #ruby
<dubkoidragon>
i see ox0dea, hownetly thats a grea explanation i get it now
<dubkoidragon>
honestly*
<dubkoidragon>
[k- : thanks for explanation on keyword_end
<[k->
let me draft out a plan for quicksort in this pseudo java like language
idiocrash has joined #ruby
bmurt has joined #ruby
allomov has joined #ruby
<[k->
I only have a few methods for manipulating lists :(
<Ox0dea>
[k-: Note well that Quicksort is technically supposed to be done in-place.
skade has quit [Quit: Computer has gone to sleep.]
<SebastianThorn>
Hi, I made a program that run manually from time to time, and I userd "$stderr.puts" for progress-info to the console and "puts" for the results, so I can run it like this: program.rb > results.txt good/bad?
leat3 has quit [Remote host closed the connection]
<[k->
but immutability makes it easier!
leat3 has joined #ruby
skade has joined #ruby
fabrice31 has quit [Read error: No route to host]
_ixti_ has joined #ruby
fabrice31 has joined #ruby
schaerli has joined #ruby
CloCkWeRX has quit [Quit: Leaving.]
ixti has quit [Ping timeout: 248 seconds]
haxrbyte has joined #ruby
<[k->
now I will need to be able to turn a recursive function into a loop!
<[k->
what fun!
pwnz0r has joined #ruby
dfockler has joined #ruby
<Ox0dea>
[k-: You can't recur?
<[k->
nope, I can't create functions
<[k->
(not yet)
bmurt has quit []
<Ox0dea>
Have you learned nothing from my executable madnesses?
<[k->
executable?
<Ox0dea>
They say Perl is "executable line noise".
<dubkoidragon>
would anyone know the diff between "#{x}\n" and "#{x}"
choke has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Ox0dea>
yorickpeterse: A queue is the opposite of a stack.
<ljarvis>
canton7: why? that's exactly what I would have expected
lkba has joined #ruby
<Ox0dea>
^
<canton7>
because Array#shift presumably requires a re-allocation?
htmldrum has joined #ruby
<ljarvis>
but yeah surprised the rdoc doesn't mention it
scripore has quit [Quit: This computer has gone to sleep]
schaerli has joined #ruby
<canton7>
most Queue implementations I've seen are based on a ring buffer, so you only have to re-allocate when the size changes, not on every single dequeue
<canton7>
(or use a linked list, for the same reason)
<Ox0dea>
canton7: Ruby is smart about it. It uses as much shared state as is feasible.
arup_r_ has quit [Ping timeout: 244 seconds]
<yorickpeterse>
Ox0dea: I'm aware of what a Queue is
<yorickpeterse>
But Ruby in the past has had more cases of "we say it's X but we do Y"
<Ox0dea>
A queue is a pretty fundamental data structure to get wrong.
<canton7>
Ox0dea, interesting. For example, if you push 100 elements onto an array, shift 50, then push another 50, how many allocations occur?
<Ox0dea>
canton7: I see a macro named ARY_SHARED_OCCUPIED(). :P
<yorickpeterse>
canton7: actually Array#shift is a pretty cheap operation in my experience
<yorickpeterse>
errrr wait
<yorickpeterse>
that was unshift
<yorickpeterse>
off by 2
<canton7>
:P
<canton7>
always get those 2 mixed up
ndrei has joined #ruby
ndrei_ has joined #ruby
<krz>
whats a good way to check if some elements in array 1 are not in array 2?
sp1rs has quit [Ping timeout: 256 seconds]
<yorickpeterse>
krz: is order important?
astrobun_ has quit [Remote host closed the connection]
senayar has quit [Remote host closed the connection]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
<Silex>
the ; one is a different char
ruurd has quit [Quit: ZZZzzz…]
<Silex>
and thus it's like a 1-char variable name
<[k->
yes!
tkuchiki_ has quit [Remote host closed the connection]
sdothum has joined #ruby
eGGsha is now known as eGGshke
xkef has quit [Ping timeout: 240 seconds]
<Silex>
I'm sure the LTR zero-width char trick can be used to drive dev crazy
<Silex>
e.g fill an online form with this char
<Silex>
then complain that you can't log in
Zai00 has quit [Quit: Zai00]
meatchicken has quit [Ping timeout: 240 seconds]
axl_ has quit [Ping timeout: 245 seconds]
meatchicken has joined #ruby
<[k->
logic tricks us :(
<[k->
Ox0dea went to sleep?
Musashi007 has quit [Quit: Musashi007]
<Ox0dea>
I'm here-ish.
<[k->
but its like 20hrs already!
cochise has quit [Remote host closed the connection]
<Ox0dea>
Onoes!
MagePsycho has joined #ruby
<adaedra>
Oh noses!
dhjondoh has quit [Quit: dhjondoh]
quimrstorres has joined #ruby
desigx has quit [Ping timeout: 264 seconds]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
i-blis has quit [Quit: Leaving.]
troulouliou_dev has quit [Quit: Leaving]
edwinvdgraaf has joined #ruby
zz_barkerd427 is now known as barkerd427_
<shevy>
Oh feet!
Limezacore has joined #ruby
<[k->
shevy: no
barkerd427_ is now known as zz_barkerd427
DaniG2k has joined #ruby
<DaniG2k>
hey gusy
aspiers has quit [Ping timeout: 246 seconds]
<[k->
o o o
<[k->
my turn!
<[k->
?guys
<ruboto>
we're not all guys - while you probably don't meant to be exclusive, not everybody feels that way. Maybe consider using "folks", "y'all" or "everyone" instead?
arturaz has quit [Remote host closed the connection]
arup_r has quit [Remote host closed the connection]
<DaniG2k>
what does sexism have to do with it
<sevenseacat>
'perhaps you want to include everyone?' 'nah, thats dumb'
<DaniG2k>
i cant make everyone in the world happy
<sevenseacat>
feel free to ask the guys for help then, and I hope one of them can help you.
<DaniG2k>
ok :)
<sevenseacat>
as for me, I will sit here and call *you* dumb.
<sevenseacat>
and laugh at your misfortune.
<DaniG2k>
you're a troll
<DaniG2k>
must be
<sevenseacat>
you're dumb/
<rdark>
anyone used datamapper with postgres running under SSL?
DaniG2k has left #ruby [#ruby]
jds has joined #ruby
<sevenseacat>
all the months I've spent helping you in these channels and you want to bite the hand that feeds you
nateberkopec has joined #ruby
chussenot has quit [Quit: chussenot]
<sevenseacat>
thats what I call dumb.
<[k->
:(
eGGshke is now known as eGGsha
<[k->
I am totally upset
<apeiros>
oh, they're gone
<apeiros>
too sad
<Ox0dea>
> gusy
<Ox0dea>
Does that mean "of or exhibiting the characteristics of a goose"?
<[k->
my brain has autocorrect module installed
<[k->
don't worry
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<rdark>
I'm using a connection with ?sslmode=verify-full. I don't have the CA cert installed for the database, but it connects fine anyway?
r_rails has quit [Quit: Page closed]
oo_ has quit [Remote host closed the connection]
<sevenseacat>
sorry bout that.
arup_r has joined #ruby
<sevenseacat>
but ffs its just asking for some consideration
yardenbar has quit [Ping timeout: 244 seconds]
<adaedra>
it's ok sevenseacat
Iskarlar has joined #ruby
hoov has joined #ruby
<shevy>
he wrote "gusy"!
<Ox0dea>
What's bad for the gusy is bad for the gander.
<mikecmpbll>
tbf i use guys all the time to refer to mixed sex groups or wholly female groups.
<shevy>
lol
<shevy>
ruboto is a gender-aware bot
emilkarl has joined #ruby
<shevy>
what gender is ruboto?
<apeiros>
metal
<adaedra>
mikecmpbll: yeah, other people do, but it's not because of that that it's right. There are so many other options available that are not ambigous
<apeiros>
?guys2 mikecmpbll
<ruboto>
mikecmpbll, it doesn’t matter if it’s “normal”/gender neutral to say "guys" in your idiolect. “you guys” to refer to a mixed group is erasure. all we ask from you is to be a decent channel member and respect that. If you want to further discuss this, join #ruby-offtopic.
<ruboto>
ruboto, I don't know anything about guys3
eGGsha has joined #ruby
<shevy>
just curious about the numbering scheme used there ... :>
oo_ has joined #ruby
<sevenseacat>
people just need to realize that 'my interpretation of a word' != 'everyones interpretation of a word'
<[k->
I thought there was only 1 dea :c
<sevenseacat>
and then we'll be all good.
nateberkopec has quit [Quit: Leaving...]
<shevy>
[k- well, the dea here is the Ox, the dead there is the 0x
<shevy>
erm, *dea
allcentury has quit [Ping timeout: 256 seconds]
<shevy>
IRC nicks should be simple!
<[k->
0xabad1dea
<shevy>
Ox0dea
<gregf_>
funny but sad, how some people get offended at anything :/. true programmers 'should' get mad at bad code. but.. ego's can decimate
<shevy>
I get mad at my own bugs
<gregf_>
'guys' can be used as a superset afaik :/.. but
oo_ has quit [Remote host closed the connection]
<sevenseacat>
gregf_: yes, to *you*. not to everyone.
<Ox0dea>
gregf_: Can "gals" be used as a superset?
pwnz0r has joined #ruby
<sevenseacat>
if you're a man, of course that makes perfect sense to you.
marr has quit []
<gregf_>
sevenseacat: if you could just keep it to programming.. i dont honestly care why someone could get offended for something i did not mean to. theres better ways to respond?
<Ox0dea>
gregf_: Go on, answer my question.
<shevy>
hey girls!
<[k->
I started this :(
<shevy>
yes!
yardenbar has joined #ruby
<sevenseacat>
[k-: no, the people that wont admit that anyone else's opinions or feelings matter, started this.
<sevenseacat>
[k-: not you.
<shevy>
it will get better - tomorrow is caturday again
<sevenseacat>
\o/
<sevenseacat>
and I have a week off work. rejoice!
Hobogrammer has joined #ruby
desigx has joined #ruby
Silent__ has quit [Ping timeout: 250 seconds]
pwnz0r has quit [Ping timeout: 248 seconds]
yfeldblu_ has quit [Ping timeout: 248 seconds]
sinkensabe has joined #ruby
oo_ has joined #ruby
cochise has joined #ruby
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<apeiros>
sevenseacat: enjoy! :D
<sevenseacat>
oh i plan to
zacstewart has joined #ruby
<[k->
Ox0dea are you having a 24h marathon? :o
jimeh has quit [Max SendQ exceeded]
diegoviola has joined #ruby
<Ox0dea>
[k-: Kinda just happens now and again.
st0mar has quit [Ping timeout: 246 seconds]
Iskarlar has joined #ruby
jimeh has joined #ruby
cochise has quit [Ping timeout: 240 seconds]
ldnunes has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
qiukun has joined #ruby
Musashi007 has joined #ruby
koos303 has joined #ruby
<bnagy>
did I just see a 0xabad1dea quote in the bot o_0
<apeiros>
yes
<bnagy>
:D
<apeiros>
she phrased that excellently IMO
_solomon has joined #ruby
schaerli has joined #ruby
dgutierrez1287 has joined #ruby
desigx has quit [Ping timeout: 240 seconds]
Rollabunna has quit [Ping timeout: 248 seconds]
saadq has joined #ruby
saadq has quit [Remote host closed the connection]
xcesariox has quit [Ping timeout: 260 seconds]
oo_ has quit [Remote host closed the connection]
jimeh has quit [Max SendQ exceeded]
Narzew has joined #ruby
jimeh has joined #ruby
nveselinov has joined #ruby
Narzew has quit [Client Quit]
pawz has joined #ruby
st0mar has joined #ruby
ttilley has quit [Changing host]
ttilley has joined #ruby
schaerli has quit [Remote host closed the connection]
rdark_ has joined #ruby
xkef has joined #ruby
kp666 has quit [Quit: Leaving]
rdark has quit [Ping timeout: 265 seconds]
OrbitalKitten has joined #ruby
heftig_ is now known as heftig
mikecmpbll has quit [Quit: ciao.]
DoubleMalt has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
schaerli has joined #ruby
intinig has joined #ruby
Pisuke has quit [Quit: WeeChat 1.2-dev]
jaequery has joined #ruby
DEA7TH_ has joined #ruby
<DEA7TH_>
If I declare a variable before Thread.new { }, is it ok to treat the variable as shared between the thread and the ongoing process?
Musashi007 has quit [Quit: Musashi007]
eGGsha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
s00pcan has joined #ruby
<DEA7TH_>
I write to the variable in order to pass information to the Thread.new
<Ox0dea>
DEA7TH_: Better to use Thread#[].
<Ox0dea>
>> t = Thread.new{}; t[:foo] = :bar; t[:foo]
<Ox0dea>
DEA7TH_: Yes, it'll do that, but Line 7 could still potentially block forever.
fantazo has quit [Quit: Verlassend]
<DEA7TH_>
Ox0dea: you mean it could, unless the thread was there?
<Ox0dea>
No, even with the Thread.
joonty has quit [Quit: joonty]
<DEA7TH_>
how come?
<Ox0dea>
Because it's a blocking operation?
jaequery has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
<DEA7TH_>
so it would stop the thread from executing?
sp1rs has joined #ruby
symm- has joined #ruby
<DEA7TH_>
it's supposed to block, just not forever
<Ox0dea>
Ah, sorry, I'm derping. I realize now that you're writing and reading the same FIFO.
<DEA7TH_>
whew. xD
ruurd has quit [Ping timeout: 240 seconds]
<jhass>
DEA7TH_: the proper variant would be to use a ConditionVariable and a flag, .wait(timeout) on it and check via the flag if you came back early or ran into the timeout
<DEA7TH_>
nice, I'll do that
<jhass>
and forget Thread#kill is a thing
ruurd has joined #ruby
<DEA7TH_>
ConditionVariable is in Ruby 2.0 documents but not in Ruby 2.2.2?
<DEA7TH_>
I suspect the code in Thread.new is wrong
rdark_ has quit [Ping timeout: 246 seconds]
cochise has joined #ruby
qiukun has quit [Quit: qiukun]
yqt has joined #ruby
Musashi007 has joined #ruby
lsmola has quit [Ping timeout: 252 seconds]
symm- has quit [Ping timeout: 252 seconds]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lsmola has joined #ruby
<[k->
Ox0dea does your brain perform consistently over the 24hrs?
<[k->
mine stops working after a few hours
gamename has joined #ruby
ndrei_ has quit [Ping timeout: 246 seconds]
<Ox0dea>
[k-: I tend to derp more often down the stretch, but I usually only get going if I'm intensely focused on something, so somewhere in the middle.
ndrei has quit [Ping timeout: 256 seconds]
<jhass>
DEA7TH_: not quite, you're missing the flag to signalize whether .wait returned from the timeout or from the wakeup, I'd wrap the whole thing up in a class
<[k->
that means I'm the only one :(
fabrice31 has quit [Remote host closed the connection]
<[k->
honestly my brain hurts after a while
fabrice31 has joined #ruby
Iskarlar has joined #ruby
<Ox0dea>
[k-: Do you keep sufficiently hydrated?
<[k->
well....
<[k->
no
galeido has quit [Read error: Connection reset by peer]
[k-_ has joined #ruby
nateberkopec has joined #ruby
<[k->
I'll get some water
<adaedra>
Ox0dea: thanks for reminding me this
joonty has joined #ruby
felixr has quit [Quit: Konversation terminated!]
quimrstorres has quit [Remote host closed the connection]
krz has quit [Read error: Connection reset by peer]
fabrice31_ has joined #ruby
<mikecmpbll>
i moved desks closer to the water cooler recently and have consequently been drinking more .. fewer headaches
kham1 has joined #ruby
Iskarlar has quit [Client Quit]
<DEA7TH_>
jhass: where can I put that flag? I don't see any properties on SharedVariable or Mutex
jack_rabbit has quit [Ping timeout: 256 seconds]
<DEA7TH_>
ConditionVariable*
kham has quit [Ping timeout: 240 seconds]
felixr has joined #ruby
<jhass>
just closure over it or as said use a class
<adaedra>
It's funny, because in french, "hs" is abbreviation of "hors sujet" = "off-topic", like this code :>
<[k-_>
i am amazed by their prowess
fabrice31 has quit [Remote host closed the connection]
fabrice31 has joined #ruby
<[k-_>
Ox0dea and shevy should be there
<shevy>
I thought the french do not use "h"
<shevy>
just as in baguette - it's completely "h" free
<[k-_>
i never thought there was a solution more ugly than mine
<[k-_>
but there is ¯\_(ツ)_/¯
<shevy>
me neither
rideh has quit [Quit: zap]
mary5030 has joined #ruby
linuxboytoo has joined #ruby
<[k-_>
you!
intinig has quit [Ping timeout: 264 seconds]
<adaedra>
shevy: we do use it
<adaedra>
it's a 4 at scrabble, iirc
mike___1234 has quit [Ping timeout: 246 seconds]
<stbenjam>
Anyone ever seen something like this with 1.8.7? https://gist.github.com/stbenjam/cb31ea06ab82430f79e8 -> Ruby is looking for a file named 'service-wait qpidd status' in /usr/sbin... Qutoing the arguments makes it execute correctly, however on later rubies the first one works and the second one doesn't
<shevy>
is there (a) a symlink, does (b) File.exist? "/usr/sbin/service-wait" return true?
riotjones has quit [Ping timeout: 256 seconds]
<JimmytheHat>
How do I run a proc? I'm making a custom matcher in RSpec: | expect{ 42 }.to be_the_answer | however, when I print 'expected' in the matches? method I get <#:Proc...> How do I 'run' the proc so it changes to 42 ? Also I want my matcher to take a block, this is just the first step in learning :)
<stbenjam>
shevy: not a symlink, File.exist? returns true
<adaedra>
JimmytheHat: Proc#call?
d10n-work has joined #ruby
<[k-_>
Proc#[] too
<[k-_>
and proc.()
<shevy>
stbenjam and you can invoke it from the commandline directly?
<shevy>
because if you can, I don't think I have ever seen a difference between `` and direct invocations
<JimmytheHat>
adaedra thanks. just realized your name is an elder scrolls reference too :P
rideh has joined #ruby
<[k-_>
in irb, when i did `clear`, it didnt work
<[k-_>
when i did system "clear", it did
<[k-_>
:o
felixr has quit [Quit: Konversation terminated!]
<[k-_>
`clear` gave me => "\e[H\e[2J"
<stbenjam>
shevy: sure can, works just fine. it's like ruby is treating the spaces as part of the command name, i've never seen anything like it, but very reproduceable even on a clean centos 6.6 install :-(
schaerli has quit [Remote host closed the connection]
DEA7TH_ has quit [Quit: DEA7TH_]
AviShastry has joined #ruby
mary5030 has quit [Remote host closed the connection]
<shevy>
yeah I have not seen such behaviour either, neither on 1.8.x
mary5030 has joined #ruby
jhn has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
sofija has quit [Remote host closed the connection]
<stbenjam>
yea, i know i've done similar before and it worked fine. maybe something with the latest centos' ruby
intinig has joined #ruby
arup_r has quit []
devdazed has joined #ruby
Igorshp has quit [Remote host closed the connection]
bungoman has quit [Remote host closed the connection]
jbw has quit [Ping timeout: 265 seconds]
<shevy>
would be curious if they modified and broke ruby :)
rideh has quit [Quit: zap]
chouhoulis has joined #ruby
Papierkorb has quit [Quit: ArchLinux completes an endless loop faster than any other distro!]
matcouto has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tkuchiki has quit [Remote host closed the connection]
choppington has joined #ruby
ruurd has quit [Ping timeout: 256 seconds]
linuxboytoo has quit [Remote host closed the connection]
schaerli has joined #ruby
jbw has joined #ruby
t0rrieri has joined #ruby
dimasg has quit [Ping timeout: 248 seconds]
ruurd has joined #ruby
dgutierrez1287 has quit [Remote host closed the connection]
rbennacer has joined #ruby
t0rrieri has quit [Client Quit]
rbennacer has quit [Remote host closed the connection]
shinnya has joined #ruby
acke has quit [Remote host closed the connection]
tagrudev has quit [Remote host closed the connection]
ndrei_ has quit [Ping timeout: 244 seconds]
ndrei has quit [Ping timeout: 246 seconds]
bungoman has joined #ruby
mike___1234 has joined #ruby
zacstewart has joined #ruby
tkuchiki has joined #ruby
zz_Outlastsheep is now known as Outlastsheep
AviShastry has quit [Ping timeout: 246 seconds]
DEA7TH_ has joined #ruby
dopie has joined #ruby
<izzol>
hello
rbennacer has joined #ruby
<[k-_>
hello
<adaedra>
olleh
ruurd has quit [Ping timeout: 240 seconds]
<[k-_>
Ox0dea: are you asleep yet? it's 24hrs!
tkuchiki has quit [Ping timeout: 244 seconds]
<izzol>
I need to do something with the file. But I don't want to save it on disk. I found the gem called mmap, which I can use for write the file to the memory.
<apeiros>
"the file"?
chouhoulis has quit [Remote host closed the connection]
<apeiros>
mmap means you have a file saved on disk. so if you don't want to save a file on disk, mmap is not for you.
<izzol>
ahh hmm
<jhass>
"do something"?
rideh has joined #ruby
stantonnet has quit [Ping timeout: 255 seconds]
chouhoulis has joined #ruby
Igorshp has joined #ruby
<[k-_>
there is Tempfile otherwise for temporary files
<adaedra>
technically, you can mmap without files, it's what malloc does nowadays.
sshuff has joined #ruby
<apeiros>
jhass: do something with the thing, but don't do that other thing, so just use that thing which does it
<apeiros>
adaedra: for real?
<adaedra>
apeiros: yes
<izzol>
basically I'm reading mails from the STDIN but if the mail has an attachment I want to do few checks on it. Right now I'm saving each file to the disk. But this is slow :(
<[k-_>
brilliant explanation apeiros
<apeiros>
interesting
<jhass>
"a few checks"?
tvw has joined #ruby
<DefV>
izzol: Won't it take StringIO?
<izzol>
jhass: like a type of the file, checking headers, size, name and so on
devdazed has quit [Read error: Connection reset by peer]
gamename has joined #ruby
<jhass>
sounds like mime metadata
Zamyatin has joined #ruby
<izzol>
jhass: yes
<DefV>
and otherwise, mount a directory in your working dir with tmpfs
DoubleMalt has quit [Ping timeout: 240 seconds]
<DefV>
and you have yourself a part of mem to read/write to
<jhass>
so why would you need to save the contents of the file to disk anyway
devdazed has joined #ruby
<izzol>
jhass: right now I'm checking the type of the file by: file -bi {file}
<jhass>
why not read the mime metadata?
<stbenjam>
shevy: in case you were curious, the problem was this service-wait script was lacking the shebang. who writes a script without that? *sigh*
<apeiros>
izzol: ruby-filemagic gem
<apeiros>
should be able to do that in-memory
<izzol>
jhass: I don't know :-) I will try to do this :)
<apeiros>
(name might slightly differ)
<DefV>
izzol: you can use libmagic (which is what file uses)
<DefV>
ah, what apeiros said
<jhass>
yeah, search for a libmagic binding
prefixed has quit [Changing host]
prefixed has joined #ruby
aganov has quit [Remote host closed the connection]
<shevy>
stbenjam interesting
[H]unt3r has joined #ruby
<izzol>
ok thanks :-) Yes, I guess this is something for me.
barkerd427_ is now known as zz_barkerd427
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jds has quit [Quit: Connection closed for inactivity]
<jhass>
well and again, only if you don't trust the mime headers
kobain has quit [Read error: Connection reset by peer]
Igorshp has quit [Remote host closed the connection]
ZeeNoodleyGamer has quit [Ping timeout: 248 seconds]
nveselinov has quit [Quit: Connection closed for inactivity]
Iskarlar has joined #ruby
<apeiros>
note that filemagic can get it wrong…
Igorshp has joined #ruby
bahar has quit [Ping timeout: 265 seconds]
<adaedra>
so many file formats based on zip.
stantonnet has joined #ruby
bahar has joined #ruby
linuxboytoo has joined #ruby
fabrice31 has quit [Read error: Connection reset by peer]
intinig has quit [Remote host closed the connection]
rubie has joined #ruby
fabrice31 has joined #ruby
werelivinginthef has joined #ruby
penzur has joined #ruby
freerobby has joined #ruby
Igorshp has quit [Ping timeout: 240 seconds]
iateadonut has quit [Quit: Leaving.]
<dudedudeman>
sort of ruby question... how many of you guys are dev ops engineers, and use ruby rather often?
Hounddog has quit [Remote host closed the connection]
momomomomo has joined #ruby
dANO_ has quit []
freerobby has quit [Client Quit]
intinig has joined #ruby
rubie has quit [Ping timeout: 265 seconds]
juanpaucar has joined #ruby
mandarinkin has quit [Quit: Leaving]
bmurt has joined #ruby
penzur has quit [Client Quit]
schaerli has quit [Remote host closed the connection]
penzur has joined #ruby
dgutierrez1287 has joined #ruby
bmurt has quit [Max SendQ exceeded]
penzur has quit [Client Quit]
bungoman_ has joined #ruby
penzur has joined #ruby
DaniG2k has joined #ruby
bmurt has joined #ruby
<izzol>
dudedudeman: there is nothing such as DevOps Engineers :P
<dudedudeman>
sys admins!
<adaedra>
woh woh
DaniG2k has quit [Client Quit]
<dudedudeman>
words!
<adaedra>
use correct terminology and don't mix work classes.
<dudedudeman>
wait. how many of you folks* sorry*
<dudedudeman>
:(
<adaedra>
heh
downwithbender has joined #ruby
sp1rs has quit [Ping timeout: 264 seconds]
<dudedudeman>
we said i'd do it, didn't we. lol.
<dudedudeman>
but i am curious.
shelby has joined #ruby
kies^ has joined #ruby
kobain has joined #ruby
Igorshp has joined #ruby
bungoman has quit [Ping timeout: 264 seconds]
alexclark has joined #ruby
<alexclark>
does anyone know what the `!~` operator does?
downwithbender has quit [Client Quit]
kfpratt has joined #ruby
dimasg has joined #ruby
hoov has quit [Ping timeout: 256 seconds]
<Silex>
logical not - bitwise not ?
DoubleMalt has joined #ruby
<Silex>
e.g !~x is x = ~x; x = !x;
<alexclark>
Silex: oi...
sshuff has quit [Quit: Leaving]
<Silex>
forget the assignments
<alexclark>
what does the tilde do?
<Silex>
bitwise not
<alexclark>
ok thanks
<ljarvis>
you know that could be a regexp operator
intinig has quit [Remote host closed the connection]
<JimmytheHat>
wait...rspec itself has test coverage provided by..rspec
<ljarvis>
correct
<[k->
well it uses a previous version, no?
DoubleMalt has quit [Remote host closed the connection]
<f4cl3y>
Hi guys,
<JimmytheHat>
[k- ah that makes more sense..it's still a pretty weird concept
sepp2k has joined #ruby
<ljarvis>
eh, it shouldn't
<ljarvis>
that actually makes less sense to me
<[k->
why would you use the current version to test the current version
<f4cl3y>
what's the correct way to you nested tags inside erb templats?
sshuff has joined #ruby
<alimiracle>
dudedudeman: whi?
<ljarvis>
[k-: because you can?
<Silex>
JimmytheHat: gcc is typically compiled with gcc too :)
<[k->
if there is a bug in the current version, how would you know
<[k->
haskell is coded in Haskell too
<ljarvis>
[k-: how would you know if you used the previous one, or what if there's a bug in that too?
<alimiracle>
dudedudeman: I love ruby
<JimmytheHat>
ljarvis What if you were testing 'describe' and 'describe' had an error? x'D
gigetoo has quit [Ping timeout: 255 seconds]
<f4cl3y>
e.g. <%= somthig_function(<%= another_function %>)%>
<ljarvis>
JimmytheHat: then you add a test for it and fix it
<JimmytheHat>
describe 'describe' do ... it's mad
<[k->
ljarvis: you cry then
<dudedudeman>
alimiracle: we love ruby, too.
sofija has joined #ruby
<JimmytheHat>
Silex : haha crazy :P
<ljarvis>
f4cl3y: <%= .... #{...} %> -- remember, what's inside is just ruby
<alimiracle>
dudedudeman: I use ruby and python and c/c++
<flaf>
Hi, if I want to define a class variable @@var, where should I define this variable? Is it possible to define just after `class Foo` (and before `def initialize`)? Should I define the variable in the body of the initialize method?
<f4cl3y>
ljarvis: Thanks!
<[k->
after class foo
<ljarvis>
flaf: you'll want to define it at the top level and then mutate it (if you want) inside your initialize
umgrosscol has joined #ruby
<Silex>
flaf: shouldn't we avoid @@ class variables when possible?
<ljarvis>
otherwise it's never defined until you instantiate an instance
ndrei has joined #ruby
ndrei_ has joined #ruby
<flaf>
ljarvis: ah ok, thx.
davejlong has quit [Remote host closed the connection]
<Silex>
I mean, instead of using @@ class variable we'd use cattr_accessor etc
davejlong has joined #ruby
<Silex>
err, not cattr_accessor... but something! :)
<ljarvis>
that's an AS/Rails thing. You'd usually prefer to use class instance variables though, yes
<flaf>
Silex: I don't know. Is it bad to have a class variables? If it's variable shared by all the instances, it's a good thing, no?
<ljarvis>
flaf: it's fine for basic stuff, but they have their pitfalls
bungoman has joined #ruby
<Silex>
flaf: see what ljarvis said, use class instance variables instead
niemcu has quit [Quit: Leaving]
<shevy>
flaf it's a question whether you need them
sevenseacat has quit [Quit: Me dun like you no more.]
<[k->
it is 90% alphanum :(
chouhoulis has quit [Ping timeout: 264 seconds]
<alimiracle>
sherybe is so nise
sinkensabe has quit [Remote host closed the connection]
<[k->
you discourage me to use Ruby
MagePsycho has quit [Quit: MagePsycho]
<[k->
off to Haskell land I go
acke has joined #ruby
Zamyatin has quit [Ping timeout: 265 seconds]
_ixti_ has quit [Ping timeout: 248 seconds]
sharpmachine has joined #ruby
last_staff has quit [Quit: last_staff]
Outlastsheep is now known as zz_Outlastsheep
fabrice31_ has joined #ruby
fabrice31_ has quit [Remote host closed the connection]
kfpratt has quit [Remote host closed the connection]
_ixti_ has joined #ruby
penzur has quit [Quit: Leaving]
yardenbar has quit [Quit: Leaving]
blueOxigen has joined #ruby
umgrosscol has quit [Ping timeout: 248 seconds]
fabrice31 has quit [Ping timeout: 244 seconds]
paulcsmith has quit [Quit: Be back later ...]
tvw has quit [Remote host closed the connection]
bluOxigen has quit [Ping timeout: 244 seconds]
acke_ has joined #ruby
<shevy>
[k- come on man, write awesome projects that are useful!
<[k->
> assuming that I even have an idea
paulcsmith has joined #ruby
<[k->
> assuming I adopt good practices
acke has quit [Read error: Connection reset by peer]
<[k->
> assuming I can remain dedicated to fix bugs
<flaf>
ljarvis: if I want to use a "class instance variable" in a method of my class, the right way to do that is self.class.instance_variable_get(:@var), correct? Is there more simple?
AviShastry has joined #ruby
<shevy>
[k- well maintenance work is much easier than creation work
<[k->
lies
<[k->
flaf @var will do just fine
<gregf_>
[k-: odd question: whats the learning curve for haskell like?
<[k->
very high
<gregf_>
[k-: if you can write haskell i would image any other non-fp language to be quite easy :/
<flaf>
[k-: I don't think so. @var is for a instance variable, here it's for a instance variable _of the class_.
<gregf_>
well, its prolly high if you're in uni :/
mleung has joined #ruby
kfpratt has joined #ruby
bffff_ has joined #ruby
<ljarvis>
flaf: you need to use attr_reader just like normal instance variables
<ljarvis>
flaf: it opens the metaclass of the class. It's covered in that article I linked you. For some background, classes inherit from Class which is a Ruby class itself
bungoman has quit [Remote host closed the connection]
<dfockler>
adaedra: although if you don't know when to use it, you probably shouldn't use it
<adaedra>
right
bungoman has joined #ruby
<flaf>
If we want to have a variable shared by all the instances (with the same value), it could be useful, no?
r0nin_ has joined #ruby
<[k->
when would that happen
<gregf_>
flaf: thats what a class variable is for
bruno- has joined #ruby
Igorshp has joined #ruby
r0nin has quit [Ping timeout: 244 seconds]
saadq has joined #ruby
<dfockler>
I feel like you can just set a default instance variable
<gregf_>
flaf: class Foo; @@bar=10; def get_bar;@@bar;end;end;3.times { print Foo.new.get_bar } <== like that?
danzilio has joined #ruby
alimiracle has quit [Read error: Connection reset by peer]
Rollabunna has joined #ruby
<[k->
just get a constant in that case ._.
choppington has quit [Ping timeout: 244 seconds]
<adaedra>
what if you want it to be mutable?
<flaf>
gregf_: yes but, if I have well understood, it's not a good practice to use @@bar.
<[k->
or initialise @bar = 3
bubbys has joined #ruby
<adaedra>
what if you want it to be shared?
<[k->
$bar
<ljarvis>
gtfo
* adaedra
slaps [k-
<[k->
:>
<[k->
ObjectSpace
<adaedra>
class variables are a way to have shared, mutable data common to all instances of a class.
<adaedra>
you can think of it to be kind of scoped globals.
<adaedra>
I guess.
schaerli has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
freerobby has joined #ruby
linuxboytoo has joined #ruby
dgbaley has joined #ruby
arup_r has joined #ruby
aphprentice has quit [Read error: Connection timed out]
<dgbaley>
Hey, is this a good place to ask about erb? I have a template with lines like """<%- if @device %>DEVICE=$device<% end %>""" but the problem is it leaves a blank line when the conditional is false. If I change to <% end -%> then it doesn't add a newline. Is there a shortcut or some syntax to do a one-liner conditional like this?
<dgbaley>
Somewhat related: is -%> basically useless if there's non-whitespace that follows on the line?
Channel6 has joined #ruby
<arup_r>
I don't even understand what the error is saying.. :/
<dgbaley>
Seems like the simplest thing for me then, is to use <% end -%> and add a \n inside the conditional
choppington has joined #ruby
benlovell has joined #ruby
<flaf>
-%> remove withespace and the newline character (\n)
zacstewa_ has quit [Read error: Connection reset by peer]
saadq has quit [Remote host closed the connection]
bronson has quit [Remote host closed the connection]
sarkyniin has joined #ruby
zacstewart has joined #ruby
intinig has quit [Remote host closed the connection]
koos303 has quit [Quit: Connection closed for inactivity]
<ljarvis>
arup_r: Data is an existing Ruby class (one that cannot be allocated) for some reason it thinks you're referencing this class, which is also why you're getting a warning about it
<ljarvis>
arup_r: basically, I would not use a class named Data, not just because of this clash but also because data is the worst possible name for anything in code
r0nin has joined #ruby
joelataylor has joined #ruby
allomov has quit [Ping timeout: 244 seconds]
r0nin has quit [Remote host closed the connection]
r0nin has joined #ruby
bungoman has quit [Remote host closed the connection]
r0nin_ has quit [Ping timeout: 244 seconds]
RobertBirnie has joined #ruby
linuxboytoo has joined #ruby
<arup_r>
Humm But it clashed while I have namespaced it
<flaf>
dgbaley: if you want a one-line instruction, you can do this:
<flaf>
<%- if @device -%>DEVICE=$device<%= "\n" %><%- end -%>
<arup_r>
ljarvis, Actually I have one class making the URL and other part is making data to POST to the url..
<flaf>
dgbaley: (it works for me)
<arup_r>
now it seems I need to change the class name to `Body`
<[k->
curse you and one liners!
<ljarvis>
arup_r: or query
<dgbaley>
flaf: yeah, that's what I said I did, except I don't need <%= "\n" %> for the newline because in my context, \n is interpreted already.
schaerli has quit [Remote host closed the connection]
<arup_r>
ljarvis, hum,,. But is it a bug ..?
<dgbaley>
flaf: so I have lots of these: <%- if @device %>DEVICE=$device\n<% end -%>
Ilyas has joined #ruby
loc22 has joined #ruby
<arup_r>
Should I make it small class and reproduce to submit..? what you say..?
quimrstorres has quit [Remote host closed the connection]
r0nin_ has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
blkperl_ is now known as blkperl
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
<arup_r>
ljarvis, but you didn't get the error? Strange!
rideh has quit [Quit: zap]
Hounddog has quit [Remote host closed the connection]
jonee has joined #ruby
<ljarvis>
arup_r: I can't see the rest of your code so I don't know what the problem is, but I would rename the class regardless which will fix the problem anyway
Hounddog has joined #ruby
<arup_r>
ok
<arup_r>
renaming
zacstewart has quit [Read error: Connection reset by peer]
rideh has joined #ruby
MrJiks has joined #ruby
r0nin has quit [Ping timeout: 255 seconds]
zacstewart has joined #ruby
amclain has joined #ruby
blaines has quit [Ping timeout: 246 seconds]
mikecmpb_ has quit [Ping timeout: 244 seconds]
allomov has joined #ruby
MrJiks has quit [Read error: Connection reset by peer]
MrJiks_ has quit [Ping timeout: 255 seconds]
quimrstorres has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
ank has joined #ruby
aryaching has quit [Ping timeout: 246 seconds]
edwinvdgraaf has joined #ruby
towski_ has joined #ruby
momomomomo has joined #ruby
desigx has quit [Ping timeout: 264 seconds]
MrJiks has joined #ruby
gizmore has joined #ruby
edwinvdg_ has joined #ruby
abuzze has joined #ruby
abuzze has quit [Remote host closed the connection]
abuzze has joined #ruby
rdark has quit [Quit: leaving]
IceDragon is now known as SomeOtherGuy
zacstewart has quit [Ping timeout: 256 seconds]
SomeOtherGuy is now known as IceDragon
DEA7TH_ has quit [Quit: DEA7TH_]
edwinvdg_ has quit [Remote host closed the connection]
edwinvdgraaf has quit [Read error: Connection reset by peer]
edwinvdgraaf has joined #ruby
blaines has joined #ruby
lostcuaz has quit [Read error: Connection reset by peer]
r0nin has joined #ruby
zacstewart has joined #ruby
aryaching has joined #ruby
linuxboytoo has quit [Remote host closed the connection]
mleung has joined #ruby
linuxboytoo has joined #ruby
maletor has quit [Quit: Computer has gone to sleep.]
<nateberkopec>
How do I make a ruby process make the current thread wait, but still block other threads from executing? From what I can tell, sleep will cause the current thread to sleep, but other threads will still be able to execute. I want to stop all execution for a period of time.
linuxboytoo has quit [Write error: Connection reset by peer]
jeremati_ has joined #ruby
linuxboytoo has joined #ruby
r0nin_ has quit [Ping timeout: 246 seconds]
zz_barkerd427 is now known as barkerd427
hj2007 has quit [Quit: This computer has gone to sleep]
dumdedum has quit [Quit: foo]
joonty has quit [Quit: joonty]
jerematic has quit [Ping timeout: 255 seconds]
dfinninger has quit [Remote host closed the connection]
galeido has joined #ruby
dfinninger has joined #ruby
rideh has quit [Quit: zap]
allomov has quit [Remote host closed the connection]
[Butch] has joined #ruby
<arup_r>
you guys have to many names :p
<adaedra>
?
rideh has joined #ruby
<jevs>
nateberkopec: maybe Fibres are more what you’re looking for which give you more control over which process is running and when?
r0nin has quit [Remote host closed the connection]
sofija has joined #ruby
sofija has quit [Changing host]
sofija has joined #ruby
r0nin has joined #ruby
BTRE has quit [Quit: Leaving]
edwinvdg_ has joined #ruby
gagrio has quit [Quit: Leaving...]
bricker has joined #ruby
<jevs>
Otherwise you’d have to have a way of telling all the other threads to pause as well. The multithreading paradigm might not be right if they depend on each other in some way
kham1 has quit [Ping timeout: 246 seconds]
Axy has joined #ruby
dgbaley has left #ruby [#ruby]
polyrob has quit [Read error: Connection reset by peer]
djbkd has joined #ruby
DoubleMalt has joined #ruby
Igorshp has quit [Remote host closed the connection]
bronson has joined #ruby
whiteline has quit [Read error: Connection reset by peer]
Yiota has joined #ruby
benlovell has quit [Ping timeout: 248 seconds]
yokel has quit [Remote host closed the connection]
<nateberkopec>
jevs: This is just for some test benchmarking, so I think I might just try to lock up a thread with some meaninless work. like generating a lot of random data or whatever.
hj2007 has joined #ruby
<nateberkopec>
I basically want to simulate a web application that does X ms of work, but doesn't relinquish the thread.
quimrstorres has quit [Remote host closed the connection]
<havenwood>
nateberkopec: Sure, you can synchronize on a global mutex lock.
poguez_ has joined #ruby
quimrstorres has joined #ruby
<havenwood>
nateberkopec: But if you really want to do the scheduling, Fibers.
<nateberkopec>
So basically sleep inside a mutex?
nofxx has joined #ruby
kham1 has joined #ruby
<jevs>
And side note: Fibers probably aren’t as complicated as you think they are :) They don’t get used often but it’s a good tool
Exuma has joined #ruby
failshell has joined #ruby
polysics has quit [Remote host closed the connection]
davejlong has quit [Remote host closed the connection]
<heftig>
was there a Hash method that stores a new value and returns the old one?
rbennacer has quit [Remote host closed the connection]
quimrstorres has quit [Remote host closed the connection]
yokel has joined #ruby
quimrstorres has joined #ruby
<havenwood>
nateberkopec: But you'd have to synchronize around everything. In this example the 0.1 seconds is just to give the Thread a chance to acquire the lock: @mutex = Mutex.new; Thread.new { @mutex.synchronize { sleep 10 } }; sleep 0.1; @mutex.synchronize { puts 'finally!' }
<Antiarc>
nateberkopec: Are you trying to measure the imapct of the GVL?
<havenwood>
nateberkopec: Yeah, say more about what you're doing! :)
xkef has quit [Ping timeout: 244 seconds]
DEA7TH_ has joined #ruby
<havenwood>
And Mutex isn't reentrant, Monitor if you need that.
<Antiarc>
(monitor's also 2x slower than mutex, don't use it unless you absolutely have to)
graydot has quit [Quit: graydot]
polyrob has joined #ruby
<jhass>
heftig: doesn't seems so, gotta foo[key].tap { foo[key] = value }
<nateberkopec>
havenwood: ooooh yeah, that looks like more of what I'm thinking
Mia has joined #ruby
benlieb has joined #ruby
Alayde has joined #ruby
<havenwood>
nateberkopec: I'm still suspicious you should be using Fibers but I'm totally unclear on what you're doing. ;)
lostcuaz has joined #ruby
<nateberkopec>
I basically want to bench/show the differences between Rack servers in different situations. So I want a rack app thats basically simulating doing real work for 100ms or so. sleep() is valuable because it will simulate I/O (going to the db) or whatever, but most rack server responses also usually involve a lot of blocking work.
shinnya has quit [Ping timeout: 244 seconds]
<Antiarc>
Personally I'd just run a loop for X seconds ;)
mikecmpbll has joined #ruby
<nateberkopec>
Antiarc: d'oh, yeah that's a lot easier.
baweaver has joined #ruby
lostcuaz has quit [Max SendQ exceeded]
Axy has quit [Ping timeout: 246 seconds]
<nateberkopec>
while Time.now < time_100_ms_from_now
<nateberkopec>
or whatever
lostcuaz has joined #ruby
whiteline has joined #ruby
<Antiarc>
I'd just write a little helper function that does it, then work_for(10) or whatever
<nateberkopec>
yeah, I don't want to yield the thread.
<Antiarc>
The scheduler will run other threads while that thread is slept; I think nateberkopec is trying to simulate performance during concurrent compute-heavy requests
jpfuentes2 has joined #ruby
rideh has quit [Quit: zap]
yeticry has quit [Ping timeout: 248 seconds]
<nateberkopec>
Antiarc: bingooo
<Antiarc>
Which is particularly important given the GVL; sleep will produce better concurrency numbers than you could get under actual CPU load
bahar has quit [Changing host]
bahar has joined #ruby
duggiefresh has quit [Remote host closed the connection]
rideh has joined #ruby
konsolebox has joined #ruby
edwinvdg_ has quit [Remote host closed the connection]
werelivinginthef has quit [Read error: Connection reset by peer]
yeticry has joined #ruby
AlexAltea has joined #ruby
dfinninger has quit [Remote host closed the connection]
r0nin has quit [Remote host closed the connection]
r0nin has joined #ruby
vlad_starkov has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
foureight84 has joined #ruby
Hounddog has quit [Read error: Connection reset by peer]
dfinninger has joined #ruby
<vlad_starkov>
Question: Hi! Could someone explain me in "a few words" why I'd need to use ConditionVariable with Mutex, and when I should apply Queue? Thanks.
hj2007 has quit [Quit: This computer has gone to sleep]
pengin has joined #ruby
gambl0re has joined #ruby
<Antiarc>
ConditionVariable objects augment class Mutex. Using condition variables, it is possible to suspend while in the middle of a critical section until a resource becomes available.
<jhass>
vlad_starkov: no that's impossible. Both constructs have a wide range of applications and are not excluding each other
<Antiarc>
Queue is basically a thread array-style data structure that is guaranteed to be synchronized across threads
<Antiarc>
If you want to pass messages between threads without explicitly managing mutexes, Queue is a great way to do it
<jhass>
note that Queue is implemented using Mutex and ConditionVariable even
pietr0 has joined #ruby
<vlad_starkov>
jhass: this is something, at least
rubie has joined #ruby
Exuma has quit [Quit: ZZZzzz…]
arturmartins has joined #ruby
<havenwood>
vlad_starkov: Queue is first-in, first-out.
<vlad_starkov>
havenwood: right
r0nin has quit [Ping timeout: 244 seconds]
<Antiarc>
vlad_starkov: Once you understand Queue, ConditionVariable is pretty self-explanatory. CV is basically just a queue of things that want a resource, and #signal tells the caller at the head of the queue that they can have the resource
chouhoul_ has joined #ruby
stan has quit [Quit: Leaving]
<vlad_starkov>
Antiarc: do you know some real-world example where Queue would be useful?
<Antiarc>
vlad_starkov: Resource pools
<havenwood>
vlad_starkov: So a first-in, first-out queue to synch between Threads.
<vlad_starkov>
havenwood: Erlang is a bit OMG thing (I tried it in RabbitMQ console to setup RabbitMQ cluster)
momomomomo has quit [Ping timeout: 264 seconds]
peter_paule has joined #ruby
relix has joined #ruby
<havenwood>
I want to try jpf-concurrent with ruby-concurrent on JRuby now...
cochise has quit [Remote host closed the connection]
fabrice31 has quit [Ping timeout: 246 seconds]
lala has joined #ruby
[k- has quit [Ping timeout: 244 seconds]
Violentr has quit [Ping timeout: 240 seconds]
paulcsmith has quit [Quit: Be back later ...]
DEA7TH_ has joined #ruby
<Antiarc>
havenwood: ooooooh
cochise has joined #ruby
mikeric has joined #ruby
momomomomo has joined #ruby
pengin has joined #ruby
pietr0 has quit [Quit: pietr0]
sofija has quit [Read error: Connection reset by peer]
djbkd has quit [Remote host closed the connection]
<Antiarc>
vlad_starkov: erlang's syntax is brainbending, but you might check out elixir - it's erlang with a rubyish syntax and it's nice :)
mike___1234 has quit [Ping timeout: 255 seconds]
<Antiarc>
(It's not *exactly* erlang but you can call erlang from it and it runs in the erlang VM)
maletor_ has joined #ruby
bungoman has quit [Remote host closed the connection]
sofija has joined #ruby
lotherk has quit [Ping timeout: 246 seconds]
umgrosscol has quit [Ping timeout: 244 seconds]
peter_paule has quit [Ping timeout: 256 seconds]
momomomomo has quit [Client Quit]
Hobbyboy has quit [Ping timeout: 256 seconds]
htmldrum has joined #ruby
bronson has quit [Remote host closed the connection]
lotherk has joined #ruby
mike___1234 has joined #ruby
tvw has joined #ruby
B1n4r10 has joined #ruby
<nofxx>
return unless v.respond_to?(:/) it'll return unless v responds to bad humour?
psy_ has quit [Ping timeout: 256 seconds]
ta_ has joined #ruby
<havenwood>
Speaking of Elixir and ruby-concurrent on JRuby, this second example on JRuby is a ThreadPoolExecutor sized to the number of cores plus two: https://github.com/havenwood/elixir.rb#examples
<havenwood>
Antiarc: Implementing Elixir stdlib in Ruby is a good excuse to play with concurrent-ruby. ;)
Zai00 has quit [Quit: Zai00]
<Antiarc>
havenwood: why plus two?
<havenwood>
Antiarc: Just copying Elixir/Erlang default async-threads.
ta has quit [Ping timeout: 248 seconds]
edwinvdgraaf has quit [Remote host closed the connection]
<Antiarc>
(also: Having direct access to executors in Ruby is easily one of my favorite JRuby perks)
<havenwood>
Antiarc: \o/
Steve_Jo1 is now known as Steve_Jobs
<Antiarc>
class Foo; include Callable; def call; ...
quimrstorres has quit [Remote host closed the connection]
danzilio has quit [Ping timeout: 244 seconds]
sarkyniin has joined #ruby
rbennacer has joined #ruby
BTRE has joined #ruby
maletor_ has quit [Quit: Computer has gone to sleep.]
lkba_ has quit [Ping timeout: 250 seconds]
bodzio has quit [Quit: Leaving.]
<shevy>
ruby-lang206 have a look at #bioinformatics too; as for biology, bioruby exists but it is not of really great quality IMHO. go get into ruby and contribute \o/
ank has quit [Read error: Connection reset by peer]
Yiota has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ironcamel>
i need to upgrade ruby system wide from 1.9 to the latest ruby. what is the recommended way to do that?
<ironcamel>
this is an ubuntu box if that matters
r0nin has joined #ruby
<Antiarc>
IMO the best way to find new projects to work on is to work on a project interesting to you, and as you start using libraries, fix/improve them, or write your own if the incumbents are insufficient :)
<Antiarc>
Find projects with lots of outstanding tickets, browse tickets until you find one you can work on, try to fix it, sumit a PR, repeat!
r0nin has quit [Remote host closed the connection]
<ruby-lang206>
u guys are like developers for developers type open source
r0nin has joined #ruby
t0rrieri has quit [Quit: Be back later ...]
<havenwood>
ruby-lang206: are open developers type u source for developers like guys
rbennacer has quit [Ping timeout: 256 seconds]
<ruby-lang206>
@antiarc I really like that link you just sent
bungoman has joined #ruby
<ruby-lang206>
very cool stuff there
<havenwood>
I still don't understand after shuffling.
lancetw has quit [Ping timeout: 246 seconds]
dmoe has quit [Ping timeout: 246 seconds]
<Antiarc>
Yeah, it's nice if you don't know where to start
cochise has quit [Remote host closed the connection]
dede has quit [Ping timeout: 246 seconds]
<ruby-lang206>
thats why i like it
im0b has quit [Ping timeout: 246 seconds]
howdoi has quit [Ping timeout: 246 seconds]
jlyndon has quit [Ping timeout: 246 seconds]
bcavileer has quit [Ping timeout: 246 seconds]
<havenwood>
shevy: yeah, still is just not here atm
mikeric has quit []
<arup_r>
ljarvis, Problem is with Rails autload feature.. something wrong is going on I asked ror channel that. Here just inform you, as my custom Data class didn't load, constant look up loaded the Ruby core Data and I got the earlier error.. Just to FYI
_ixti_ has quit [Ping timeout: 260 seconds]
hj2007 has joined #ruby
howdoi has joined #ruby
bcavileer has joined #ruby
<ruby-lang206>
im a self taught developer. and very barely decent. I'm trying to build the mindset needed to win at what I'm doing
lancetw has joined #ruby
dede has joined #ruby
im0b has joined #ruby
dmoe has joined #ruby
hj2007 has quit [Client Quit]
<ruby-lang206>
before i go even more hardcore and work on building package managers for open source.
<Antiarc>
arup_r: autoload works on missing constants. If the constant is defined autoload won't kick in; explicitly load your files in those cases
<Antiarc>
(IMO, always explicitly load anyhow)
danzilio has joined #ruby
<shevy>
ruby-lang206 same description counts for me too btw, I also studied biology (or actually, molecular genetics to be more precise). I never was and never will be a "programmer", I just like ruby
Kully3xf_ has joined #ruby
<havenwood>
shevy: you're nto a programmer?
<ruby-lang206>
@lol
<Antiarc>
ruby-lang206: contributing to a project is a great way to get better. I'd pick a project that interests you and really dig deep into that rather than just floating around between projects
<havenwood>
shevy: if you program...
yqt has quit [Ping timeout: 246 seconds]
pizzaops has quit [Ping timeout: 246 seconds]
jlyndon has joined #ruby
<shevy>
I write poetry
<havenwood>
shevy: poet and programmer
<ruby-lang206>
@Antiarc i appreciate that a lot
<Antiarc>
shevy: it just happens to be executable poetry? :)
baweaver has joined #ruby
<shevy>
well interpreted... I think the biggest I compile self-written was hello_world.c
blaines has joined #ruby
Dreamer3 has quit [Ping timeout: 264 seconds]
bluOxigen has quit [Read error: Connection reset by peer]
<ruby-lang206>
i just recently had to mimic alchemy cms abstract content storage
pizzaops has joined #ruby
<shevy>
what is alchemy cms
Kully3xf has quit [Ping timeout: 246 seconds]
yardenbar has joined #ruby
bluOxigen has joined #ruby
<nofxx>
Is there this joke in your language? In portuguese a programmer get paid for a 'program', hookers also get paid for a 'program'. So here if you say you do 'programs' for money it's a funny joke
bronson has joined #ruby
<Antiarc>
nofxx: "program" doesn't really have any naughty connotation in English, no
phat4life has quit [Quit: ZNC - 1.6.0 - http://znc.in]
pengin has quit [Remote host closed the connection]
vlad_starkov has quit [Remote host closed the connection]
<ruby-lang206>
an open source CMS for you to allow non developers to update their sites on the fly
<ruby-lang206>
<shevy>
<shevy>
aha
<nofxx>
Antiarc, that confirms english. From my poor spanish I think thre's not either. Maybe another latin tongue, italian or french perhaps.
goodcodeguy has joined #ruby
phat4life has joined #ruby
hj2007 has joined #ruby
allomov has quit [Remote host closed the connection]
stczhc has joined #ruby
pengin has joined #ruby
stczhc has left #ruby [#ruby]
<nofxx>
Antiarc, actually a bad old joke anyway, between programers one common reply was 'soft or firmware?' But 'firm' also has a naughy connotation here.
ledestin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<nofxx>
Yeah, we can find fun in a lot of words.
Dreamer3 has joined #ruby
hinbody has joined #ruby
<Antiarc>
nofxx: yeah, firm can have a naughty connotation in English. "Hard disk" and "floppy disk" in particular tend to be the source of many jokes.
bungoman has quit [Remote host closed the connection]
hinbody has quit [Client Quit]
<shevy>
you naughty people you
<Antiarc>
(granted, floppies aren't a thing anymore, but still)
<Antiarc>
.
apt-get_ has joined #ruby
hinbody has joined #ruby
stczhv has joined #ruby
<Volsus>
ive heard of 'fsck' used in colorful ways
stczhv has quit [Client Quit]
<Antiarc>
the whole gnu toolchain can be naughty if you work hard enough
<shevy>
"if you work hard enough"
<shevy>
he never stops!
sarkyniin has quit [Ping timeout: 260 seconds]
GhettoCode has joined #ruby
stczhv has joined #ruby
<nofxx>
What would be of like w/o some fun and jokery. I'm 100% with epicurus
dfinninger has joined #ruby
<nofxx>
well, we are here and not in java, so we share the same idea
paulcsmith has joined #ruby
mikeric has joined #ruby
mikeric has quit [Max SendQ exceeded]
eggoez has quit [Ping timeout: 248 seconds]
<Antiarc>
Hey now, I'm also in #jruby :)
Kyhz has joined #ruby
algernon__ has quit [Read error: No route to host]
Dreamer3 has quit [Ping timeout: 250 seconds]
devbug has joined #ruby
ruby-lang206 has quit [Ping timeout: 246 seconds]
ramfjord has joined #ruby
r0nin_ has joined #ruby
<shevy>
you have fallen to the dark side
dfinninger has quit [Remote host closed the connection]
<Antiarc>
jruby's awesome! I like the JVM, and Java honestly isn't *horrible* as long as you have an IDE to do most of your typing for you :)
graydot has joined #ruby
baweaver has quit [Remote host closed the connection]
<Antiarc>
(though if I had my preferences I'd write in C# over Java anyday)
hj2007 has quit [Quit: This computer has gone to sleep]
<Antiarc>
It's certainly prolific
lotherk has quit [Ping timeout: 240 seconds]
dfinninger has joined #ruby
eggoez has joined #ruby
dfinninger has quit [Remote host closed the connection]
r0nin has quit [Ping timeout: 265 seconds]
quimrstorres has joined #ruby
meph has quit [Remote host closed the connection]
<theRoUS>
markdown-to-html-as-generated-by-yard question: i want to show "(n)" with the 'n' being emphasised (italic), but '(*n*)' ends up getting treated as a literal. the only workaround i've found is to use '( *n*)' but that's ugly..
_solomon has quit [Quit: _solomon]
momomomomo has joined #ruby
danzilio has quit [Quit: My computer has fallen asleep!]
Kully3xf_ has quit [Remote host closed the connection]
dfinninger has joined #ruby
neanderslob has joined #ruby
duderonomy has joined #ruby
benlieb has quit [Quit: benlieb]
woodruffw has quit [Read error: Connection reset by peer]
danzilio has joined #ruby
benlieb has joined #ruby
TheHodge has quit [Quit: Connection closed for inactivity]
paulcsmith has quit [Quit: Be back later ...]
lotherk has joined #ruby
cochise has joined #ruby
benlieb has quit [Client Quit]
momomomomo has quit [Ping timeout: 240 seconds]
Luun has quit [Quit: Luun]
freerobby has quit [Quit: Leaving.]
quimrstorres has quit [Ping timeout: 256 seconds]
momomomomo has joined #ruby
freerobby has joined #ruby
<prefixed>
what do I use to parse arguments in ruby?
NeverDie has joined #ruby
Exuma has quit [Quit: ZZZzzz…]
Exuma has joined #ruby
rbennacer has joined #ruby
davejlong has quit [Remote host closed the connection]
JoshL has quit [Read error: No route to host]
swgillespie has joined #ruby
paulcsmith has joined #ruby
benlieb has joined #ruby
JoshL has joined #ruby
benlieb has quit [Client Quit]
charliesome has joined #ruby
sshuff|gone is now known as sshuff
davejlong has joined #ruby
konsolebox has quit [Remote host closed the connection]
Agoldfish has joined #ruby
kies^ has quit [Remote host closed the connection]
cochise has quit [Ping timeout: 260 seconds]
kham1 has quit [Ping timeout: 252 seconds]
Spami has joined #ruby
woodruffw has joined #ruby
<Antiarc>
command-line arguments? OptionParser is the stdlib way to do it
Spami has quit [Client Quit]
pengin has quit [Remote host closed the connection]
<prefixed>
yes. do you have a tutorial for it? the documentation is kinda bad
exadeci has quit [Quit: Connection closed for inactivity]
<Antiarc>
Which tells you things like --warnings is an optional flag, which takes an optional argument
<Antiarc>
-R is an optional flag which takes a required argument
<adaedra>
So yeah, someone seriously just think that.
edwinvdgraaf has quit [Ping timeout: 264 seconds]
TOAA has joined #ruby
<prefixed>
do |lib|
<prefixed>
options.library << lib
<prefixed>
what is this ^
<Antiarc>
the argument passed to the block, lib, is going to be the value of the argument for that flag
<Antiarc>
Then you handle it however you see fit inside the block
<Antiarc>
So if you have a switch on("--flag=ARG") {|flag| ... }, and then you parse the call "./foo.rb --flag=bar", then in the block, the value of flag will be "bar"
<prefixed>
what is <<
cochise has joined #ruby
<Antiarc>
It's just a method named <<. In an Array context, it's the push operator.
r0nin has joined #ruby
<Antiarc>
Without knowing what options.library is though it's not possible to answer conclusively though
<adaedra>
it's the same as options.library.<<(lib)
<prefixed>
wow. ok
<adaedra>
so it depends on how library defines <<
<adaedra>
Array uses it as push, String as append
htmldrum has quit [Ping timeout: 250 seconds]
pengin has joined #ruby
jackjackdripper has joined #ruby
baweaver has joined #ruby
<Antiarc>
>> class Foo; def <<(arg); puts "#{arg}: TO DA LEFT"; end; end; Foo.new << "prefixed"
<jhass>
ruby-lang841: my go to advice is to reflect on your daily life and find things you do regulary (daily to weekly) that you could (partially) automate with Ruby
<jhass>
solve a problem you actually have
ruby-lang841 has quit [Ping timeout: 246 seconds]
<jhass>
ah
SaintMoriarty has joined #ruby
<Ox0dea>
Ya scared him.
<SaintMoriarty>
Hi I am having an issue trying to access my assets and getting a 404
<jhass>
not possible, count the seconds
<jhass>
?rails SaintMoriarty
<ruboto>
SaintMoriarty, Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
Outlastsheep is now known as zz_Outlastsheep
<bougyman>
anyone know of a higher level elasticsearch lib that's not railsy?
<bougyman>
was hoping something like Sequel had an adapter, but nay.
<Antiarc>
I just use the elasticsearch gem with jbuilder
<bougyman>
er hoping there was something like a sequel library for it.
<bougyman>
yeah, i'm using jbuilder now.
DoubleMalt has quit [Remote host closed the connection]
momomomomo has joined #ruby
r0nin has quit [Ping timeout: 256 seconds]
bruno- has quit [Ping timeout: 250 seconds]
<Antiarc>
I've taken a stab at building one a few times and keep finding that it's just a complex enough query langauge that an abstraction layer can't abstract too much
<bougyman>
i feel like that's what i'm doing, here.
_solomon has joined #ruby
<bougyman>
but i'm leaving out 90% of the stuff people won't use (in our use-case)
krz has joined #ruby
brianpWins has joined #ruby
stczhc has joined #ruby
quimrstorres has joined #ruby
stczhv has quit [Ping timeout: 256 seconds]
krz has quit [Read error: Connection reset by peer]
t0rrieri has quit [Quit: Be back later ...]
stczhc has left #ruby [#ruby]
krzkrz has joined #ruby
ValicekB has quit [Ping timeout: 246 seconds]
jhack has joined #ruby
benlieb has quit [Quit: benlieb]
bricker has quit [Ping timeout: 264 seconds]
serivich has joined #ruby
marr has quit [Ping timeout: 260 seconds]
quimrstorres has quit [Remote host closed the connection]
reset has joined #ruby
darkf has quit [Quit: Leaving]
lyonsb has joined #ruby
lyonsb has left #ruby ["Konversation terminated!"]
krzkrz has quit [Ping timeout: 240 seconds]
sheperson has joined #ruby
pl1ght has quit [Ping timeout: 244 seconds]
krzkrz has joined #ruby
baweaver has joined #ruby
ValicekB has joined #ruby
Fezzler has joined #ruby
jonee has quit [Ping timeout: 256 seconds]
pl1ght has joined #ruby
danzilio has joined #ruby
danzilio has quit [Read error: Connection reset by peer]
danzilio_ has joined #ruby
last_staff has joined #ruby
bruno- has joined #ruby
sharpmachine has quit [Remote host closed the connection]
fabrice31 has joined #ruby
pengin has quit [Remote host closed the connection]
bungoman has joined #ruby
krzkrz has quit [Ping timeout: 256 seconds]
bricker has joined #ruby
towski_ has quit [Remote host closed the connection]
allomov has joined #ruby
xkef has joined #ruby
baweaver has quit [Remote host closed the connection]
<toretore>
bougyman: i too am mostly just building json manually and find that it's usually the right level of abstraction already
fabrice31 has quit [Ping timeout: 256 seconds]
momomomomo has quit [Ping timeout: 240 seconds]
<toretore>
i use tire, but find it limiting
<bougyman>
toretore: I was hoping to not have to teach everyone the ES query dsl.
ndrei has joined #ruby
ndrei_ has joined #ruby
<bougyman>
at least for the basics.
<toretore>
you kind of have to know it i think
<bougyman>
bah, such a skeptic.
<prefixed>
yo
jhack has quit [Ping timeout: 250 seconds]
<prefixed>
is it ok if i make my arguments globals?
endash has quit [Quit: endash]
<toretore>
you can abstract away simple things like "search products for these attributes", but for generic abstractions the underlying structure will always bleed through
<prefixed>
or is that a "bad, bad, no good" practice?
jud has quit [Quit: Leaving]
<toretore>
prefixed: elaborate
Zai00 has joined #ruby
<toretore>
usually, anything that has to do with global state is automatically bad
krzkrz has quit [Ping timeout: 256 seconds]
<prefixed>
my program takes some arguments. I want them to be accessable globally so I don't have to pass them into every method.
<toretore>
no good
Scientz is now known as Scient
<toretore>
bad
<prefixed>
why
diego85 has quit [Remote host closed the connection]
Scient_ is now known as Scient
<toretore>
google.com?q=global+state
bungoman has quit [Ping timeout: 250 seconds]
<prefixed>
why is it bad for arguments to be global?
<toretore>
i guess you will just have to try it and learn the hard way
<jhass>
prefixed: because they don't change. They're Constant
<prefixed>
yes, and?
kirun has joined #ruby
<jhass>
$globals are for global changing state, which is very very bad
momomomomo has joined #ruby
jamesaxl has joined #ruby
<toretore>
as a general rule, you should never reach out of your current scope more than is absolutely necessary
<shevy>
prefixed if you use many different .rb files written by many different authors, it may be quite likely that these global variables may clash with other global variables
<toretore>
shevy: though that's still the same thing, it's still global
<prefixed>
?
<shevy>
how is it global? it resides in Foo
AlphaAtom has joined #ruby
arturmartins has joined #ruby
shadoi has joined #ruby
<toretore>
prefixed: your classes should take the arguments they need to function, and they should know absolutely nothing about arguments given to the program
<toretore>
shevy: it's accessible from anywhere
<toretore>
and mutable from anywhere
<Ox0dea>
toretore: Like... everything else in Ruby?
<shevy>
it is most definitely not a global
<Ox0dea>
^
<prefixed>
Why are the options in that example not assigned as OptparseExample fields?
<toretore>
i didn't say it's "a" global, i said it's global
<toretore>
there is no difference in their scope
<Ox0dea>
toretore: The scope of that 5 in shevy's example is the Foo class.
<toretore>
ok, scope is the wrong word, but it's accessible from *anywhere* in your program, just like a $global
baweaver has quit [Remote host closed the connection]
<prefixed>
this argument code seems dumb
<toretore>
all the caveats that apply to a global variable apply just the same to an attribute on a class
<prefixed>
why aren't the options instance variables?
aspiers has joined #ruby
<Ox0dea>
toretore: He didn't define an attribute writer.
<toretore>
prefixed: do you have any code you can share?
<Ox0dea>
It's globally *mutable* state that tends to cause problems.
jpfuentes2 has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
prefixed: it's much easier to give advice on real code
<prefixed>
toretore that's real code
<prefixed>
in fact, the documentation explicitly states that it's real code
<willywos>
is the argument about if a class constant the same as a global variable?
<toretore>
Ox0dea: right, globally mutable state, which it is
jpfuentes2 has joined #ruby
<toretore>
prefixed: i mean your code
<Ox0dea>
toretore: By way of #instance_variable_set, you mean?
jhack has joined #ruby
<prefixed>
toretore I am using that code
<Ox0dea>
willywos: No, a class instance variable.
<toretore>
Ox0dea: oh you're talking about the def self.foo? sorry, i thought we were talking about the constant
<toretore>
prefixed: for what?
<prefixed>
parsing arguments
xkef has quit [Ping timeout: 264 seconds]
<prefixed>
am i being trolled?
<prefixed>
I'm using it to make a sandwidch
<Ox0dea>
prefixed: There are better ways to do that.
<prefixed>
ok. i thought so.
<willywos>
lol
<prefixed>
maybe someone should fix that
<Ox0dea>
prefixed: Perhaps we'll be of more assistance now that we've gotten your XY problem out of the way.
RatelDev has joined #ruby
<Ox0dea>
Which deli meats and/or cheeses are you in possession of at present?
<prefixed>
I'm not really trying to make a sandwich
<Ox0dea>
I don't believe you.
<willywos>
you have to say sudo
<prefixed>
I just had lunch. it was fantastic
<Ox0dea>
prefixed: Did you eat Ruby code?
<prefixed>
didn't even have to make it myself AND i had a pint alongside it
<toretore>
prefixed: you're parsing arguments, but *then* what are you doing with them?
dfinninger has quit [Remote host closed the connection]
<toretore>
the original question wasn't about *how* to parse arguments, it was what to do with them *after*, which is why i was asking to see your code
podman has joined #ruby
<prefixed>
It's ok. I think i've got it from here. I prefer to only ask questions as a last resort.
yardenbar has quit [Ping timeout: 240 seconds]
n008f4g_ has quit [Ping timeout: 256 seconds]
<prefixed>
here's a useful style question though: is it useful to write self.somemethod, or should i just skip the self
<Antiarc>
(Imagine if you had a foo = val variable set in a method, and then later added a foo=() writer to the object, and your methods that used the localvar started breaking)
<Ox0dea>
toretore: Needs more Java.
jhack32 has joined #ruby
<apeiros>
toretore: no MooFactory?
<apeiros>
no MooBean?
<Antiarc>
IMooFactoryProviderFactory
<Ox0dea>
Yeah, I was gonna mention that Java class names are required to be greater than twenty characters in length.
a_i is now known as ai_x
mike___1234 has quit [Ping timeout: 256 seconds]
SegFaultAX has quit [K-Lined]
G has quit [K-Lined]
drewdavis has quit [K-Lined]
paulcsmith has joined #ruby
eGGsha has joined #ruby
casadei_ has quit [Remote host closed the connection]
goodcodeguy has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
drewdavis has joined #ruby
jhack has quit [Ping timeout: 256 seconds]
SegFaultAX has joined #ruby
eggoez has quit [Ping timeout: 244 seconds]
theery has quit [Remote host closed the connection]
ai_x has quit [Remote host closed the connection]
Igorshp has joined #ruby
theery has joined #ruby
bluOxigen has quit [Ping timeout: 264 seconds]
pengin has quit [Remote host closed the connection]
devbug has joined #ruby
RatelDev has joined #ruby
serivich has quit [Ping timeout: 240 seconds]
<shevy>
you get paid for verbosity!
marr has joined #ruby
benlovell has joined #ruby
RatelDev has quit [Client Quit]
RatelDev has joined #ruby
RatelDev has quit [Max SendQ exceeded]
eggoez has joined #ruby
RatelDev has joined #ruby
RatelDev has quit [Max SendQ exceeded]
joelataylor has quit [Ping timeout: 246 seconds]
<toretore>
pay = wc -c **/*
RatelDev has joined #ruby
RatelDev has quit [Max SendQ exceeded]
RatelDev_ has joined #ruby
benlovell has quit [Ping timeout: 264 seconds]
RatelDev_ has quit [Remote host closed the connection]
maletor has quit []
RatelDev has joined #ruby
RatelDev_ has joined #ruby
RatelDev has quit [Remote host closed the connection]
RatelDev_ has quit [Remote host closed the connection]
RatelDev has joined #ruby
casadei_ has joined #ruby
huddy has joined #ruby
RatelDev has quit [Remote host closed the connection]
<adaedra>
except if you rescue it in the hidden code
<arup_r>
No man.. Let me add the class then one min
<arup_r>
adaedra, added
<adaedra>
But if you want your throw to be caught by the rescue l.32, you have to move your E24PaymentPipe.new after the begin
<adaedra>
the rescue will only catch what happens between l30 and 31
<arup_r>
Oopss!!!!!!! Yup
<arup_r>
thanks
drewvans1one has joined #ruby
quimrstorres has joined #ruby
lxsameer has joined #ruby
endash has joined #ruby
choppington has quit [Ping timeout: 240 seconds]
krzkrz has quit [Quit: WeeChat 1.0.1]
<prefixed>
yo. so let's say i'm using OptionParser and have a flag, -f, which is supposed to represent a file name. Can I run the script as follows: ./myscript.rb -f somefile.txt ?
drewvanstone has quit [Ping timeout: 260 seconds]
mikeric has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
douglasssss has joined #ruby
hanmac has quit [Ping timeout: 246 seconds]
<adaedra>
arup_r: also note that Module#=== takes an instance as argument – and if you want to test if an object is of a type, Object#is_a? is more appropriate.
d10n-work has quit [Quit: Connection closed for inactivity]
MagePsycho has joined #ruby
lsmola has quit [Ping timeout: 252 seconds]
<arup_r>
ok
<Ox0dea>
prefixed: This would be the third time you've been linked directly to the OptionParser docs...
jenrzzz has joined #ruby
rideh has quit [Quit: zap]
Poiju_ has joined #ruby
Axy has joined #ruby
Axy has joined #ruby
roolo has joined #ruby
shadoi has joined #ruby
MasterPiece has joined #ruby
<prefixed>
Ox0dea funny. I would have thought after the second time, you'd realize I don't really understand the docs.
<adaedra>
I don't remember the docs from option parser to be that unreadable
choppington has joined #ruby
<adaedra>
I even remember progressive samples that help well
momomomomo_ has joined #ruby
Mia has quit [Ping timeout: 246 seconds]
momomomomo has quit [Ping timeout: 244 seconds]
momomomomo_ is now known as momomomomo
<Ox0dea>
> Specifies short style switch which takes a mandatory, optional or no argument.
<Ox0dea>
prefixed: Out of earnest curiosity, which word(s) do you have trouble with there?
jobewan has quit [Quit: Leaving]
jgpawletko has joined #ruby
<Ox0dea>
Calling it a "switch" would be momentarily confusing if you'd had prior exposure to CLIs, but I assume that's not the case.
<Ox0dea>
arup_r: Sorry about that `super === sub` nonsense from earlier.
<adaedra>
Ox0dea: d'ou tu parles français toi
<arup_r>
adaedra, your auto completion is buggy :)
ivanf has quit [Remote host closed the connection]
<adaedra>
arup_r: nope, that's human error here, I was thinking about both replies at the same time and switched nicks
<arup_r>
saying with ref to "Bye Ox0dea"
<arup_r>
Ohkay!! I was kidding..
<adaedra>
:)
jeramyRR has joined #ruby
devbug has quit [Ping timeout: 240 seconds]
<arup_r>
I am using HexChat it is awesome
<adaedra>
I don't like it that much
Poiju_ has quit [Ping timeout: 246 seconds]
chamila has quit [Ping timeout: 246 seconds]
JoshL has quit []
ybian has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
ngscheurich has quit [Quit: leaving]
simplyianm has joined #ruby
<shevy>
arup_r aha the successor to xchat
<arup_r>
shevy, it is awesome for my old aged laptop
Spami has quit [Quit: Leaving]
Sypheren has quit [Ping timeout: 240 seconds]
<Senjai>
arup_r: Weechat best irc client
<adaedra>
^
<Ox0dea>
Confirmed.
tjohnson has quit [Quit: Connection closed for inactivity]
Azure has joined #ruby
hanmac has joined #ruby
Sypheren has joined #ruby
towski_ has joined #ruby
codecop has quit [Remote host closed the connection]
<prefixed>
Ox0dea the documentation doesn't really cover all use cases. you know how you said something like "[--input file]" specified an optional argument? I don't see this explained in the documentation
arup_r has quit [Quit: Leaving]
arturmartins has quit [Ping timeout: 260 seconds]
<hololeap>
is there any performance difference between these two types of method chains: `array.map(&:name).map(&:downcase).map(&:to_sym)` vs. `array.map { |x| x.name.downcase.to_sym }`
Carnage\ has joined #ruby
<Ox0dea>
prefixed: You've conflated me with somebody else, I'm afraid.
ndrei_ has quit [Ping timeout: 264 seconds]
BeatNick_ has left #ruby ["Leaving"]
<Senjai>
Ox0dea: conflated... yeah. Haven't heard that in a sentence for a long while
<Ox0dea>
prefixed: Using square brackets for optional arguments is *right there* in the documentation, dude.
ndrei has quit [Ping timeout: 246 seconds]
dfinninger has quit [Remote host closed the connection]
bmurt has quit []
GhettoCode has quit []
<Ox0dea>
hololeap: The latter is more space-efficient.
baweaver has quit [Remote host closed the connection]
<Ox0dea>
It doesn't create as many intermediary arrays.
DoubleMalt has joined #ruby
<Ox0dea>
Ergo, it's also almost certainly faster.
phutchins has joined #ruby
edwinvdgraaf has joined #ruby
allcentury has quit [Ping timeout: 256 seconds]
devbug has joined #ruby
<hololeap>
Ox0dea: thank you
<Ox0dea>
Sure thing.
<Ox0dea>
hololeap: Feel free to whip out benchmark/ips to test the theory. :)
<hazelux>
Senjai: thanks! Why shouldn't you have to?
momomomomo has joined #ruby
casadei_ has joined #ruby
baweaver has quit [Remote host closed the connection]
<heftig>
hazelux: IIRC decorators are supposed to remain compatible so you can still use the DecoratedPerson everywhere you can use the plain Person
relix has joined #ruby
<heftig>
so there's no need to obtain the decorated object
El3ktra_ has joined #ruby
bungoman has joined #ruby
matcouto has joined #ruby
sgambino has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
vdamewood has quit [Quit: Life beckons.]
Casty has joined #ruby
El3ktra_ has quit [Client Quit]
<heftig>
or maybe it was that you the decorator is only used by code that doesn't need to handle the decorated object
El3ktra has joined #ruby
<heftig>
code that needs the latter would get the object passed without needing to unwrap it
El3ktra has left #ruby [#ruby]
<hazelux>
heftig: That's what I expected, too. This is the problem that is actually causing the problem (inside an ActiveRecord model): User.likes.exists?(activity: decorated_activity)
dubkoidragon has joined #ruby
<hazelux>
I tried asking in #rubyonrails, but they seem pretty unresponsive.
<apeiros>
heftig: I understood it the same way as your first description.
<apeiros>
a decorated object *adds* stuff. all the rest is supposed to be identical.
pandaant has quit [Remote host closed the connection]
<heftig>
apeiros: otherwise it's an adapter, i guess
<Senjai>
hazelux: I wouldnt be suprised if that failed
<Senjai>
hazelux: thing.is_a?(activity) would fail
Fezzler has quit [Quit: Leaving]
<Senjai>
I'm not sure that is_a is delegated
<Senjai>
or anything for class checcking
gamename has quit [Remote host closed the connection]
bungoman has quit [Ping timeout: 256 seconds]
jbw has quit [Ping timeout: 256 seconds]
gamename has joined #ruby
jbw has joined #ruby
<heftig>
Senjai: I think SimpleDelegator is too simple and ducky here
<heftig>
hazelux: try DelegateClass
<Senjai>
heftig: I dont think it should be used like this at all :/
blackmes1 has joined #ruby
<hazelux>
Yeah, and monkeypatching is_a? and .class are not good ideas.
kadoppe has quit [Ping timeout: 255 seconds]
jhack32 has quit [Ping timeout: 248 seconds]
mikeric has quit []
<Ox0dea>
`case foo; when :bar.to_proc` works, but `case foo; when &:bar` doesn't. I wonder if it should...
<Senjai>
hazelux: Dont use a delegator here.
<heftig>
hm, no, DelegateClass doesn't work, either
momomomomo has quit [Quit: momomomomo]
kadoppe has joined #ruby
blackmesa has quit [Ping timeout: 246 seconds]
<apeiros>
Ox0dea: & is for method calls
<apeiros>
case/when isn't a method call
gamename has quit [Ping timeout: 244 seconds]
<hazelux>
Senjai: Any other ideas, besides callbacks?
<hazelux>
I'll gist it so you guys can see it better.
<apeiros>
*if* &:bar should work in case/when, it should be syntax for calling to_proc everywhere. but the additional meaning of "convert it to a block" is lost there.
<Ox0dea>
Yeah, that makes sense.
<Senjai>
hazelux: The question is: "What are you trying to accomplish by using the delegator in the first place"
quimrstorres has quit [Remote host closed the connection]
baweaver has joined #ruby
borodin has quit [Quit: Page closed]
peter_paule has joined #ruby
xkef has quit [Ping timeout: 246 seconds]
bungoman has joined #ruby
<hazelux>
Senjai: I need to send a notification when an activity is saved. And I want to avoid callbacks.
sshuff is now known as sshuff|gone
<Senjai>
hazelux: So your doing this to avoid fixing code that needs to be fixed?
<Senjai>
hazelux: Oh, wait, sorry
<Senjai>
hazelux: You want a callback, except not on the active record objec?T
<Senjai>
hazelux: define a seperate object that is responsible for saving the record, and sending a notification afterwards
sarkyniin has joined #ruby
<Senjai>
Dont use a delegator, use an -actual- class that would hold the responsibility
<Senjai>
a before_create is totally fine for a notification
jenrzzz has joined #ruby
<hazelux>
after_create, rather
<Senjai>
I'd prefer it in the controller
<Senjai>
In your controller, create the thing, then send the notification
jgpawletko has quit [Quit: jgpawletko]
devbug has quit [Ping timeout: 255 seconds]
_solomon has quit [Quit: _solomon]
failshell has joined #ruby
freerobby has joined #ruby
devbug has joined #ruby
dfinninger has quit [Remote host closed the connection]
<hazelux>
Damn. Yeah, I think I just made a mess out of myself trying to use delegators for this. Thanks Senjai and heftig!
momomomomo has joined #ruby
<Senjai>
hazelux: If it feels like its too hard, it often is being done incorrectly ;)
jamesaxl|2 has joined #ruby
<hazelux>
so true.
jenrzzz has quit [Ping timeout: 244 seconds]
<Senjai>
hazelux: +1 on trying not to use AR callbacks though
failshell has quit [Ping timeout: 244 seconds]
avahey has joined #ruby
icebourg has quit []
failshell has joined #ruby
jamesaxl has quit [Ping timeout: 246 seconds]
peter_paule has quit [Ping timeout: 240 seconds]
freerobby has quit [Read error: Connection reset by peer]
freerobby1 has joined #ruby
devbug has quit [Ping timeout: 248 seconds]
bruno- has joined #ruby
<hazelux>
Senjai: so tempting though! But yeah, it's just asking for trouble down the line. Thanks for helping out even if it was slightly out of context
momomomomo has quit [Client Quit]
dfockler has quit [Remote host closed the connection]
<Senjai>
hazelux: np
peter_paule has joined #ruby
blue_deref has quit [Quit: bbn]
JohnBat26 has quit [Ping timeout: 246 seconds]
jamesaxl|2 is now known as jamesaxl
<ytti>
&win 12
freerobby1 has quit [Client Quit]
<ytti>
yeah that happened
kawaii-imouto is now known as pyon
casadei_ has quit [Remote host closed the connection]
vdamewood has joined #ruby
Ox0dea has quit [Quit: WeeChat 1.2]
bruno- has quit [Ping timeout: 256 seconds]
allomov has quit [Remote host closed the connection]
shadoi has quit [Quit: Leaving.]
Ilyas has quit [Read error: Connection reset by peer]
casadei_ has joined #ruby
dfinninger has joined #ruby
devbug has joined #ruby
vivekananda has joined #ruby
chouhoulis has quit [Remote host closed the connection]
poguez_ has quit [Quit: Connection closed for inactivity]
theery has quit [Remote host closed the connection]
miwood_ has quit [Remote host closed the connection]
dh64 has quit [Quit: Konversation terminated!]
decoponio has quit [Read error: Connection reset by peer]
zz_barkerd427 is now known as barkerd427
victortyau has quit [Quit: Leaving]
peter_paule has quit [Ping timeout: 264 seconds]
decoponio has joined #ruby
mikeric has joined #ruby
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
theery has joined #ruby
stantonnet has quit [Ping timeout: 250 seconds]
tubulife- has joined #ruby
LoBoGoL has quit [Quit: Leaving]
quimrstorres has joined #ruby
jeramyRR has joined #ruby
jeramyRR has quit [Client Quit]
vdamewood has quit [Ping timeout: 250 seconds]
theery has quit [Ping timeout: 255 seconds]
werelivinginthef has quit [Remote host closed the connection]
crwilcox has quit [Ping timeout: 248 seconds]
vdamewood has joined #ruby
quimrstorres has quit [Ping timeout: 265 seconds]
zrowe007 has quit [Read error: Connection reset by peer]
kham1 has quit [Ping timeout: 264 seconds]
ledestin has joined #ruby
duggiefresh has joined #ruby
<yorickpeterse>
ok naming question:
<yorickpeterse>
I have a method that should yield self and then iterate upwards a tree yielding all parents
<yorickpeterse>
so it's self -> parent of self -> parent of parent of self -> etc
<yorickpeterse>
How the heck should I call this?
nahtnam has joined #ruby
<yorickpeterse>
"self_and_every_parent" is meh
<yorickpeterse>
and "while_parent" is too vague I think