havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Jonopoly has quit [Quit: WeeChat 2.5]
TCZ has joined #ruby
rkoller has joined #ruby
chalkmonster has quit [Ping timeout: 260 seconds]
jmcgnh has quit [Ping timeout: 255 seconds]
chalkmonster has joined #ruby
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
margeas has joined #ruby
TCZ has quit [Quit: Leaving]
TCZ has joined #ruby
markong has quit [Ping timeout: 260 seconds]
rkoller has quit [Quit: Textual IRC Client: www.textualapp.com]
hiroaki has quit [Ping timeout: 272 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
xco has quit [Remote host closed the connection]
markoong has joined #ruby
margeas has quit [Ping timeout: 240 seconds]
akem has quit [Ping timeout: 265 seconds]
Xiti has quit [Ping timeout: 255 seconds]
markoong has quit [Ping timeout: 255 seconds]
Xiti has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
markopasha has quit [Remote host closed the connection]
markopasha has joined #ruby
wildtrees has quit [Quit: Leaving]
leitz has quit [Quit: Leaving]
postmodern has joined #ruby
envex has quit [Ping timeout: 260 seconds]
s2013 has joined #ruby
Dirak has quit [Ping timeout: 265 seconds]
Dirak has joined #ruby
krillbat has joined #ruby
markopasha has quit [Ping timeout: 255 seconds]
pabs has quit [Ping timeout: 248 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
TCZ has quit [Quit: Leaving]
ttoocs has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has quit [Quit: WeeChat 2.7.1]
cnsvc has joined #ruby
code_zombie has quit [Quit: Leaving]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
ooheitooh has quit [Quit: The Lounge - https://thelounge.chat]
orbyt_ has joined #ruby
samort7 has quit [Read error: Connection reset by peer]
chalkmonster has joined #ruby
johnny56 has quit [Read error: Connection reset by peer]
johnny56 has joined #ruby
dinfuehr has quit [Ping timeout: 255 seconds]
dinfuehr has joined #ruby
ooheitooh has joined #ruby
krillbat has quit [Quit: Connection closed for inactivity]
code_zombie has joined #ruby
pinpox has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pinpox has joined #ruby
davor has quit [Quit: Bye]
davor has joined #ruby
sergioro has quit [Quit: leaving]
_whitelogger has joined #ruby
fluxAeon has joined #ruby
dinfuehr has quit [Ping timeout: 256 seconds]
dinfuehr has joined #ruby
_whitelogger has joined #ruby
Dirak has quit [Ping timeout: 256 seconds]
MrCrackPot has quit [Quit: Leaving]
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7.1]
Dirak has joined #ruby
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
fluxAeon has quit [Ping timeout: 256 seconds]
fluxAeon has joined #ruby
howdoi has joined #ruby
code_zombie has quit [Quit: Leaving]
infinityfye has joined #ruby
d3bug has quit [Quit: Connection closed for inactivity]
al2o3-cr has quit [Quit: WeeChat 2.7.1]
_whitelogger has joined #ruby
al2o3-cr has joined #ruby
dionysus69 has joined #ruby
ur5us has joined #ruby
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
ravenx has joined #ruby
alexherbo2 has joined #ruby
rippa has joined #ruby
infinityfye has quit [Quit: Leaving]
ur5us has quit [Ping timeout: 256 seconds]
ur5us has joined #ruby
_whitelogger has joined #ruby
dionysus69 has quit [Quit: dionysus69]
ur5us has quit [Ping timeout: 256 seconds]
Ai9zO5AP has quit [Ping timeout: 255 seconds]
Ai9zO5AP has joined #ruby
markopasha has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cnsvc has quit [Ping timeout: 240 seconds]
howdoi has quit [Quit: Connection closed for inactivity]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
alfiemax has joined #ruby
_whitelogger has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
chalkmonster has joined #ruby
troulouliou_dev has joined #ruby
Dirak has quit [Ping timeout: 240 seconds]
xco has joined #ruby
Dirak has joined #ruby
cnsvc has joined #ruby
Dirak has quit [Ping timeout: 268 seconds]
alfiemax has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
markoong has joined #ruby
bvdw has quit [Quit: bvdw]
mheld has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
bvdw has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
infinityfye has joined #ruby
ua has quit [Ping timeout: 258 seconds]
ua has joined #ruby
TCZ has joined #ruby
lxsameer has quit [Quit: WeeChat 2.6]
chalkmonster has quit [Quit: WeeChat 2.7.1]
bvdw has quit [Quit: bvdw]
akem has joined #ruby
lxsameer has joined #ruby
gix has joined #ruby
johnny56 has quit [Ping timeout: 240 seconds]
johnny56 has joined #ruby
lxsameer has quit [Quit: WeeChat 2.6]
johnny56 has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
markoong has quit [Ping timeout: 258 seconds]
markong has joined #ruby
cnsvc has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
johnny56 has joined #ruby
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
TCZ has quit [Quit: Leaving]
hiroaki has joined #ruby
TCZ has joined #ruby
nowhere_man has joined #ruby
akem has quit [Quit: Leaving]
nowhere_man has quit [Ping timeout: 272 seconds]
cnsvc has joined #ruby
infinityfye has quit [Remote host closed the connection]
_whitelogger has joined #ruby
weird_error has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
galaxie has quit [Remote host closed the connection]
galaxie has joined #ruby
lucasb has joined #ruby
dviola has joined #ruby
cnsvc has joined #ruby
nowhere_man has joined #ruby
RiPuk has quit [Ping timeout: 265 seconds]
RiPuk has joined #ruby
RiPuk has quit [Quit: ZNC 1.7.5 - https://znc.in]
RiPuk has joined #ruby
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
markong has quit [Ping timeout: 260 seconds]
markong has joined #ruby
c0san0stra has quit [Ping timeout: 260 seconds]
c0san0stra has joined #ruby
davor has quit [Quit: Bye]
lightstalker has quit [Ping timeout: 255 seconds]
lightstalker has joined #ruby
TCZ has quit [Quit: Leaving]
RiPuk has quit [Quit: ZNC 1.7.5 - https://znc.in]
RiPuk has joined #ruby
lxsameer has quit [Quit: WeeChat 2.6]
davor has joined #ruby
galaxie has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
lxsameer has quit [Client Quit]
TCZ has joined #ruby
galaxie has joined #ruby
TCZ has quit [Quit: Leaving]
d3bug has joined #ruby
margeas has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
markoong has joined #ruby
markong has quit [Ping timeout: 258 seconds]
margeas has quit [Ping timeout: 265 seconds]
nowhereman has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
cnsvc has joined #ruby
code_zombie has joined #ruby
alfiemax has quit [Ping timeout: 255 seconds]
cnsvc has quit [Ping timeout: 240 seconds]
markong has joined #ruby
sergioro has joined #ruby
markoong has quit [Ping timeout: 240 seconds]
postmodern has quit [Quit: Leaving]
mheld has quit [Quit: Connection closed for inactivity]
dviola has quit [Quit: WeeChat 2.7.1]
Esa_ has joined #ruby
davor has quit [Quit: Bye]
davor has joined #ruby
DTZUZU has quit [Ping timeout: 256 seconds]
DTZUZU has joined #ruby
orbyt_ has joined #ruby
margeas has joined #ruby
markong has quit [Ping timeout: 260 seconds]
markoong has joined #ruby
margeas has quit [Ping timeout: 258 seconds]
weird_error has quit [Quit: weird_error]
nowhereman has joined #ruby
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ruby
alexherbo2 has quit [Client Quit]
al2o3-cr has quit [Quit: WeeChat 2.7.1]
cnsvc has joined #ruby
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
al2o3-cr has joined #ruby
davor has quit [Quit: Bye]
cd has joined #ruby
e2 has quit [Max SendQ exceeded]
e2 has joined #ruby
Milos has quit [Ping timeout: 265 seconds]
Milos has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
pi0 has joined #ruby
kinduff has quit [Read error: Connection reset by peer]
kinduff has joined #ruby
nowhereman has quit [Ping timeout: 240 seconds]
davor has joined #ruby
Xiti has quit [Read error: Connection reset by peer]
Xiti has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mokha has joined #ruby
lxsameer has joined #ruby
nowhereman has joined #ruby
Esa_ has quit [Ping timeout: 258 seconds]
Ven`` has joined #ruby
paraxial2 has joined #ruby
paraxial has quit [Ping timeout: 265 seconds]
paraxial2 is now known as paraxial
cnsvc has joined #ruby
gordie has joined #ruby
cnsvc has quit [Ping timeout: 240 seconds]
<gordie> hi ! I'm searching to compare two hashes, and remove in hash A the properties that do not exists in hash B. How can I do that ? https://stackoverflow.com/questions/60569726/how-to-remove-in-hash-a-the-properties-that-do-not-exists-in-hash-b
<_phaul> &>> a = { a: 1, b: 2}; b = { a: 3 }; a.select { |k| b.key? k }
<rubydoc> # => {:a=>1} (https://carc.in/#/r/8p5l)
<_phaul> gordie: does this^ do what you are after?
pi0 has left #ruby [#ruby]
hiroaki has quit [Ping timeout: 265 seconds]
<gordie> wow that's quite abstract but seems that it works. Thing is, my reference hash is a JSON schema, so it is not formatted the same way... Would be too easy. Look at the example on stackoverflow
royal_screwup21 has joined #ruby
<CommunistWolf> &>> { a: 1, b:2 } & {a:1, c:3}
<rubydoc> stderr: -e:4:in `<main>': undefined method `&' for {:a=>1, :b=>2}:Hash (NoMethodError)... check link for more (https://carc.in/#/r/8p5m)
<CommunistWolf> hmmmmmmmmm
<baweaver> They don't have Set operations
<baweaver> Though I agree I'd like them
<CommunistWolf> seems like an oversight, yeah
<baweaver> Coulda sworn someone made an issue of that at one point
<_phaul> what is the intersection of {a: 1} & {a: 2} ?
<CommunistWolf> {}
<baweaver> Yeah that's mostly why
<baweaver> I can see + and - as naive merge and diff
<baweaver> { a: 1 } + { a: 2 } => { a: 2 }
<CommunistWolf> | is a little tougher
<baweaver> { a: 1 } - { a: 2 } => { }
<baweaver> Kinda like how sum is a naive summation and reduce can do more if you need it later.
<havenwood> &>> class Hash; %i[& + -].each { |meth| define_method(meth) { |other| to_a.public_send(meth, other.to_a).to_h } } end
<rubydoc> # => [:&, :+, :-] (https://carc.in/#/r/8p5n)
<_phaul> yeah but these don't actually help solving the original question.. as [:a, 1] and [:a, 2] different, but :a should be kept in first hash, because it was a key in the second hash
<baweaver> To be fair the full problem is much more involved
<baweaver> and based on JSON schema shenanigans
<gordie> are you talking about my question or another one ?
ur5us has joined #ruby
<baweaver> gordie: Yeah, yours
<baweaver> Not quite as straightforward as hash diffing
<baweaver> It's more of applying a schema
<gordie> ok
<gordie> yeah, not an easy one I guess
<baweaver> There's also the mixing of string and hash keys
<baweaver> &>> { 'a': 1 }
<rubydoc> # => {:a=>1} (https://carc.in/#/r/8p5s)
<gordie> I should admit this is too advanced for me to understand
<baweaver> There's also whether or not the defaults are applied
<baweaver> Such that a hypothetical AsubD has a default of 1, isn't present, and gets added to the output with that default value
<gordie> I was thinking it would have been possible to start from the function I had tweaked to extract the default values (stackoverflow)
<baweaver> The first thing I would do is make all those keys strings
<baweaver> otherwise it becomes a juggling game remembering which key is which
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<apotheon> Is ActsAsTaggableOn still a good tool to use for tagging with ActiveRecord?
<gordie> and is it not possible to do a function that just iterate the whole hash, and for each key, checks if that same key exists (with an updated path since it is not formatted the same way) in the json schema ?
cnsvc has joined #ruby
<baweaver> I mean possible yes, and json schema probably has things you can riff off of
gordie has quit [Remote host closed the connection]
phaul has joined #ruby
urinal666 has joined #ruby
<urinal666> hi everyone is ruby good for promoting racism and/or facism?
Dirak has joined #ruby
_phaul has quit [Ping timeout: 255 seconds]
Dirak has quit [Ping timeout: 256 seconds]
Frogging101 has joined #ruby
<apotheon> I never would have expected that question from someone with a respectable name like "urinal666".
<urinal666> uh but yes i am trying to make a meaningful conversation by combining random parts of knowledge tha i have gained on other irc channels
<apotheon> Nothing is "good" for promoting racism or fascism, though perhaps Ruby could be very useful for developing a flashcard application that can help with spelling.
<urinal666> i have a spelling of a gnat
<urinal666> but for the objective like uh promoting facism it would be a good idea to to approach poor and mentally ill and or unemployed young people and tel that their problams are because facism is is not implemented
<urinal666> i mean it would be a valid marketing strategy
<urinal666> i don't personally support facism or racism
<apotheon> I'm going to do something more productive than pay further attention to this.
yxhuvud has quit [Ping timeout: 240 seconds]
<baweaver> !troll urinal666
urinal666 was banned on #ruby by baweaver [*!~ydgfdhh@ncsg05c2eyk7auvrm-2.v6.elisa-mobile.fi]
urinal666 was kicked from #ruby by baweaver [Your behavior is not conducive to the desired environment.]
<baweaver> Screw right off with that.
nowhereman has quit [Ping timeout: 256 seconds]
Dirak has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
mokha has quit [Quit: mokha]
Dirak has quit [Ping timeout: 240 seconds]
hiroaki has joined #ruby
royal_screwup21 has joined #ruby
leitz has joined #ruby
davor has quit [Quit: Bye]
davor has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
d3bug has quit [Quit: Connection closed for inactivity]
<apotheon> baweaver: good call
troulouliou_dev has quit [Quit: Leaving]
markopasha has quit [Remote host closed the connection]
alfiema__ has joined #ruby
orbyt_ has joined #ruby
Inoperable has joined #ruby
Ven`` has quit [Ping timeout: 255 seconds]
Dirak has joined #ruby
alfiema__ has quit [Ping timeout: 260 seconds]
hiroaki has quit [Ping timeout: 272 seconds]
jmcgnh has quit [Read error: Connection reset by peer]
jmcgnh has joined #ruby
d3bug has joined #ruby
gavlee has joined #ruby
pupsikov has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
taserface has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]