<RUBYLANG30>
Halo how common to setup rails server using chef?
ur5us has joined #ruby-lang
fusillicode has quit [Ping timeout: 244 seconds]
kimegede has joined #ruby-lang
<RUBYLANG30>
Halo is anybody using chef to setup rails server?
RUBYLANG30 has quit [Quit: Page closed]
mistym has quit [Remote host closed the connection]
mistym has joined #ruby-lang
mistym has quit [Ping timeout: 246 seconds]
tylersmith has quit [Remote host closed the connection]
solars has joined #ruby-lang
kwd has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
pr0ton_ has quit [Quit: pr0ton_]
francisfish has quit [Remote host closed the connection]
symm- has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby-lang
skammer2 has joined #ruby-lang
goatish_mound has quit [Read error: Connection reset by peer]
rsl has joined #ruby-lang
migbar has joined #ruby-lang
bruno- has quit [Ping timeout: 245 seconds]
Iskarlar has joined #ruby-lang
skammer2 has quit [Ping timeout: 260 seconds]
danijoo has quit [Read error: Connection reset by peer]
danijoo_ has joined #ruby-lang
wallerdev has joined #ruby-lang
migbar has quit [Ping timeout: 246 seconds]
relix has joined #ruby-lang
apeiros has joined #ruby-lang
greenarrow has joined #ruby-lang
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<maloik_>
I work at a hosting company that does so, but I doubt I'll be able to help as that's not exactly what I do here
<maloik_>
oh he's left..
zarubin has quit []
ikrima has joined #ruby-lang
Iskarlar has joined #ruby-lang
yatish27 has joined #ruby-lang
AKASkip has joined #ruby-lang
yatish27 has quit [Ping timeout: 272 seconds]
matp has quit [Quit: ZZZzzz…]
diegoviola has quit [Quit: WeeChat 1.0]
francisfish has joined #ruby-lang
Newbie0086 has joined #ruby-lang
riffraff has joined #ruby-lang
chussenot has joined #ruby-lang
sMecKs has quit [Read error: Connection reset by peer]
skammer2 has joined #ruby-lang
ta has joined #ruby-lang
riffraff has quit [Client Quit]
ur5us has quit [Remote host closed the connection]
charliesome has quit [Quit: zzz]
robbyoconnor has quit [Quit: Konversation terminated!]
migbar has joined #ruby-lang
mikecmpbll has joined #ruby-lang
robbyoconnor has joined #ruby-lang
skammer2 has quit [Ping timeout: 240 seconds]
migbar has quit [Ping timeout: 244 seconds]
charliesome has joined #ruby-lang
bsvineeth has quit [Remote host closed the connection]
elia has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
Paul_McFreely has joined #ruby-lang
charliesome has quit [Quit: zzz]
j4cknewt has joined #ruby-lang
Ghis_ has joined #ruby-lang
wallerdev has quit [Quit: wallerdev]
michd is now known as MichD
andrewvo1 has joined #ruby-lang
andrewvo1 has left #ruby-lang ["WeeChat 0.4.0"]
tobiassvn has joined #ruby-lang
fumduq has joined #ruby-lang
fumduq has quit [Client Quit]
fumduq has joined #ruby-lang
danijoo_ has quit [Ping timeout: 250 seconds]
marr has joined #ruby-lang
danijoo has joined #ruby-lang
bruno- has joined #ruby-lang
skammer2 has joined #ruby-lang
arBmind1 has quit [Quit: Leaving.]
migbar has joined #ruby-lang
bruno- has quit [Ping timeout: 258 seconds]
skammer2 has quit [Ping timeout: 240 seconds]
mlangenberg has joined #ruby-lang
qba73 has joined #ruby-lang
migbar has quit [Ping timeout: 258 seconds]
<mlangenberg>
In RSpec passing a block that passes to a pending spec outputs ‘FIXED’. Is there an equivalent for MiniTest?
<mlangenberg>
Because ‘skip’, just skips without running the test.
arBmind has joined #ruby-lang
workmad3 has joined #ruby-lang
<maloik_>
I don't get your question mlangenberg... you want to run the test, but you don't care about the result, is that it?
<mlangenberg>
Yes, but I do care if it passes in the future.
<maloik_>
personally I'd just skip it and try it every once in a while
<maloik_>
something else you can do is remote the assertion and just output the result of the check
<maloik_>
as in, to use rspec terms, `expect(foo).to eq(bar)` becomes `puts foo == bar` and the test will pass but it'll still display what you want
<maloik_>
s/remote/remove/
ur5us has joined #ruby-lang
bsvineeth has joined #ruby-lang
<mlangenberg>
maloik_: well I’ve got a test that fails becaue of a Rails bug. I added a workaround, but would like to keep the pending (=FAIL) test until a newer Rails version fixes the bug.
<mlangenberg>
In RSpec I would just do: pending { expect(foo).to eq(bar) }
<mlangenberg>
And when foo == bar, it will print FIXED
<mlangenberg>
In MiniTest, skip actually skips these tests.
<yorickpeterse>
cherry blues, cherry greens and me on topre
<yorickpeterse>
prrft cherry peasantry
<yorickpeterse>
errr s/blues/reds actually
tkuchiki has quit [Remote host closed the connection]
ldnunes has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dangerousdave has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
j4cknewt has joined #ruby-lang
dangerousdave has quit [Client Quit]
arBmind has quit [Ping timeout: 245 seconds]
bsvineeth has joined #ruby-lang
j4cknewt has quit [Ping timeout: 245 seconds]
danijoo has quit [Read error: Connection reset by peer]
danijoo has joined #ruby-lang
Iskarlar has joined #ruby-lang
yfeldblum has quit [Ping timeout: 272 seconds]
greenarrow has quit [Quit: 500]
elia has quit [Quit: Computer has gone to sleep.]
tkuchiki has joined #ruby-lang
greenarrow has joined #ruby-lang
chussenot has quit [Quit: chussenot]
Iskarlar has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chussenot has joined #ruby-lang
Iskarlar has joined #ruby-lang
bruno- has quit [Ping timeout: 245 seconds]
karamazov has joined #ruby-lang
Iskarlar has quit [Client Quit]
tkuchiki has quit [Remote host closed the connection]
toertore has joined #ruby-lang
yalue has joined #ruby-lang
spastorino has joined #ruby-lang
chussenot has quit [Quit: chussenot]
arBmind has joined #ruby-lang
yfeldblum has joined #ruby-lang
danrage77 has joined #ruby-lang
j4cknewt has joined #ruby-lang
chussenot has joined #ruby-lang
chussenot has quit [Client Quit]
yfeldblum has quit [Ping timeout: 260 seconds]
robbyoconnor has quit [Excess Flood]
robbyoconnor has joined #ruby-lang
chussenot has joined #ruby-lang
chussenot has quit [Client Quit]
tkuchiki has joined #ruby-lang
thomasxie has joined #ruby-lang
banister has quit [Read error: Connection reset by peer]
banister_ has joined #ruby-lang
yfeldblum has joined #ruby-lang
skammer3 has joined #ruby-lang
skammer2 has quit [Ping timeout: 272 seconds]
yfeldblum has quit [Ping timeout: 260 seconds]
Ghis_ has quit [Ping timeout: 260 seconds]
Forgetful_Lion has joined #ruby-lang
elia has joined #ruby-lang
<maloik_>
topre?
<maloik_>
whats topre
mkaesz has joined #ruby-lang
dangerousdave has joined #ruby-lang
<yorickpeterse>
switch type
<yorickpeterse>
basically rubber dome + mechanical
elia has quit [Quit: Computer has gone to sleep.]
yatish27 has joined #ruby-lang
stef_204 has joined #ruby-lang
elia has joined #ruby-lang
symm- has quit [Ping timeout: 272 seconds]
miqui has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mkaesz has quit [Ping timeout: 246 seconds]
symm- has joined #ruby-lang
Forgetful_Lion has quit [Remote host closed the connection]
dangerousdave has joined #ruby-lang
mlangenberg has left #ruby-lang [#ruby-lang]
kgrz has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 245 seconds]
hagabaka has quit [Ping timeout: 246 seconds]
kwd has quit [Quit: Sleeping now. ZZZzzz…]
hagabaka has joined #ruby-lang
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oleo has joined #ruby-lang
sepp2k has joined #ruby-lang
yfeldblum has joined #ruby-lang
CorrosiveOne has joined #ruby-lang
relix has joined #ruby-lang
yfeldblum has quit [Ping timeout: 258 seconds]
enkristoffer has joined #ruby-lang
arooni-mobile has joined #ruby-lang
joast has quit [Quit: Leaving.]
charliesome has quit [Quit: zzz]
chills42 has quit [Remote host closed the connection]
Iskarlar has joined #ruby-lang
chouhoulis has joined #ruby-lang
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ducklobster has joined #ruby-lang
yfeldblum has joined #ruby-lang
klmlfl has joined #ruby-lang
cmhobbs_ has joined #ruby-lang
Zurav has joined #ruby-lang
cmhobbs_ has quit [Client Quit]
cmhobbs_ has joined #ruby-lang
<[spoiler]>
Hmm
yfeldblum has quit [Ping timeout: 246 seconds]
cmhobbs_ has quit [Client Quit]
<[spoiler]>
yorickpeterse, what's the benefits of using a mechanical keyboard? A colleague at work lent me his (he's a sys. admin) to give it a test-run, but idk; I didn't see a big difference, apart from the fact it generated more noise
cmhobbs has joined #ruby-lang
<[spoiler]>
Apparently it's easier on the fingers, but I didn't really feel that much of a difference
<Zurav>
I'm receiving a NoMethodError ... undefined method `bytesize' when attempting to call .each on a custom class in my Sinatra app. I am able to do this just fine in irb, but when it executes within the app, nada
<[spoiler]>
Zurav, example of your IRB code and the code you're using in Sinatra would help
<Zurav>
alright, back with that soon
elico has quit [Remote host closed the connection]
<[spoiler]>
Zurav, of the top of my head, I'd say your method isn't returning a string, and Sinatra expects once
<[spoiler]>
try adding `return "I beg you to work"` at the end of the method (or just omit the return if you're a purist)
<yorickpeterse>
[spoiler]: depending on the switch type, easier on the fingers, more pleasant feel
workmad3 has joined #ruby-lang
<yorickpeterse>
With rubber domes you, especially once they wear off, you might have to start typing with your fists at some point
ta has quit [Remote host closed the connection]
<yorickpeterse>
mechanicals typically only take a little bit of force for the keys to be pressed down
<yorickpeterse>
I'm still not sure if I like Topre that much though, they're just a tiny bit too stiff
<Zurav>
spoiler, you were correct
<[spoiler]>
yorickpeterse, oh I'm aware that rubber ones become "harder" eventually, yeah.
<Zurav>
returning a string solved it
<yorickpeterse>
if you have cherry blues/reds you basically just look at the keys and they press themselves
<[spoiler]>
yorickpeterse, LOL
dangerousdave has joined #ruby-lang
<[spoiler]>
yorickpeterse, I am a clumsy typist, maybe it's a good thing I need to apply a bit of force to press my keys :P
<[spoiler]>
Zurav, yay! :D
_elia has joined #ruby-lang
<[spoiler]>
Zurav, if it's something inside of a `<insert http method name here> 'route' do` block, then it needs to return a string
CorrosiveOne has quit [Quit: I was drunk last time I set this message]
<[spoiler]>
Why, you might ask thyself, because Rack said so, and we don't question Rack's methodology. :-)
enkristoffer has quit [Quit: ❤]
Zurav has quit [Ping timeout: 246 seconds]
nathanstitt has joined #ruby-lang
elia has quit [Ping timeout: 272 seconds]
joast has joined #ruby-lang
charliesome has joined #ruby-lang
loincloth has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arBmind1 has joined #ruby-lang
arBmind has quit [Ping timeout: 272 seconds]
kgrz has joined #ruby-lang
j4cknewt has quit [Remote host closed the connection]
<yorickpeterse>
[spoiler]: actually, less force would make you type easier
<yorickpeterse>
since you can much more easily move your fingers around
<[spoiler]>
Hmm. I might get one to test it out, I guess
<yorickpeterse>
Never tried those layouts. The annoying thing with these keyboards is that you can never test drive them
<yorickpeterse>
Either you buy them, and risk not liking them, or you don't
<yorickpeterse>
there's no shop (at least here) where you can just mash on them before deciding
wallerdev has quit [Quit: wallerdev]
<yorickpeterse>
^ startup idea right there
<oddmunds>
yeah
<oddmunds>
the weird layout ones take some time to get used to as well
<yorickpeterse>
"Show HN: Keyboard.ly: Try mechanical keyboards before buying. Only in San Francisco"
<workmad3>
yorickpeterse: hmmm, could be rubber dome... thought they were cherry browns, but could easily be mistaken
<yorickpeterse>
workmad3: well, pull a cap and find out!
<workmad3>
yorickpeterse: I did get to try before I bought though... knew someone with the kb, so tried it out a bit before deciding it was the way to go
<yorickpeterse>
Ah, I just had to gamble for it :/
<workmad3>
yorickpeterse: I tried... it's a stupidly difficult kb to find info out about :P
bruno- has joined #ruby-lang
tenderlove has joined #ruby-lang
<yorickpeterse>
bbl, I have some weird animal themed meeting
<yorickpeterse>
apparently I'm in "Team Orca"
<yorickpeterse>
I go on holidays for two weeks and all kinds of weird shit happens
Lewix has joined #ruby-lang
<workmad3>
fun
arooni-mobile has quit [Ping timeout: 246 seconds]
teleporting_cat has quit [Remote host closed the connection]
mkaesz has quit [Ping timeout: 272 seconds]
allomov has joined #ruby-lang
<Lewix>
hi
arBmind has joined #ruby-lang
dangerousdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cmhobbs has joined #ruby-lang
cmhobbs has quit [Changing host]
cmhobbs has joined #ruby-lang
klmlfl has joined #ruby-lang
relix has joined #ruby-lang
sarkyniin has joined #ruby-lang
bradcliffe has joined #ruby-lang
chris2 has joined #ruby-lang
yfeldblum has joined #ruby-lang
yfeldblum has quit [Ping timeout: 244 seconds]
centrx has quit [Quit: The plan is programmed into every one of my one thousand robots]
mskaesz has quit [Read error: Connection reset by peer]
mkaesz has joined #ruby-lang
ruby-lang522 has joined #ruby-lang
<ruby-lang522>
Hello :D
chills42 has joined #ruby-lang
<jhass>
hi
kgrz has quit [Remote host closed the connection]
karamazov has quit [Remote host closed the connection]
ruby-lang522 has quit [Ping timeout: 246 seconds]
karamazov has joined #ruby-lang
centrx has joined #ruby-lang
arooni-mobile has joined #ruby-lang
bantic has joined #ruby-lang
mkaesz has quit [Ping timeout: 240 seconds]
arooni-mobile has quit [Read error: Connection reset by peer]
mkaesz has joined #ruby-lang
moepp has quit [Ping timeout: 250 seconds]
bruno- has joined #ruby-lang
<[spoiler]>
hai
yfeldblum has joined #ruby-lang
rcvalle has joined #ruby-lang
yfeldblu_ has joined #ruby-lang
arBmind has quit [Ping timeout: 272 seconds]
elia has quit [Ping timeout: 240 seconds]
arBmind has joined #ruby-lang
bruno- has quit [Ping timeout: 260 seconds]
yfeldblum has quit [Ping timeout: 244 seconds]
yfeldblu_ has quit [Ping timeout: 258 seconds]
moepp has joined #ruby-lang
omosoj has quit [Ping timeout: 260 seconds]
elia has joined #ruby-lang
ikrima has quit [Ping timeout: 245 seconds]
momomomomo has quit [Ping timeout: 245 seconds]
tectonic has joined #ruby-lang
klmlfl has quit [Remote host closed the connection]
kgrz has joined #ruby-lang
mustmodify has joined #ruby-lang
kgrz has quit [Remote host closed the connection]
yatish27 has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
hakunin has quit []
mkaesz has quit [Read error: Connection reset by peer]
mskaesz has joined #ruby-lang
<mustmodify>
This question is half-rails and half-ruby... but when I ask it on the rails channel I get crickets. So for now, let me see if I can get help understanding the Ruby part. In Rails, if I create a scope like this: `class User; scope :active, -> { where(active: 'true')}; end`, that somehow is the same as User.scope.where(active: 'true') ... meaning that inside that lambda, 'where' is an in-scope message. How do I take a lambda and say "OK apply that with
<mustmodify>
My ultimate goal is to have ( using the example) a UserSearch class that builds an array of lambdas, applies each and returns the resulting scope.
yatish27 has quit [Ping timeout: 260 seconds]
amsi has quit [Ping timeout: 272 seconds]
<jhass>
I think your message got cut off after "Ok apply that with
<[spoiler]>
Yep
<[spoiler]>
same here
<mustmodify>
jhass: I really wish my client would tell me when that was going to happen.
<[spoiler]>
I thought it might've continued into the next line, but it made no sense
<mustmodify>
"OK apply that with this scope"?
<jhass>
can you maybe make some pseudo code? I'm not sure I follow
<[spoiler]>
I'm not sure how you'd build an array of lambdas, unless you eval'd it
<jhass>
[-> { }, -> { }] ?
<[spoiler]>
but that's a literal
jds has joined #ruby-lang
<mustmodify>
sure, one moment.
jkyle has joined #ruby-lang
<jkyle>
I have some rake tasks exclusively for development. They use some gems that are also only used in development. When we deploy, other rake tasks get run on the destination server and fail since the development gems are being required, but not used. What can I do to avoid this error while not installing development gems on a production server?
<mustmodify>
jhass: That's a good question. I've done that before... there must be some reason I'm not doing it here.
tkuchiki has quit [Ping timeout: 272 seconds]
<mustmodify>
hm...
<[spoiler]>
What is the reason? :-)
<mustmodify>
yeah, that's a good question.
<mustmodify>
Well, I like the idea of creating an array and applying it better, but that's not enough to justify doing that. :P
<[spoiler]>
jhass's (check out my paresltongue) suggestion is pretty solid
<mustmodify>
yep, that's what I'll do.
<[spoiler]>
mustmodify, you could create the array and iterate over it, I guess
snoopybbt has quit [Ping timeout: 245 seconds]
<jhass>
I mean you could do something like conditions.inject(User) {|scope, condition| scope.instance_eval(&condition) }
<mustmodify>
spoiler: it's not creating the array that causes the problem... it's that I don't know how to apply that array in the right scope. But for now, I'll go with jhauss's's's's suggestion.
<jhass>
but it seems totally overkill here
mkaesz has joined #ruby-lang
mskaesz has quit [Read error: Connection reset by peer]
banister has quit [Ping timeout: 272 seconds]
<mustmodify>
jhass: sure.
yatish27 has joined #ruby-lang
banister has joined #ruby-lang
klmlfl has joined #ruby-lang
<mustmodify>
My tests already include example of SQL injection and I'm confident that it's not vulnerable, but want to get your feedback anyway... what attack would you use on the (newly updated) third example, why_not_this.rb ?
dangerousdave has joined #ruby-lang
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<jhass>
that's exactly what I meant with bind variables
Technodrome has joined #ruby-lang
<Technodrome>
why can’t you do Object.puts(‘hey there’) ?
<Technodrome>
isn’t it just a class method and the Object classi s imported already?
<[spoiler]>
because Object references a class
<jhass>
Technodrome: puts is a module function on Kernel as well as a instance method on IO
<jhass>
it's not a class method on Object but Object does include Kernel
mustmodify has left #ruby-lang [#ruby-lang]
mustmodify has joined #ruby-lang
<Technodrome>
so why does Object.send work for it?
<Technodrome>
I always wondered thsi
<jhass>
because it's a private method in Kernel
<jhass>
compare to public_send
<jhass>
a private method is a method that can't be called with an explicit receiver
<Technodrome>
yes i get that, but how does the send work at the Object class level?
<Technodrome>
yes
<Technodrome>
Kernel.puts("hey")
<Technodrome>
this works fine
<jhass>
yes, as said it's a module_function on Kernel
<jhass>
module_function copies a method as a class method
<Technodrome>
what is module_function ? the name of the C function to create it?
<Technodrome>
jhass: so because Class inherits from Kernel , its availble in an instance of Object?
<jhass>
Technodrome: no
kimegede has joined #ruby-lang
<jhass>
Technodrome: Object.new is an instance of class Object, but Object is an instance of class Class. Class is a subclass of Module and Module is subclass of Object. Object does _include_ Kernel
amsi has joined #ruby-lang
<jhass>
yes, that's self-referential at this point in the object model
kimegede has quit [Client Quit]
gnufied has quit [Ping timeout: 260 seconds]
tdy has quit [Remote host closed the connection]
DEac- has quit [Quit: Lost terminal]
DEac- has joined #ruby-lang
Xney has joined #ruby-lang
lcdhoffman has joined #ruby-lang
kimegede has joined #ruby-lang
gnufied has joined #ruby-lang
moepp has quit [Ping timeout: 250 seconds]
imkmf_ has quit [Ping timeout: 245 seconds]
imkmf has quit [Ping timeout: 244 seconds]
omosoj has joined #ruby-lang
kimegede has quit [Quit: Leaving...]
emmesswhy has joined #ruby-lang
fusillicode has quit [Quit: Leaving.]
fusillicode has joined #ruby-lang
wkoch has quit [Quit: wkoch]
wkoch has joined #ruby-lang
miqui has quit [Remote host closed the connection]
ikrima has joined #ruby-lang
imkmf has joined #ruby-lang
imkmf_ has joined #ruby-lang
Squarepy has joined #ruby-lang
imkmf__ has joined #ruby-lang
Squarepy has quit [Remote host closed the connection]
Squarepy has joined #ruby-lang
imkmf_ has quit [Ping timeout: 272 seconds]
imkmf_ has joined #ruby-lang
imkmf has quit [Ping timeout: 240 seconds]
bradcliffe has quit [Remote host closed the connection]
jbardin has joined #ruby-lang
elico has quit [Quit: Leaving.]
IPGlider has quit []
elia has quit [Quit: Computer has gone to sleep.]
tbuehlmann has joined #ruby-lang
chouhoul_ has joined #ruby-lang
elia has joined #ruby-lang
yatish27 has quit [Remote host closed the connection]
<oddmunds>
yorickpeterse: thanks for the armstrong link
xybr_ is now known as xybre
<yorickpeterse>
oddmunds: heh, I loved the part where he goes on about Grunt, gruntfiles, bakefiles, makefiles, rakefiles, etc
chouhoulis has quit [Ping timeout: 245 seconds]
<yorickpeterse>
really does show the insanity of all these Xfiles
<yorickpeterse>
(no pun intended there regarding the series)
<yorickpeterse>
Only a matter of time before we have a Filefile that provides a unified format for all the other *files
yatish27 has joined #ruby-lang
<yorickpeterse>
and of course a Filefile.lock
<oddmunds>
:)
dwknoxy is now known as dknox-lunch
itsraining has quit [Quit: itsraining]
yatish27 has quit [Remote host closed the connection]
yatish27 has joined #ruby-lang
danrage77 has quit [Remote host closed the connection]
yfeldblu_ has quit [Remote host closed the connection]
chills42 has quit [Remote host closed the connection]
yfeldblum has joined #ruby-lang
yfeldblum has quit [Remote host closed the connection]
yatish27 has quit [Ping timeout: 240 seconds]
yfeldblum has joined #ruby-lang
omosoj has quit [Ping timeout: 245 seconds]
netlogics has joined #ruby-lang
Lewix has quit [Remote host closed the connection]
hagabaka has quit [Ping timeout: 240 seconds]
<yorickpeterse>
bah, neighbours downstairs doing the laundry and my entire place is shaking
<yorickpeterse>
<insert "first world problems" joke>
fusillicode has quit [Ping timeout: 272 seconds]
hagabaka has joined #ruby-lang
karamazov has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
karamazov has joined #ruby-lang
karamazov has quit [Read error: Connection reset by peer]
karamazov has joined #ruby-lang
shinnya has joined #ruby-lang
karamazov has quit [Ping timeout: 272 seconds]
tkuchiki has joined #ruby-lang
netlogics has quit []
chussenot has joined #ruby-lang
netlogics has joined #ruby-lang
MichD is now known as michd
tkuchiki has quit [Ping timeout: 258 seconds]
whippythellama has quit [Quit: whippythellama]
bin7me has quit [Read error: Connection reset by peer]
stef_204 has joined #ruby-lang
Swooop has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
stef_204 has quit [Client Quit]
klmlfl has quit [Remote host closed the connection]
Technodrome has quit [Quit: Technodrome]
chouhoul_ has quit [Remote host closed the connection]
mustmodify has left #ruby-lang [#ruby-lang]
<soahccc>
I've got some problems with thread scheduling on 2.0... I'm using a Monitor to synchronize async calls to the main thread. Sometimes the thread takes forever to aquire the lock. I've illustrated the problem here: https://gist.github.com/2called-chaos/cab6909f8e987ee40bd9 Any ideas why that happens?
lcdhoffman has quit [Quit: lcdhoffman]
<|jemc|>
how many threads are contending over the lock?
sarkyniin has quit [Quit: Quitte]
<jhass>
soahccc: I don't think your example reproduces
tectonic has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<|jemc|>
(and how long does each thread hold onto it)?
<|jemc|>
depending on what you're doing (which I have no idea about at this point), you may find it works better to dump tasks into a Queue and have your 'main' thread consume from the queue
<soahccc>
|jemc|: The main thread/loop does it's things all within the sychronize and then sleeps/Thread.pass'es (like in the illustration). At the moment I try to hunt down the bug and I've only got one thread waiting for the lock
<yorickpeterse>
soahccc: for one, there's no guarantee Thread.pass actually switches threads
<yorickpeterse>
plus it's totally useless outside of MRI
Technodrome has joined #ruby-lang
<soahccc>
yeah I'm aware that this is MRI specific. But I've got a 0.25 second sleep, that should work no?
<|jemc|>
heh, there are still no guarantees about thread shceduling
<soahccc>
I had the idea that maybe the monitor wants to be called via conditional variable but it might be the wrong path
<yorickpeterse>
Your problem here looks to be that the main thread and the background thread are fighting for the lock at the same time
<yorickpeterse>
basically the main thread is going crazy with locking/unlocking
<|jemc|>
soahcc ConditionVariable is a solution to the problem where you want to type sleep(until_x_happens)
<yorickpeterse>
at any given point during that the background thread comes along and says "oi, gimme the lock"
<|jemc|>
so if that sounds like your problem it may indeed be what you want
<yorickpeterse>
but it might still be locked at that point, and that might also be the case for the next 100 times it checks
allomov has quit [Remote host closed the connection]
AKASkip has quit [Ping timeout: 258 seconds]
<|jemc|>
or maybe I should have said: sleep(until_i_wake_you_up)
relix has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<yorickpeterse>
You would have to perform _all_ work inside the synchronize block
<yorickpeterse>
Only then can you guarantee exclusive access to whatever the lock wraps
<soahccc>
:/ that is unfortune but even if I would use a queue, same problem basically (just that the time frame would be smaller)
<yorickpeterse>
What problem are you trying to solve?
<soahccc>
Currently my main loop takes (measured) <1ms and therefore sleeps almost all the 0.25 seconds. Shouldn't the thread which is waiting for the lock permanently at some point get the lock? I'm still not confident that this is the bug. Since it works most of the time
<yorickpeterse>
(not this particular gist, but in the real world)
<|jemc|>
soahccc: well, the example you gave seems to work as expected
<|jemc|>
and we're not looking at your code
<jhass>
it smells like producer consumer, so a queue if used properly should solve it
<jhass>
but we still don't know anything about you real problem, so all that has been said so far is only guesswork
sepp2k has quit [Quit: Leaving.]
<soahccc>
produce/consumer still requires locking and this seems to be the problem. I could link the project but you will punch me for that code :D
sepp2k has joined #ruby-lang
<jhass>
no, a properly implemented producer/consumer won't suffer from the problems a "i try to sleep just long enough" solution does
<jhass>
and I think that's what you experience
<|jemc|>
soahccc: you're probably not going to solve this problem of threads accessing a shared resource in Ruby in a way that doesn't use a lock in some way - so yes, a Queue uses a lock internally but it uses it differently than you seem to be using it
<jhass>
doesn't a queue use a semaphore to wait?
<jhass>
I'd hope so
mark07 has joined #ruby-lang
<jhass>
also maybe you want a SizedQueue, we still can only guess
<soahccc>
So my concerns are things like "writing to log" or "invoking commands in a process". Would I have to extract that into producer/consumer each for one thing?
<|jemc|>
so you're not sleeping at all if your 'tick' took too long
<soahccc>
|jemc|: Yeah I measured that the tick is not taking more than 1ms but I just say that I stupid idiot are sleeping inside the sync >.<
chussenot has quit [Client Quit]
<soahccc>
s/say/saw
<|jemc|>
oh, is app.sync your monitor synchronize?
Lewix has joined #ruby-lang
<|jemc|>
because if so, you're sleeping inside your monitor synchronize
<|jemc|>
meaning you still hold the lock
<soahccc>
yeah it is... I was blind, looking on that for an hour
<|jemc|>
and no other thread can wrest it from your cold, sleeping hands
chussenot has joined #ruby-lang
netlogics has left #ruby-lang [#ruby-lang]
<Technodrome>
jhass: can you help me understand that Object.puts thing again?
<jhass>
Technodrome: I think there's no point in repeating what I said already. So what's your question?
<Technodrome>
I’m sorry
<Technodrome>
I just still don’t understand
<|jemc|>
jhass: Queue is implemented in terms of Mutex and ConditionVariable
<jhass>
Technodrome: so you do see the Object::puts is defined, just as private?
<soahccc>
Thanks anyway. Maybe I'll should do some things different but this project was never supposed to do what it does today.
<jhass>
|jemc|: which both reduce to a semaphore :P But what I mean is proper block/notify behavior which ConditionVariable provides
wallerdev_ has quit [Quit: wallerdev_]
<|jemc|>
jhass: yes
<Technodrome>
jhass: yes
<Technodrome>
and the real puts method is defined in Kernel
face has quit [Ping timeout: 244 seconds]
<jhass>
okay. Did you understand module_function so far?
face has joined #ruby-lang
<soahccc>
I'm astonished that I brought it that far considering that I iterate over numbers because I suck at math so badly :D
<jhass>
many good programmers suck at math. At least that's my only hope :P
certainty has quit [Ping timeout: 240 seconds]
<|jemc|>
soahccc: but yeah, it's a good example of when you're looking at your model of a problem and can't figure out why it's not working because you overlooked something in your model :)
<Technodrome>
I did not quite grasp what module_function is doing
<jhass>
okay, so you do understand that if you do module Foo; def bar; end; end; you can't do Foo.bar ?
<jhass>
and if you do module Foo; def self.bar; end; end; you can't do class Baz; include Foo; end; Baz.new.bar nor Baz.bar ?
<mark07>
|jemc|: hi, I was thinking about your suggestion for easyoptions not using global variables... you suggested wrapping the options and args with a class.... any particular reason not using a module instead? is it just because of the "::"?
wallerdev_ has joined #ruby-lang
* mark07
still think what's the less ugly way than global vars
<jhass>
so many features with such a simple statement!
<mark07>
jhass: the "problem" is: easyoptions provide two vars, $options and $arguments, after parsing command line arguments, you can guess what they are for (otherwise I think it's not so 'easy' as I thought)... the problem is finding a replacement because global vars "should be avoided"
certainty has quit [Ping timeout: 240 seconds]
<mark07>
jhass: just saw your last code... well, hmmm.... dunno :)
<jhass>
haha, and I thought you write another curl wrapper all the time :P
<mark07>
not last
kgrz has quit [Ping timeout: 250 seconds]
_lexjm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mark07>
why did you think "easyoptions" was related to curl? :)