havenwood changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.1.1, 3.0.3, 2.7.5: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
perrierjouet has joined #ruby
roadie has joined #ruby
roshanavand has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
trillp has joined #ruby
freeworld has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
ur5us has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
Rounin has quit [Ping timeout: 252 seconds]
roshanavand has quit [Ping timeout: 256 seconds]
gproto23 has joined #ruby
roadie has joined #ruby
<wand> how can i get the worker proccesses to read from the queue after they fork -> https://termbin.com/ciqv
<wand> they never process F,G,H
<wand> i want them to idle until there is something in the queue
roadie has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
Thanzex4 has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
<wand> read from a socket?
hanzo has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
mixfix41 has joined #ruby
<adam12> wand: Bed time for me, but I'd try using a proper queue first.
mixfix41 has quit [Remote host closed the connection]
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
mixfix41 has joined #ruby
constxd has quit [Ping timeout: 268 seconds]
trillp has quit [Quit: WeeChat 3.3]
donofrio has quit [Ping timeout: 240 seconds]
polishdub has joined #ruby
mooff has quit [Remote host closed the connection]
trillp has joined #ruby
mooff has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
polishdub has quit [Quit: leaving]
ur5us has quit [Ping timeout: 250 seconds]
John_Ivan has quit [Ping timeout: 256 seconds]
freeworld has joined #ruby
eddof13 has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 252 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
cxl has quit [Quit: bye]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
gproto23 has quit [Ping timeout: 252 seconds]
work has joined #ruby
szkl has joined #ruby
CrazyEddy has quit [Ping timeout: 256 seconds]
hanzo has quit [Quit: Connection closed for inactivity]
teclator has joined #ruby
roshanavand has joined #ruby
roshanavand has quit [Remote host closed the connection]
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ferr_ has joined #ruby
fercell has quit [Ping timeout: 240 seconds]
DiggerNick has joined #ruby
ur5us has joined #ruby
taupiqueur has joined #ruby
roadie has joined #ruby
cxl has joined #ruby
ur5us has quit [Quit: Leaving]
ur5us has joined #ruby
Rounin has joined #ruby
DiggerNick has quit [K-Lined]
moldorcoder7 has quit [Read error: Connection reset by peer]
moldorcoder7 has joined #ruby
freeworld has quit [Ping timeout: 256 seconds]
szkl has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 240 seconds]
donofrio has joined #ruby
freeworld has joined #ruby
dionysus69 has joined #ruby
dionysus69 has left #ruby [#ruby]
dionysus69 has joined #ruby
work has quit [Quit: Connection closed for inactivity]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
ule has quit [Remote host closed the connection]
roadie has joined #ruby
fef has joined #ruby
ule has joined #ruby
freeworld has quit [Ping timeout: 252 seconds]
nightw0lf has joined #ruby
nightw0lf has quit [Client Quit]
cK has joined #ruby
cK has quit [Remote host closed the connection]
osXnut has joined #ruby
osXnut has quit [Remote host closed the connection]
osXnut has joined #ruby
osXnut is now known as osXnuts
osXnuts is now known as osXnut
osXnut has quit [Quit: leaving]
<mooff> wand: your forks won't see any changes to objects in their parent processes
<mooff> the pattern you're using there is well served by Ractors in Ruby 3: https://docs.ruby-lang.org/en/3.1/Ractor.html
freeworld has joined #ruby
freeworld has quit [Ping timeout: 256 seconds]
freeworld has joined #ruby
TCZ has joined #ruby
John_Ivan has joined #ruby
constxd has joined #ruby
TCZ has quit [Quit: Leaving]
gproto23 has joined #ruby
bit4bit has joined #ruby
taupiqueur has quit [Ping timeout: 240 seconds]
taupiqueur has joined #ruby
szkl has joined #ruby
Tempesta has quit [Quit: See ya!]
CrazyEddy has joined #ruby
jimeh has quit [Remote host closed the connection]
jimeh has joined #ruby
Tempesta has joined #ruby
tungki has joined #ruby
Tempesta has quit [Ping timeout: 265 seconds]
tungki60 has joined #ruby
Tempesta has joined #ruby
tungki has quit [Ping timeout: 256 seconds]
dionysus69 has quit [Ping timeout: 252 seconds]
tungki60 has quit [Ping timeout: 256 seconds]
Tasi has joined #ruby
basso has left #ruby [The Lounge - https://thelounge.chat]
quintasan_ has quit [Quit: No Ping reply in 180 seconds.]
<Tasi> hy guys! I have a question. I was ruby programmer few years ago, but I don't follow the features of the new versions recently. I see, the Ruby introduce the RBS as a file format for type declarations. My question is the following: Can I write my ruby code and the type declarations togeather in common file?
quintasan has joined #ruby
<leah2> afaiu no
<adam12> Tasi: https://github.com/AaronC81/sord might work, but you're not writing RBS signatures directly at that point, but rather YARD doctags.
<Tasi> adam12, woow, sounds good
axisys has joined #ruby
taupiqueur has quit [Quit: taupiqueur]
<wand> adam12 and mooff, thanks for the links. I'll look at queue objects and reactors
<axisys> how do I change this 'Foo' => 'true', in my rb file to make sure it is true only when stage.equal? not 'beta' ?
<adam12> wand: I thought you were using threads when I suggested Queue. I still think a proper Queue should be used but mooff was right that it wont' work across processes. There's probably a million solutions to this, but one option is Rinda.
<axisys> if not stage.equal? 'beta' 'Foo' => 'true' will work?
<adam12> axisys: Can you show more code? Your question isn't clear IMHO.
<axisys> adam12: I want to add a logic around this line in rb file https://dpaste.org/jBf5
<axisys> so set that true only when not stage.equal 'beta'
<adam12> axisys: And if it's not "beta", then what?
<axisys> if it is 'beta' set that to false otherwise true
atille_ has joined #ruby
<adam12> "FOO" => stage.equal?("beta").to_s
TomyWork has joined #ruby
<axisys> adam12: nice!
<axisys> adam12: i think this does opposite. I like set to false when beta
<adam12> axisys: Ahh. (stage != "beta").to_s maybe?
<adam12> axisys: Unless you _need_ the equal? method call, but I suspect it's the BasicObject method that == calls.
<axisys> ok, so there is no .notequal , right?
<adam12> axisys: No
<axisys> I am not hundred percent, so can we may be use "FOO" => not stage.equal?("beta").to_s
<axisys> or like this? "FOO" => (not stage.equal?("beta")).to_s
<adam12> Second one likely.
<adam12> Because of precedence.
<axisys> adam12: thanks, right
<axisys> ah.. suggestion is to use simple if else logic
<adam12> axisys: stage.equal?("beta") ? "false" : "true"
<adam12> Not really sure what the suggestion is there for?
<adam12> Anyways, lunch time. Good luck.
szkl has quit [Quit: Connection closed for inactivity]
TCZ has joined #ruby
TCZ has quit [Client Quit]
m_antis has joined #ruby
bit4bit has quit [Ping timeout: 250 seconds]
Thanzex has quit [Read error: Connection reset by peer]
Thanzex has joined #ruby
CrazyEddy has quit [Ping timeout: 240 seconds]
<ox1eef> wand: https://github.com/0x1eef/xchan.rb - pretty much an IPC queue, might help you and it is pretty easy to use
TomyWork has quit [Remote host closed the connection]
<axisys> actually is it possible to make it like "FOO" => if stage != 'beta' "true" else "false" end ? I know my syntax is wrong
<axisys> adam12: i really like yours like C style, but seems like they want the style I am showing to be consistent to their code style
roadie` has joined #ruby
trillp has quit [Quit: WeeChat 3.3]
<axisys> not sure what is the correct syntax for I am showing
mixfix41 has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 252 seconds]
legit has quit [Quit: WeeChat 2.8]
<axisys> actually is it possible to make it like "FOO" => if stage != 'beta' "true," else "false," I need a comma at the end
legit has joined #ruby
<axisys> I suppose that would be like this for your C style syntax "FOO" => stage.equal?("beta")? "true,": "false," ?
<axisys> adam12: ^
<axisys> so I think this should work with ternary stage.equal?("beta") ? "false": "true", with comma at the end. but I still like to convert it to if .. syntax
<weaksauce> what's the rest of the context?
gproto23 has quit [Remote host closed the connection]
<adam12> axisys: I'd have to see more code than just the one line you pasted to make any suggestions.
o|||||o has joined #ruby
trillp has joined #ruby
<leftylink> sure there are two ways to use if/else there, I just prefer ternary when it's on one line. but don't let me tell you what to do
<leftylink> pandabot: rb {'FOO' => if true then 'true' else 'false' end, 'BAR' => if true; 'true' else 'false' end}
<pandabot> {"FOO"=>"true", "BAR"=>"true"} - https://carc.in/#/r/cwlu
<o|||||o> can someone help me understand why these two lines are not outputting the same results? https://paste.ee/p/3vdz9
<weaksauce> say you had 1000 sales one of which is 100 dollars and the rest are 1 penny why do you think that the price should be 1000*100.01 when it's actually 1*100 + 0.01*1000
<o|||||o> thanks, weaksauce i need to revisit basic arithmetic lol
<weaksauce> np
<weaksauce> yeah it's best to think about the extreme cases when something doesn't seem right
justAstache has quit [Read error: Connection reset by peer]
justAstache has joined #ruby
bit4bit has joined #ruby
oxfuxxx has joined #ruby
osXnut has joined #ruby
mixfix41 has joined #ruby
_ht has joined #ruby
o|||||o has quit [Remote host closed the connection]
o|||||o has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
bit4bit has quit [Remote host closed the connection]
teclator has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
ur5us has joined #ruby
<axisys> adam12: this looks right, just like your but a style they like if stage == "beta" then "false" else "true" env
<axisys> adam12: correction: if stage == "beta" then "false" else "true" end
<ox1eef> generally speaking i dont think 'if then else end' is that common, most drop the 'then'.
mirage_ has joined #ruby
<axisys> ox1eef: (learning) so I can do if stage == "beta" "false" else "true" end ?
mirage_ has quit [Quit: Leaving...]
oxfuxxx has joined #ruby
<mooff> axisys: do true and false need to be strings?
TCZ has joined #ruby
o|||||o has quit [Ping timeout: 240 seconds]
fef has quit [Ping timeout: 240 seconds]
Tasi_ has joined #ruby
Tasi__ has joined #ruby
Tasi has quit [Ping timeout: 240 seconds]
Tasi_ has quit [Ping timeout: 240 seconds]
weyhmueller has quit [Quit: ZNC 1.8.2 - https://znc.in]
weyhmueller has joined #ruby
<havenwood> (stage != 'beta').to_s
<havenwood> hard to give suggestions out of context
havenwood has quit [Quit: The Lounge - https://thelounge.chat]
havenwood has joined #ruby
_ht has quit [Remote host closed the connection]
roadie` has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
roadie has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
mixfix41 has quit [Ping timeout: 250 seconds]
Tasi__ has quit [Quit: Leaving]
oxfuxxx has joined #ruby
TCZ has quit [Quit: Leaving]
roadie has quit [Ping timeout: 252 seconds]
mdemo has quit [Ping timeout: 240 seconds]
mdemo has joined #ruby
RougeR has joined #ruby
oxfuxxx has quit [Ping timeout: 250 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 256 seconds]
ur5us has quit [Ping timeout: 240 seconds]
oxfuxxx has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
<nakilon> "#{"beta" != stage}"
<nakilon> (just alternative)
oxfuxxx has joined #ruby
RougeR has quit [Remote host closed the connection]
szkl has joined #ruby
oxfuxxx has quit [Ping timeout: 240 seconds]
freeworld has quit [Quit: Konversation terminated!]
<wand> ox1eef: thanks, I'll try that out
oxfuxxx has joined #ruby
<wand> ox1eef: i like that you support multiple serialization formats in xchan
oxfuxxx has quit [Ping timeout: 256 seconds]