1
I have several Engines in my API, all have as a dependency Artemis::Core
.
I want to understand the difference between declaring Gemfile
, for example Gem artemis-core
:
source 'https://rubygems.org'
gem 'artemis-core', '~> 0.0.1'
gemspec
And declare in the same Gem in the file gemspec
:
$LOAD_PATH.push File.expand_path('../lib', __FILE__)
require 'artemis/support/version'
Gem::Specification.new do |s|
s.name = 'artemis-support'
s.version = Artemis::Support::VERSION
s.authors = ['Secret Name']
s.email = ['[email protected]']
s.summary = 'Secret summary'
s.files = Dir['{app,config,db,lib}/**/*', 'Rakefile', 'README.md']
s.add_dependency 'rails', '~> 5.0.2', '>= 5.0.2'
s.add_dependency 'artemis-core', '~> 0.0.1'
s.add_development_dependency 'pg', '~> 0.20'
end
I know that automatically the gemspec
inherits the Gems declared in Gemfile
.
Is there any special rule for such situations? Thank you.
This influences the dependencies that will be installed by the host?
– Bruno Wego
Making some tests I understood better, for this example what goes to the
Gemfile
will be used to develop Gem, and what goes to thegemspec
shall be used to rotate the Gem.– Bruno Wego