havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: 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!
heyimwill has joined #ruby
nirix has quit [Quit: ZNC 1.7.1 - https://znc.in]
conta has joined #ruby
nirix has joined #ruby
Dbugger has quit [Ping timeout: 250 seconds]
infernix has joined #ruby
conta has quit [Ping timeout: 250 seconds]
Puffball has quit [Quit: Puffball]
Fernando-Basso has quit [Remote host closed the connection]
ongo has quit [Ping timeout: 245 seconds]
orbyt_ has quit [Ping timeout: 246 seconds]
Dbugger has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
elcontrastador has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
themsay has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
dbugger_ has joined #ruby
Dbugger has quit [Ping timeout: 272 seconds]
peteretep has joined #ruby
Pillus has joined #ruby
manveru has joined #ruby
rann has joined #ruby
Fenhl has joined #ruby
discopatrick has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
al2o3-cr has quit [Ping timeout: 246 seconds]
mozzarella has quit [Quit: WeeChat 2.2]
cd has joined #ruby
mozzarella has joined #ruby
bmurt has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
mikecmpbll has quit [Quit: inabit. zz.]
blackswan has joined #ruby
al2o3-cr has joined #ruby
<blackswan> i am trying to use perl's Inline::Ruby and it seems to be dying from a NoMethodError because the Ruby module IO::generic_writable doesn't have instance_methods defined
jokester has joined #ruby
<blackswan> this makes me sad.
JoL1hAHN has joined #ruby
_ikke_ has joined #ruby
dviola has joined #ruby
onawebuc has joined #ruby
markoong has quit [Quit: Konversation terminated!]
markoong has joined #ruby
markoong has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 246 seconds]
cnsvc has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
spacesuitdiver has joined #ruby
spacesuitdiver has quit [Quit: Textual IRC Client: www.textualapp.com]
eblip has quit [Read error: Connection reset by peer]
cnsvc has joined #ruby
eblip has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> fuck off
v01d4lph4 has joined #ruby
<havenwood> al2o3-cr: ?
icarus has quit [Quit: leaving]
d10n-work has quit [Quit: Connection closed for inactivity]
octos has quit [Read error: Connection reset by peer]
octos has joined #ruby
v01d4lph4 has quit [Ping timeout: 250 seconds]
renich has joined #ruby
bougyman_ is now known as bougyman
AJA4350 has quit [Quit: AJA4350]
code_zombie has quit [Quit: Leaving]
dviola has quit [Quit: WeeChat 2.3]
solocshaw has joined #ruby
onawebuc has left #ruby ["ERC (IRC client for Emacs 25.1.1)"]
postmodern has joined #ruby
dbugger__ has joined #ruby
salasrod has quit [Read error: Connection reset by peer]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
salasrod has joined #ruby
dbugger_ has quit [Ping timeout: 246 seconds]
solocshaw has quit [Quit: solocshaw]
tdy has joined #ruby
\void has joined #ruby
bmurt has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 250 seconds]
cthulchu_ has quit [Ping timeout: 240 seconds]
segy has quit [Quit: ZNC - http://znc.in]
<elcontrastador> Any expert ruby sockets developers online?
<elcontrastador> I'd like to hire for a pair programming session
segy has joined #ruby
Azure has quit [Quit: Oops.]
wolfshappen_ has quit [Quit: Waffs have technical problems too]
ogres has quit [Quit: Connection closed for inactivity]
wolfshappen has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
Azure has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renich_ has joined #ruby
sgen has joined #ruby
renich has quit [Ping timeout: 268 seconds]
renich_ is now known as renich
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
lytol_ has quit [Remote host closed the connection]
tdy has quit [Remote host closed the connection]
elcontrastador has quit [Ping timeout: 245 seconds]
v01d4lph4 has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
gigetoo has quit [Ping timeout: 245 seconds]
TitoN- has quit [Ping timeout: 246 seconds]
v01d4lph4 has quit [Remote host closed the connection]
ogres has joined #ruby
esrse has joined #ruby
renich has quit [Ping timeout: 250 seconds]
Emmanuel_Chanel has joined #ruby
tdy has joined #ruby
cruzo66342 has joined #ruby
arescorpio has joined #ruby
arescorpio has quit [Max SendQ exceeded]
wilbert has joined #ruby
maryo has joined #ruby
johnny56_ has quit [Ping timeout: 272 seconds]
dellavg__ has joined #ruby
jcarl43 has joined #ruby
johnny56_ has joined #ruby
maryo has quit [Quit: Leaving]
maryo has joined #ruby
elcontrastador has joined #ruby
conta has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aupadhye has joined #ruby
Inline has quit [Quit: Leaving]
dinfuehr_ has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
elcontrastador has joined #ruby
FrankD has joined #ruby
arup_r has joined #ruby
paranoicsan has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
<danst> do I look like I know what jpeg is
sgen has quit [Ping timeout: 268 seconds]
conta has quit [Read error: Connection reset by peer]
conta1 has joined #ruby
conta1 is now known as conta
tankf33der has left #ruby [#ruby]
arup_r has quit []
aufi has joined #ruby
agent_white has quit [Quit: bbl]
<kevinsjoberg> elcontrastador: What do you want to acheieve?
<elcontrastador> kevinsjoberg: Proprietary paging to polycom phones...via multicast. Polycom has this documented for 3rd party integrations...
<kevinsjoberg> I see. Socket isn't my day-to-day work so I think this might be a bit out of my comfort zone.
<elcontrastador> seems pretty simple...
<kevinsjoberg> elcontrastador: Pretty good docs I must say.
<elcontrastador> the signaling to the phones for them to accept/unacccept a stream...the subsequent stream, I believe, could be streamed by ffmpeg to the configured mcast addr
<elcontrastador> y
wilbert has quit [Ping timeout: 245 seconds]
<elcontrastador> I have Cisco phones working tits...but they use an xml rpc for setup and tear down of their listening...much more open (go figure)
clemens3_ has quit [Ping timeout: 272 seconds]
cruzo66342 has quit [Remote host closed the connection]
ogres has quit [Quit: Connection closed for inactivity]
sauvin has joined #ruby
paranoicsan has quit [Quit: paranoicsan]
paranoicsan has joined #ruby
DTZUZO has quit [Ping timeout: 268 seconds]
clemens3_ has joined #ruby
lightstalker has quit [Ping timeout: 250 seconds]
BH23 has joined #ruby
nowhere_man has joined #ruby
lightstalker has joined #ruby
ellcs has joined #ruby
powerbit has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has joined #ruby
ellcs has quit [Ping timeout: 250 seconds]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
<dionysus69> how do I write this consicely destination_address = operation["to"] || operation["account"], if one is nil the other value should be used and vice-versa
<dionysus69> this doesn't work
lightstalker has quit [Ping timeout: 246 seconds]
<baweaver> destination_address = [operation['to'], operation['from']].find(&:itself)
nowhere_man has quit [Ping timeout: 250 seconds]
lightstalker has joined #ruby
paranoicsan is now known as paranoicsan[Away
elcontrastador has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
badeball_ is now known as badeball
<dionysus69> baweaver: thanks!
paranoicsan[Away is now known as paranoicsan
lightstalker has quit [Ping timeout: 272 seconds]
mikecmpbll has joined #ruby
lightstalker has joined #ruby
chichou has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
chichou has quit [Client Quit]
cnsvc has quit [Ping timeout: 256 seconds]
prestorium has joined #ruby
paranoicsan has quit [Read error: Connection reset by peer]
paranoicsan has joined #ruby
ellcs has joined #ruby
v01d4lph4 has joined #ruby
maryo has quit [Quit: Leaving]
paul__ has joined #ruby
<paul__> hello guys
<paul__> can i use attr_accessor with module ?
conta has quit [Ping timeout: 268 seconds]
segy has quit [Quit: ZNC - http://znc.in]
kapil____ has joined #ruby
<paul__> can i use attr_accessor with module ?
cd has quit [Remote host closed the connection]
blackswan has quit [Ping timeout: 250 seconds]
segy has joined #ruby
cd has joined #ruby
<al2o3-cr> &>> ["c1fd6c34"].pack('H8').unpack('C4').join ?.
<rubydoc> # => "193.253.108.52" (https://carc.in/#/r/68d6)
<al2o3-cr> &>> Module.new { attr_accessor :foo, :bar }.instance_methods
<rubydoc> # => [:foo=, :foo, :bar, :bar=] (https://carc.in/#/r/68d7)
ongo has joined #ruby
<al2o3-cr> paul__: why do you ask?
<paul__> i wish to use it with a module
<al2o3-cr> all attr_accessor does is create 2 instance methods for getting and setting attributes.
markoong has joined #ruby
mikecmpb_ has joined #ruby
<paul__> for example : module Craft ; attr_accessor :ben ; end
<paul__> how can i access ben in this way ?
<al2o3-cr> paul__: you can't unless you include it in a class. (instance level)
mikecmpbll has quit [Ping timeout: 250 seconds]
<paul__> ok, thank you al2o3-cr
<lupine> there's also the dirty `extend self` tricfk
<lupine> I wouldn't
<paul__> hum, this works : module Craft ; extend self ; attr_accessor :ben ; end
<paul__> and Craft.ben
<paul__> thank you so much lupine
<lupine> I really wouldn't :D
<al2o3-cr> &>> module Craft class << self; attr_accessor :ben end end; Craft.ben = 42
<paul__> lupine: can you explain me why you wouldn't ? :)
<rubydoc> # => 42 (https://carc.in/#/r/68d8)
<al2o3-cr> but why?
<lupine> it will lead to bad code
<lupine> class-level attributes invariably do, no matter how you implement them
<al2o3-cr> paul__: don't get into bad habits :)
<lupine> `extend self` is particularly bad because you'll invariably find that someone eventually includes the module elsewhere, and then you'll have two conflicting contexts for the same methods
<paul__> both does the same ? i mean 'extend self' and 'class << self'
<lupine> no, they're quite different
<paul__> what' s about the class<<self usage ? is it better in my case ?
<al2o3-cr> depends on you use case.
<lupine> class << self is better, in that it's more focused and the created methods won't be shared with anything you later include the module into, but I'd still generally avoid it
<al2o3-cr> *your
<paul__> ok
clemens3_ has quit [Ping timeout: 250 seconds]
conta has joined #ruby
<al2o3-cr> paul__: consider using a struct if attributes only e.g
<al2o3-cr> &>> Target = Struct.new(:x, :y, :z); T = Target.new(1,2,3); * = T.x, T.y, T.z
<rubydoc> # => [1, 2, 3] (https://carc.in/#/r/68d9)
<al2o3-cr> i generally use somthing like this.
<paul__> thank's al2o3-cr
<al2o3-cr> np
conta has quit [Remote host closed the connection]
<al2o3-cr> or make it anonymous if needs be.
conta has joined #ruby
<al2o3-cr> &>> Struct.new("Target", :x, :y, :z); Struct::Target.new(1,2,3); * = T.x, T.y, T.z
<rubydoc> # => uninitialized constant T (NameError) (https://carc.in/#/r/68da)
<al2o3-cr> oops :(
<al2o3-cr> &>> Struct.new("Target", :x, :y, :z); Struct::Target.new(1,2,3).x
<rubydoc> # => 1 (https://carc.in/#/r/68db)
<al2o3-cr> you get the idea :)
conta has quit [Ping timeout: 250 seconds]
<paul__> awesome al2o3-cr
blackswan has joined #ruby
<al2o3-cr> :^)
<al2o3-cr> emoji tuesday!
<paul__> al2o3-cr: can i post my project here to get feedback, advices ?
<paul__> i'm novice, i'm learning Ruby, trying to make a gem for my favorite OS named OpenBSD
<al2o3-cr> paul__: sure, use a paste service though.
<al2o3-cr> paul__: if you've got an account on github use gist.guthub.com || dpaste.de
<paul__> al2o3-cr: ok, tks, one moment
esrse has quit [Ping timeout: 246 seconds]
<al2o3-cr> paul__: have to go for 1/2 hour, but i'm sure someone here will aquaint your needs ;)
<paul__> al2o3-cr: can you review that when you re back ?
<al2o3-cr> if not, i'll get back you
<al2o3-cr> paul__: sure, np.
<paul__> wait 2min :)
<al2o3-cr> ok.
<al2o3-cr> be quick though.
<al2o3-cr> gotta go, i'll be bk after.
<paul__> Here it is : https://gist.github.com/wesley974/ca930061307f730177ea5f8007e705dd if someone can review, give me some feedback, advices, thank you very much for your comments
clemens3 has joined #ruby
<phaul> I wouldn't write class methods for everything. Feels like elixir program in ruby :)
<phaul> i would use objects, like why not class FS and move methods to instance side? then fs = OpenBSD::FS.new; fs.backup_location( ... etc
<phaul> when you set backup_location, consider calling the instance variable @backup_location, and using attr_writer :backup_location
clemens3 has quit [Ping timeout: 246 seconds]
<phaul> but given that only one method uses the instance var, consider moving it into the arguments of that method instead of instance state
<paul__> phaul: great idea about the Fs class
AJA4350 has joined #ruby
<phaul> typo ^ s/consider calling the/consider calling it/
<paul__> :)
<paul__> phaul: by looking at all, globally, it is bad ? useless ? seems to you ok?
<paul__> i mean writing a gem for this case* of course there's a part missing rcctl.rb (manage OpenBSD daemons)
conta1 has joined #ruby
<phaul> paul__: it's not bad. And even if it was it didn't matter as that's not what's important. Imoprtant is: having fun, and learning on the way :D
<paul__> It is the case, i'm learning and trying to apply what i learnt :)
<phaul> idea: give OO interface to sysctl / pfctl ;)
conta1 has quit [Ping timeout: 268 seconds]
<phaul> pf.tables['badhost'] << '192.168.7.13'
<paul__> phaul: sysctl yep, but pfctl too keywords :D
<paul__> phaul: if you re interested i published a doc about OpenBSD online : http://www.openbsdjumpstart.org sorry for the noise*
TheBrayn has quit [Quit: poof]
<phaul> I used openbsd for about 10 years.. started almost at the beginings of the OS :)
<paul__> wow
TheBrayn has joined #ruby
clemens3 has joined #ruby
<blackswan> i'm having a weird problem with a Module that doesn't appear to have the instance_methods method defined.
<blackswan> two, actually. IO::generic_readable and IO::generic_writable.
<phaul> blackswan: please paste your code
<phaul> a minimal example that reproduces the issue you are experiencing. Without code, there is too much second guessing
<blackswan> i'm still trying to get it simplified enough to paste. i'm using ruby embedded in perl with the Inline::Ruby perl module.
<blackswan> needless to say, this is tricksy.
stryek has joined #ruby
<phaul> &>> IO.instance_methods.grep /generic_/
<rubydoc> # => [] (https://carc.in/#/r/68dd)
<phaul> &list generic_
<rubydoc> Found no entry that matches method generic_
<phaul> where are those methods coming from?
<phaul> &list generic_%
<rubydoc> Found no entry that matches method generic_%
<blackswan> and now you see why i have a problem...
<phaul> not really. I don't see any stdlib defining those methods? so I don't know why you expect them being defined
<blackswan> *i* don't. i'm trying to debug the Perl Inline::Ruby code.
<blackswan> it is getting this from a list of modules that get defined, and then it is trying to call methods and instance_methods on those modules
<blackswan> it fails on IO::generic_writeable and IO::generic_readable, which are magic methods from ext/stringio/stringio.c in the ruby source.
<blackswan> so i can't tell if this is a bug in ruby or in the Inline::Ruby module or something else because i am unfamiliar with the code.
<phaul> they are not methods
<phaul> they are modules
<blackswan> oh. i'm a little confused in the pastebin.
<blackswan> sorry, magic modules.
<blackswan> not enough caffeine yet today.
paranoicsan is now known as paranoicsan[Away
paranoicsan[Away has quit [Quit: paranoicsan[Away]
<phaul> their name is hacked lowercase which means you can't use them by name.
<phaul> this errors:
<phaul> &>> IO::generic_writabe.class
<rubydoc> # => undefined method `generic_writabe' for IO:Class (NoMethodError) (https://carc.in/#/r/68de)
<blackswan> that's what Inline::Ruby is getting when it tries to call instance_methods.
<phaul> &>> IO::included_modules.first.name
<blackswan> but not, for some reason, methods. i think.
<rubydoc> # => "File::Constants" (https://carc.in/#/r/68df)
<phaul> &>> IO::included_modules
<rubydoc> # => [File::Constants, Enumerable, Kernel] (https://carc.in/#/r/68dg)
<phaul> &>> StringIO::included_modules
<rubydoc> # => [IO::generic_writable, IO::generic_readable, Enumerable, Kernel] (https://carc.in/#/r/68dh)
<phaul> &>> StringIO::included_modules.first.name
<rubydoc> # => "IO::generic_writable" (https://carc.in/#/r/68di)
<phaul> so you can't call it by name, but if you get to it by other means you can use it
<blackswan> it's setting k to "IO::generic_writable" and doing eval "#{k}.instance_methods"
lucasb has joined #ruby
<phaul> yes that would fail
<blackswan> yes, when i access it from StringIO::included_modules i get an instance_methods method, that's what is confusing.
RougeR has joined #ruby
<blackswan> but no, it works when it calls "methods". i thought.
<blackswan> i added puts statements to see what is going on
<phaul> I don't think so
<blackswan> let me do a bigger pastebin with more info.
<phaul> &>> StringIO::generic_writable.methods
<rubydoc> # => undefined method `generic_writable' for StringIO:Class (NoMethodError) (https://carc.in/#/r/68dj)
<blackswan> and maybe i will find out i am stating the problem incorrectly.
<phaul> what is the code that fills k with value "StringIO::generic_writable" ?
<phaul> all it needs is not stringifying the method and sending the method to the module object ratherthan evalling a string
<phaul> s/stringifying the method/stringifying the module/
BH23 has quit [Ping timeout: 246 seconds]
<phaul> &>> k = StringIO.included_modules.first; k.class
<rubydoc> # => Module (https://carc.in/#/r/68dk)
<phaul> &>> k = StringIO.included_modules.first; k.name
<rubydoc> # => "IO::generic_writable" (https://carc.in/#/r/68dl)
themsay has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
<blackswan> i'm not sure if it can do that.
<paul__> Thank you everyone, see you later :)
paul__ has quit [Quit: Page closed]
<blackswan> what it's doing is it's trying to figure out what ruby objects were created after running a chunk of ruby code so that those objects can be made visible to Perl.
<phaul> paste the code that fills in the variable k
<blackswan> it's failing in build
<blackswan> search for modules_arg
<blackswan> maybe i didn't see what i thought i saw. it's possible it was always failing on calling methods. i'm not sure any more.
BH23 has joined #ruby
wildermind has joined #ruby
<phaul> insert a bit of guard code in: if k == 'StringIO::generic_writable; then k = StringIO.included_modules[0]; ns[k]['methods'] = k.methods; else ... normal path...
ongo has quit [Ping timeout: 272 seconds]
<blackswan> that's so ugly.
<blackswan> that's giving up and not understanding the problem.
<blackswan> which i might do, but not yet.
<phaul> oh I thought we just wanted to make it run.
<blackswan> well, yes.
<blackswan> but not *just* that.
<blackswan> ok. i've come to the tentative conclusion that the NoMethodError is misleading. it's a NoMethodError because there's no method, but there's no method because it can't access IO::generic_readable or IO::generic_writable by their names for some reason, and it's throwing NoMethodError instead of NameError because reasons.
AJA4350 has quit [Ping timeout: 272 seconds]
<blackswan> possible because rb_eval is not in ruby but is in the xs for Inline::Ruby
<phaul> it's just the ruby parser parsing lowecase name as method name
bmurt has joined #ruby
<phaul> as was demonstrated by the channel bot, which does the exact same behaviour
<blackswan> oh. it should be called IO::Generic_readable and IO::Generic_writable?
<blackswan> ok.
<blackswan> that makes sense.
<phaul> lower case module name is an internal hack. they shouldn't do it, and given they did it they shouldn't leak it out. There was an attempt by nobu to remove it from the list of constants, but seems it still leaks https://bugs.ruby-lang.org/issues/12389
<blackswan> thank you.
<phaul> yw
conta1 has joined #ruby
DTZUZO has joined #ruby
paranoicsan has joined #ruby
AJA4350 has joined #ruby
eminencehc has joined #ruby
aupadhye has quit [Ping timeout: 246 seconds]
catbusters has joined #ruby
<phaul> &fake Hacker.say_something_smart
<rubydoc> I'll generate the digital PNG capacitor, that should transmitter the FTP card!
eblip has quit [Read error: Connection reset by peer]
ogres has joined #ruby
paranoicsan has quit [Quit: paranoicsan]
blackswan has left #ruby [#ruby]
akosednar has quit [Ping timeout: 268 seconds]
eblip has joined #ruby
eblip has quit [Client Quit]
Rapture has joined #ruby
eblip has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
akosednar has joined #ruby
paraxial has quit [Quit: The Lounge - https://thelounge.chat]
paraxial has joined #ruby
rippa has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
Nicmavr has quit [Read error: Connection reset by peer]
Rapture has joined #ruby
Xiti` has joined #ruby
Nicmavr has joined #ruby
Xiti has quit [Ping timeout: 244 seconds]
efertone has quit [Ping timeout: 252 seconds]
yitsushi has joined #ruby
exchgr has quit [Quit: ZNC - http://znc.in]
Inline has joined #ruby
roshanavand__ has joined #ruby
roshanavand_ has quit [Ping timeout: 240 seconds]
awkwords has joined #ruby
BH23 has quit [Ping timeout: 240 seconds]
conta1 has quit [Ping timeout: 250 seconds]
v01d4lph4 has quit [Remote host closed the connection]
snk has quit [Quit: ZNC 1.6.6+deb1ubuntu0.1 - http://znc.in]
cruzo66342 has joined #ruby
snk has joined #ruby
snk has quit [Client Quit]
snk has joined #ruby
cruzo66342 has quit [Ping timeout: 240 seconds]
zapata has joined #ruby
cruzo66342 has joined #ruby
elcontrastador has joined #ruby
VladGh has quit [Quit: Lost terminal]
VladGh has joined #ruby
jcarl43 has joined #ruby
agent_white has joined #ruby
eminencehc has quit [Remote host closed the connection]
cthulchu has joined #ruby
eminencehc has joined #ruby
catbusters has quit [Quit: Connection closed for inactivity]
gregf_ has quit [Ping timeout: 256 seconds]
\void has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
conta1 has joined #ruby
awkwords has quit [Quit: sleepy time]
elcontrastador has quit [Ping timeout: 272 seconds]
nowhere_man has joined #ruby
sgen has joined #ruby
uplime is now known as nchambers
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
paul__ has joined #ruby
<paul__> Hi
<paul__> i have a main class named Car (1 file) with an other class named Colors, if i use class Car < Colors ; inheritance works
<paul__> but what happen i have a third file with a new class Model
roshanavand__ has quit [Ping timeout: 250 seconds]
<paul__> can i use class < Car < Model ?
eminencehc has quit [Remote host closed the connection]
polishdub has joined #ruby
tdy has joined #ruby
gregf_ has joined #ruby
<havenwood> paul__: No, there's no multiple inheritance. You can only inherit from one Class. On the other hand, you can mixin many Modules.
<paul__> what s about class A , B and C
octos has quit [Remote host closed the connection]
octos has joined #ruby
<paul__> can i do this => class C ; end ; class B < C ; end ; class A < B ; end
<havenwood> Try to not lean on inheritance unless it's dead obvious that's the way to go. You'll probably find that often mixins work very well.
<havenwood> paul__: Make B and C modules, and: class A; include B; include C; end
<havenwood> paul__: You can include as many modules as you want in a class.
<paul__> just tried, works like a charm ! thank's havenwood
<havenwood> paul__: no prob!
<paul__> i have second question for you, of course i can submit it to you :)
<paul__> i have a cmd line that report exit code always zero ; that said, when the cmd line is OK, we have a stdout, and when the cmd is wrong we get a stderr
<paul__> how can i run this cmd line in Ruby showing stdout, stderr and return true or false ?
<paul__> i tried system, %x doesn't work for me
<paul__> any idea ?
<havenwood> paul__: Open3 gives a lot more options for handling stderr: https://docs.ruby-lang.org/en/2.6.0/Open3.html
<paul__> i also tried stdout, stderr, status = Open3.capture3('cmd line')
<paul__> i can't see the stdout
<paul__> i can test if stderr is empty then choose between true/false, see stderr
<paul__> but no way to get the stdout
<paul__> strange behavior
clemens3 has quit [Ping timeout: 250 seconds]
eminencehc has joined #ruby
eminencehc has quit [Read error: Connection reset by peer]
<havenwood> paul__: `stdout` is an empty string unexpectedly?
<paul__> when i try a puts method on stdout : empty string
<havenwood> paul__: and `status.success? #=> true`?
<paul__> if i type the cmd line in shell, i can see something in stdout
p47r30n has joined #ruby
<paul__> always true
<paul__> status is false when stderr.empty is false
<p47r30n> yeah
<paul__> the remaining issue i get is : i can't see the stdout
<havenwood> paul__: What's the command you're shelling out to run?
p47r30n has quit [Client Quit]
<paul__> it is an OpenBSD system with korn shell ; the command line is pkg_add
<paul__> it always return zero
p47r30n has joined #ruby
<paul__> i test the cmd in shell, stdout and stderr works
<paul__> but using the ruby code, no way to get stdout
AJA4350 has joined #ruby
p47r30n has quit [Client Quit]
valadares has joined #ruby
<paul__> The test i done in shell :
<havenwood> paul__: Are you separating the command from it's arguments? Like: capture3('ls', '-l')
conta1 has quit [Quit: conta1]
<paul__> doas pkg_add sl (package sl exist) => stdout ok
<paul__> doas pkg_add sli (package sli doesn't exist) => stderr ok
<paul__> I tested in shell at the end of each command : 2>/dev/null to be sure it is stderr
<paul__> I tested in shell at the end of each command : 1>/dev/null to be sure it is stdout
<paul__> i also check with $? to get the exit code : always zero
jane_booty_doe has quit [Quit: Ping timeout (120 seconds)]
jane_booty_doe has joined #ruby
octos has quit [Read error: Connection reset by peer]
<paul__> the code is here :
chihhsin has quit [Read error: Connection reset by peer]
lxsameer has quit [Ping timeout: 246 seconds]
chihhsin has joined #ruby
<paul__> and yes i didn't separate
jane_booty_doe has quit [Client Quit]
[Butch] has joined #ruby
<paul__> here 'doas' is like 'sudo'
millerti has joined #ruby
jane_booty_doe has joined #ruby
<havenwood> paul__: Just curious, but same result if you capture3 with `Shellwords.split(command)` instead of just `command`?
<paul__> i tried : stdout, stderr, status = Open3.capture3('pkg_add', 'sl' )
<paul__> lib $ doas ruby demo.rb
<paul__> i have an empty line
<paul__> same issue
Xiti` has quit [Quit: Xiti`]
Xiti has joined #ruby
<paul__> if i use the Shellwords.split(cmd) , i get error message : kg_add: Missing pkgname (RuntimeError)
<paul__> typo pkg_add
awkwords has joined #ruby
<paul__> i updated the gist
eindoofus has joined #ruby
<paul__> any idea guys ? :)
v01d4lph4 has joined #ruby
<eindoofus> can someone please explain what "yielder" is in this example:
<eindoofus> is it something that the enumerator passes in on each "next"
<phaul> it's an object Enumerator passes into the block that was given to new.
skyikot has joined #ruby
<havenwood> paul__: How about?: capture3(*Shellwords.split(command))
<paul__> havenwood: see the result at https://gist.github.com/wesley974/858fc7e1eaa22ae791b1679fce2f46a5 i just updated
<paul__> i get an error message from the command pkg_add
<phaul> eindoofus: essentially yes, it's the values enumerator gives you on each next
hiroaki has joined #ruby
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
Eiam has quit [Ping timeout: 250 seconds]
maryo has joined #ruby
tdy1 has joined #ruby
Rapture has quit [Ping timeout: 258 seconds]
jcarl43 has quit [Quit: WeeChat 2.3]
Cthulu201 has joined #ruby
<paul__> Anyone can help me with my issue (no stdout from Open3.capture3) ? see the updated gist : https://gist.github.com/wesley974/858fc7e1eaa22ae791b1679fce2f46a5 ; thank's! :)
orbyt_ has joined #ruby
tdy has quit [Ping timeout: 258 seconds]
mikecmpb_ has quit [Quit: inabit. zz.]
reber has joined #ruby
<phaul> do you mean that the stdout does not appear on the console any more? That's because it's captured into stdout variable.
<phaul> ah, nm I see you actually do a puts stdout at the end
<phaul> try puts stdout.inspect and see if that changes anything
valadares has quit [Remote host closed the connection]
valadares has joined #ruby
awkwords_ has joined #ruby
awkwords has quit [Ping timeout: 272 seconds]
wildermind has quit [Quit: Connection closed for inactivity]
aufi has quit [Ping timeout: 250 seconds]
TomyWork has joined #ruby
v01d4lph4 has quit [Read error: No route to host]
v01d4lph4 has joined #ruby
eindoofus has quit [Remote host closed the connection]
<paul__> i get : ""
code_zombie has joined #ruby
<phaul> try puts stderr.inspect
<paul__> regarding stderr, it works
<paul__> i can get stderr
<paul__> but no way to print stdout
<phaul> I mean check if it's outputting to stderr when you think it should output to stdout
<phaul> in case of no error
prestorium has quit [Ping timeout: 246 seconds]
<paul__> stderr.empty? works
<paul__> when stderr is empty, stdout is also empty
<phaul> ah. it was status == 0 when I looked at it ;)
<paul__> yep
<phaul> nm. I donno then
<paul__> just updated from my original file
<RougeR> soo. developing ruby on windows
<RougeR> opinions.
Rapture has joined #ruby
<TomyWork> WSL or bust
<RougeR> yeah ill be using WSL
<RougeR> my work is making me swap to windows....i currently use ubuntu
<RougeR> i still cant get a straight answer out of them why
<RougeR> ill likely just spend all my time in virtualbox with ubuntu and full guest additions...
<TomyWork> make your windows look and feel like ubuntu :)
wilbert has joined #ruby
<RougeR> TomyWork, all gems are going to have issues
<RougeR> currently half my unit tests fail out the box
<TomyWork> with wsl?
<RougeR> im waiting to get WSL installed. but i need to install a windows update
<RougeR> im curious if they pass with WSL
<TomyWork> probably
<TomyWork> but question: what is the target environment?
<RougeR> fucking linux
<RougeR> all linux
<TomyWork> likely not a windows with wsl, right?
<RougeR> ubuntu18.10
<RougeR> the same os i was running
<TomyWork> so basically you're developing on the wrong os now
<RougeR> yes
<RougeR> but im being treated like a stupid child for trying to say this
<TomyWork> offer them to run windows in a VM instead
<RougeR> i had a few issues with rdp and other linux qualms
<RougeR> TomyWork, i did
<TomyWork> KRDC is nice
<RougeR> i also offered full dualboot
<RougeR> laptop has an ssd so 10s reboot times
<RougeR> but nope. windows or bust
<TomyWork> they likely want some corporate crap in there
<TomyWork> or maybe antivirus
<RougeR> I think that and no one else in the company uses linux
ellcs has quit [Ping timeout: 268 seconds]
<TomyWork> or maybe they just don't wanna deal with linux
<RougeR> TomyWork, i deal with it lol
<TomyWork> offer them to admin the system yourself
<RougeR> i have
<RougeR> i have been for 6 months
<RougeR> honestly. im just going to go the malicious complicance route
<TomyWork> is there anything you can't do on linux that you would be able to do on windows that is relevant to your work?
<RougeR> TomyWork, i bet im going to have a lot of issues with gems natively
<TomyWork> no the other way round
dbugger__ has quit [Remote host closed the connection]
<RougeR> ah
<RougeR> RDP....and 1 or two piece of propietary remote access software
<TomyWork> in my company, it's legacy crap like notes and old vsphere
<RougeR> which i can run in a vm
Dbugger has joined #ruby
Dbugger has quit [Remote host closed the connection]
<RougeR> i always had issues with rdp on my ubuntu install...but i used it so infrequently i never bothered to fix it
<RougeR> it was okay. just issues with guest additions
<RougeR> ill see how the malicious complicance route goes. but currently im trying to mirror my enviroment in a ubuntu vm and windows
<RougeR> giving it a 100GB+ dynamic drive and 8GB RAM to the VM
mikecmpbll has joined #ruby
Dbugger has joined #ruby
Dbugger has quit [Remote host closed the connection]
<RougeR> i dont know, needed to rant
<TomyWork> just install a windows 10 theme on ubuntu
<TomyWork> probably best to use kde for this, it's more customizable
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RougeR> haha. TomyWork i could do that on the VM
<RougeR> more meta
AJA4351 has joined #ruby
<RougeR> on the best OS for ruby dev
<RougeR> "Ubuntu. I don't care how you use ubuntu. You can install it to free room on your hdd, install it to a second hdd, or you can overwrite your windows install. But, Ubuntu is what you want. Bash shell, and relative ease installing rails. Idk how you personally install rails on a mac, but I use RVM, and it's not bad. Whatever method you use to get it up and running, will probably be done identically on Ubuntu. Or any linux distro. But Ubuntu is a nice
<RougeR> starter distro.
<RougeR> You can also use elementaryOS, which is built of ubuntu, but borrows heavily from macOS UI design. Or Linux Mint, also built of Ubuntu, but UI looks a bit more like windows (windows 7 era)"
<TomyWork> can you request a 2nd comp?
<RougeR> nahh no chance
<TomyWork> maybe they just want you to have one with windows
<RougeR> i honestly dont know. im going to dig deeper
<RougeR> any time i put up any kind of questioning or resistance
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<RougeR> i get treated like an ignorant 5 year old....because im the only guy who runs nix
<RougeR> lot of .net guys in the company
<TomyWork> return the favor then?
<RougeR> TomyWork, yeah i dont wana get sacked
<TomyWork> and your team is the only one working on ruby stuff?
<RougeR> yep
<RougeR> and they all use macbooks
<TomyWork> what does your team lead say?
<TomyWork> macbooks with windows?
<RougeR> hes the one forcing it on me
<RougeR> macbooks with osx
<RougeR> and i think occasional use of parralels
<TomyWork> and you can't get the same deal because?
<RougeR> well originally i didnt want a mac. and they let me use linux on some crappy windows pc
<RougeR> which i was okay with
<RougeR> i really dont like osx, but id rather run it than windows i think.
<RougeR> with a bit of work, would be fine
<TomyWork> brew sounds better than windows :)
<TomyWork> and a lot of ruby devs use macs
<RougeR> indeed
<TomyWork> so you get good support
<RougeR> ive never google a ruby question and been given a windows based answer
<RougeR> ever
prestorium has joined #ruby
Eiam has joined #ruby
prestorium has quit [Client Quit]
<miah> windows has chocolatey, which is like brew
<TomyWork> except it's still not a unix
<TomyWork> not posix compliant, backslash paths and all that stupidity
<miah> eh, i'd rather not get into OS Holy War in this channel, take it to #ruby-offtopic please
<RougeR> i agree miah. and i have no issue with windows or osx being used to their strengths
<RougeR> if im developing .net ill use windows
<RougeR> if im developing ruby...linux or osx
<miah> ive done ruby dev on windows even, it works
<RougeR> what tools did you use
<RougeR> works? or works without lots of annoying bugs?
<phaul> paul__: I have an idea!
<miah> i used https://rubyinstaller.org/ and vim for windows
dellavg__ has quit [Ping timeout: 272 seconds]
<miah> but often, because of work i use chefdk + my product which is all bundled together https://downloads.chef.io/inspec/stable/3.6.6#windows
<phaul> paul__: try redirecting the command output into a file from the shell and check the output. Some programs check if their output is tty and if not then they behave differently
<RougeR> interesting miah
<RougeR> yeah ive been thinking of using something like vagrant
<miah> ya vagrant is solid
<phaul> paul__: ls is an example. If outputting to tty it prints a comapct list if output is not tty it outputs an entry per line
<miah> i use that a lot for integration testing
<RougeR> nice. yeah all of our stuff runs dockerized. its just building it from local and running tests
<RougeR> ty
<miah> and i use a plugin to run it all through docker (kitchen-dokken)
<miah> but often i'll use virtualbox integration because i want to test on like BSD
_whitelogger has quit [Remote host closed the connection]
themsay has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
clemens3 has quit [Ping timeout: 240 seconds]
bmurt has quit [Ping timeout: 240 seconds]
maxmanders has quit [Ping timeout: 240 seconds]
maxmanders_ is now known as maxmanders
clemens3_ has joined #ruby
ellcs has joined #ruby
mim7 has joined #ruby
mim7 has quit [Client Quit]
actuallybatman has joined #ruby
govg has joined #ruby
dostoyev1ky has quit [Quit: leaving]
dostoyevsky has joined #ruby
jwr has quit [Read error: Connection reset by peer]
jwr_ has joined #ruby
r29v has quit [Quit: r29v]
actuallybatman has left #ruby ["ERC (IRC client for Emacs 27.0.50)"]
bmurt has joined #ruby
wilbert has quit [Ping timeout: 250 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
ellcs has left #ruby [#ruby]
moei has quit [Quit: Leaving...]
AJA4350 has joined #ruby
orbyt_ has quit [Ping timeout: 245 seconds]
roshanavand_ has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cipheralpha has quit [Remote host closed the connection]
cow[moo] has joined #ruby
<phaul> &>> [*?!..??]*??
<rubydoc> # => "!?\"?#?$?%?&?'?(?)?*?+?,?-?.?/?0?1?2?3?4?5?6?7?8?9?:?;?<?=?>??" (https://carc.in/#/r/68ij)
bmurt has joined #ruby
awkwords_ has quit [Quit: sleepy time]
r29v has joined #ruby
reber has quit [Ping timeout: 246 seconds]
<leftylink> remember that sudoku bug... there was a small subproblem of "make a public statement that makes it likely I know the answer, but doesn't give too much away"
sgen_ has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
awkwords has joined #ruby
<phaul> it's a problem of making puzzles, not an easy one
<phaul> I was thinking about it a bit after the fact myself too. The thing was it would have been largely unfair to give any less information, as then I would have just pointed to a code of ~300 dense lines of code.Without familiarity to the code I would say it becomes impossible
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cow[moo] has quit [Ping timeout: 250 seconds]
conta1 has joined #ruby
<leftylink> o. yeah if it had just been a "find the unspecified bug in these 300 lines" I probably wouldn't have bothered
conta1 has quit [Ping timeout: 259 seconds]
<phaul> I played a bit more with that code base, and managed to gain 3x speedup with two optimizations steps. I was thinking about doing a write up, kinda like a blog post. atm I don't have a ruby blog
<SeepingN> but you do have a blog?
<SeepingN> add tag: ruby and viola! you have started a ruby blog
<phaul> sorry wrong position
awkwords has quit [Quit: sleepy time]
bambanx has joined #ruby
awkwords has joined #ruby
awkwords has quit [Client Quit]
ruby[bot] has joined #ruby
FrankD has quit [Read error: Connection reset by peer]
polishdub has quit [Quit: leaving]
bambanx has quit [Quit: Leaving]
chichou has joined #ruby
marius has joined #ruby
chichou has quit [Client Quit]
lunarkitty7 has quit [Ping timeout: 259 seconds]
bmurt has joined #ruby
Inline has quit [Read error: Connection reset by peer]
Inline has joined #ruby
code_zombie has quit [Quit: Leaving]
cruzo66342 has quit [Remote host closed the connection]
cruzo66342 has joined #ruby
Swyper has joined #ruby
Swyper has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sgen_ has quit [Ping timeout: 250 seconds]
clemens3_ has quit [Ping timeout: 250 seconds]
ogres has quit [Quit: Connection closed for inactivity]
AJA4350 has quit [Ping timeout: 246 seconds]
yitsushi is now known as efertone