semantic_range 2.1.0 → 3.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
- SHA1:
3
- metadata.gz: ec95fe31851133a57a3c90992bb3124739ce82c0
4
- data.tar.gz: 3a137c6d5e47ab85b4845bb4162d8c5f9253a180
2
+ SHA256:
3
+ metadata.gz: 67ae11bb60e5aa3341d7d83eae4e7f100262878f2ef6612391b4e18ce3ee5801
4
+ data.tar.gz: d25d1b605ddf68eed7979808d0ce1bebbaac5e7025e47ac9d81564dbabb21ca6
5
5
  SHA512:
6
- metadata.gz: f50a2b6cdd8dafbc675b0e43b7f6dd74cbdb6f70b88d51350b9c2e1977ca9c6192533863a7c48170ef0f4db580afa9d1de3c7d2810b855d97d497ecc41c44f3a
7
- data.tar.gz: '07929eadc26321cdb53da674de931e7449dba9a264e9b8ba007ed47a1cd1469755c4b39ecab0fce43edf61aaf6c28c15c3ab93f9d343904c1797518dcde37bca'
6
+ metadata.gz: 873719a7f9a4af750cd6deda9a59a7953566d87558f3c7b9825cb3001f188d6453dfca58ce429fb013ffe664ea1806ebefbd081c4c2eadfee734e87dc1d167cf
7
+ data.tar.gz: dff74a1adac2232a3425e6e6d9b7de0412dadd574a3dee8a114d008b9a003c9070db6a69444142980e16e7c7586f7d50f409769e616b18c298b47fb8ce25877d
data/README.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  [node-semver](https://github.com/npm/node-semver) written in Ruby for comparison and inclusion of semantic versions and ranges.
4
4
 
5
+ **NOTE: current `master` and releases `>= 3` use keyword arguments instead of positional arguments to pass options.
6
+ If you used `SemanticRange.compare(a, b, true)` in SemanticRange 2, in SemanticRange 3 use `SemanticRange.compare(a, b, loose: true)`**
7
+
8
+
9
+
5
10
  ## Installation
6
11
 
7
12
  Add this line to your application's Gemfile:
@@ -24,11 +29,20 @@ Or install it yourself as:
24
29
  SemanticRange.valid('1.2.3') # '1.2.3'
25
30
  SemanticRange.valid('a.b.c') # nil
26
31
  SemanticRange.clean(' =v1.2.3 ') # '1.2.3'
27
- SemanticRange.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') # true
28
- SemanticRange.gt('1.2.3', '9.8.7') # false
29
- SemanticRange.lt('1.2.3', '9.8.7') # true
32
+ SemanticRange.filter(['0.9.0', '1.3.0', '1.5.0', '2.0.5'], '1.3.0 || <1.0.0 || >2.0.0') # ['0.9.0', '1.3.0', '2.0.5']
33
+ SemanticRange.satisfies?('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') # true
34
+ SemanticRange.gt?('1.2.3', '9.8.7') # false
35
+ SemanticRange.lt?('1.2.3', '9.8.7') # true
30
36
  ```
31
37
 
38
+ ### Options
39
+ All functions support optional keyword arguments that modify default behavior. The options supported are:
40
+ * `loose` Be more forgiving about not-quite-valid semver strings. Any resulting output will always be 100% strict compliant. `false` by default.
41
+
42
+ Some functions support `platform` option:
43
+ * `platform` Changes behavior for `'Rubygems'` and `'Packagist'`. `nil` by default. See https://github.com/librariesio/semantic_range/issues/59
44
+
45
+
32
46
  ## Development
33
47
 
34
48
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -37,7 +51,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
37
51
 
38
52
  ## Contributing
39
53
 
40
- Bug reports and pull requests are welcome on GitHub at https://github.com/librariesio/semantic_range. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
54
+ Bug reports and pull requests are welcome on GitHub at https://github.com/librariesio/semantic_range. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](https://www.contributor-covenant.org/) code of conduct.
41
55
 
42
56
 
43
57
  ## License
@@ -50,15 +50,15 @@ module SemanticRange
50
50
  class InvalidComparator < StandardError; end
51
51
  class InvalidRange < StandardError; end
52
52
 
53
- def self.ltr(version, range, loose = false, platform = nil)
54
- outside(version, range, '<', loose, platform)
53
+ def self.ltr?(version, range, loose: false, platform: nil)
54
+ outside?(version, range, '<', loose: loose, platform: platform)
55
55
  end
56
56
 
57
- def self.gtr(version, range, loose = false, platform = nil)
58
- outside(version, range, '>', loose, platform)
57
+ def self.gtr?(version, range, loose: false, platform: nil)
58
+ outside?(version, range, '>', loose: loose, platform: platform)
59
59
  end
60
60
 
61
- def self.cmp(a, op, b, loose = false)
61
+ def self.cmp(a, op, b, loose: false)
62
62
  case op
63
63
  when '==='
64
64
  a = a.version if !a.is_a?(String)
@@ -69,27 +69,27 @@ module SemanticRange
69
69
  b = b.version if !b.is_a?(String)
70
70
  a != b
71
71
  when '', '=', '=='
72
- eq(a, b, loose)
72
+ eq?(a, b, loose: loose)
73
73
  when '!='
74
- neq(a, b, loose)
74
+ neq?(a, b, loose: loose)
75
75
  when '>'
76
- gt(a, b, loose)
76
+ gt?(a, b, loose: loose)
77
77
  when '>='
78
- gte(a, b, loose)
78
+ gte?(a, b, loose: loose)
79
79
  when '<'
80
- lt(a, b, loose)
80
+ lt?(a, b, loose: loose)
81
81
  when '<='
82
- lte(a, b, loose)
82
+ lte?(a, b, loose: loose)
83
83
  else
84
84
  raise 'Invalid operator: ' + op
85
85
  end
86
86
  end
87
87
 
88
- def self.outside(version, range, hilo, loose = false, platform = nil)
89
- version = Version.new(version, loose)
90
- range = Range.new(range, loose, platform)
88
+ def self.outside?(version, range, hilo, loose: false, platform: nil)
89
+ version = Version.new(version, loose: loose)
90
+ range = Range.new(range, loose: loose, platform: platform)
91
91
 
92
- return false if satisfies(version, range, loose, platform)
92
+ return false if satisfies?(version, range, loose: loose, platform: platform)
93
93
 
94
94
  case hilo
95
95
  when '>'
@@ -114,15 +114,15 @@ module SemanticRange
114
114
 
115
115
  case hilo
116
116
  when '>'
117
- if gt(comparator.semver, high.semver, loose)
117
+ if gt?(comparator.semver, high.semver, loose: loose)
118
118
  high = comparator
119
- elsif lt(comparator.semver, low.semver, loose)
119
+ elsif lt?(comparator.semver, low.semver, loose: loose)
120
120
  low = comparator
121
121
  end
122
122
  when '<'
123
- if lt(comparator.semver, high.semver, loose)
123
+ if lt?(comparator.semver, high.semver, loose: loose)
124
124
  high = comparator
125
- elsif gt(comparator.semver, low.semver, loose)
125
+ elsif gt?(comparator.semver, low.semver, loose: loose)
126
126
  low = comparator
127
127
  end
128
128
  end
@@ -132,15 +132,15 @@ module SemanticRange
132
132
 
133
133
  case hilo
134
134
  when '>'
135
- if (low.operator.empty? || low.operator == comp) && lte(version, low.semver, loose)
135
+ if (low.operator.empty? || low.operator == comp) && lte?(version, low.semver, loose: loose)
136
136
  return false;
137
- elsif (low.operator == ecomp && lt(version, low.semver, loose))
137
+ elsif (low.operator == ecomp && lt?(version, low.semver, loose: loose))
138
138
  return false;
139
139
  end
140
140
  when '<'
141
- if (low.operator.empty? || low.operator == comp) && gte(version, low.semver, loose)
141
+ if (low.operator.empty? || low.operator == comp) && gte?(version, low.semver, loose: loose)
142
142
  return false;
143
- elsif low.operator == ecomp && gt(version, low.semver, loose)
143
+ elsif low.operator == ecomp && gt?(version, low.semver, loose: loose)
144
144
  return false;
145
145
  end
146
146
  end
@@ -148,22 +148,28 @@ module SemanticRange
148
148
  true
149
149
  end
150
150
 
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)
151
+ def self.satisfies?(version, range, loose: false, platform: nil)
152
+ return false if !valid_range(range, loose: loose, platform: platform)
153
+ Range.new(range, loose: loose, platform: platform).test(version)
154
154
  end
155
155
 
156
- def self.max_satisfying(versions, range, loose = false, platform = nil)
156
+ def self.filter(versions, range, loose: false, platform: nil)
157
+ return [] if !valid_range(range, loose: loose, platform: platform)
158
+
159
+ versions.filter { |v| SemanticRange.satisfies?(v, range, loose: loose, platform: platform) }
160
+ end
161
+
162
+ def self.max_satisfying(versions, range, loose: false, platform: nil)
157
163
  versions.select { |version|
158
- satisfies(version, range, loose, platform)
164
+ satisfies?(version, range, loose: loose, platform: platform)
159
165
  }.sort { |a, b|
160
- rcompare(a, b, loose)
166
+ rcompare(a, b, loose: loose)
161
167
  }[0] || nil
162
168
  end
163
169
 
164
- def self.valid_range(range, loose = false, platform = nil)
170
+ def self.valid_range(range, loose: false, platform: nil)
165
171
  begin
166
- r = Range.new(range, loose, platform).range
172
+ r = Range.new(range, loose: loose, platform: platform).range
167
173
  r = '*' if r.nil? || r.empty?
168
174
  r
169
175
  rescue
@@ -171,89 +177,84 @@ module SemanticRange
171
177
  end
172
178
  end
173
179
 
174
- def self.compare(a, b, loose = false)
175
- Version.new(a, loose).compare(b)
180
+ def self.compare(a, b, loose: false)
181
+ Version.new(a, loose: loose).compare(b)
176
182
  end
177
183
 
178
184
  def self.compare_loose(a, b)
179
- compare(a, b, true)
185
+ compare(a, b, loose: true)
180
186
  end
181
187
 
182
- def self.rcompare(a, b, loose = false)
183
- compare(b, a, true)
188
+ def self.rcompare(a, b, loose: false)
189
+ compare(b, a, loose: true)
184
190
  end
185
191
 
186
- def self.sort(list, loose = false)
192
+ def self.sort(list, loose: false)
187
193
  # TODO
188
194
  end
189
195
 
190
- def self.rsort(list, loose = false)
196
+ def self.rsort(list, loose: false)
191
197
  # TODO
192
198
  end
193
199
 
194
- def self.lt(a, b, loose = false)
195
- compare(a, b, loose) < 0
200
+ def self.lt?(a, b, loose: false)
201
+ compare(a, b, loose: loose) < 0
196
202
  end
197
203
 
198
- def self.gt(a, b, loose = false)
199
- compare(a, b, loose) > 0
204
+ def self.gt?(a, b, loose: false)
205
+ compare(a, b, loose: loose) > 0
200
206
  end
201
207
 
202
- def self.eq(a, b, loose = false)
203
- compare(a, b, loose) == 0
208
+ def self.eq?(a, b, loose: false)
209
+ compare(a, b, loose: loose) == 0
204
210
  end
205
211
 
206
- def self.neq(a, b, loose = false)
207
- compare(a, b, loose) != 0
212
+ def self.neq?(a, b, loose: false)
213
+ compare(a, b, loose: loose) != 0
208
214
  end
209
215
 
210
- def self.gte(a, b, loose = false)
211
- compare(a, b, loose) >= 0
216
+ def self.gte?(a, b, loose: false)
217
+ compare(a, b, loose: loose) >= 0
212
218
  end
213
219
 
214
- def self.lte(a, b, loose = false)
215
- compare(a, b, loose) <= 0
220
+ def self.lte?(a, b, loose: false)
221
+ compare(a, b, loose: loose) <= 0
216
222
  end
217
223
 
218
- def self.valid(version, loose = false)
219
- v = parse(version, loose)
224
+ def self.valid(version, loose: false)
225
+ v = parse(version, loose: loose)
220
226
  return v ? v.version : nil
221
227
  end
222
228
 
223
- def self.clean(version, loose = false)
224
- s = parse(version.strip.gsub(/^[=v]+/, ''), loose)
229
+ def self.clean(version, loose: false)
230
+ s = parse(version.strip.gsub(/^[=v]+/, ''), loose: loose)
225
231
  return s ? s.version : nil
226
232
  end
227
233
 
228
- def self.parse(version, loose = false)
234
+ def self.parse(version, loose: false)
229
235
  return version if version.is_a?(Version)
230
236
 
231
237
  return nil unless version.is_a?(String)
232
238
 
233
- version.strip!
239
+ stripped_version = version.strip
234
240
 
235
- return nil if version.length > MAX_LENGTH
241
+ return nil if stripped_version.length > MAX_LENGTH
236
242
 
237
243
  rxp = loose ? LOOSE : FULL
238
- return nil if !rxp.match(version)
244
+ return nil if !rxp.match(stripped_version)
239
245
 
240
- Version.new(version, loose)
246
+ Version.new(stripped_version, loose: loose)
241
247
  end
242
248
 
243
- def self.increment!(version, release, loose, identifier)
244
- if loose.is_a? String
245
- identifier = loose
246
- loose = false
247
- end
248
-
249
- Version.new(version, loose).increment!(release, identifier).version
249
+ def self.increment!(version, release, identifier, loose: false)
250
+ Version.new(version, loose: loose).increment!(release, identifier).version
250
251
  rescue InvalidIncrement, InvalidVersion
251
252
  nil
252
253
  end
253
254
 
254
255
  def self.diff(a, b)
255
- a = Version.new(a, false) unless a.kind_of?(Version)
256
- b = Version.new(b, false) unless b.kind_of?(Version)
256
+ a = Version.new(a, loose: false) unless a.kind_of?(Version)
257
+ b = Version.new(b, loose: false) unless b.kind_of?(Version)
257
258
  pre_diff = a.prerelease.to_s != b.prerelease.to_s
258
259
  pre = pre_diff ? 'pre' : ''
259
260
  return "#{pre}major" if a.major != b.major
@@ -262,9 +263,23 @@ module SemanticRange
262
263
  return "prerelease" if pre_diff
263
264
  end
264
265
 
265
- def self.to_comparators(range, loose = false, platform = nil)
266
- Range.new(range, loose, platform).set.map do |comp|
266
+ def self.to_comparators(range, loose: false, platform: nil)
267
+ Range.new(range, loose: loose, platform: platform).set.map do |comp|
267
268
  comp.map(&:to_s)
268
269
  end
269
270
  end
271
+
272
+ class << self
273
+ # Support for older non-inquisitive method versions
274
+ alias_method :gt, :gt?
275
+ alias_method :gtr, :gtr?
276
+ alias_method :gte, :gte?
277
+ alias_method :lt, :lt?
278
+ alias_method :ltr, :ltr?
279
+ alias_method :lte, :lte?
280
+ alias_method :eq, :eq?
281
+ alias_method :neq, :neq?
282
+ alias_method :outside, :outside?
283
+ alias_method :satisfies, :satisfies?
284
+ end
270
285
  end
@@ -17,7 +17,7 @@ module SemanticRange
17
17
  def test(version)
18
18
  return true if @semver == ANY
19
19
  version = Version.new(version, @loose) if version.is_a?(String)
20
- SemanticRange.cmp(version, @operator, @semver, @loose)
20
+ SemanticRange.cmp(version, @operator, @semver, loose: @loose)
21
21
  end
22
22
 
23
23
  def parse(comp)
@@ -27,26 +27,26 @@ module SemanticRange
27
27
  @operator = m[1]
28
28
  @operator = '' if @operator == '='
29
29
 
30
- @semver = !m[2] ? ANY : Version.new(m[2], @loose)
30
+ @semver = !m[2] ? ANY : Version.new(m[2], loose: @loose)
31
31
  end
32
32
 
33
- def intersects(comp, loose = false, platform = nil)
33
+ def intersects?(comp, loose: false, platform: nil)
34
34
  comp = Comparator.new(comp, loose)
35
35
 
36
36
  if @operator == ''
37
- range_b = Range.new(comp.value, loose, platform)
38
- SemanticRange.satisfies(@value, range_b, loose, platform)
37
+ range_b = Range.new(comp.value, loose: loose, platform: platform)
38
+ SemanticRange.satisfies?(@value, range_b, loose: loose, platform: platform)
39
39
  elsif comp.operator == ''
40
- range_a = Range.new(@value, loose, platform)
41
- SemanticRange.satisfies(comp.semver, range_a, loose, platform)
40
+ range_a = Range.new(@value, loose: loose, platform: platform)
41
+ SemanticRange.satisfies?(comp.semver, range_a, loose: loose, platform: platform)
42
42
  else
43
43
  same_direction_increasing = (@operator == '>=' || @operator == '>') && (comp.operator == '>=' || comp.operator == '>')
44
44
  same_direction_decreasing = (@operator == '<=' || @operator == '<') && (comp.operator == '<=' || comp.operator == '<')
45
45
  same_version = @semver.raw == comp.semver.raw
46
46
  different_directions_inclusive = (@operator == '>=' || @operator == '<=') && (comp.operator == '>=' || comp.operator == '<=')
47
- opposite_directions_lte = SemanticRange.cmp(@semver, '<', comp.semver, loose) &&
47
+ opposite_directions_lte = SemanticRange.cmp(@semver, '<', comp.semver, loose: loose) &&
48
48
  ((@operator == '>=' || @operator == '>') && (comp.operator == '<=' || comp.operator == '<'))
49
- opposite_directions_gte = SemanticRange.cmp(@semver, '>', comp.semver, loose) &&
49
+ opposite_directions_gte = SemanticRange.cmp(@semver, '>', comp.semver, loose: loose) &&
50
50
  ((@operator == '<=' || @operator == '<') && (comp.operator == '>=' || comp.operator == '>'))
51
51
 
52
52
  same_direction_increasing || same_direction_decreasing || (same_version && different_directions_inclusive) ||
@@ -54,14 +54,18 @@ module SemanticRange
54
54
  end
55
55
  end
56
56
 
57
- def satisfies_range(range, loose = false, platform = nil)
58
- range = Range.new(range, loose, platform)
57
+ def satisfies_range?(range, loose: false, platform: nil)
58
+ range = Range.new(range, loose: loose, platform: platform)
59
59
 
60
60
  range.set.any? do |comparators|
61
61
  comparators.all? do |comparator|
62
- intersects(comparator, loose, platform)
62
+ intersects?(comparator, loose: loose, platform: platform)
63
63
  end
64
64
  end
65
65
  end
66
+
67
+ # Support for older non-inquisitive method versions
68
+ alias_method :intersects, :intersects?
69
+ alias_method :satisfies_range, :satisfies_range?
66
70
  end
67
71
  end
@@ -2,7 +2,7 @@ module SemanticRange
2
2
  class Range
3
3
  attr_reader :loose, :raw, :range, :set, :platform
4
4
 
5
- def initialize(range, loose = false, platform = nil)
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
@@ -31,7 +31,7 @@ module SemanticRange
31
31
 
32
32
  def test(version)
33
33
  return false if !version
34
- version = Version.new(version, @loose) if version.is_a?(String)
34
+ version = Version.new(version, loose: @loose) if version.is_a?(String)
35
35
  @set.any?{|s| test_set(s, version) }
36
36
  end
37
37
 
@@ -64,6 +64,9 @@ module SemanticRange
64
64
  # caret trim
65
65
  range = range.gsub(CARETTRIM, '\1^')
66
66
 
67
+ # comma trim
68
+ range = range.gsub(',', ' ')
69
+
67
70
  # normalise spaces
68
71
  range = range.split(/\s+/).join(' ')
69
72
 
@@ -280,12 +283,12 @@ module SemanticRange
280
283
  "#{from} #{to}".strip
281
284
  end
282
285
 
283
- def intersects(range, loose = false, platform = nil)
284
- range = Range.new(range, loose, platform)
286
+ def intersects(range, loose: false, platform: nil)
287
+ range = Range.new(range, loose: loose, platform: platform)
285
288
 
286
289
  @set.any? do |comparators|
287
290
  comparators.all? do |comparator|
288
- comparator.satisfies_range(range, loose, platform)
291
+ comparator.satisfies_range(range, loose: loose, platform: platform)
289
292
  end
290
293
  end
291
294
  end
@@ -1,10 +1,10 @@
1
1
  module SemanticRange
2
- VERSION = "2.1.0"
2
+ VERSION = "3.0.0"
3
3
 
4
4
  class Version
5
5
  attr_reader :major, :minor, :patch, :prerelease
6
6
 
7
- def initialize(version, loose = false)
7
+ def initialize(version, loose: false)
8
8
  @raw = version
9
9
  @loose = loose
10
10
 
@@ -45,13 +45,13 @@ module SemanticRange
45
45
  end
46
46
 
47
47
  def compare(other)
48
- other = Version.new(other, @loose) unless other.is_a?(Version)
48
+ other = Version.new(other, loose: @loose) unless other.is_a?(Version)
49
49
  res = truthy(compare_main(other)) || truthy(compare_pre(other))
50
50
  res.is_a?(FalseClass) ? 0 : res
51
51
  end
52
52
 
53
53
  def compare_main(other)
54
- other = Version.new(other, @loose) unless other.is_a?(Version)
54
+ other = Version.new(other, loose: @loose) unless other.is_a?(Version)
55
55
  truthy(self.class.compare_identifiers(@major, other.major)) ||
56
56
  truthy(self.class.compare_identifiers(@minor, other.minor)) ||
57
57
  truthy(self.class.compare_identifiers(@patch, other.patch))
metadata CHANGED
@@ -1,43 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic_range
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2021-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.11'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '1.11'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: '12.0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: '12.0'
41
13
  - !ruby/object:Gem::Dependency
42
14
  name: rspec
43
15
  requirement: !ruby/object:Gem::Requirement
@@ -59,27 +31,13 @@ executables: []
59
31
  extensions: []
60
32
  extra_rdoc_files: []
61
33
  files:
62
- - ".github/CONTRIBUTING.md"
63
- - ".github/ISSUE_TEMPLATE.md"
64
- - ".github/PULL_REQUEST_TEMPLATE.md"
65
- - ".github/SUPPORT.md"
66
- - ".gitignore"
67
- - ".rspec"
68
- - ".travis.yml"
69
- - CODE_OF_CONDUCT.md
70
- - Gemfile
71
- - Guardfile
72
34
  - LICENSE.txt
73
35
  - README.md
74
- - Rakefile
75
- - bin/console
76
- - bin/setup
77
36
  - lib/semantic_range.rb
78
37
  - lib/semantic_range/comparator.rb
79
38
  - lib/semantic_range/pre_release.rb
80
39
  - lib/semantic_range/range.rb
81
40
  - lib/semantic_range/version.rb
82
- - semantic_range.gemspec
83
41
  homepage: https://libraries.io/github/librariesio/semantic_range
84
42
  licenses:
85
43
  - MIT
@@ -99,8 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
57
  - !ruby/object:Gem::Version
100
58
  version: '0'
101
59
  requirements: []
102
- rubyforge_project:
103
- rubygems_version: 2.6.13
60
+ rubygems_version: 3.1.2
104
61
  signing_key:
105
62
  specification_version: 4
106
63
  summary: node-semver rewritten in ruby, for comparison and inclusion of semantic versions
@@ -1,195 +0,0 @@
1
- ## Contributing to Libraries.io :heart:
2
- Thanks for considering contributing. These guidelines outline how to contribute to the [Libraries.io](http://github.com/librariesio) project.
3
-
4
- ## Table of Contents
5
- [What is Libraries.io all about?](#whats-librariesio-about)
6
-
7
- [Who is Libraries.io for?](#who-is-librariesio-for)
8
-
9
- [What should I know Before I get started?](#what-should-i-know-before-i-get-started)
10
- * [Code of conduct](#code-of-conduct)
11
- * [Language](#language)
12
- * [Installation and setup](#setup)
13
-
14
- [How can I contribute?](#how-can-i-contribute)
15
- * [Reporting bugs](#reporting-bugs)
16
- * [Suggesting enhancements](#suggesting-enhancements)
17
- * [Suggesting a new feature](#suggesting-new-features)
18
- * [Your first contribution](#your-first-contribution)
19
- * [Tackling something meatier](#tackling-something-meatier)
20
-
21
- [How can I talk to other contributors?](#how-can-i-talk-to-other-contributors)
22
- * [Chat](#chat)
23
- * [Video](#video)
24
- * [Social media](#twitter)
25
-
26
- [Who Are Libraries.io's Users?](#who-are-librariesios-users)
27
-
28
- [Our workflow](#workflow)
29
-
30
-
31
- ## What's Libraries.io About?
32
- _Our goal is to raise the quality of all software._
33
-
34
- By outlining our [mission and strategy](/strategy.md) we hope to give you more power to make decisions and determine how best to spend your time. Specifically we tackle three distinct problems:
35
-
36
- * Discovery: _Helping developers make faster, more informed decisions about the software that they use._
37
- * Maintainability: _Helping maintainers understand more about the software they depend upon and the consumers of their software._
38
- * Sustainability: _Supporting undervalued software by highlighting shortfalls in contribution and funneling support to them._
39
-
40
- The first of these problems is our foccus for Libraries.io. The other two we are trying to tackle at [Tidelift](https://tidelift.com).
41
-
42
- ## Who is Libraries.io For?
43
- Libraries.io currently caters for the needs of three distinct user groups:
44
-
45
- * Google: _is hungry for your linked datas so she can serve you up search traffic_
46
- * Searcher: _is a developer with a problem, she is looking for something to help solve it._
47
- * Maintainer: _has a project that is used within and/or incorporates open dependencies. She needs to ensure her project(s) are working as expected for users._
48
-
49
- These groups have been expanded into [personas](/personas.md) for contributors to reference.
50
-
51
- ## What Should I Know Before I Get Started?
52
-
53
- ### Code of Conduct
54
- Libraries.io is an open and inclusive [community of people](https://github.com/orgs/librariesio/people) working together. We expect contributors to abide by our [contributor code of conduct](CODE_OF_CONDUCT.md) which basically say 'be excellent to each other'. Please report unacceptable behavior to conduct@libraries.io
55
-
56
- ### Language
57
- We communicate predominately in English. Contributions to the project should be made with English as the first language. We are happy for members of the community to communicate in a language other than English in chat, email and video but be aware that this might be considered exclusive by other members of the community.
58
-
59
- ### Documentation
60
- Documentation for the project as a whole is available at [docs.libraries.io](https://docs.libraries.io). These pages are generated from the [documentation](https://github.com/librariesio/documentation) repo. Documentation that needs to be in every repo is replicated in [required-files](https://github.com/librariesio/required-files) (currently limited to [GitHub templates](https://github.com/blog/2111-issue-and-pull-request-templates)). Otherwise documentation will be specific to that repo. For example the main [Libraries.io](https://github.com/librariesio/libraries.io) `README.md` contains information about installing and running the main rails application.
61
-
62
- ### Setup
63
- If you wish to make contributions to Libraries.io then you'll need a local version of the site to test. You can find instructions to install the correct Ruby version, Postgres, and to set up the database in our [README](https://github.com/librariesio/libraries.io/blob/master/README.md#getting-started).
64
-
65
- ## How Can I Contribute?
66
-
67
- ### Reporting Bugs
68
-
69
- The simplest thing that you can do to help us is by filing good bug reports, so here we go:
70
-
71
- #### Before Submitting a Bug Report
72
-
73
- * Double-check that the bug is persistent. The site is still in it's infancy and sometimes artifacts may appear and disappear.
74
- * Double-check the bug hasn't already been reported [on our issue tracker](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they *should* be labelled `bug` or `bugsnag`.
75
-
76
- If something hasn't been raised, you can go ahead and create a new issue using [the template](/issue_template.md). If you'd like to help investigate further or fix the bug just mention it in your issue and check out our [workflow](#workflow).
77
-
78
- ### Suggesting Enhancements
79
-
80
- The next simplest thing you can do to help us is by telling us how we can improve the features we already support, here we go:
81
-
82
- #### Before Submitting an Enhancement
83
-
84
- * Check that the enhancement is not already [in our issue tracker](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they should be labelled 'enhancement'.
85
-
86
- If there isn't already an issue for feature then go ahead and create a new issue for it using the [template](/issue_template.md). If you'd like to work on the enhancement then just mention it in a comment and check out our [workflow](#workflow).
87
-
88
- ### Suggesting New Features
89
-
90
- If you're into this zone then you need to understand a little more about what we're trying to achieve:
91
-
92
- #### Before Suggesting a Feature
93
-
94
- * Check that it aligns with [our strategy](strategy.md) and is specifically not in line with something we have said we will not do (for the moment this is anything to do with ranking *people*).
95
- * Check that the feature is not already [in our issue tracker](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they should be tagged 'feature'.
96
-
97
- If you're still thinking about that killer feature that no one else is thinking about then *please* create an issue for it using the [template](/issue_template.md).
98
-
99
- ### Your First Contribution
100
- You're in luck! We label issues that are ideal for first time contributors with [`first-pr`](https://github.com/search?l=&q=is%3Aopen+is%3Aissue+org%3Alibrariesio+label%3Afirst-pr&ref=advsearch&type=Issues&utf8=%E2%9C%93). For someone who wants something a little more meaty you might find an issue that needs some assistance with [`help wanted`](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio+label%3A%22help+wanted%22&type=Issues). Next you'll want to read our [workflow](#workflow).
101
-
102
- ### Tackling Something Meatier
103
-
104
- Tickets are labeled by size, skills required and to indicate workflow. Details can be found in our [labelling policy](/labelling.md).
105
-
106
- To get you started you might want to check out issues concerning [documentation](https://github.com/librariesio/documentation/issues/), [user experience](https://github.com/librariesio/libraries.io/labels/ux), [visual design](https://github.com/librariesio/libraries.io/issues/labels/visual%20design) or perhaps something already [awaiting help](https://github.com/librariesio/libraries.io/labels/help%20wanted). You may find the following useful:
107
-
108
- * Our [strategy](/strategy.md) which outlines what our goals are, how we are going to achieve those goals and what we are specifically going to avoid.
109
- * An [overview](/overview.md) of the components that make up the Libraries.io project and run the [https://libraries.io](https://libraries.io) site.
110
-
111
- ## How Can I Talk To Other Contributors?
112
-
113
- ### Chat
114
- We use [Slack](http://slack.io) for chat. There's an open invitation available to anyone who wishes to join the conversation at [http://slack.libraries.io](http://slack.libraries.io).
115
-
116
- We try to use the following channels accordingly:
117
-
118
- * `#general` channel is used for general, water cooler-type conversation, contributor updates and issue discussion.
119
- * `#events` is used to share and discuss events that may be of interest to or attended by members of the community
120
- * `#activity` contains notifications from the various platforms that we use to keep the Libraries.io project turning. Including notifications from GitHub, Twitter and our servers.
121
-
122
- Members are encouraged to openly discuss their work, their lives, share views and ask for help using chat. It should be considered a *safe space* in which there is *no such thing as a stupid question*. Conversely no one contributor should ever be expected to have read something said in a chat. If someone should know something then it should be written down as an issue and/or documented in an obvious place for others to find.
123
-
124
- ### Video
125
- [Google Hangouts](http://hangouts.google.com) is our preferred tool for video chat. We operate an [open hangout](http://bit.ly/2kWtYak) for anyone to jump into at any time to discuss issues face to face.
126
-
127
- ### Regular updates
128
- Contributors are encouraged to share what they're working on. We do this through daily or weekly updates in the `#general` channel on Slack. Updates should take the format 'currently working on X, expecting to move onto Y, blocked on Z' where x, y and z are issues in our [issue tracker](https://github.com/search?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio).
129
-
130
- Additionally we host an [open hangout](http://bit.ly/2kWtYak) for any contributor to join at *5pm BST/GMT on a Tuesday* to discuss their work, the next week's priorities and to ask questions of other contributors regarding any aspect of the project. Again this is considered a *safe space* in which *there is no such thing as a stupid question*.
131
-
132
- ### Mail
133
- The [core team](https://github.com/orgs/librariesio/teams/core) operate a mailing list for project updates. If you'd like to subscribe you'll find a form in the footer on [Libraries.io](http://libraries.io).
134
-
135
- ### Twitter
136
- We have an account on Twitter at [@librariesio](http://twitter.com/librariesio). This is predominately used to retweet news, events and musings by contributors rather than as a direct method of communication. Contributors are encouraged to use @librariesio in a tweet when talking about the project, so that we may retweet if appropriate. The account is moderated and protected by the [core team](https://github.com/orgs/librariesio/teams/core).
137
-
138
- ### Facebook
139
- We have a Facebook page at [@libraries.io](https://www.facebook.com/libraries.io). Again this is predominantly used to gather and reflect news, events and musings by contributors rather than as a direct method of communication. Contributors are encouraged to reference Libraries.io in a post when talking about the project, so that we may reflect this if appropriate. Again the account is moderated and protected by the [core team](https://github.com/orgs/librariesio/teams/core).
140
-
141
- ### Medium
142
- We have a Medium account at [@librariesio](https://medium.com/@librariesio) and once again it is used to reflect news, events and musings by contributors rather than a direct method of communication. Contributors are encouraged to reference @librariesio in a post when talking about the project, so that we may recommend it if appropriate. Again the account is moderated and protected by the [core team](https://github.com/orgs/librariesio/teams/core).
143
-
144
- ## Who Are Libraries.io's Users?
145
- Libraries.io focusses on the following personas:
146
-
147
- ### Google
148
- _Is hungry for linked data so she can serve you up search traffic_
149
-
150
- ### 'Searcher'
151
- _Is a developer with a problem, she is looking for something to help solve it._
152
-
153
- ### 'Extender'
154
- _Has her own ideas. She wants access to the raw data so that she can mash up her own service and offer it to the world._
155
-
156
- ## Workflow
157
- In general we use [GitHub](https://help.github.com/) and [Git](https://git-scm.com/docs/gittutorial) to support our workflow. If you are unfamiliar with those tools then you should check them out until you feel you have a basic understanding of GitHub and a working understanding of Git. Specifically you should understand how forking, branching, committing, PRing and merging works.
158
-
159
- #### Forking
160
- We prefer that contributors fork the project in order to contribute.
161
-
162
- #### Branching
163
- We *try* to use principles of [GitHub-flow](https://lucamezzalira.com/2014/03/10/git-flow-vs-github-flow/) in our branching model. That is the `master` branch will always be deployable to the live site, and that every branch from that will be used to add a feature, fix a bug, improve something or otherwise represent an atomic unit of work.
164
-
165
- #### Ticketing
166
- We *try* to create an issue for everything. That is any bug, feature or enhancement that is worth an open, focussed and documented discussion.
167
-
168
- #### Labelling
169
- We constrain labels as they are a key part of our workflow. Tickets will be labeled according to our [labelling policy](/labelling.md).
170
-
171
- #### Templates
172
- We use templates to guide contributors toward good practice in [filing bugs, requesting enhancements and features](/issue_template.md) and in [issuing pull-requests](/pull_request_template.md).
173
-
174
- #### Commenting
175
- If it is possible to comment your contribution — for instance if you are contributing code — then do so in a way that is simple, clear, concise and lowers the level of understanding necessary for others to comprehend what comes afterward. If you are contributing code it is very likely it will be rejected if it does not contain sufficient comments.
176
-
177
- #### Committing
178
- When committing to a branch be sure to use plain, simple language that describes the incremental changes made on the branch toward the overall goal. Avoid unnecessary complexity. Simplify whenever possible. Assume a reasonable but not comprehensive knowledge of the tools, techniques and context of your work.
179
-
180
- #### Testing
181
- When adding or fixing functionality, tests should be added to help reduce future regressions and breakage. All tests are ran automatically when new commits are pushed to a branch. Pull requests with broken/missing tests are not likely to be merged.
182
-
183
- #### Submitting for Review
184
- Once a piece of work (in a branch) is complete it should be readied for review. This is your last chance to ensure that your contribution is [properly tested](#testing). If you are contributing code it is likely your contribution will be rejected if it would lower the test-coverage. Once this is done you can submit a pull-request following the [template](/pull_request_template.md).
185
-
186
- It is likely that your contributions will need to be checked by at least one member of the [core team](https://github.com/orgs/librariesio/teams/core) prior to merging. It is also incredibly likely that your contribution may need some re-work in order to be accepted. Particularly if it lacks an appropriate level of comments, tests or it is difficult to understand your commits. Please do not take offense if this is the case. We understand that contributors give their time because they want to improve the project but please understand it is another's responsibility to ensure that the project is maintainable, and good practices like these are key to ensuring that is possible.
187
-
188
- #### Reviewing a PR
189
- We appreciate that it may be difficult to offer constructive criticism, but it is a necessary part of ensuring the project is maintainable and successful. If it is difficult to understand something, request it is better documented and/or commented. If you do not feel assured of the robustness of a contribution, request it is better tested. If it is unclear what the goal of the piece of work is and how it relates to the [strategy](/strategy.md), request a clarification in the corresponding issue. If a pull-request has no corresponding issue, decreases test coverage or otherwise decreases the quality of the project. Reject it. Otherwise, merge it.
190
-
191
- #### Merging
192
- As we keep the `master` branch in a permanent state of 'deployment ready' once-merged your contribution will be live on the next deployment.
193
-
194
- #### Deploying
195
- Any member of the [deployers](https://github.com/orgs/librariesio/teams/deployers) team are able to redeploy the site. If you require a deployment then you might find one of them in our `#general` [chat channel on Slack](slack.libraries.io).
@@ -1,18 +0,0 @@
1
- Thanks for taking the time to raise an issue. This template should guide you through the process of submitting a bug, enhancement or feature request. Please erase any part of this template that is not relevant to your issue.
2
-
3
- ## Bugs
4
- Before submitting a bug report:
5
-
6
- - [ ] Double-check that the bug is persistent,
7
- - [ ] Double-check the bug hasn't already been reported [on our issue tracker](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they *should* be labelled `bug` or `bugsnag`.
8
-
9
- If you have completed those steps then please replace this section with a description of the steps taken to recreate the bug, the expected behavior and the observed behavior.
10
-
11
- ## Enhancements and Features
12
-
13
- Before submitting an enhancement or feature request:
14
-
15
- - [ ] Check that the enhancement is not already [in our issue tracker](https://github.com/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+org%3Alibrariesio), they should be labelled 'enhancement'.,
16
- - [ ] For large feature requests, check that your request aligns with our strategy http://docs.libraries.io/strategy.
17
-
18
- If you have complete the above step then please replace this section with a description of your proposed enhancement or feature, the motivation for it, an approach and any alternative approaches considered, and whether you are willing and able to create a pull request for it. Note that we may close this issue if it's not something we're planning on working on.
@@ -1,10 +0,0 @@
1
- Thanks taking the time to contribute. This template should help guide you through the process of creating a pull request for review. Please erase any part of this template that is not relevant to your pull request:
2
-
3
-
4
- - [ ] Have you followed the guidelines for [contributors](http://docs.libraries.io/contributorshandbook)?
5
- - [ ] Have you checked to ensure there aren't other open pull requests on the repository for a similar change?
6
- - [ ] Is there a corresponding ticket for your pull request?
7
- - [ ] Have you written new tests for your changes?
8
- - [ ] Have you successfully run the project with your changes locally?
9
-
10
- If so then please replace this section with a link to the ticket(s) it addressed, an explanation of your change and why you think we should include it. Thanks again!
data/.github/SUPPORT.md DELETED
@@ -1,10 +0,0 @@
1
- # Libraries.io Support
2
-
3
- If you're looking for support for Libraries.io there are a lot of options, check out:
4
-
5
- * Documentation &mdash; https://docs.libraries.io
6
- * Email &mdash; support@libraries.io
7
- * Twitter &mdash; https://twitter.com/librariesio
8
- * Chat &mdash; https://slack.libraries.io
9
-
10
- On Discuss and in the Libraries.io Slack team, there are a bunch of helpful community members that should be willing to point you in the right direction.
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- .idea
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --format documentation
2
- --color
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- language: ruby
2
- rvm:
3
- - 2.3.3
4
- before_install: gem install bundler -v 1.13.6
5
- cache: bundler
6
- sudo: false
7
- notifications:
8
- slack:
9
- secure: lT8nj3FTS1JncJ3+lBrztipeeUCT02AWDT+yqNRrYFcHni4nKpxjSMVuT7VJvWzyiCHo5bqqoHMZLrcoA71Qoe6uaO4Gcpe6Go6Rtg2HAh+F2gpEkGCCqKSrhckbgj6gtrBncm4JsbUHoyu0n75LNUTf7+CUZE88mr0cqNkaKUeD6tPvocAt14YN+w3HhtHsnldjv+I8WW2Uai+u3JOlB2Pvje7i8GGQMgjftmbFzcAGZKryKX+VUPqt0OgzeBXop6N+9X3U5Gf0kPSu5JMlsBXlb/bt+z95bw3BAkUdiTXl/HK/qcgLE0nA6e2NZ0H7SyiVl1XrANh/Gy2LrkSv38yqCpnGnAP3mr20DuBK1cytCc+1bHzGwnXz96QWbv2SUGIcWDbW+NLXVDqwQTNYVdjKLErPL08D1DWjSMHMbq7bf8QuNhtoCDs/1Peh1Ju7um5oADesbr+z5Wf5dxiA6RXbUfYGYuKxN2pkbZimHW+Tn2EMEJ4FvQxnpNF6d+l4VlTkhzUEr0b2GZ4hKTrfCMfRJjN2vjuLQjVv48V3FIMRBuYgoT6X9x3E/1oIfTvkZAXhCWPe8RbOKY7DWW1IugCaN2mUqOSl16buYOMzSl60B/iqv8TBnjXYzLeskrAE3Zj5jY6E+DZRNhhOJXczbwyqxWC7QSDh6YHr7QcCrpE=
data/CODE_OF_CONDUCT.md DELETED
@@ -1,74 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
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.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
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
22
-
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/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in semantic_range.gemspec
4
- gemspec
5
- gem 'guard-rspec'
data/Guardfile DELETED
@@ -1,87 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- ## Uncomment and set this to only include directories you want to watch
5
- # directories %w(app lib config test spec features) \
6
- # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
-
8
- ## Note: if you are using the `directories` clause above and you are not
9
- ## watching the project directory ('.'), then you will want to move
10
- ## the Guardfile to a watched dir and symlink it back, e.g.
11
- #
12
- # $ mkdir config
13
- # $ mv Guardfile config/
14
- # $ ln -s config/Guardfile .
15
- #
16
- # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
-
18
- guard :bundler do
19
- require 'guard/bundler'
20
- require 'guard/bundler/verify'
21
- helper = Guard::Bundler::Verify.new
22
-
23
- files = ['Gemfile']
24
- files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
25
-
26
- # Assume files are symlinked from somewhere
27
- files.each { |file| watch(helper.real_path(file)) }
28
- end
29
-
30
- guard 'migrate' do
31
- watch(%r{^db/migrate/(\d+).+\.rb})
32
- watch('db/seeds.rb')
33
- end
34
-
35
- # Note: The cmd option is now required due to the increasing number of ways
36
- # rspec may be run, below are examples of the most common uses.
37
- # * bundler: 'bundle exec rspec'
38
- # * bundler binstubs: 'bin/rspec'
39
- # * spring: 'bin/rspec' (This will use spring if running and you have
40
- # installed the spring binstubs per the docs)
41
- # * zeus: 'zeus rspec' (requires the server to be started separately)
42
- # * 'just' rspec: 'rspec'
43
-
44
- guard :rspec, cmd: "bundle exec rspec" do
45
- require "guard/rspec/dsl"
46
- dsl = Guard::RSpec::Dsl.new(self)
47
-
48
- # Feel free to open issues for suggestions and improvements
49
-
50
- # RSpec files
51
- rspec = dsl.rspec
52
- watch(rspec.spec_helper) { rspec.spec_dir }
53
- watch(rspec.spec_support) { rspec.spec_dir }
54
- watch(rspec.spec_files)
55
-
56
- # Ruby files
57
- ruby = dsl.ruby
58
- dsl.watch_spec_files_for(ruby.lib_files)
59
-
60
- # Rails files
61
- rails = dsl.rails(view_extensions: %w(erb haml slim))
62
- dsl.watch_spec_files_for(rails.app_files)
63
- dsl.watch_spec_files_for(rails.views)
64
-
65
- watch(rails.controllers) do |m|
66
- [
67
- rspec.spec.("routing/#{m[1]}_routing"),
68
- rspec.spec.("controllers/#{m[1]}_controller"),
69
- rspec.spec.("acceptance/#{m[1]}")
70
- ]
71
- end
72
-
73
- # Rails config changes
74
- watch(rails.spec_helper) { rspec.spec_dir }
75
- watch(rails.routes) { "#{rspec.spec_dir}/routing" }
76
- watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
77
-
78
- # Capybara features specs
79
- watch(rails.view_dirs) { |m| rspec.spec.("features/#{m[1]}") }
80
- watch(rails.layouts) { |m| rspec.spec.("features/#{m[1]}") }
81
-
82
- # Turnip features and steps
83
- watch(%r{^spec/acceptance/(.+)\.feature$})
84
- watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
85
- Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
86
- end
87
- end
data/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
3
-
4
- RSpec::Core::RakeTask.new(:spec)
5
-
6
- task :default => :spec
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "semantic_range"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here
@@ -1,24 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'semantic_range/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "semantic_range"
8
- spec.version = SemanticRange::VERSION
9
- spec.authors = ["Andrew Nesbitt"]
10
- spec.email = ["andrewnez@gmail.com"]
11
-
12
- spec.summary = %q{node-semver rewritten in ruby, for comparison and inclusion of semantic versions and ranges}
13
- spec.homepage = "https://libraries.io/github/librariesio/semantic_range"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.11"
22
- spec.add_development_dependency "rake", "~> 12.0"
23
- spec.add_development_dependency "rspec", "~> 3.4"
24
- end