Skip to content

Utility to rewrite .gemspec for dependency versions #21

Description

@jdickey

There's a note in the crypt_ident.gemspec file reminding us that

NOTE: During development, we're not specifying Gem versions, because we're bundling locally using bin/setup and scripts/build-gem-list.rb. Before merging back to master, at latest, this must be updated to show minimum Gem versions; e.g., '>= 3.1.12' for bcrypt. It Would Be Very Nice if we had a script to automatically rewrite the Gemspec for us each way. PRs welcome.

So, basically, this utility, let's call it gemspec_versions, would take one of two command-line parameters:

  • --lock-down would rewrite each add_runtime_dependency and add_development_dependency specification in the .gemspec to specify a version greater than or equal to the version in the present Gemfile.lock. For example (as of mid-December, 2018), it would rewrite the line
  spec.add_development_dependency "minitest"

to

  spec.add_development_dependency "minitest", '5.11.3'
  • --unlock would rewrite each dependency specification which includes a version specification to omit the version specifier, exactly reversing the --lock option.

Given a locked-down .gemspec and a Gemfile.lock file, running the commands gemspec_versions --unlock && gemspec_versions --lock must produce a .gemspec that matches the original.

Marking this as TGF, though having it for the next update cycle would be a Very Good Thing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAdditional function or capability of existing featuregood first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions