Gotchas for writing rubigem

There were questions with answers to how to write rubygems, but what should you avoid when writing rubigems? What can cause problems for people using your rubygem?

+5
source share
1 answer

Gem Packaging: Best Practices gives a lot of advice, some of which include

  • Do not pollute the global download path. Ideally, only foo.rbin your directory liband put all other files in lib/foo.

  • Do not use requirefiles with __FILE__.

  • - . , . , -

    VERSION =:: File.read(:: File.join(:: File.dirname(FILE), "..", "..", "VERSION" )).

  • $LOAD_PATH lib.

  • VERSION.

  • . , , rubygems, ( ). , rescue Gem::LoadError.

Rubygems. ... , .

: , , . .

+5

All Articles