deb_version 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da683bbad0561bf83d9e53fb06c0c15b4e91f7a0d965a9896f9b2488b0aa075a
4
- data.tar.gz: '061307976f05755c2a8aa14f3f25a9138b944f1385e30b85d30a4eea4f8edc90'
3
+ metadata.gz: f72ae7e36419f0ef876d4642f3e06ae058d5168da675477d0d3afc341cb4cb05
4
+ data.tar.gz: 86ae7061b1030633724befc368d3a1dec093f87070d3baba11d5260c9d3b955f
5
5
  SHA512:
6
- metadata.gz: e1ce022f6a242e528c54c818dee4689c49881f32457d0113804327f749dffb91a78b1f55e160e3fb2f750f90b017dd25652af29da59761626a47adfb0a939800
7
- data.tar.gz: 567f056f47116d4eb68dadff2038041a5c9df017a541ccc0811dbd3be5f250876074aa8b49e7da497656a1de5c138bfbd5e1f6b6d33b2a9fceaf5a3a3f2dbaa3
6
+ metadata.gz: 7960018f5b00825dc38fc58720af204aaed05ed1c74a70e9cdae00640341993e6fe86e7ed5865fc7875a68fd16d54245b154712fea0d6777d715598214c3b6a3
7
+ data.tar.gz: 25aa6034cc10675a821236dea14dd514b471e23c1c648518b7464f70bb4bca77ef890b9f0461483614fc69fa1fe637d60b0f1c80f45b9ce409bea8e6e63ef307
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [1.0.1] - 2023-05-30
4
+ - Bug fix for versions using `z`
5
+ - Adds a new `to_s` method.
6
+
3
7
  ## [0.1.0] - 2023-05-07
4
8
 
5
9
  - Initial release
data/README.md CHANGED
@@ -34,6 +34,8 @@ Run `bundle exec rake rubocop` to check for style violations.
34
34
 
35
35
  Run `bundle exec rake test` to run tests.
36
36
 
37
+ See [HACKING.md](HACKING.md) for further details.
38
+
37
39
  ## Contributing
38
40
 
39
41
  Bug reports and pull requests are welcome on GitHub at https://github.com/captn3m0/ruby-deb-version. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/captn3m0/ruby-deb-version/blob/main/CODE_OF_CONDUCT.md).
data/bin/console ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "deb_version"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ require "irb"
11
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -31,6 +31,14 @@ class DebVersion
31
31
  [@epoch, @upstream_version, @debian_revision]
32
32
  end
33
33
 
34
+ def to_s
35
+ result = ""
36
+ result << "#{@epoch}:" if @epoch != 0
37
+ result << @upstream_version
38
+ result << "-#{@debian_revision}" unless @debian_revision.empty?
39
+ result
40
+ end
41
+
34
42
  # Internal method to get the largest digit prefix
35
43
  def get_digit_prefix(characters)
36
44
  value = 0
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class DebVersion
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
data/lib/deb_version.rb CHANGED
@@ -14,7 +14,7 @@ class DebVersion
14
14
 
15
15
  # Sorted list of characters used by Debian Version sort.
16
16
  # see https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
17
- SORT_LIST = ["~", ""] + ("A"..."Z").to_a + ("a"..."z").to_a + PUNCTUATION
17
+ SORT_LIST = ["~", ""] + ("A".."Z").to_a + ("a".."z").to_a + PUNCTUATION
18
18
 
19
19
  mapping = {}
20
20
  SORT_LIST.each_with_index do |char, index|
metadata CHANGED
@@ -1,85 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deb_version
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nemo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-25 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: minitest
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.18'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.18'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '13.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '13.0'
41
- - !ruby/object:Gem::Dependency
42
- name: rubocop
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '1.21'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '1.21'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop-minitest
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.31.0
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.31.0
69
- - !ruby/object:Gem::Dependency
70
- name: rubocop-rake
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 0.6.0
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 0.6.0
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
+ dependencies: []
83
13
  description:
84
14
  email:
85
15
  - rubygem@captnemo.in
@@ -87,19 +17,14 @@ executables: []
87
17
  extensions: []
88
18
  extra_rdoc_files: []
89
19
  files:
90
- - ".rubocop.yml"
91
20
  - CHANGELOG.md
92
- - CODE_OF_CONDUCT.md
93
- - Gemfile
94
- - Gemfile.lock
95
21
  - LICENSE.txt
96
22
  - README.md
97
- - Rakefile
98
- - deb_version.gemspec
23
+ - bin/console
24
+ - bin/setup
99
25
  - lib/deb_version.rb
100
26
  - lib/deb_version/compare.rb
101
27
  - lib/deb_version/version.rb
102
- - sig/deb_version.rbs
103
28
  homepage: https://github.com/captn3m0/ruby-deb-version
104
29
  licenses:
105
30
  - MIT
data/.rubocop.yml DELETED
@@ -1,22 +0,0 @@
1
- require:
2
- - rubocop-minitest
3
- - rubocop-rake
4
-
5
- Style/StringLiterals:
6
- Enabled: true
7
- EnforcedStyle: double_quotes
8
-
9
- Style/StringLiteralsInInterpolation:
10
- Enabled: true
11
- EnforcedStyle: double_quotes
12
-
13
- Layout/LineLength:
14
- Max: 120
15
- Metrics/MethodLength:
16
- Max: 20
17
-
18
- AllCops:
19
- NewCops: enable
20
- TargetRubyVersion: 3.0
21
- Lint/BinaryOperatorWithIdenticalOperands:
22
- Enabled: false
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at coc@captnemo.in. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile DELETED
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Specify your gem's dependencies in deb_version.gemspec
6
- gemspec
data/Gemfile.lock DELETED
@@ -1,55 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- deb_version (0.1.0)
5
-
6
- GEM
7
- remote: https://rubygems.org/
8
- specs:
9
- ast (2.4.2)
10
- json (2.6.3)
11
- json (2.6.3-java)
12
- minitest (5.18.0)
13
- parallel (1.23.0)
14
- parser (3.2.2.1)
15
- ast (~> 2.4.1)
16
- rainbow (3.1.1)
17
- rake (13.0.6)
18
- regexp_parser (2.8.0)
19
- rexml (3.2.5)
20
- rubocop (1.50.2)
21
- json (~> 2.3)
22
- parallel (~> 1.10)
23
- parser (>= 3.2.0.0)
24
- rainbow (>= 2.2.2, < 4.0)
25
- regexp_parser (>= 1.8, < 3.0)
26
- rexml (>= 3.2.5, < 4.0)
27
- rubocop-ast (>= 1.28.0, < 2.0)
28
- ruby-progressbar (~> 1.7)
29
- unicode-display_width (>= 2.4.0, < 3.0)
30
- rubocop-ast (1.28.1)
31
- parser (>= 3.2.1.0)
32
- rubocop-minitest (0.31.0)
33
- rubocop (>= 1.39, < 2.0)
34
- rubocop-rake (0.6.0)
35
- rubocop (~> 1.0)
36
- ruby-progressbar (1.13.0)
37
- unicode-display_width (2.4.2)
38
-
39
- PLATFORMS
40
- universal-java-1.8
41
- universal-java-11
42
- x86_64-darwin
43
- x86_64-darwin-20
44
- x86_64-linux
45
-
46
- DEPENDENCIES
47
- deb_version!
48
- minitest (~> 5.18)
49
- rake (~> 13.0)
50
- rubocop (~> 1.21)
51
- rubocop-minitest (~> 0.31.0)
52
- rubocop-rake (~> 0.6.0)
53
-
54
- BUNDLED WITH
55
- 2.4.12
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rubocop/rake_task"
5
- require "minitest/test_task"
6
-
7
- RuboCop::RakeTask.new
8
-
9
- Minitest::TestTask.create(:test) do |t|
10
- t.warning = false
11
- t.test_globs = ["test.rb"]
12
- end
13
-
14
- task default: :test
data/deb_version.gemspec DELETED
@@ -1,38 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative "lib/deb_version/version"
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "deb_version"
7
- spec.version = DebVersion::VERSION
8
- spec.authors = ["Nemo"]
9
- spec.email = ["rubygem@captnemo.in"]
10
-
11
- spec.summary = "A port of Debian Version comparison to Ruby."
12
- spec.homepage = "https://github.com/captn3m0/ruby-deb-version"
13
- spec.license = "MIT"
14
- spec.required_ruby_version = ">= 3.0.0"
15
-
16
- spec.metadata["homepage_uri"] = spec.homepage
17
- spec.metadata["source_code_uri"] = "https://github.com/captn3m0/ruby-deb-version"
18
- spec.metadata["changelog_uri"] = "https://github.com/captn3m0/ruby-deb-version/blob/main/README.md"
19
-
20
- # Specify which files should be added to the gem when it is released.
21
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
- spec.files = Dir.chdir(__dir__) do
23
- `git ls-files -z`.split("\x0").reject do |f|
24
- (File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git all-debian-versions.lst
25
- test.rb])
26
- end
27
- end
28
-
29
- spec.require_paths = ["lib"]
30
-
31
- spec.add_development_dependency "minitest", "~> 5.18"
32
- spec.add_development_dependency "rake", "~> 13.0"
33
- spec.add_development_dependency "rubocop", "~> 1.21"
34
- spec.add_development_dependency "rubocop-minitest", "~> 0.31.0"
35
- spec.add_development_dependency "rubocop-rake", "~> 0.6.0"
36
-
37
- spec.metadata["rubygems_mfa_required"] = "true"
38
- end
data/sig/deb_version.rbs DELETED
@@ -1,4 +0,0 @@
1
- module DebVersion
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end