version_sorter 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/version_sorter/version_sorter.c +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a70fd7cdb6644724f9e56ec43763ab434869157e
|
4
|
+
data.tar.gz: 158a5dca9eb719f7a70cfc31c4e25939869c2953
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b129cf5ded38073805a6893b2dc1d9eb2c5d5ed18f5306dd277a042a7f3e6ce066e30b1ee9c181945acc93a4dfbf0a21349b5e29745915ab0879c46339547cb
|
7
|
+
data.tar.gz: b827661988f7d51796a24b6e08d376b8a8e43477c02a81a19f1f5ab2373a4225243f430f3a85ffd767e4c5a61748b1509b751c6a3c7b5ef7486c5b75ebac7707
|
@@ -232,6 +232,14 @@ rb_version_sort_r_bang(VALUE rb_self, VALUE rb_versions)
|
|
232
232
|
return rb_version_sort_1(rb_self, rb_versions, version_compare_cb_r);
|
233
233
|
}
|
234
234
|
|
235
|
+
static VALUE
|
236
|
+
rb_version_compare(VALUE rb_self, VALUE rb_version_a, VALUE rb_version_b)
|
237
|
+
{
|
238
|
+
struct version_number *version_a = parse_version_number(StringValuePtr(rb_version_a));
|
239
|
+
struct version_number *version_b = parse_version_number(StringValuePtr(rb_version_b));
|
240
|
+
return INT2NUM(version_compare_cb(&version_a, &version_b));
|
241
|
+
}
|
242
|
+
|
235
243
|
void Init_version_sorter(void)
|
236
244
|
{
|
237
245
|
VALUE rb_mVersionSorter = rb_define_module("VersionSorter");
|
@@ -239,4 +247,5 @@ void Init_version_sorter(void)
|
|
239
247
|
rb_define_module_function(rb_mVersionSorter, "rsort", rb_version_sort_r, 1);
|
240
248
|
rb_define_module_function(rb_mVersionSorter, "sort!", rb_version_sort_bang, 1);
|
241
249
|
rb_define_module_function(rb_mVersionSorter, "rsort!", rb_version_sort_r_bang, 1);
|
250
|
+
rb_define_module_function(rb_mVersionSorter, "compare", rb_version_compare, 2);
|
242
251
|
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: version_sorter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: VersionSorter is a C extension that does fast sorting of large sets of
|
15
15
|
version strings.
|