rhannequin / astronoby

Ruby library based on astronomy and astrometry books
https://dev.to/rhannequin/series/17782
MIT License
59 stars 2 forks source link

Simplify gemspec required gems #98

Closed trevorturk closed 2 months ago

trevorturk commented 2 months ago

Description

I noticed in astronoby.gemspec we have the following:

  spec.add_dependency "matrix", "~> 0.4.2"
  spec.add_dependency "rake", "~> 13.0"
  spec.add_dependency "rspec", "~> 3.0"

  spec.add_development_dependency "standard", "~> 1.3"

...which means an app using the gem will get rspec included in the dependencies (for all envs) for rspec etc.

Reproduction Steps

Add gem "astronoby" to an existing Rails app etc and run bundle install.

Note in the Gemfile.lock:

    astronoby (0.5.0)
      matrix (~> 0.4.2)
      rake (~> 13.0)
      rspec (~> 3.0)

Expected behavior

Gemfile.lock should not get rspec added if it's not already in use (and other gems).

Actual behavior

Gemfile.lock gets rspec etc added.

System configuration

astronoby version: 0.5.0 ruby version: 3.3.5

I believe we can change at least respec from add_dependency to add_development_dependency.