Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update scripts to work on Ruby 1.9.x

  • Loading branch information...
commit 033e3efaaae06d1a365e83be3dc999fcc1a59639 1 parent 8fb1df3
Charlie Savage authored
Showing with 22 additions and 10 deletions.
  1. +11 −5 scripts/txt2html
  2. +11 −5 scripts/txt2js
View
16 scripts/txt2html
@@ -7,7 +7,9 @@ gem 'syntax'
require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
-require File.dirname(__FILE__) + '/../lib/composite_primary_keys/version.rb'
+
+version_path = File.join(File.dirname(__FILE__), '..', 'lib', 'composite_primary_keys', 'version.rb')
+require File.expand_path(version_path)
version = CompositePrimaryKeys::VERSION::STRING
download = 'http://rubygems.org/gems/composite_primary_keys'
@@ -18,10 +20,14 @@ class Fixnum
return 'th' if (10..19).include?(self % 100)
# others
case self % 10
- when 1: return 'st'
- when 2: return 'nd'
- when 3: return 'rd'
- else return 'th'
+ when 1
+ return 'st'
+ when 2
+ return 'nd'
+ when 3
+ return 'rd'
+ else
+ return 'th'
end
end
end
View
16 scripts/txt2js
@@ -5,7 +5,9 @@ require 'redcloth'
require 'syntax/convertors/html'
require 'erb'
require 'active_support'
-require File.dirname(__FILE__) + '/../lib/composite_primary_keys/version.rb'
+
+version_path = File.join(File.dirname(__FILE__), '..', 'lib', 'composite_primary_keys', 'version.rb')
+require File.expand_path(version_path)
version = CompositePrimaryKeys::VERSION::STRING
download = 'http://rubygems.org/gems/composite_primary_keys'
@@ -16,10 +18,14 @@ class Fixnum
return 'th' if (10..19).include?(self % 100)
# others
case self % 10
- when 1: return 'st'
- when 2: return 'nd'
- when 3: return 'rd'
- else return 'th'
+ when 1
+ return 'st'
+ when 2
+ return 'nd'
+ when 3
+ return 'rd'
+ else
+ return 'th'
end
end
end

0 comments on commit 033e3ef

Please sign in to comment.
Something went wrong with that request. Please try again.