<zaben[m]>
this allows it to load things like the ActionController::Base Class without needing to do something like require 'rails/action_controller/base'
<zaben[m]>
Otherwise you are typically calling `require` somewhere in your code (doesn't have to be the same file the class is used) to load classes into Ruby. Where `require` points to something like '<gem_name>/file_to_load' or `require_relative '/some/path/to/ruby_file'`
<zaben[m]>
unlike in Python (looks like your example comes from) you don't need to explicitly import Classes or Modules to be able to use them
crax23 has quit [Ping timeout: 256 seconds]
cartdrige has joined #ruby
ur5us has joined #ruby
moldorcoder7 has quit [Ping timeout: 272 seconds]
Sankalp has quit [Ping timeout: 256 seconds]
Sankalp has joined #ruby
ur5us has quit [Ping timeout: 246 seconds]
crax23 has joined #ruby
cartdrige has quit [Ping timeout: 256 seconds]
Y05hito__ has joined #ruby
tomtmym has joined #ruby
tomtmym has quit [Changing host]
tomtmym has joined #ruby
crax23 has quit [Ping timeout: 260 seconds]
aeris has quit [Remote host closed the connection]
aeris has joined #ruby
Linux_Kerio has quit [Quit: Konversation terminated!]
Linux_Kerio has joined #ruby
Linux_Kerio has quit [Ping timeout: 256 seconds]
Rounin has joined #ruby
Rounin has joined #ruby
Rounin has quit [Changing host]
hightower2 has joined #ruby
Linux_Kerio has joined #ruby
teclator has joined #ruby
teclator has quit [Remote host closed the connection]
ur5us has joined #ruby
<introom>
zaben[m]:when hovering on ActionController (in rubymine) and go to defintion, it pops up several of them: https://i.imgur.com/Uu41b8B.png
FullMetalStacker has joined #ruby
<introom>
I wonder how ruby selects among them
TomyWork has joined #ruby
<zaben[m]>
When Ruby finds the same class defined, it will merge them in the order it loads them in (monkey patching), this allows us to continue to add functionality to a Class as required. When you are using something like RubyMine which shows all files that references the class ActionController definition, all those files are continuing to add functionality, but due to how Ruby loads files, it doesn't need to match the name of the file. For example:
ur5us_ has quit [Remote host closed the connection]
jvalleroy has joined #ruby
ur5us_ has joined #ruby
Linux_Kerio has quit [Ping timeout: 255 seconds]
dionysus69 has joined #ruby
<jhass[m]>
It's IntelliJ, so I'd guess a fair mix between Java and Kotlin these days
<introom>
zaben[m]:thanks for the expalation. back into my picture: https://i.imgur.com/Uu41b8B.png there are lots of files containing ActionController. I wonder *WHICH* files are required.
<introom>
there must be some place to define what files to require.
FullMetalStacker has quit [Read error: Connection reset by peer]
nemesit has quit [Read error: Connection reset by peer]
hrberg has quit [Ping timeout: 256 seconds]
nemesit has joined #ruby
hrberg has joined #ruby
konsolebox has quit [Remote host closed the connection]
cartdrige has joined #ruby
willfish has quit [Ping timeout: 265 seconds]
crax23 has joined #ruby
ur5us_ has joined #ruby
cartdrige has quit [Ping timeout: 252 seconds]
caedmon has quit [Remote host closed the connection]
caedmon has joined #ruby
<isene>
ox1eef_: So, I moved all my lib files to a new directory, xlib. I added xrpn_load.rb in lib with a simple command; `Dir[__dir__ + "/../xlib/*"].each { |file| load file }` I included the file in the gemspec. Now how do I ensure that this is run when the main file runs `require xrpn`?
<isene>
adam12:^^^
<adam12>
isene: Make a file called `xrpn.rb` in lib, and have it `require_relative "xrpn_load"`.
<adam12>
isene: require "xrpn" is essentially `$LOAD_PATH.each { |path| require File.join(path, "xrpn.rb") rescue LoadError nil }`. Since `$LOAD_PATH` will include your gem `lib`, it will eventually come across xrpn-1.2.3/lib and try to require `xrpn.rb` from it.
<isene>
Why not just put the load comman directly into the xrpn.rb?
<isene>
adam12: Basically rename my xrpn_load.rb to xrpn.rb?
<adam12>
isene: Sure, that's fine too.
FullMetalStacker has joined #ruby
FullMetalStacker has quit [Client Quit]
cryptkeeper has joined #ruby
matoro has joined #ruby
matoro has quit [Changing host]
Laplace has joined #ruby
stirl has joined #ruby
stirl has quit [Remote host closed the connection]
stirl has joined #ruby
dionysus69 has joined #ruby
otisolsen70 has quit [Quit: Leaving]
mahler is now known as mahler|away
___nick___ has joined #ruby
<isene>
adam12: Damn, can't get it to work... do I have to specify lib/xrpn.rb as executable in the gemspec also (in addition to the main program `xrpn`)?
<adam12>
isene: No. Can you make sure your changes are on GitHub in a branch? I'll check them out and look.
Y05hito__ has joined #ruby
<isene>
adam12: OK, I'll do that tomorrow. Need to go horizontal now and get some sleep. And, btw; Thanks for all the help you're offering here. It's highly appreciated.