<old_relik>
in any case, is there a simple one-pass way of making this structure
dfucci has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
dfucci_ has joined #ruby
braincrash has joined #ruby
arahael has left #ruby ["WeeChat 2.7.1"]
dualfade has quit [Ping timeout: 256 seconds]
dualfade has joined #ruby
dfucci_ has quit [Ping timeout: 246 seconds]
old_relik has quit [Remote host closed the connection]
<leftylink>
what the hell
<leftylink>
I had just finished thinking of how I want to answer the question
<leftylink>
that is really frustrating
<leftylink>
and I am powerless to do anything about it! that is what makes it the most frustrating
<leftylink>
like, sure, I can withhold my answer (which I will), but that has absolutely no effect on the state of affairs, so it's not even like it's a punitive measure that achieves any sense of justice
<leftylink>
so people who get off on spite won't even be satisfied
<leftylink>
don't drink and irc
<leftylink>
goodbye for now while I cool off ("cool off" being a euphemism for what is actually happening)
ChmEarl has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BrianWGray has joined #ruby
Emmanuel_ChanelW has quit [Quit: Leaving]
GodFather has quit [Ping timeout: 260 seconds]
aldoescudero has joined #ruby
hiroaki has joined #ruby
aldoescudero has quit [Ping timeout: 256 seconds]
cuerbot has joined #ruby
elcuervo has quit [Ping timeout: 264 seconds]
skape has quit [Quit: Connection closed for inactivity]
howdoi has joined #ruby
ruurd has joined #ruby
vqrs has quit [Ping timeout: 272 seconds]
vqrs has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Rudd0 has quit [Remote host closed the connection]
_whitelogger has joined #ruby
akemhp has joined #ruby
ams___ has joined #ruby
adu has joined #ruby
akemhp has quit [Remote host closed the connection]
akemhp has joined #ruby
akemhp has quit [Remote host closed the connection]
adu has quit [Quit: adu]
skape has joined #ruby
akemhp has joined #ruby
Rudd0 has joined #ruby
davispuh has joined #ruby
akemhp has quit [Remote host closed the connection]
TCZ has quit [Quit: Leaving]
akemhp has joined #ruby
akemhp has quit [Remote host closed the connection]
sgen has quit [Ping timeout: 246 seconds]
aldoescudero has joined #ruby
adu has joined #ruby
DaRock has quit [Ping timeout: 240 seconds]
GodFather has joined #ruby
akemhp has joined #ruby
per1 has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
akemhp_ has joined #ruby
Asa has joined #ruby
Asa is now known as Guest5257
orbyt_ has joined #ruby
aldoescudero has quit [Ping timeout: 265 seconds]
PikaChokeMe has quit [Quit: Leaving]
jenrzzz has joined #ruby
Blacink has quit [Quit: This computer has gone to sleep]
mac_ has quit [Quit: This computer has gone to sleep]
Blacink has joined #ruby
mac_ has joined #ruby
nofxx has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 264 seconds]
nofxx has joined #ruby
tumdum has quit [Remote host closed the connection]
tumdum has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adu has quit [Quit: adu]
imode has joined #ruby
mozzarella has joined #ruby
aldoescudero has joined #ruby
aldoescudero has quit [Ping timeout: 256 seconds]
dfucci has joined #ruby
jenrzzz has joined #ruby
GodFather has quit [Ping timeout: 260 seconds]
orbyt_ has joined #ruby
ams___ has quit [Quit: Connection closed for inactivity]
jenrzzz has quit [Ping timeout: 260 seconds]
per1 has quit [Quit: Leaving]
mac_ has quit [Quit: This computer has gone to sleep]
Blacink has quit [Quit: This computer has gone to sleep]
howdoi has quit [Quit: Connection closed for inactivity]
dviola has quit [Quit: WeeChat 2.9]
dviola has joined #ruby
Guest5257 has quit [Ping timeout: 240 seconds]
Rudd0 has quit [Remote host closed the connection]
neshpion has joined #ruby
aandrew has joined #ruby
dfucci has quit [Read error: Connection reset by peer]
weaksauce has joined #ruby
TCZ has joined #ruby
aldoescudero has joined #ruby
mac_ has joined #ruby
Blacink has joined #ruby
shokohsc has quit [Ping timeout: 256 seconds]
howdoi has joined #ruby
cnsvc has joined #ruby
dionysus69 has joined #ruby
go|dfish has quit [Quit: WeeChat 1.4]
go|dfish has joined #ruby
Blacink has quit [Quit: Leaving]
mac_ has quit [Quit: Leaving]
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Read error: Connection reset by peer]
Emmanuel_Chanel has quit [Quit: Leaving]
<nakilon>
when I'm developing a gem, how am I supposed to install what's listed as add_development_dependency?
<havenwood>
nakilon: Typically there's a Gemfile with a `gemspec` line which installs those when you run `bundle`.
<havenwood>
nakilon: How deps are installed is just by convention so it may vary.
<havenwood>
nakilon: Typically, install deps with `bundle` and run tests with `rake`.
<havenwood>
nakilon: Or rather: bundle exec rake
<nakilon>
oh indeed, didn't know this Gemfile thing installs dev deps
<havenwood>
nakilon: It does if you have the `gemspec` directive, which I do for gems and see commonly.
<nakilon>
yep
<nakilon>
otherwise there is no point in having Gemfile in the gem repo though
Emmanuel_Chanel has joined #ruby
jcsaba has joined #ruby
adu has joined #ruby
ChmEarl has quit [Quit: Leaving]
Secret-Fire has quit [Remote host closed the connection]
cliluw has quit [Read error: Connection reset by peer]
<nakilon>
imagine there is some popular lib/gem/framework with its classes and I made a gem that adds functionality to some class of it
<nakilon>
the OOP tells me that since the custom routines that I implement are going to be executes only around that class I have to include my module into it
<nakilon>
now what if years later that class starts having the method with the same name as one that I made for my functionality? should I kind of "move"? rename my stuff to avoid collisions?
<nakilon>
I wonder if there are any other ways to solve the issue
ruurd has quit [Read error: Connection reset by peer]
ruurd has joined #ruby
cliluw has quit [Ping timeout: 260 seconds]
cliluw has joined #ruby
adu has quit [Quit: adu]
postmodern has joined #ruby
<havenwood>
nakilon: When you want to add pluggable functionality to a gem. Plugins are pretty common and work well. https://guides.rubygems.org/plugins/
<havenwood>
nakilon: Well that link is plugins to rubygems itself, but namespace under the gem. Let me find a link.
aldoescudero has quit [Remote host closed the connection]
aldoescudero has joined #ruby
aldoescudero has quit [Ping timeout: 240 seconds]
neshpion has quit [Quit: WeeChat 2.9]
powerhouse has joined #ruby
aandrew has left #ruby [#ruby]
shokohsc has joined #ruby
neshpion has joined #ruby
<nakilon>
the case of cry is not very clear to me -- I guess they have the plugins pattern from the beginning
<nakilon>
the case of Net::HTTP -- they add a submodule/subclass, not expand an existing one with new methods
<nakilon>
imagine it's Selenium::WebDriver::Node or Ferrum::Node -- instances that their libraries instantiate massively whenever they want, and I want a Node to have my method
pwnd_sfw has quit [Remote host closed the connection]
<havenwood>
nakilon: By not commingling plugin methods you can have many plugins without stomping on each other.
<nakilon>
Net::HTTP is actually a module while ...::Node is a class
<havenwood>
nakilon: Either way, you can have plugins. If it's a core feature, make it core.
<havenwood>
nakilon: If you have some code, we could advise. With what you've said, I'd suggest avoid a design where you're accreting modules in mix in to a core, since you'll just end up with a god object with methods stomping on each other.
<havenwood>
nakilon: The only reasons for modules and classes is to make it easier for us humans.
<havenwood>
Try the simplest thing that can possibly work first.
<havenwood>
nakilon: As a general principle, make plugins pluggable and don't stomp on core behavior.
<havenwood>
nakilon: If you have specific code, someone in the channel may have specific suggestions.
<nakilon>
the simpliest thing is to make user able to call node.my_cool_method where node is from someone's library and my_cool_method is mine; but I can't garauntee that they won't add the same method too
<havenwood>
nakilon: Well, it's simpler to just reopen the class.
<havenwood>
nakilon: But we want to avoid method collision, so use a separate namespace for plugins typically.
<nakilon>
I mean I'll overwrite the existing method and it will break
<nakilon>
if Node was a Module it would not be a problem since I could put my module inside
<nakilon>
but it's a class
<havenwood>
nakilon: When you say "put my module inside" what do you mean?
<havenwood>
nakilon: You can namespace within a class. And you can mixin to a class. What is it you're trying to do that a class doesn't work?
<nakilon>
I mean a = Theirmodule::Myextention.new; a.cool_method()
<havenwood>
nakilon: You can mixin to a class. Consider whether you should be mixing in though.
<havenwood>
nakilon: What's the problem with?: a = Theirmodule::Myextention.new; a.cool_method()
<havenwood>
Seems fine to me?
<havenwood>
Concrete code might help.
<havenwood>
Or maybe someone else get's what the problem is.
<havenwood>
gets*
<havenwood>
(I'm multitasking at the moment. Saturday! \o/)
<nakilon>
Node is a class, the webdriver node (after you find it on the page with css/xpath selector) is an instance that has it's own methods designed my Webdriver/Selenium developers to be called via . (dot)
<nakilon>
but if I want to call my cool method via dot too there can appear a collision if they come up with the same method name in future
<nakilon>
*designed by
Rounin has quit [Remote host closed the connection]
<havenwood>
nakilon: You can design it in many ways. For example: Node.new.your_plugin.novel_method
<havenwood>
nakilon: Method chaining is one option.
<nakilon>
the collision will happen no matter what the implementation is -- my question is are there any other nice ways to add my method other than calling it via dot
<nakilon>
Node.new.your_plugin.novel_method -- now my plugin collides with their method )
<havenwood>
nakilon: Do they have a method called #your_plugin already?
<nakilon>
they will tomorrow
<havenwood>
nakilon: Typically you don't allow two plugins of the same name.
<havenwood>
nakilon: The name of your gem or plugin must be unique, then you namespace under it to avoid any collisions.
<havenwood>
nakilon: Namespaces of plugins are what keep plugins separate. They must be named differently.
<havenwood>
nakilon: Similarly, namespaces of gems are what keep gems separate.
<nakilon>
"namespace under it" -- it's a case about module, not the class instance
<havenwood>
nakilon: You can namespace under either. I don't really get the problem here.
<nakilon>
you can't namespace under the instance
<havenwood>
nakilon: There are all sorts of ways to add behavior to an instance without colliding. You can enclose around it like `Node::Foo(node)` or you can have a convention for plugins having a method namespace like `node.foo.bar` or all sorts of ways depending on what you're doing.
<havenwood>
nakilon: In Ruby there are almost always many ways to do it. I suspect there're many ways to do what you're asking. If you can extract a code example I'm sure folk here can suggest a few ways.
<nakilon>
Node::Foo(node) -- this is interesting, but makes code bigger
<havenwood>
nakilon: If you want to entangle plugins deeply, design around a convention like Roda and Sequel do. Typically, a class/module namespace suffices like the Pry plugins I linked above - which are more shallowly entangled and therefore require less adherence to convention.
<havenwood>
nakilon: Elegant plugins are probably seen less often than they should be, ideally. I do think it's a worthwhile endeavor to study excellent implementations for ideas. In general, keep it as simple as you can.
<havenwood>
A small core is a worthy target for many cases, so plugins can be handy.
<nakilon>
thanks for the links
<havenwood>
no prob - any time
aandrew has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]