angular-semver-sort-rails 0.2.0 → 0.2.1

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: 193f81d5ac4488f375d600166aa3924da5dda85e
4
- data.tar.gz: 08626bc1f7fad94a3a4410c76094585f0b10b289
3
+ metadata.gz: f19ff08ea6079d45d902ea5412ee46ae70c0b0ff
4
+ data.tar.gz: b7b23180f51facc97d9855e1736e6ed2eb4cd16b
5
5
  SHA512:
6
- metadata.gz: 1d60238fce76348348a03cc7a7634fd77bf233e63ef8a9e46c044c16dd50f75f7d7ef87a8ae97f04c4240ed1d05ffe315a86968a3d1621cc881d6ae99e74e938
7
- data.tar.gz: 5a1b10ed05168d72df1d156916401cfffa37c6efbcffa2a045b1c6a39f1c3217d0869bc5a26b1c52e9f15f4c89a61883572fc4bc4bf761082d52251673993cd0
6
+ metadata.gz: 046a37f58f9a6fd44545c16a42822ab2d269c80306f542de0cdb5a42c8dae60fe112565a3a25439a853204b984b907367276d81becee040a2c722942d2389f4d
7
+ data.tar.gz: 837336e707ec28f51e8c1393442fa1f4a1df2ab501d68f672a41cd171057789b8088f3e9288a5a9aa5e4316bc67a40295386c354d298c977830b4e5dc427eda4
@@ -7,11 +7,11 @@ Gem::Specification.new do |spec|
7
7
  # This is the only reason why this asset gem was created.
8
8
 
9
9
  spec.name = 'angular-semver-sort-rails'
10
- spec.version = '0.2.0'
10
+ spec.version = '0.2.1'
11
11
  spec.authors = ['Dominik Porada']
12
12
  spec.email = ['dominik@porada.co']
13
13
  spec.summary = 'angular-semver-sort packaged for Rails assets pipeline'
14
- spec.homepage = 'https://github.com/monterail/angular-semver-sort'
14
+ spec.homepage = 'https://github.com/rails-assets/angular-semver-sort'
15
15
  spec.license = 'BSD'
16
16
  spec.files = `git ls-files`.split($/)
17
17
  spec.require_paths = ['lib']
@@ -1,5 +1,5 @@
1
1
  /*!
2
- angular-semver-sort v0.2.0 <http://git.io/angular-semver>
2
+ angular-semver-sort v0.2.1 <http://git.io/angular-semver>
3
3
  @includes <http://git.io/semver> by Isaac Z. Schlueter
4
4
  @license BSD
5
5
  */
@@ -253,6 +253,8 @@ function SemVer(version, loose) {
253
253
  return version;
254
254
  else
255
255
  version = version.version;
256
+ } else if (typeof version !== 'string') {
257
+ throw new TypeError('Invalid Version: ' + version);
256
258
  }
257
259
 
258
260
  if (!(this instanceof SemVer))
@@ -325,7 +327,7 @@ SemVer.prototype.comparePre = function(other) {
325
327
  return -1;
326
328
  else if (!this.prerelease.length && other.prerelease.length)
327
329
  return 1;
328
- else if (!this.prerelease.lenth && !other.prerelease.length)
330
+ else if (!this.prerelease.length && !other.prerelease.length)
329
331
  return 0;
330
332
 
331
333
  var i = 0;
@@ -346,19 +348,49 @@ SemVer.prototype.comparePre = function(other) {
346
348
  } while (++i);
347
349
  };
348
350
 
351
+ // preminor will bump the version up to the next minor release, and immediately
352
+ // down to pre-release. premajor and prepatch work the same way.
349
353
  SemVer.prototype.inc = function(release) {
350
354
  switch (release) {
355
+ case 'premajor':
356
+ this.inc('major');
357
+ this.inc('pre');
358
+ break;
359
+ case 'preminor':
360
+ this.inc('minor');
361
+ this.inc('pre');
362
+ break;
363
+ case 'prepatch':
364
+ this.inc('patch');
365
+ this.inc('pre');
366
+ break;
367
+ // If the input is a non-prerelease version, this acts the same as
368
+ // prepatch.
369
+ case 'prerelease':
370
+ if (this.prerelease.length === 0)
371
+ this.inc('patch');
372
+ this.inc('pre');
373
+ break;
351
374
  case 'major':
352
375
  this.major++;
353
376
  this.minor = -1;
354
377
  case 'minor':
355
378
  this.minor++;
356
- this.patch = -1;
379
+ this.patch = 0;
380
+ this.prerelease = [];
381
+ break;
357
382
  case 'patch':
358
- this.patch++;
383
+ // If this is not a pre-release version, it will increment the patch.
384
+ // If it is a pre-release it will bump up to the same patch version.
385
+ // 1.2.0-5 patches to 1.2.0
386
+ // 1.2.0 patches to 1.2.1
387
+ if (this.prerelease.length === 0)
388
+ this.patch++;
359
389
  this.prerelease = [];
360
390
  break;
361
- case 'prerelease':
391
+ // This probably shouldn't be used publically.
392
+ // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
393
+ case 'pre':
362
394
  if (this.prerelease.length === 0)
363
395
  this.prerelease = [0];
364
396
  else {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: angular-semver-sort-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Porada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-27 00:00:00.000000000 Z
11
+ date: 2014-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -51,7 +51,7 @@ files:
51
51
  - angular-semver-sort-rails.gemspec
52
52
  - lib/angular-semver-sort-rails.rb
53
53
  - vendor/assets/javascripts/angular-semver-sort.js
54
- homepage: https://github.com/monterail/angular-semver-sort
54
+ homepage: https://github.com/rails-assets/angular-semver-sort
55
55
  licenses:
56
56
  - BSD
57
57
  metadata: {}