'is it possible to get a gemspec from a .gem archive?

This might be really naive as I have never had to do this before but is there a way to generate a .gemspec file from a .gem? Like the opposite of gem build xxx.



Solution 1:[1]

A .gem file is basically a .tar archive. Inside this .tar archive you will have 2 important files:

  • data.tar.gz - containing the source code and possibly a .gemspec file (this is not a guarantee though)
  • metadata.gz - basically a .gemspec, but in a YAML format which you won't be easily able to convert back

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 hmdne