MaksimPinigin has quit [Ping timeout: 248 seconds]
orbyt_ has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
MaksimPinigin has joined #ruby
kapil___ has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
marxarelli|afk is now known as marxarelli
maum has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has quit [Ping timeout: 248 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ruby
alfiemax has joined #ruby
NightMonkey has quit [Ping timeout: 248 seconds]
cschneid_ has joined #ruby
cschneid_ has quit [Ping timeout: 248 seconds]
oleo has quit [Quit: Leaving]
ta_ has quit [Ping timeout: 265 seconds]
cschneid_ has joined #ruby
troys has quit [Quit: Bye]
phate408 has quit [Remote host closed the connection]
bronson has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
cschneid_ has quit [Ping timeout: 264 seconds]
bronson has quit [Ping timeout: 256 seconds]
LocaMocha has joined #ruby
anisha has joined #ruby
govg has quit [Ping timeout: 268 seconds]
meinside has joined #ruby
eckhardt has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
govg has joined #ruby
goatish has joined #ruby
avelldiroll has quit [Quit: WeeChat 1.6]
alfiemax has quit [Remote host closed the connection]
avelldiroll has joined #ruby
drcode has quit [Ping timeout: 260 seconds]
marxarelli is now known as marxarelli|afk
KeyJoo has joined #ruby
NightMonkey has joined #ruby
alfiemax has joined #ruby
edwardly has quit [Ping timeout: 276 seconds]
drewmcmillan has joined #ruby
kke has quit [Changing host]
kke has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
yeticry has quit [Ping timeout: 248 seconds]
apeiros has quit [Ping timeout: 248 seconds]
rabajaj has joined #ruby
yeticry has joined #ruby
ur5us has joined #ruby
tectonic has joined #ruby
drewmcmillan has joined #ruby
drewmcmillan has quit [Client Quit]
conta has joined #ruby
bronson has joined #ruby
dionysus69 has joined #ruby
Ltem has joined #ruby
alex`` has joined #ruby
bronson has quit [Ping timeout: 276 seconds]
ta_ has quit [Ping timeout: 276 seconds]
alex`` has quit [Quit: WeeChat 1.9]
darkhanb has joined #ruby
drewmcmillan has joined #ruby
drewmcmillan has quit [Client Quit]
mkroman has quit [Ping timeout: 240 seconds]
mkroman has joined #ruby
ramfjord has joined #ruby
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
govg has quit [Ping timeout: 256 seconds]
terens has joined #ruby
govg has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
sundhell_away is now known as sundhell
goatish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has joined #ruby
Pgouv_ has joined #ruby
terens has quit [Ping timeout: 252 seconds]
justicefries has joined #ruby
zautomata has joined #ruby
ana_ has joined #ruby
apeiros has joined #ruby
Burgestrand has joined #ruby
Dimik has joined #ruby
_main_ has joined #ruby
phaul has joined #ruby
__main__ has quit [Ping timeout: 260 seconds]
_main_ is now known as __main__
__main__ has quit [Read error: Connection reset by peer]
<dminuoso>
Burgestrand: Interesting, I did not expect that.
aufi has joined #ruby
__main__ has joined #ruby
<Burgestrand>
dminuoso I've always considered private/protected in Ruby more as guidelines than hard rules, turns out private constants aren't exempt from that :D
<dminuoso>
Burgestrand: Honestly its way too easy to break basic principles that enforce good design.
r3kz has quit [Quit: Connection closed for inactivity]
iamarun has quit [Ping timeout: 276 seconds]
guardianx has joined #ruby
TomyWork has joined #ruby
<Burgestrand>
dminuoso Well, I disagree :D restricted by default with a roundabout workaround is a nice way of going about it. It's hard to accidentally do something against the design, unless you're copy-pasting from stackoverflow in which case you're already out on a limb not even considering you're about the break some rules
alex`` has joined #ruby
iamarun has joined #ruby
ta_ has joined #ruby
<Burgestrand>
That said, in practice I don't really care, can't say it's made or broken my day more than possibly a few times…
<dminuoso>
Burgestrand: If you have to resort to breaking design boundaries, then clearly the design is wrong in the first place. Any further development is likely shoehorning new features into said, already shoehorned, design.
ta_ has quit [Remote host closed the connection]
ta_ has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Burgestrand>
I'm mainly doing mobile development nowadays, more often than not I've had to submit pull requests, wait a few days and then update dependencies just to get around something not being visible publicly, with the only reason it not being public was that nobody had needed it before
bronson has joined #ruby
<Burgestrand>
dminuoso Sure, but I don't think I've ever come across a perfect design because circumstance change
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 248 seconds]
halt has joined #ruby
halt is now known as Guest64438
claudiuinberlin has joined #ruby
jnyw has joined #ruby
zautomata has quit [Read error: Connection reset by peer]
mark_66 has joined #ruby
zautomata has joined #ruby
brent__ has quit [Quit: Connection closed for inactivity]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ledestin has joined #ruby
shinnya has quit [Ping timeout: 268 seconds]
Dimik has quit [Ping timeout: 240 seconds]
Pgouv_ has quit [Read error: Connection reset by peer]
juggler has joined #ruby
eckhardt has joined #ruby
<yeoman>
eam: thanks alot
jaruga has joined #ruby
tectonic has quit []
guardianx has quit []
lacour has quit [Quit: Leaving]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zautomata1 has joined #ruby
<yeoman>
is it just me or does rust look like it stole alot of ruby?
k0mpa has quit [Remote host closed the connection]
<dminuoso>
yeoman: no, its just basic functional programming.
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zautomata1 has quit [Ping timeout: 240 seconds]
hurricanehrndz has quit [Quit: Goodbye]
<dminuoso>
yeoman: A block in ruby is just a lambda expression, its mostly the same as proc or lambda (with just some subtle and minor differences), and a lambda expression is just a first class function.
<dminuoso>
so its no different than say lisps: (find p l)
<yeoman>
dminuoso: but this |param| stuff
<yeoman>
looks ruby
<yeoman>
i know it's basicially lambda
hurricanehrndz has joined #ruby
<dminuoso>
yeoman: Oh yeah thats probably inspired by Ruby. But I dont know how you get from there to "stealing a lot of ruby"
alfiemax has quit [Remote host closed the connection]
<yeoman>
lol, why is it crossed? the text
<dminuoso>
yeoman: It refers to the `do` keyword from back in the day.
<dminuoso>
yeoman: you used to be able to do `do f(...) |a| { ... }`
<dminuoso>
Which was semantically basically just `f(...) do |a| ... end`
<dminuoso>
(The former being Rust, the latter being Ruby)
alfiemax has joined #ruby
<dminuoso>
yeoman: But that syntax is less elegant than you might think if you consider a block being just a lambda expression, and it effectively being an argument.
<dminuoso>
because even in ruby `f(...) { ... }` is semantically: f(..., ->() { ...})
<dminuoso>
But the reasons for removal were related to closures and procedures, it was kind of messy.
mikhael_k33hl has quit [Ping timeout: 260 seconds]
ams__ has joined #ruby
tvw has joined #ruby
MaksimPinigin has quit [Ping timeout: 240 seconds]
Gnukpd has joined #ruby
jnollette has joined #ruby
tectonic_ has joined #ruby
marr has joined #ruby
sepp2k has joined #ruby
immune has quit [Ping timeout: 264 seconds]
zautomata1 has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
tectonic_ has quit []
MaksimPinigin has joined #ruby
ramfjord has joined #ruby
zautomata1 has quit [Ping timeout: 248 seconds]
cdg has joined #ruby
zautomata1 has joined #ruby
iamarun has quit [Ping timeout: 248 seconds]
cdg_ has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
cdg has quit [Ping timeout: 252 seconds]
cdg_ has quit [Ping timeout: 252 seconds]
iamarun has joined #ruby
Maximus580 has joined #ruby
<Maximus580>
Hi
<Maximus580>
Anyone here?
Maximus580 has quit [Client Quit]
John___ has joined #ruby
immune has joined #ruby
<yeoman>
2 minutes of waiting
tectonic_ has joined #ruby
ur5us has quit [Remote host closed the connection]
deadnull has joined #ruby
milardovich has joined #ruby
dhollin3 has joined #ruby
zautomata1 has quit [Quit: WeeChat 1.7]
dhollinger has quit [Ping timeout: 248 seconds]
Beams has joined #ruby
jnyw has quit [Quit: WeeChat 2.0.1]
tectonic_ has quit []
juggler has quit [Remote host closed the connection]
tectonic has joined #ruby
cdg has joined #ruby
ur5us has joined #ruby
Riddell has quit [Ping timeout: 240 seconds]
Burgestrand has quit [Quit: Closing time!]
cdg has quit [Ping timeout: 246 seconds]
bronson has joined #ruby
Riddell has joined #ruby
KeyJoo has quit [Ping timeout: 248 seconds]
bronson has quit [Ping timeout: 248 seconds]
guardianx has joined #ruby
biberu has joined #ruby
jameser_ has quit [Ping timeout: 256 seconds]
nemesit|znc has joined #ruby
ldnunes has joined #ruby
immune has quit [Ping timeout: 240 seconds]
elphe has quit [Ping timeout: 256 seconds]
guardianx has quit [Ping timeout: 248 seconds]
iamarun has quit [Remote host closed the connection]
iamarun has joined #ruby
aupadhye has quit [Ping timeout: 248 seconds]
biberu has quit []
biberu has joined #ruby
uZiel has quit [Remote host closed the connection]
guardianx has joined #ruby
justicefries has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
elphe has joined #ruby
cdg has quit [Ping timeout: 252 seconds]
yeoman is now known as Bish
terens has joined #ruby
<terens>
hello
elphe has quit [Ping timeout: 240 seconds]
uZiel has joined #ruby
apparition has joined #ruby
jottr has joined #ruby
<terens>
I receive messages from a socket using a custom format. Each message has a topic as a destination. Which is a good pattern to offload
<terens>
to handle this and separate them somehow ?
Troy2 has joined #ruby
meadmoon has joined #ruby
Troy2 has quit [Ping timeout: 255 seconds]
zwliew has joined #ruby
meadmoon has quit [Client Quit]
bronson has joined #ruby
elphe has joined #ruby
<canton7>
terens, publish-subscribe or chain or responsibility?
drcode has joined #ruby
jameser has joined #ruby
uZiel has quit [Remote host closed the connection]
bronson has quit [Ping timeout: 260 seconds]
iamarun has quit [Remote host closed the connection]
Riddell has quit [Ping timeout: 255 seconds]
Burgestrand has joined #ruby
uZiel has joined #ruby
miskatonic has joined #ruby
Riddell has joined #ruby
jameser_ has joined #ruby
walterheck has joined #ruby
ramfjord has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
jameser has quit [Ping timeout: 276 seconds]
mtkd has quit [Ping timeout: 276 seconds]
deadnull has quit [Quit: deadnull]
mtkd has joined #ruby
walterheck has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 240 seconds]
plexigras has joined #ruby
walterheck has joined #ruby
hfp_work has quit [Quit: bye]
ur5us has quit [Remote host closed the connection]
MyMind has joined #ruby
Sembei has quit [Ping timeout: 248 seconds]
alex`` has quit [Ping timeout: 255 seconds]
plexigras has quit [Ping timeout: 265 seconds]
guardianx has quit []
elphe has quit [Ping timeout: 260 seconds]
plexigras has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
mtkd has joined #ruby
<terens>
canton7, what do you mean ?
jottr has quit [Ping timeout: 248 seconds]
<canton7>
terens, two patterns which might be what you're after
<canton7>
*chain of responsibility
<terens>
hm ok thankz
<canton7>
(they're both on wikipedia)
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
cdg has quit [Ping timeout: 265 seconds]
terens has quit [Remote host closed the connection]
elphe has joined #ruby
plexigras has quit [Ping timeout: 265 seconds]
mrsolo has quit [Read error: Connection reset by peer]
mrsolo has joined #ruby
cschneid_ has joined #ruby
clemens3 has joined #ruby
plexigras has joined #ruby
plexigras has quit [Client Quit]
Troy2 has joined #ruby
plexigras has joined #ruby
milardovich has quit [Ping timeout: 265 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
KeyJoo has joined #ruby
drewmcmillan has joined #ruby
<dminuoso>
This does not sound like something in need of elaborate patterns.. ¯\_(ツ)_/¯
cschneid_ has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
Troy2 has quit [Ping timeout: 246 seconds]
walterheck has quit [Ping timeout: 240 seconds]
dcluna has quit [Read error: Connection reset by peer]
<canton7>
publish-subscribe is just a name for a hash of "name of topic" -> object which receives messages for that topic
_aeris_ has quit [Remote host closed the connection]
dcluna has joined #ruby
<apeiros>
*objects IMO
<canton7>
sure
Riddell has quit [Ping timeout: 248 seconds]
InfinityFye has joined #ruby
<canton7>
if the subscriber is the thing responsible for decoding the object, though, there's likely to be only one of them: you're not going to be decoding the same message twice independently
<apeiros>
I'd expect messages in a pubsub to be uniform
sleetdrop has quit [Quit: Computer has gone to sleep.]
ElFerna has joined #ruby
<apeiros>
at least from the view of the subscribers
Psybur has joined #ruby
bronson has joined #ruby
<canton7>
the original problem, as I understood it, was that he has a bunch of (say binary) messages coming in, differentiated by a string topic. He wants to decode those messages (you know how to decode a message based on its string topic), then do some message-specific processing on it
<apeiros>
ok
koenrh has quit [Ping timeout: 256 seconds]
_aeris_ has joined #ruby
Lyubo1 has quit [Ping timeout: 246 seconds]
jinie has quit [Ping timeout: 256 seconds]
Riddell has joined #ruby
Troy2 has joined #ruby
Lyubo1 has joined #ruby
llua has quit [Ping timeout: 256 seconds]
Psybur_ has joined #ruby
llua has joined #ruby
<canton7>
... so my suggestions were a bunch of decoders (one per possible topic value), that are registered with the thing that receives the messages. A received message is dispatched to the appropriate decoder for that topic. Another suggestion is chain of responsibility, where the decoders form a linked list, and a decoder either consumes a message (if it can handle it), or passes it onto the next decoder in the chain (if it cant')
bronson has quit [Ping timeout: 240 seconds]
jinie has joined #ruby
Riddell has quit [Changing host]
Riddell has joined #ruby
AJA4350 has joined #ruby
ElFerna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Psybur has quit [Ping timeout: 240 seconds]
<apeiros>
if the messages indeed are structurally different, then your approach is of course sensible. I'm not sure I'd call it pubsub, though. not sure how I'd call it. it's a form of delegation.
uZiel has quit [Ping timeout: 272 seconds]
<canton7>
publish-register? :P
<apeiros>
register seems a good term
<apeiros>
anyway, minutiae :D
Psybur_ is now known as Psybur
Psybur has quit [Changing host]
Psybur has joined #ruby
terens has joined #ruby
<terens>
canton7, ok that could work
vyorkin has joined #ruby
vyorkin has quit [Client Quit]
ElFerna has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
ElFerna has quit [Client Quit]
jameser has joined #ruby
xco has joined #ruby
xco has quit [Client Quit]
jeffreylevesque has quit [Ping timeout: 265 seconds]
ElFerna has joined #ruby
Gnukpd has quit [Quit: Leaving]
synthroid has joined #ruby
govg has quit [Ping timeout: 264 seconds]
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
ShalokShalom has joined #ruby
Beams has quit [Remote host closed the connection]
Beams has joined #ruby
ShalokShalom has quit [Remote host closed the connection]
raynold has joined #ruby
govg has joined #ruby
crst has joined #ruby
dain has joined #ruby
shinnya has joined #ruby
<crst>
Hi, this looks really strange to me. Does it make sense? supplier_fuel_price * (invoice_order_amount || order_amount)
<Xeago>
crst: what looks strange to you? Syntax or logic?
<crst>
Xeago: logic
<Xeago>
I'd deem it plausible but definitely frown-worthy without a comment.
<crst>
lol, that's a great comment actually
<crst>
it calcultes records ind a db table
Cyb3rCl4w has joined #ruby
chocoelho has joined #ruby
<crst>
what if both are present? or both are null
dain has left #ruby [#ruby]
<canton7>
(invoice_order_amount || order_amount) is an idiom to take invoice_order_amount if invoice_order_amount is not nil (or false), otherwise take order_amount
<dminuoso>
Xeago: That is not frown worthy at all.
<dminuoso>
Xeago: If that is not readily readable you are not comfortable with ruby yet. That code looks concise and clear, documentation would just be pointless noise.
<dminuoso>
It's a very common idiom.
milardovich has joined #ruby
<dminuoso>
crst: If both are nil you are out of luck, but that's what you get for working in a singly typed language. :-)
Cyb3rCl4w has left #ruby [#ruby]
bronson has joined #ruby
Troy2 has quit [Ping timeout: 240 seconds]
Ishido has joined #ruby
<crst>
dminuoso: thanks for the explanation, it makes more sense to me now
bluesmonk has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
<crst>
canton7 ^
milardovich has quit [Ping timeout: 264 seconds]
bronson has quit [Ping timeout: 240 seconds]
Troy2 has joined #ruby
plexigras has quit [Quit: WeeChat 2.0.1]
<dminuoso>
crst: what you could do is `factor = invoice_order_amount || order_amount; handle_error if factor.nil?; ... supplier_fuel_price * factor`
<dminuoso>
Kind of depends on whether you can assume order_amount to exist or not.
plexigras has joined #ruby
<crst>
dminuoso: There's not much reliability on the new project I'm working on. It's a mess to be honest and needs a big cleaning.
k0mpa has joined #ruby
jeffreylevesque has joined #ruby
<crst>
I have been working with laravel for last couple of months. Really happy working with rails again, though laravel is really ok
solocshaw has quit [Quit: solocshaw]
aupadhye has joined #ruby
LenPayne has quit [Ping timeout: 248 seconds]
bmurt has joined #ruby
zwliew has quit [Quit: Connection closed for inactivity]
plexigras has quit [Quit: WeeChat 2.0.1]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plexigras has joined #ruby
justicefries has joined #ruby
elphe has quit [Ping timeout: 240 seconds]
Troy2 has quit [Ping timeout: 248 seconds]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 246 seconds]
aupadhye has quit [Quit: Leaving]
cdg has joined #ruby
DTZUZO has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
phaul has quit [Ping timeout: 276 seconds]
cdg has quit [Ping timeout: 246 seconds]
nadir has quit [Quit: Connection closed for inactivity]
chocoelho has quit [Quit: chocoelho]
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
justicefries has joined #ruby
cdg has joined #ruby
laekur has joined #ruby
laekur has quit [Remote host closed the connection]
Puffball has joined #ruby
LenPayne has joined #ruby
TLAXKIT has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Press10>
Hey all. Brains not working today. How would I get an objects class name within said object instance method. self.class.name public_send(:class).name aren't giving me what I want (instance.class.name)
rippa has joined #ruby
<apeiros>
>> class Foo; def whatsmyname; self.class.name; end; end; Foo.new.whatsmyname
<ruby[bot]>
apeiros: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Press10>
I guess to_s works.
<apeiros>
>> class Foo; def whatsmyname; self.class.name; end; end; Foo.new.whatsmyname
<apeiros>
Press10: see ^, Module#name is correct. can't tell you why it doesn't work for you
oleo has joined #ruby
MaksimPinigin has quit [Quit: My computer went into sleep mode or I turned it off]
<Press10>
Ah silly mistake. I had a feeling my brain wasn't working. I placed self.class.name in initialize without a print statement and was just getting back the Foo instance, thinking thats what self.class.name was returning.
apeiros__ has quit [Read error: Connection reset by peer]
apeiros has quit [Ping timeout: 255 seconds]
Rapture has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
safetypin has joined #ruby
goatish has joined #ruby
dviola has joined #ruby
prutheus has joined #ruby
bronson has joined #ruby
<prutheus>
Hello. I am writing a Rails webapp where I want to run several scripts in background (via threads). THe problem is , i need to store the threads in database so I can start and stop them manually. But Marshal cant convert threads, so how could I do that?
<dminuoso>
prutheus: Serialize the process, not the code.
<prutheus>
what do you mean?
<dminuoso>
prutheus: serialize the state of computation
<dminuoso>
say
<dminuoso>
you have a thread that just increments a counter
<dminuoso>
you would just serialize the counter, and deserialize when you resume
<prutheus>
No that is not possible. I have a thread which do webscraping
<dminuoso>
prutheus: Why would that not be possible.
<prutheus>
I wanna launch several webscrapers via the interface
<prutheus>
The webscraper is a thread, not a counter
dhollin3 is now known as dhollinger
<dminuoso>
prutheus: The webscraper has internal state no?
<dminuoso>
maybe its a "list of websites to scrape"
<dminuoso>
so the state would be "which item has it compeleted last"
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bronson has quit [Ping timeout: 248 seconds]
InfinityFye has quit [Quit: Leaving]
<prutheus>
nono that is not possible. the webscraper already is done. very complex. I just need to run or stop him via his Class methods start or stop, which are handling a thread of him
huddy has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John___ has quit [Read error: Connection reset by peer]
jottr has joined #ruby
<dminuoso>
prutheus: Not following you. Uncomplexify your problem.
<prutheus>
Or is there any way I can perform the thread operation on a variable which is rails-servesided, so I mean my a which is SCRAPER_CLASS.new element, that is server-sided and I can access it from somewhere
<prutheus>
i am new to rails so I dont know where to put it to be global
<prutheus>
got it
<prutheus>
can store it globally with $ variables
cjs226 has joined #ruby
prutheus has quit [Quit: Page closed]
plexigras has joined #ruby
valkyr2e has quit [Ping timeout: 248 seconds]
troys has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
valkyr2e has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 264 seconds]
cschneid_ has joined #ruby
prutheus has joined #ruby
<prutheus>
Hey, its me again
<prutheus>
one more question to rails:
mtkd has quit [Ping timeout: 260 seconds]
<prutheus>
How can I create a method like the Controller defaults new method and route it, but it should take no controller argument. e.g. Recipes Controller should have a download method which route is /recipes/dowload , without a recipe id in route
<prutheus>
now, i always get a error at set_recipe scaffolded function with Couldn't find Recipe with 'id'=download
mtkd has joined #ruby
dareenzo has joined #ruby
dareenzo has quit [Quit: [BX] Gary Coleman uses BitchX. Whatchoo talkin bout foo?]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: Closing time!]
solocshaw has joined #ruby
synthroid has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 260 seconds]
bluesmonk has quit [Ping timeout: 268 seconds]
synthroid has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
jottr has joined #ruby
yokel has joined #ruby
amatas_ has joined #ruby
cdg has quit [Remote host closed the connection]
amatas_ has quit [Remote host closed the connection]
TLAXKIT has quit [Quit: Saliendo...]
aufi has quit [Quit: Leaving]
amatas_ has joined #ruby
bronson has joined #ruby
vondruch has joined #ruby
uZiel has joined #ruby
bronson has quit [Ping timeout: 256 seconds]
GremL1N2 has quit [Ping timeout: 268 seconds]
mark_66 has quit [Remote host closed the connection]
conta has quit [Ping timeout: 256 seconds]
cdg has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
FrostCandy has joined #ruby
<FrostCandy>
Hi all, I want to set up a hash that will sometimes not include some variables for sending an http post. So basically d={ var1 = var2 unless var2.nil? } exept this will still have the key var1, and I don't want var1 at all if var2 is nil
AJA4350 has quit [Ping timeout: 265 seconds]
eckhardt has joined #ruby
<FrostCandy>
maybe something like d = { (unless var2.nil? var1 = var2), (unless var4.nil? var3 = var 4) }
jottr has joined #ruby
nahra has quit [Remote host closed the connection]
[Butch] has joined #ruby
Troy2 has joined #ruby
theRoUS has quit [Read error: Connection reset by peer]
Troy2 has quit [Ping timeout: 260 seconds]
<FrostCandy>
rather d = { (unless var2.nil? var1 => var2 ), }
Puffball has quit [Ping timeout: 256 seconds]
rabajaj has quit [Remote host closed the connection]
prutheus has quit [Quit: Page closed]
n0m4d1c has joined #ruby
universa1 has quit [Ping timeout: 255 seconds]
universa1 has joined #ruby
reber has joined #ruby
<FrostCandy>
found it, d[:v] = "there" unless x.empty?
Puffball has joined #ruby
n0m4d1c has quit [Read error: Connection reset by peer]
n0m4d1c_ has joined #ruby
Puffball has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
sameerynho has quit [Ping timeout: 248 seconds]
troulouliou_dev has joined #ruby
ghoti_ is now known as ghoti
guille-moe has joined #ruby
knight33 has joined #ruby
drewmcmillan has quit [Read error: Connection reset by peer]
mrBen2k2k2k has quit [Max SendQ exceeded]
chouhoulis has quit [Remote host closed the connection]
drewmcmillan has joined #ruby
milardovich has joined #ruby
troulouliou_dev has quit [Quit: Leaving]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
milardovich has quit [Ping timeout: 264 seconds]
KeyJoo has quit [Read error: Connection reset by peer]
guille-moe has quit [Remote host closed the connection]
guille-moe has joined #ruby
brent__ has joined #ruby
KeyJoo has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
miskatonic has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
DTZUZO has joined #ruby
hanmac has quit [Ping timeout: 276 seconds]
mtkd has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
mtkd has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has joined #ruby
darkhanb has quit [Client Quit]
dionysus69 has quit [Ping timeout: 264 seconds]
jaruga has joined #ruby
tomphp has joined #ruby
sameerynho has joined #ruby
DTZUZO has quit [Ping timeout: 248 seconds]
solocshaw has quit [Quit: solocshaw]
darkhanb has joined #ruby
sameerynho has quit [Quit: WeeChat 1.9.1]
claudiuinberlin has joined #ruby
Gnukpd has joined #ruby
darkhanb has quit [Client Quit]
sameerynho has joined #ruby
hanmac has joined #ruby
mistergibson has quit [Quit: Leaving]
darkhanb has joined #ruby
zapata has quit [Ping timeout: 265 seconds]
zapata has joined #ruby
rrutkowski has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
bronson has joined #ruby
darkhanb_ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
alfiemax has quit [Remote host closed the connection]
eckhardt has joined #ruby
mistergibson has joined #ruby
darkhanb has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
orbyt_ has joined #ruby
rrutkowski has quit [Quit: rrutkowski]
rrutkowski has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
jeffreylevesque has quit [Ping timeout: 276 seconds]
milardovich has joined #ruby
sammi` has quit [Ping timeout: 240 seconds]
DoubleMalt has quit [Remote host closed the connection]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
bawNg has quit [Ping timeout: 260 seconds]
elphe has quit [Quit: leaving]
DoubleMalt has joined #ruby
cats has joined #ruby
raynold has joined #ruby
desperek has joined #ruby
Asher has quit [Ping timeout: 248 seconds]
sammi` has joined #ruby
SeepingN has joined #ruby
rrutkowski has quit [Quit: rrutkowski]
jottr has joined #ruby
sammi` has quit [Ping timeout: 256 seconds]
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
rrutkowski has joined #ruby
jottr has quit [Read error: Connection reset by peer]
miah has joined #ruby
Gnukpd has left #ruby ["Leaving"]
jenrzzz has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
guacamole has quit [Client Quit]
rrutkowski has quit [Client Quit]
Stazer has joined #ruby
Stazer has left #ruby [#ruby]
rrutkowski has joined #ruby
Stazer has joined #ruby
cjs226 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
FrostCandy has quit []
ams__ has quit [Quit: Connection closed for inactivity]
cjs226 has joined #ruby
milardovich has quit []
phaul has joined #ruby
jrp93 has joined #ruby
alex`` has quit [Ping timeout: 276 seconds]
Stazer has quit [Quit: Leaving.]
Stazer has joined #ruby
John___ has joined #ruby
Stazer has quit [Client Quit]
cdg_ has joined #ruby
Ltem has quit [Quit: good night]
Troy2 has joined #ruby
jamesaxl has quit [Quit: WeeChat 1.9.1]
Hexian has joined #ruby
ldnunes has quit [Quit: Leaving]
<Hexian>
anyone here have experience with using rb_gc_register_address (aka rb_global_variable) from C exts?
troulouliou_div2 has joined #ruby
ua has quit [Quit: Leaving]
jtdoncas has joined #ruby
<Hexian>
I have structs created in an extension which need to prevent GC from freeing a ruby proc which is used as a callback... I'd really like to do this efficiently without resorting to something slow like storing the objects in a hash, but using rb_gc_register_address only works on a static VALUE created from C, it does nothing on an object created by Ruby such as a block
<Hexian>
surely there should be a more efficient way to mark these ruby procs as referenced by the C extension
immune has joined #ruby
bronson has joined #ruby
pilne has joined #ruby
ta_ has joined #ruby
troys is now known as troys_
pastorinni has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
sammi` has joined #ruby
goatish has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Troy2 has quit [Ping timeout: 240 seconds]
<Hexian>
if I understand correctly, rb_gc_register_address doesn't work on a ruby created object because the VALUE passed to the C extension is a copy of the VALUE.. so what I actually need to know is how to get a pointer to the address of the actual ruby VALUE on the heap
sammi` has quit [Ping timeout: 240 seconds]
banko has joined #ruby
sepp2k has quit [Quit: Leaving.]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jtdoncas has quit [Ping timeout: 252 seconds]
minimalism has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
miskatonic has joined #ruby
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
justicefries has joined #ruby
justicefries has quit [Client Quit]
orbyt_ has joined #ruby
synthroid has quit [Remote host closed the connection]
orbyt_ has quit [Client Quit]
cdg has joined #ruby
cdg_ has quit [Ping timeout: 265 seconds]
jeffreylevesque has joined #ruby
alfiemax has quit [Remote host closed the connection]
FastJack has quit [Quit: leaving]
abra_ha_m has joined #ruby
abra_ha_m has quit [Client Quit]
weathermaker has joined #ruby
jenrzzz has quit [Ping timeout: 268 seconds]
fmcgeough has quit [Quit: fmcgeough]
jenrzzz has joined #ruby
jaruga has quit [Quit: jaruga]
Derperperd has quit [Ping timeout: 248 seconds]
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
alfiemax has joined #ruby
mtkd has quit [Ping timeout: 256 seconds]
cjs226 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
fmcgeough has joined #ruby
fmcgeough has quit [Client Quit]
justicefries has joined #ruby
npgm has joined #ruby
Derperperd has joined #ruby
Derperperd has quit [Changing host]
Derperperd has joined #ruby
jnyw has joined #ruby
alfiemax has quit [Remote host closed the connection]
troydm has quit [Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset]
ahrs has quit [Read error: Connection reset by peer]
quobo has joined #ruby
quobo has joined #ruby
quobo has quit [Changing host]
quobo has quit [Changing host]
quobo has joined #ruby
Kilobyte22 has quit [Ping timeout: 268 seconds]
ahrs has joined #ruby
yosafbridge has joined #ruby
Scient has joined #ruby
Kilobyte22 has joined #ruby
axsuul has quit [Ping timeout: 260 seconds]
selim has quit [Ping timeout: 260 seconds]
cjs226 has joined #ruby
mikeiniowa has quit [Ping timeout: 260 seconds]
<zenspider>
halp. I'm refactoring some stuff in minitest and I need a name.
selim has joined #ruby
axsuul has joined #ruby
marxarelli is now known as marxarelli|afk
<zenspider>
I've separated Result from Test, both subclass Runnable, and both include a module with some code they have in common. I'm currently calling it Minitest::Thingy but...maybe that's not the best name :P
<zenspider>
The module includes concrete impls of passed?, skipped?, result_code, and location.
drakko has joined #ruby
<zenspider>
passed? skipped? and result_code are all abstract methods on Runnable so I can't/won't push those up
<zenspider>
location? maybe but probably not because it currently has knowledge about Result
<zenspider>
Hexian: did you get it figured out?
goatish has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Hexian>
zenspider: yes, it wasn't clear that it's not about where the object came from but just that the pointer used for registration is static in memory
drakko has quit [Read error: Connection reset by peer]
jeffreylevesque has quit [Ping timeout: 268 seconds]
desperek has quit [Ping timeout: 240 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider>
you can also hold onto the proc in one of your structs and register THAT using TypeData_Make_Struct and friends
<zenspider>
if it's a 1-off proc then registering it as a global is fine
zachary12 has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
<Hexian>
yeah in this case I'm avoiding creating any ruby object to wrap my struct and the proc since that isn't needed, I just needed to be able to prevent GC from freeing it
<zenspider>
you can also stow away an array into a class const or class ivar and push them all into that... any valid object reference will do
postmodern has joined #ruby
troys_ is now known as troys
n0m4d1c has quit []
troulouliou_div2 has quit [Remote host closed the connection]
<Hexian>
that is slower, but looking at the ruby source.. rb_gc_unregister_address isn't gonna scale either
<zenspider>
do you have actual measurements showing that it matters? otherwise, it's mentarbation.
<zenspider>
if you're creating and registering so many procs that pushing them into an array is slowing you down, you might want to rethink things.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plexigras has quit [Ping timeout: 246 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
ricer2 has quit [Quit: Caught SystemExit exception.]
Troy2 has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
ricer2 has joined #ruby
ricer2 has quit [Client Quit]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ricer2 has joined #ruby
jeffreylevesque has joined #ruby
ErhardtMundt has quit [Remote host closed the connection]
rrutkowski has joined #ruby
ErhardtMundt has joined #ruby
alfiemax has joined #ruby
rrutkowski has quit [Client Quit]
ramfjord has quit [Ping timeout: 260 seconds]
rrutkowski has joined #ruby
jeffreylevesque_ has joined #ruby
cjs226 has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
jeffreylevesque has quit [Ping timeout: 248 seconds]
rrutkowski_ has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
rrutkowski_ has quit [Remote host closed the connection]
justicefries has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
Anyways, more seriously... You have a Result and a Test, both share concepts which are essentially result oriented like passed, skipped, result_code, and location?
<tectonic>
FactoryFactory
<zenspider>
OH FUCK YOU
<zenspider>
BOTH OF YOU
<zenspider>
:P
sanscoeu_ has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
rrutkowski has joined #ruby
bronson has quit [Ping timeout: 264 seconds]
<zenspider>
baweaver: yeah. currently: Runnable < Result < Test but I'm breaking the last two apart
<baweaver>
Test inherits from Result?
ramfjord has quit [Ping timeout: 256 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
(well, used to)
Vapez has quit [Remote host closed the connection]
<baweaver>
They seem like concepts that could be called a Status. Status of the test or of the test's result
<baweaver>
though it kinda feels like a Test has_a Result
miah has quit [Quit: Lost terminal]
sanscoeur has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
rrutkowski has quit [Client Quit]
eb0t has quit [Quit: WeeChat 1.9.1]
rrutkowski has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
zacts has quit [Quit: WeeChat 1.9.1]
<zenspider>
baweaver: yeah. Test#run -> Result
<baweaver>
Admittedly haven't read the minitest source before
<zenspider>
Originally it was Test#run -> self, but tests can do all sorts of shit that aren't serializable
<zenspider>
so this is insulation that tries to guarantee Marshal will work
zacts has joined #ruby
pastorin_ has quit [Remote host closed the connection]
Troy2 has joined #ruby
ramfjord has quit [Ping timeout: 260 seconds]
sammi` has joined #ruby
biberu has quit []
<zenspider>
baweaver: I have to step out. Throw anything at me in PM
<baweaver>
kk
ramfjord has joined #ruby
sammi` has quit [Ping timeout: 260 seconds]
ramfjord has quit [Ping timeout: 248 seconds]
sdrew has joined #ruby
eb0t has joined #ruby
ramfjord has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
orbyt_ has joined #ruby
sanscoeu_ has quit [Remote host closed the connection]
eblip has joined #ruby
John___ has quit [Read error: Connection reset by peer]