GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of wycats/merb-plugins
Description: Merb Plugins: Even more modules to hook up your Merb installation
Homepage: http://www.merbivore.com
Clone URL: git://github.com/auser/merb-plugins.git
Minor cleanup and comment about using the assistance instead of my custom 
extensions...
vanpelt (author)
Thu Mar 13 12:30:20 -0700 2008
commit  152d325043adcd516e6af702616ef661b469b28a
tree    185f1825c46387cb0f8a83d985d2a75c34a45be3
parent  e3c91da6afcb8770d16dde818327663f31e471de
...
9
10
11
12
13
14
15
...
9
10
11
 
12
13
14
0
@@ -9,7 +9,6 @@ module Merb
0
     end
0
     
0
     def self.load
0
- puts "Loading.. #{Merb::Plugins.config[:merb_helpers].inspect}"
0
       if Merb::Plugins.config[:merb_helpers]
0
         config = Merb::Plugins.config[:merb_helpers]
0
         raise "With and Without options cannot be used with merb_helpers plugin configuration" if config[:with] && config[:without]
...
26
27
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
30
31
...
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
...
93
94
95
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
96
97
98
0
@@ -26,6 +26,32 @@ module TimeDSL
0
   alias :from_now :since
0
 end
0
 
0
+class Integer
0
+ # Ordinalize turns a number into an ordinal string used to denote the
0
+ # position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
0
+ #
0
+ # Examples
0
+ # 1.ordinalize # => "1st"
0
+ # 2.ordinalize # => "2nd"
0
+ # 1002.ordinalize # => "1002nd"
0
+ # 1003.ordinalize # => "1003rd"
0
+ def ordinalize
0
+ if (11..13).include?(self % 100)
0
+ "#{self}th"
0
+ else
0
+ case self % 10
0
+ when 1; "#{self}st"
0
+ when 2; "#{self}nd"
0
+ when 3; "#{self}rd"
0
+ else "#{self}th"
0
+ end
0
+ end
0
+ end
0
+end
0
+
0
+Numeric.send :include, TimeDSL
0
+# Everything above here has pretty much been implemented in the assistance gem...
0
+
0
 # Time.now.to_ordinalized_s :long
0
 # => "February 28th, 2006 21:10"
0
 module OrdinalizedFormatting
0
@@ -67,31 +93,6 @@ class Time
0
   def to_time; self; end
0
 end
0
 
0
-class Integer
0
- # Ordinalize turns a number into an ordinal string used to denote the
0
- # position in an ordered sequence such as 1st, 2nd, 3rd, 4th.
0
- #
0
- # Examples
0
- # 1.ordinalize # => "1st"
0
- # 2.ordinalize # => "2nd"
0
- # 1002.ordinalize # => "1002nd"
0
- # 1003.ordinalize # => "1003rd"
0
- def ordinalize
0
- if (11..13).include?(self % 100)
0
- "#{self}th"
0
- else
0
- case self % 10
0
- when 1; "#{self}st"
0
- when 2; "#{self}nd"
0
- when 3; "#{self}rd"
0
- else "#{self}th"
0
- end
0
- end
0
- end
0
-end
0
-
0
-Numeric.send :include, TimeDSL
0
-
0
 module Merb
0
   module Helpers
0
     # Provides a number of methods for displaying and dealing with dates and times

Comments

    No one has commented yet.