epitools 0.5.92 → 0.5.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5af87dba30589c9d2cf9367cc81758b72b2a853
4
- data.tar.gz: d100d1a465f5d5088176a7d9d624e9460e7774b8
3
+ metadata.gz: ccd113a18ef194f3dfeb84a6cde8196031734ce2
4
+ data.tar.gz: 5829f09d3fd9719cac246f744f5fd33cdda00b05
5
5
  SHA512:
6
- metadata.gz: fe5397193aed765f41464fe9fad1da4cb98d5a8c47b6c7aa5d5a7e8da0235aa21a2190839e929f2d13692594e8d39147366388f9fd7f72eddd4d9232b9e238e5
7
- data.tar.gz: 6c85fda4344ecbecf77539a32e76660585ebf6222f955f3b1deb156a42922430a2bd137c5ffafc489285a7fd9d714e2cec89d06a03d7d09940a3c1a56cbadd1b
6
+ metadata.gz: 579ccbea64bdc0b3c3f130d53fd1932b2692591ac75426f6e7a3a14e891bf9807a9d3f409d164ccf473a805c5c5e231d54e1074e10239045d28323a3942c8389
7
+ data.tar.gz: 5be9db454be2fdea00fe2babd98bdb90308b14b6b99b41135d3bd8a7cdaeac270b0afe812f9636e6a94a285fe2366ae036c967edb893500c3b97b161d4020a08
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.92
1
+ 0.5.93
@@ -410,8 +410,9 @@ module Enumerable
410
410
  #
411
411
  def sort_numerically
412
412
  sort_by do |e|
413
- case e
414
- when String
413
+ e = e.path if e.is_a? Path
414
+
415
+ if e.is_a? String
415
416
  e.split(/(\d+)/).map { |s| s =~ /^\d+$/ ? s.to_i : s }
416
417
  else
417
418
  [e]
@@ -627,8 +627,13 @@ describe Enumerable do
627
627
 
628
628
  it "sorts strings numerically" do
629
629
  a = ["a1", "a11", "a2", "a3"]
630
- a.sort_numerically.should == ["a1", "a2", "a3", "a11"]
630
+ proper = ["a1", "a2", "a3", "a11"]
631
+
632
+ a.sort_numerically.should == proper
631
633
  a.sort.should_not == a.sort_numerically
634
+
635
+ ps = a.map(&:to_Path)
636
+ ps.sort_numerically.map(&:filename).should == proper
632
637
  end
633
638
 
634
639
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epitools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.92
4
+ version: 0.5.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - epitron