Skip to content

Simplify gemspec required gems #98

@trevorturk

Description

@trevorturk

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions