naturalsorter 3.0.11 → 3.0.12

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: b5ef3f2f8651e025ce0853aaa502b530f6b60e97
4
- data.tar.gz: c802e36cfe0f9ef3796783c69a16e2018611801a
3
+ metadata.gz: b2dfabc180135b204d332e4ba86d5b0d958a701b
4
+ data.tar.gz: 4bdc68dab8743afda6368ae4b5ba6d397112a646
5
5
  SHA512:
6
- metadata.gz: 03935e8d1da7c6d459753a72f6ef61b829dabf7bc042b737339ab06fced3d02700950fa6edbed4feb3a6bdf51f712e4ef50d8d2e865fcece142c730a0eb2b382
7
- data.tar.gz: 0ff45ca12f2a93ef2ce0e1e652a93a7ff6d01400fe3f836949416a1a340c5d7259f4f931bffb8f902b7dc3d0125632621e6e58058db92020cda795feea73a39c
6
+ metadata.gz: c378640fab039c1d2109f8935e53a2a039369ec2ddd640063de24d4bd27ab80bcdc775e81cb9860dae5cfa0f5f76aed5500e2e50b43a35e3ba509f52c7315cfd
7
+ data.tar.gz: 518a7cc52e061986970797ce99a66b2bf036048f7d458936e01b8248d7d988b7dbd7c3e4f78ee519610eb0bded365b143432a09a8dd2899f3f4557bcbd2e385e
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ service_name: travis-ci
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ coverage
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.2.3
data/.travis.yml CHANGED
@@ -1,3 +1,3 @@
1
1
  language: ruby
2
- rvm: 2.0.0-p353
2
+ rvm: 2.2.3
3
3
  script: bundle exec rspec spec
data/README.markdown CHANGED
@@ -1,8 +1,9 @@
1
1
  # NaturalSorter
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/naturalsorter.png)](http://badge.fury.io/rb/naturalsorter)
4
- [![Dependency Status](http://www.versioneye.com/package/naturalsorter/badge.png)](http://www.versioneye.com/package/naturalsorter)
4
+ [![Dependency Status](https://www.versioneye.com/ruby/naturalsorter/badge?style=flat)](https://www.versioneye.com/ruby/naturalsorter)
5
5
  [![Build Status](https://travis-ci.org/versioneye/naturalsorter.png)](https://travis-ci.org/versioneye/naturalsorter)
6
+ [![Coverage Status](https://coveralls.io/repos/versioneye/naturalsorter/badge.svg?branch=master&service=github)](https://coveralls.io/github/versioneye/naturalsorter?branch=master)
6
7
  [![Code Climate](https://codeclimate.com/github/versioneye/naturalsorter.png)](https://codeclimate.com/github/versioneye/naturalsorter)
7
8
  [![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=157523)](https://www.bountysource.com/trackers/157523-versioneye-naturalsorter?utm_source=157523&utm_medium=shield&utm_campaign=TRACKER_BADGE)
8
9
 
@@ -26,12 +27,25 @@ Because the default sort method does not recognize the numbers in the string. Th
26
27
 
27
28
  You should add this line to your Gemfile
28
29
 
29
- `gem 'naturalsorter', '3.0.11'`
30
+ `gem 'naturalsorter', '3.0.12'`
30
31
 
31
32
  and run this command in your app root directory
32
33
 
33
34
  `bundle install`
34
35
 
36
+ ## Testing
37
+
38
+ This project has a lot of test cases and a test coverage above 90%. To run the tests you need to have installed Ruby 2.X. To install the test dependencies run this in the root directory:
39
+
40
+ ```
41
+ bundle install
42
+ ```
43
+
44
+ To execute the tests run this in the root directory:
45
+
46
+ ```
47
+ rspec
48
+ ```
35
49
 
36
50
  ## Version Sorting
37
51
  This fork contains some special algorithms to sort version numbers in a natural order. This project is used at <https://www.versioneye.com> to show versions of selected open source projects.
@@ -1,3 +1,3 @@
1
1
  module Naturalsorter
2
- VERSION = "3.0.11"
2
+ VERSION = "3.0.12"
3
3
  end
data/lib/versioncmp.rb CHANGED
@@ -203,6 +203,7 @@ class Versioncmp
203
203
 
204
204
 
205
205
  def self.timestamp? part
206
+ return false if part.to_s.empty?
206
207
  return part.length() == 8 && part.match(/^[0-9]+$/) != nil
207
208
  end
208
209
 
@@ -23,4 +23,6 @@ Gem::Specification.new do |s|
23
23
  # s.add_development_dependency "rspec"
24
24
  # s.add_runtime_dependency "rest-client"
25
25
  s.add_development_dependency "rspec", "3.2.0"
26
+ s.add_development_dependency "coveralls", "0.8.3"
27
+ s.add_development_dependency "simplecov", "0.10.0"
26
28
  end
@@ -1,3 +1,4 @@
1
+ require 'spec_helper'
1
2
  require "naturalsorter"
2
3
 
3
4
  describe Naturalsorter::Sorter do
@@ -1,3 +1,4 @@
1
+ require 'spec_helper'
1
2
  require "naturalsorter"
2
3
 
3
4
  describe VersionTagRecognizer do
@@ -357,8 +358,5 @@ describe VersionTagRecognizer do
357
358
  VersionTagRecognizer.stability_tag_for( "dev-garbage-collection-configuration").should eql(VersionTagRecognizer::A_STABILITY_DEV)
358
359
  end
359
360
 
360
-
361
-
362
-
363
361
 
364
362
  end
@@ -1,3 +1,4 @@
1
+ require 'spec_helper'
1
2
  require "naturalsorter"
2
3
 
3
4
  describe Versioncmp do
@@ -0,0 +1,5 @@
1
+ require 'simplecov'
2
+ require 'coveralls'
3
+
4
+ SimpleCov.formatter = Coveralls::SimpleCov::Formatter
5
+ SimpleCov.start
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: naturalsorter
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.11
4
+ version: 3.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - reiz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-03 00:00:00.000000000 Z
12
+ date: 2016-02-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -25,6 +25,34 @@ dependencies:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
27
  version: 3.2.0
28
+ - !ruby/object:Gem::Dependency
29
+ name: coveralls
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - '='
33
+ - !ruby/object:Gem::Version
34
+ version: 0.8.3
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - '='
40
+ - !ruby/object:Gem::Version
41
+ version: 0.8.3
42
+ - !ruby/object:Gem::Dependency
43
+ name: simplecov
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - '='
47
+ - !ruby/object:Gem::Version
48
+ version: 0.10.0
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - '='
54
+ - !ruby/object:Gem::Version
55
+ version: 0.10.0
28
56
  description: This GEM is sorting Arrays in a natural order. a2 < a10. Beside that
29
57
  this GEM has some methods to sort version strings. It even recognises alpha, beta,
30
58
  RC, dev and stable versions.
@@ -34,6 +62,7 @@ executables: []
34
62
  extensions: []
35
63
  extra_rdoc_files: []
36
64
  files:
65
+ - ".coveralls.yml"
37
66
  - ".gitignore"
38
67
  - ".ruby-version"
39
68
  - ".travis.yml"
@@ -47,9 +76,10 @@ files:
47
76
  - lib/version_tag_recognizer.rb
48
77
  - lib/versioncmp.rb
49
78
  - naturalsorter.gemspec
50
- - spec/naturalsorter_spec.rb
51
- - spec/version_tag_recognizer_spec.rb
52
- - spec/versioncmp_spec.rb
79
+ - spec/naturalsorter/naturalsorter_spec.rb
80
+ - spec/naturalsorter/version_tag_recognizer_spec.rb
81
+ - spec/naturalsorter/versioncmp_spec.rb
82
+ - spec/spec_helper.rb
53
83
  homepage: https://github.com/versioneye/naturalsorter
54
84
  licenses:
55
85
  - MIT
@@ -75,6 +105,7 @@ signing_key:
75
105
  specification_version: 4
76
106
  summary: Sorting arrays in natural order
77
107
  test_files:
78
- - spec/naturalsorter_spec.rb
79
- - spec/version_tag_recognizer_spec.rb
80
- - spec/versioncmp_spec.rb
108
+ - spec/naturalsorter/naturalsorter_spec.rb
109
+ - spec/naturalsorter/version_tag_recognizer_spec.rb
110
+ - spec/naturalsorter/versioncmp_spec.rb
111
+ - spec/spec_helper.rb