Skip to content

Consider enabling - (dash/hypen) in prerelease strings #3086

@aharpervc

Description

@aharpervc

I'm having a problem and would like to a feature.

My current problem is:

I would like to publish prerelease versions with dashes, eg something like 1.2.0.pre-update-logo. This appears to not be possible as of rubygems version 3.0.4:

irb(main):001:0> Gem::Version.new('1.2.0.pre-update-logo')
=> #<Gem::Version "1.2.0.pre.pre.update.pre.logo">

The -'s are all replaced by .pre. which is fairly unhelpful (except possibly the first replacement). That happens here: https://github.com/rubygems/rubygems/blob/d8fa21e82b5669880331e2fe236b2cede1d6c4fb/lib/rubygems/version.rb#L221

Dashes in prerelease versions are allowed by the SemVer spec:

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]

Note that I'm not asking about "FULL SEMVER", but only about dashes in prerelease labels

This issue is related to:

  • Network problems
  • Installing a library
  • Publishing a library
  • The command line gem
  • Other

Other issues:

Here are my current environment details:

$ gem env version
RubyGems Environment:
  - RUBYGEMS VERSION: 3.0.4
  - RUBY VERSION: 2.5.3 (2018-10-18 patchlevel 105) [x86_64-linux]
(etc, n/a)

I will abide by the code of conduct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions