OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library pub_semver.src.version_range; | |
6 | |
7 import 'version.dart'; | 5 import 'version.dart'; |
8 import 'version_constraint.dart'; | 6 import 'version_constraint.dart'; |
9 import 'version_union.dart'; | 7 import 'version_union.dart'; |
10 | 8 |
11 /// Constrains versions to a fall within a given range. | 9 /// Constrains versions to a fall within a given range. |
12 /// | 10 /// |
13 /// If there is a minimum, then this only allows versions that are at that | 11 /// If there is a minimum, then this only allows versions that are at that |
14 /// minimum or greater. If there is a maximum, then only versions less than | 12 /// minimum or greater. If there is a maximum, then only versions less than |
15 /// that are allowed. In other words, this allows `>= min, < max`. | 13 /// that are allowed. In other words, this allows `>= min, < max`. |
16 class VersionRange implements VersionConstraint { | 14 class VersionRange implements VersionConstraint { |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 if (max != null) { | 326 if (max != null) { |
329 if (min != null) buffer.write(' '); | 327 if (min != null) buffer.write(' '); |
330 buffer.write(includeMax ? '<=' : '<'); | 328 buffer.write(includeMax ? '<=' : '<'); |
331 buffer.write(max); | 329 buffer.write(max); |
332 } | 330 } |
333 | 331 |
334 if (min == null && max == null) buffer.write('any'); | 332 if (min == null && max == null) buffer.write('any'); |
335 return buffer.toString(); | 333 return buffer.toString(); |
336 } | 334 } |
337 } | 335 } |
OLD | NEW |