Permalink
Browse files

improvement for dev php

  • Loading branch information...
1 parent b57f2ff commit 3249eba1364b4932d6577752e64a1273578bafe4 @reiz reiz committed Oct 21, 2012
Showing with 10 additions and 2 deletions.
  1. +1 −1 README.markdown
  2. +1 −1 lib/naturalsorter/version.rb
  3. +4 −0 lib/versioncmp.rb
  4. +4 −0 spec/versioncmp_spec.rb
View
@@ -76,7 +76,7 @@ because '~>1.1' doesn't fit anymore the newest version.
You should add this line to your Gemfile
-`gem 'naturalsorter', '0.5.10'`
+`gem 'naturalsorter', '0.5.11'`
and run this command in your app root directory
@@ -1,3 +1,3 @@
module Naturalsorter
- VERSION = "0.5.10"
+ VERSION = "0.5.11"
end
View
@@ -43,11 +43,15 @@ def self.compare(a_val, b_val)
a = String.new(a_val)
if a_val.match(/\.x-dev$/)
a = a_val.gsub("x-dev", "9999999")
+ elsif a_val.match(/-dev$/)
+ a = a_val.gsub("-dev", ".9999999")
end
b = String.new(b_val)
if b_val.match(/\.x-dev$/)
b = b_val.gsub("x-dev", "9999999")
+ elsif b_val.match(/-dev$/)
+ b = b_val.gsub("-dev", ".9999999")
end
offset1 = 0;
View
@@ -9,6 +9,10 @@
it "smaler" do
Versioncmp.compare("1.1.5", "1.1.x-dev").should eql(-1)
end
+
+ it "smaler" do
+ Versioncmp.compare("1.1.5", "1.1-dev").should eql(-1)
+ end
it "bigger" do
Versioncmp.compare("1.1", "1.0").should eql(1)

0 comments on commit 3249eba

Please sign in to comment.