What is the Ruby equivalent of python setup.py?

I'm new to ruby ​​and I need to debug some ruby ​​application packaged as a gem.

I use rvm, where I installed the package as a gem, and also received a new github version of this package. How can I tell my rvm environment to use the code in the github repository instead of the gem installed?

This is the equivalent of python setup.py develop for people familiar with python.

Setuptools allows you to deploy your projects for use in a shared directory or staging area, but without copying any files. Thus, you can edit each project code in your upload directory

https://pythonhosted.org/setuptools/setuptools.html#development-mode

+7
source share
2 answers

Yes, you can.

Check out the Bundler . This is the actual standard for its use.

+7
source

In addition to the previous answer.

Sometimes gems / packages provide an executable. The good thing with python setup.py develop is that you will always have the latest version of this executable in its path. It is very convenient for development. As far as I know, Gem does not provide such functionality. To emulate this, you can use the Bundler , and it is like this:

  • First create a new Gemfile: bundle init
  • Then edit this file and add the local Gem you are working on (for me it's Nanoc): gem "nanoc", path: "path/to/local/nanoc"
  • Then, to access the executable provided by Gem, you can use bundler like this: bundle exec nanoc ...

Here, bundle exec will take the Gem version from your Gemfile and use it. If this Gem is specified with the :path option, then it will use this.

Of course, it’s less convenient that in Python, but this is the closest solution I found in Ruby.

0
source

All Articles