Is it useful to declare development dependencies in gemspec when using a binder?

I am working on a new Ruby Gem. I am familiar with using the Bundler to manage gems:

source "https://rubygems.org"

gemspec

gem 'rspec-rails'

I am familiar with defining dependencies in the gemspec file:

Gem::Specification.new do |s|
  # ...
  s.add_dependency "rails", "~> 4.1.5"
end

The created Gemfile mentions that I should move the dependency declarations from my Gemfile to my gemspec when I am ready for release.

# Declare any dependencies that are still in development here instead of in
# your gemspec. These might include edge Rails or gems from your path or
# Git. Remember to move these dependencies to your gemspec before releasing
# your gem to rubygems.org.

Why do I want to do this? Why does my gemspec care about which gems I use in development? What purpose development_dependencydoes what the Bundler no longer does for me?

+4
source share
2 answers

, Bundler Rubygems. , .

[ Gemfile .gemspec]?

Gemfile , . , Git ( - ).

, Rubygem , .gemspec. gemspec Bundler Rubygems. , gem, .gemspec

gemspec , ?

add_development_dependency:

, .

Rspec. Rspec , , .

+1

, " ", ", ". , , , Git. RubyGems Git; , Bundler . , , RubyGems (, VCS), Gemfile .gemspec.

+1

All Articles