adam12 changed the topic of #ruby to: Rules: https://ruby-community.com | Ruby 3.0.2, 2.7.4, 2.6.8: https://www.ruby-lang.org | Paste 4+ lines to: https://gist.github.com | Books: https://goo.gl/wpGhoQ
splud has quit [Ping timeout: 252 seconds]
Oxfuxxx has quit [Quit: bbl]
Oxfuxxx has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
Oxfuxxx has quit [Quit: Lost terminal]
Oxfuxxx has joined #ruby
splud has joined #ruby
goldfish has quit [Ping timeout: 250 seconds]
neshpion has quit [Remote host closed the connection]
neshpion has joined #ruby
Oxfuxxx has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
roadie has joined #ruby
Oxfuxxx has quit [Ping timeout: 252 seconds]
Oxfuxxx has joined #ruby
elf_fortrez has joined #ruby
<newton> anyone have thoughts on a gem that is an api wrapper with a good test/mock setup?
<newton> writing up an internal lib for an app and looking for inspiration on structure there
neshpion has quit [Quit: neshpion]
NightMonkey has quit [Quit: ZNC - http://znc.in]
NightMonkey has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jetchisel has quit [Ping timeout: 250 seconds]
roadie has quit [Ping timeout: 240 seconds]
jpw has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
NightMonkey has quit [Quit: ZNC - http://znc.in]
NightMonkey has joined #ruby
elf_fortrez has quit [Quit: Client closed]
roadie has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
roadie has quit [Ping timeout: 240 seconds]
Oxfuxxx has quit [Ping timeout: 250 seconds]
Oxfuxxx has joined #ruby
gr33n7007h has quit [Ping timeout: 240 seconds]
<nakilon> why would you need more wrappers?
<nakilon> and what is "good"
gr33n7007h has joined #ruby
elf_fortrezz has joined #ruby
elf_fortrezz has quit [Quit: Client closed]
roadie has joined #ruby
gr33n7007h has quit [Quit: WeeChat 3.2]
Oxfuxxx has quit [Ping timeout: 240 seconds]
Oxfuxxx has joined #ruby
bobdobbs has joined #ruby
jmcgnh has quit [Ping timeout: 245 seconds]
<peder> weaksauce: TERM=xterm-mono does not work, neither does RUBY_TESTOPTS=--color=never
Oxfuxxx has quit [Ping timeout: 240 seconds]
jmcgnh has joined #ruby
Rounin has joined #ruby
<peder> 'ruby -wc |& cat' does, and then fetch rubys exit code from ${PIPESTATUS[n]}
michigan has quit []
Oxfuxxx has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
perrierjouet has quit [Ping timeout: 250 seconds]
roadie has joined #ruby
perrierjouet has joined #ruby
michigan has joined #ruby
jetchisel has joined #ruby
jetchisel has quit [Client Quit]
roadie has quit [Quit: ERC (IRC client for Emacs 25.3.50.1)]
elf_fortrez has joined #ruby
roadie has joined #ruby
elf_fortrez has quit [Client Quit]
jetchisel has joined #ruby
elf_fortrez has joined #ruby
ollysmith has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
cnsvc has quit [Quit: %bye%]
ollysmith has joined #ruby
cnsvc has joined #ruby
pyrareae has quit [Ping timeout: 252 seconds]
pyrareae has joined #ruby
mrkz_c has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
<nakilon> does spec.executable in .gemspec really mean anything?
<nakilon> oh, probably it won't create the shim
<nakilon> if it's not specified like this
elf_fortrez has quit [Ping timeout: 246 seconds]
nik has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
<nakilon> guys, when I want to make custom class that behaves like String but also has one extra field that I pass when create such object, I do: MyClass < String .... def initialize string, extra ; super string ; @extra = extra ....; and then I call it like x = MyClass.new "asd", extra
<nakilon> but once I decided to derive from Fixnum, not String, it started saying there is no method new
<nakilon> how do I properly derive from Fixnum?
<nakilon> or should I just use refinement...
<adam12> Fixnum's are essentially singleton's, AFAIK.
<adam12> You could maybe try delegateclass, but I've never tried it for Fixnum's before.
<nakilon> (also if I try to add instance variable directly to Fixnum instance I get "can't modify frozen Fixnum")
bobdobbs has quit [Read error: Connection reset by peer]
<nakilon> the initial problem is that my program is made with thinking that "those things are Fixnums" and now I want it to be able to get more info from them like they were tuples with an extra value but I don't want to rewrite it to operate them like tuples because it would pollute code with needless splatting
<nakilon> DelegateClass seems to be working
<nakilon> majestically it does not fail on "super num"
<adam12> Should work as long as you don't === Fixnum
roadie has quit [Ping timeout: 240 seconds]
maroloccio has joined #ruby
perrierjouet has quit [Ping timeout: 252 seconds]
noa has joined #ruby
perrierjouet has joined #ruby
roadie has joined #ruby
dachinat has quit [Remote host closed the connection]
dachinat has joined #ruby
maroloccio has quit [Quit: WeeChat 3.0]
maroloccio has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
maroloccio has quit [Client Quit]
maroloccio has joined #ruby
roadie has joined #ruby
<rapha> jhass[m]: so, finally figured it out. just having an empty module called Array will mess some things up wrt arrays. changed it into a refinement, now all is well.
<jhass[m]> which is why I suggested ::Array
<jhass[m]> "only breaks inside some module" smelled like constant lookup rules from the start
<rapha> jhass[m]: yeah, i didn't understand that and thus didn't pay as much attention to it as i should have.
<rapha> oh, wait, so, calling the module "::Array" disambiguates the whole thing to the interpreter, then?
<jhass[m]> :: starts constant lookup at the toplevel namespace (in effect at Object)
roadie has quit [Ping timeout: 240 seconds]
<jhass[m]> plain constant reference looks up in Module.nesting
jpw_ has joined #ruby
jpw has quit [Ping timeout: 252 seconds]
<jhass[m]> >> A = 1; module Foo; A = 2; A + ::A; end
<ruby[bot]> jhass[m]: # => 3 (https://carc.in/#/r/bt8y)
phenom has quit [*.net *.split]
lipoqil has quit [*.net *.split]
seisatsu has quit [*.net *.split]
Bitflux has quit [*.net *.split]
insolentworm has quit [*.net *.split]
mbrndtgn5 has quit [*.net *.split]
glider_ has quit [*.net *.split]
reset has quit [*.net *.split]
swaggboi has quit [*.net *.split]
balo has quit [*.net *.split]
dviola has quit [*.net *.split]
nakilon has quit [*.net *.split]
dorian has quit [*.net *.split]
Milos has quit [*.net *.split]
hsiktas has quit [*.net *.split]
josephl has quit [*.net *.split]
Cork has quit [*.net *.split]
thiccdaddy has quit [*.net *.split]
Bish has quit [*.net *.split]
ox1eef has quit [*.net *.split]
finsternis has quit [*.net *.split]
clemens3 has quit [*.net *.split]
tv- has quit [*.net *.split]
leftylink has quit [*.net *.split]
belak51 has quit [*.net *.split]
bougyman has quit [*.net *.split]
gcd has quit [*.net *.split]
rhe has quit [*.net *.split]
phenom has joined #ruby
lipoqil has joined #ruby
seisatsu has joined #ruby
glider_ has joined #ruby
Bitflux has joined #ruby
balo has joined #ruby
swaggboi has joined #ruby
mbrndtgn5 has joined #ruby
nakilon has joined #ruby
dviola has joined #ruby
Milos has joined #ruby
josephl has joined #ruby
dorian has joined #ruby
hsiktas has joined #ruby
insolentworm has joined #ruby
reset has joined #ruby
Bish has joined #ruby
thiccdaddy has joined #ruby
Cork has joined #ruby
ox1eef has joined #ruby
bougyman has joined #ruby
tv- has joined #ruby
leftylink has joined #ruby
clemens3 has joined #ruby
belak51 has joined #ruby
rhe has joined #ruby
finsternis has joined #ruby
gcd has joined #ruby
finsternis has quit [Max SendQ exceeded]
finsternis has joined #ruby
yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
yxhuvud has joined #ruby
bit4bit has joined #ruby
<nakilon> hm, "undefined method `DelegateClass' for main:Object"
<nakilon> happens only on specific ruby version when calling via popen _<>
<adam12> nakilon: -rdelegate?
<nakilon> i.e. such versions results, happens on this line: string, status = Open3.capture2e "#{prefix}./bin/rasel examples/#{cmd}"
<nakilon> adam12 ruby -rdelegate test.rb -- same error
<nakilon> oh wait
<nakilon> I'm stupid
<nakilon> 1 minute
<nakilon> yeah, now it works
roadie has joined #ruby
<nakilon> though it's weird that those tests that are not about popen ./bin are passing fine
roadie has quit [Ping timeout: 250 seconds]
keyvan has quit []
keyvan has joined #ruby
roadie has joined #ruby
dionys has quit [Quit: dionys]
roadie has quit [Ping timeout: 240 seconds]
Liothen has quit []
Liothen has joined #ruby
bit4bit has quit [Read error: Connection reset by peer]
TomyWork has joined #ruby
roadie has joined #ruby
nik has quit [Quit: Leaving]
roadie has quit [Ping timeout: 240 seconds]
<nakilon> how am I supposed to timout popen3? with Timeout.timeout?
roadie has joined #ruby
roadie has quit [Client Quit]
roadie has joined #ruby
dachi_ has joined #ruby
dachinat has quit [Ping timeout: 250 seconds]
caleb has quit []
caleb has joined #ruby
TomyWork has quit [Remote host closed the connection]
mrkz_c has joined #ruby
MachinShin has quit []
MachinShin has joined #ruby
_ht has joined #ruby
howdoi has joined #ruby
entel_ has quit []
entel_ has joined #ruby
joast has joined #ruby
neshpion has joined #ruby
gr33n7007h has joined #ruby
rubion has joined #ruby
phenom has quit [Ping timeout: 268 seconds]
Guest42 has joined #ruby
neshpion has quit [Remote host closed the connection]
neshpion has joined #ruby
cognemo has quit [Quit: ZNC 1.8.2 - https://znc.in]
cognemo has joined #ruby
Guest42 has quit [Ping timeout: 246 seconds]
perrierjouet has quit [Ping timeout: 252 seconds]
perrierjouet has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
maroloccio has quit [Quit: WeeChat 3.0]
goldfish has joined #ruby
rubion has quit [Ping timeout: 250 seconds]
noa has quit [Quit: Leaving]
roadie has joined #ruby
Guest94 has joined #ruby
<Guest94> Hello, In this method definition: `def value=(value){return value} end ` What the meaning of the equale sign? Thanks
<nakilon> it's a part of the method name
<Guest94> nakilon Does it have a special meaning?
<nakilon> ever time you do a = b you implicitely do a.=(b)
<nakilon> in Ruby you can't just assign value to some class instance attribute -- you have to call a "setter" method
<nakilon> and it's just a convenience to call them with = in the end
<nakilon> *to name them
<Guest94> nakilon I sometimes see method that ends with a question marks "?" wich usually, return a bolean, something like `def ready? {.....}`. So I was wondering if the "=" signe have similar meaning
<nakilon> it's the same "convenience", just a nice practice
<nakilon> maybe there is something more behind =, idk
<nakilon> I doubt
<Guest94> nakilon I just saw it from here : https://stackoverflow.com/a/5890199/2056208
<newton> ? and ! are just syntax sugar
<newton> they don't do anything special it's up to you to use them in your method names (? usually suggests the method returns a boolean, ! suggests it mutates data)
<nakilon> I suppose if in that snippet you don't define the value=, you are unable to assign to that attribute
<Guest94> nakilon but isn't `value=` a method? I thought it was supposed to receive an argument
<adam12> Guest94: it does. (value)
<adam12> Guest94: if you think of it as message passing, `foobar.value = 1` is essentially `foobar.send(:value=, 1)`. You can see `value=` as the method name when you break it up like that, and less so as an assignment.
<Guest94> So in ruby, a method is a class instance attribute too?
<adam12> Guest94: It can be, if you look at it that way.
rubion has joined #ruby
<adam12> Guest94: Instances of a class have methods. They may or may not accept a parameter. They may or may not return a value. They may or may not contain state (to be considered an attribute?). You send a message to the object, it may update state of the object. It may return a useful value.
<adam12> It may do nothing :P
Guest94 has quit [Ping timeout: 246 seconds]
mrkz_c has quit [Quit: Connection closed for inactivity]
Oxfuxxx has quit [Ping timeout: 250 seconds]
jpw_ has quit [Ping timeout: 250 seconds]
jpw has joined #ruby
maroloccio has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
jpw has quit [Remote host closed the connection]
jpw has joined #ruby
maroloccio has quit [Quit: WeeChat 3.0]
_ht has quit [Remote host closed the connection]
noa has joined #ruby
Guest19 has joined #ruby
jpw has quit [Remote host closed the connection]
<Guest19> adam12 Thanks for the information
<Guest19> about class instance variable...
Guest19 has quit [Quit: Client closed]
Bitflux is now known as Byteflux
noa has quit [Ping timeout: 240 seconds]
roadie has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
splud has quit [Ping timeout: 240 seconds]
splud has joined #ruby
roadie has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
gr33n7007h has quit [Ping timeout: 240 seconds]
roadie has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
rubion has quit [Ping timeout: 240 seconds]
Oxfuxxx has joined #ruby
pyrareae has quit [Changing host]
pyrareae has joined #ruby
roadie has joined #ruby
phenom has joined #ruby
roadie has quit [Ping timeout: 250 seconds]
thelounge3353 has joined #ruby
thelounge3353 is now known as benjaminoakes
benjaminoakes has quit [Quit: The Lounge - https://thelounge.chat]
benjaminoakes has joined #ruby
roadie has joined #ruby
mrkz_c has joined #ruby
roadie has quit [Ping timeout: 240 seconds]
benjaminoakes has quit [Quit: Client closed]
Bish has quit [Ping timeout: 268 seconds]
Bish has joined #ruby
SuperLag has quit [Remote host closed the connection]
roadie has joined #ruby
invisage has joined #ruby
<invisage> hello?
invisage has left #ruby [#ruby]
<newton> nakilon, I forgot I asked a question last night re api wrappers. good being subjective to the person making the recommendation and "why more wrappers" I was curious how people were implementing their testing of api requests and responses
<newton> I decided to go with vcr ¯\_( ͡° ͜ʖ ͡°)_/¯
roadie has quit [Ping timeout: 250 seconds]
Bish has quit [Ping timeout: 252 seconds]
shokohsc has quit [Remote host closed the connection]
Bish has joined #ruby
shokohsc has joined #ruby
desnudopenguino has quit [Ping timeout: 250 seconds]
rob has joined #ruby
<rob> Given a hash of arrays, how might one invert it without assignment such that:
<rob> {key1 => [value1, value2], key2 => [value3, value4]}
<rob> ... becomes
<rob> {value1 => key1, value2 => key1, value3 => key2, value4 => key2}
<rob> ?