haf / semver Goto Github PK
View Code? Open in Web Editor NEWThis project forked from flazz/semver
gem: "semver2" fork. simple command line util & ruby module for managing versions according to http://semver.org
License: MIT License
This project forked from flazz/semver
gem: "semver2" fork. simple command line util & ruby module for managing versions according to http://semver.org
License: MIT License
I tried to package this gem using gem2rpm in the Open Build Service, but it requires RPM files to have a License
field, and the current gem version on rubygems.org does not contain the license information.
The commits adding this information were made shortly after the release of the current version (3.4.2) and it would be great if a new version of this gem with these changes could be published.
My convention to tag is without v
prefix. could the format be loaded from .semver
as well, so other project users follow same tagging format.
repeating semver format "%M.%m.%p%s"
is tedious.
[alias]
release = !semver increment patch && tag=$(semver format "%M.%m.%p%s") && git tag -a "$tag" -m \"Release $tag\" && git show "$tag"
...
/opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/xsemver.rb:29:in `block in find_file': undefined method `exists?' for File:Class (NoMethodError)
while !File.exists? path do
^^^^^^^^
Did you mean? exist?
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/xsemver.rb:28:in `chdir'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/xsemver.rb:28:in `find_file'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/xsemver.rb:18:in `find'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/runner.rb:59:in `block in <class:Runner>'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/dsl.rb:23:in `run_command'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/lib/runner.rb:15:in `initialize'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/bin/semver:6:in `new'
from /opt/homebrew/lib/ruby/gems/3.2.0/gems/semver2-3.4.2/bin/semver:6:in `<top (required)>'
from /usr/local/opt/gems/bin/semver:25:in `load'
from /usr/local/opt/gems/bin/semver:25:in `<main>'
โ ruby --version
ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]
Hi,
A colleague posted this on the parent repo. Thought I'd cross-post here:
Thanks for any insight.
According to https://semver.org/#spec-item-7 and https://semver.org/#spec-item-8 :
Patch version MUST be reset to 0 when minor version is incremented.
Patch and minor versions MUST be reset to 0 when major version is incremented.
# irb
irb(main):001:0> require 'semver'
=> true
irb(main):002:0> s = SemVer.new(1,2,3)
=> #<SemVer:0x0000557120b63050 @major=1, @minor=2, @patch=3, @special="", @metadata="">
irb(main):003:0> s.major += 1
=> 2
irb(main):004:0> s
=> #<SemVer:0x0000557120b63050 @major=2, @minor=2, @patch=3, @special="", @metadata="">
I'm using this locally:
class SemVer
def next_major
n = clone
n.major += 1
%w(minor patch).each { |v| n.send("#{v}=", 0) }
n
end
def next_minor
n = clone
n.minor += 1
n.patch = 0
n
end
def next_patch
n = clone
n.patch += 1
n
end
end
It would be nice if init (some new command is fine too) can initialize from existing version.
For example, to ensure the tags created by other means do not conflict.
$ semver init $(git describe --tags --abbrev=0)
$ cat .semver
---
:major: 0
:minor: 0
:patch: 0
:special: ''
:metadata: ''
Would be nice to define a license in the gemspec ;-) Maybe MIT ;)
Travis CI for this repository does not seem to be enabled:
https://travis-ci.org/haf/semver
Repository owner must do this, the switches are here:
https://travis-ci.org/account/repositories
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.