semantic_range 1.0.0 → 2.0.0

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
  SHA1:
3
- metadata.gz: cb5291e42f7111e3e2a32c66c9ea3bf647b8476f
4
- data.tar.gz: c56b165d6e765b0d9360f0ec32cc8bcd8014018a
3
+ metadata.gz: a72dfb5f4daf51c6e6d88874e8841c320d27dfaf
4
+ data.tar.gz: 90a11311eb49a841ca6a6d811dfd6e9e459e3064
5
5
  SHA512:
6
- metadata.gz: 94c4fb6189ca2e27813a0a792516c90517456789818626f10a634dcebbf9e53d5eebd6608c5175c38f424f401f42b90fba722fb97fd880c25284a26276e20171
7
- data.tar.gz: edeaddff9d68446766e4cfda74537d033342c6716054eaf95b663312cc644a616b459abdedfd2bbcbefe1f716edd500ce1c2afa6fd7077efd6f38e235215a295
6
+ metadata.gz: 64ec8be0833eb08994a285705502f29973447291e91fb34655f38734d64bb3e00a3f9297c782fe6b856aa75800b4687a58edfe36036f6d7f1ef824881581be12
7
+ data.tar.gz: 355e05563a46f6258e0c3783dff2f9fa9dade4e00ce86af3d8f79643b9b64f82595aaee3e30154a629a67b7fbb2073c036c3801f7e06dba047008b4b98b4f142
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2.3
4
- before_install: gem install bundler -v 1.10.6
3
+ - 2.2.4
4
+ before_install: gem install bundler -v 1.11
5
+ cache: bundler
6
+ sudo: false
data/CODE_OF_CONDUCT.md CHANGED
@@ -1,13 +1,74 @@
1
- # Contributor Code of Conduct
1
+ # Contributor Covenant Code of Conduct
2
2
 
3
- As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
3
+ ## Our Pledge
4
4
 
5
- We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
6
11
 
7
- Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
12
+ ## Our Standards
8
13
 
9
- Project maintainers 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. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
10
16
 
11
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
12
22
 
13
- This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at andrew@libraries.io. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,10 @@
1
+ # Contributing
2
+
3
+ * Fork the project.
4
+ * Make your feature addition or bug fix.
5
+ * Add tests for it. This is important so I don't break it in a future version unintentionally.
6
+ * Send a pull request. Bonus points for topic branches.
7
+
8
+ ## Code of Conduct
9
+
10
+ Please note that this project is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By participating in this project you agree to abide by its terms.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Andrew Nesbitt
3
+ Copyright (c) 2016 Andrew Nesbitt
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -50,12 +50,12 @@ module SemanticRange
50
50
  class InvalidComparator < StandardError; end
51
51
  class InvalidRange < StandardError; end
52
52
 
53
- def self.ltr(version, range, loose = false)
54
- outside(version, range, '<', loose)
53
+ def self.ltr(version, range, loose = false, platform = nil)
54
+ outside(version, range, '<', loose, platform)
55
55
  end
56
56
 
57
- def self.gtr(version, range, loose = false)
58
- outside(version, range, '>', loose)
57
+ def self.gtr(version, range, loose = false, platform = nil)
58
+ outside(version, range, '>', loose, platform)
59
59
  end
60
60
 
61
61
  def self.cmp(a, op, b, loose = false)
@@ -85,11 +85,11 @@ module SemanticRange
85
85
  end
86
86
  end
87
87
 
88
- def self.outside(version, range, hilo, loose = false)
88
+ def self.outside(version, range, hilo, loose = false, platform = nil)
89
89
  version = Version.new(version, loose)
90
- range = Range.new(range, loose)
90
+ range = Range.new(range, loose, platform)
91
91
 
92
- return false if satisfies(version, range, loose)
92
+ return false if satisfies(version, range, loose, platform)
93
93
 
94
94
  case hilo
95
95
  when '>'
@@ -148,22 +148,22 @@ module SemanticRange
148
148
  true
149
149
  end
150
150
 
151
- def self.satisfies(version, range, loose = false)
152
- return false if !valid_range(range, loose)
153
- Range.new(range, loose).test(version)
151
+ def self.satisfies(version, range, loose = false, platform = nil)
152
+ return false if !valid_range(range, loose, platform)
153
+ Range.new(range, loose, platform).test(version)
154
154
  end
155
155
 
156
- def self.max_satisfying(versions, range, loose = false)
156
+ def self.max_satisfying(versions, range, loose = false, platform = nil)
157
157
  versions.select { |version|
158
- satisfies(version, range, loose)
158
+ satisfies(version, range, loose, platform)
159
159
  }.sort { |a, b|
160
160
  rcompare(a, b, loose)
161
161
  }[0] || nil
162
162
  end
163
163
 
164
- def self.valid_range(range, loose = false)
164
+ def self.valid_range(range, loose = false, platform = nil)
165
165
  begin
166
- r = Range.new(range, loose).range
166
+ r = Range.new(range, loose, platform).range
167
167
  r = '*' if r.nil? || r.empty?
168
168
  r
169
169
  rescue
@@ -262,8 +262,8 @@ module SemanticRange
262
262
  return "prerelease" if pre_diff
263
263
  end
264
264
 
265
- def self.to_comparators(range, loose = false)
266
- Range.new(range, loose).set.map do |comp|
265
+ def self.to_comparators(range, loose = false, platform = nil)
266
+ Range.new(range, loose, platform).set.map do |comp|
267
267
  comp.map(&:to_s)
268
268
  end
269
269
  end
@@ -1,10 +1,10 @@
1
1
  module SemanticRange
2
2
  class Range
3
- attr_reader :loose, :raw, :range, :set
3
+ attr_reader :loose, :raw, :range, :set, :platform
4
4
 
5
- def initialize(range, loose = false)
5
+ def initialize(range, loose = false, platform = nil)
6
6
  range = range.raw if range.is_a?(Range)
7
-
7
+ @platform = platform
8
8
  @raw = range
9
9
  @loose = loose
10
10
  split = range.split(/\s*\|\|\s*/)
@@ -158,7 +158,12 @@ module SemanticRange
158
158
  elsif isX(m)
159
159
  ">=#{mj}.0.0 <#{(mj.to_i + 1)}.0.0"
160
160
  elsif isX(p)
161
- ">=#{mj}.#{m}.0 <#{mj}.#{(m.to_i + 1)}.0"
161
+ if ['Rubygems', 'Packagist'].include?(platform)
162
+ ">=#{mj}.#{m}.0 <#{mj.to_i+1}.0.0"
163
+ else
164
+ ">=#{mj}.#{m}.0 <#{mj}.#{(m.to_i + 1)}.0"
165
+ end
166
+
162
167
  elsif pr
163
168
  pr = '-' + pr if (pr[0] != '-')
164
169
  ">=#{mj}.#{m}.#{p}#{pr} <#{mj}.#{(m.to_i + 1)}.0"
@@ -1,5 +1,5 @@
1
1
  module SemanticRange
2
- VERSION = "1.0.0"
2
+ VERSION = "2.0.0"
3
3
 
4
4
  class Version
5
5
  attr_reader :major, :minor, :patch, :prerelease
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Andrew Nesbitt"]
10
10
  spec.email = ["andrewnez@gmail.com"]
11
11
 
12
- spec.summary = %q{node-semver rewritten in ruby, for comparison and inclusion of semantic versions and rangee}
12
+ spec.summary = %q{node-semver rewritten in ruby, for comparison and inclusion of semantic versions and ranges}
13
13
  spec.homepage = "https://libraries.io/github/librariesio/semantic_range"
14
14
  spec.license = "MIT"
15
15
 
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "bundler", "~> 1.10"
22
- spec.add_development_dependency "rake", "~> 10.4"
21
+ spec.add_development_dependency "bundler", "~> 1.11"
22
+ spec.add_development_dependency "rake", "~> 11.0"
23
23
  spec.add_development_dependency "rspec", "~> 3.4"
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-11-20 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.10'
19
+ version: '1.11'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.10'
26
+ version: '1.11'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.4'
33
+ version: '11.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.4'
40
+ version: '11.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -63,6 +63,7 @@ files:
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
65
  - CODE_OF_CONDUCT.md
66
+ - CONTRIBUTING.md
66
67
  - Gemfile
67
68
  - Guardfile
68
69
  - LICENSE.txt
@@ -96,10 +97,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
97
  version: '0'
97
98
  requirements: []
98
99
  rubyforge_project:
99
- rubygems_version: 2.4.8
100
+ rubygems_version: 2.6.4
100
101
  signing_key:
101
102
  specification_version: 4
102
103
  summary: node-semver rewritten in ruby, for comparison and inclusion of semantic versions
103
- and rangee
104
+ and ranges
104
105
  test_files: []
105
- has_rdoc: