Stuart Pontins
Stuart Pontins

Reputation: 285

Where are .gemspecs located?

Where do you find a .gemspec file related to a gem?

For example; Rapidfire for implementation of another gem into its engine?

Where are these .gemspec files located because I can't for the life of me find it and I've checked every folder associated with Rapidfire

Gem::Specification.new do |s|
  s.add_dependency "devise"
end

Where do I add this to make Devise work in Rapidfire?

Upvotes: 0

Views: 965

Answers (1)

Simone Carletti
Simone Carletti

Reputation: 176402

.gemspec files are located in the root of the repo. For example, here you can find the rapidfire.gemspec

Then the gem is packaged, the spec is serialized into a Ruby structured and stored in the metadata file within the gem.

If you download a gem, and rename the file from .gem to .zip (a .gem is essentially a zip file) you can explore its content. You'll find a metadata.gz file that is a compressed file, that stores the .gemspec data.

--- !ruby/object:Gem::Specification
name: rapidfire
version: !ruby/object:Gem::Version
  version: 2.1.0
platform: ruby
authors:
- Yuva Kumar
autorequire: 
bindir: bin
cert_chain: []
date: 2015-02-19 00:00:00.000000000 Z
...

Upvotes: 1

Related Questions