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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8c82692288ea72e0ad0c5318293c8129299a147
4
- data.tar.gz: a03518ac5700f0ff074cd02cbff312088686e1b7
3
+ metadata.gz: a70fd7cdb6644724f9e56ec43763ab434869157e
4
+ data.tar.gz: 158a5dca9eb719f7a70cfc31c4e25939869c2953
5
5
  SHA512:
6
- metadata.gz: b31e76a36fd9d14ecdbc396802d0c52bd99ade19c60b18fe29ca08a4519e586d90bc34d8847da0dfaf73eae87d58990d642c5aec3e6704a6e6a986a2c88f93dd
7
- data.tar.gz: 39467bac6e670ab4d6e47a10a1122d0b8fe4113764dc68889b0d0a18f840729c29e5e94a94b5c4ba6a433472cf59f2a0c34dd01cc8057c7458dbce5b3efbe159
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.1.0
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: 2016-08-07 00:00:00.000000000 Z
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.