public
Clone URL: git://github.com/defunkt/exception_logger.git
Updated init.rb and helper to not require will_paginate
Jason Knight (author)
Thu May 15 06:00:42 -0700 2008
commit  22c9278e0c45806d99b367b278957dd40c606d26
tree    05c536e369b3a7cd09fca24b0167195d4f298cd7
parent  c25f64a95fb20c705bf9a0ddfb6a1f22016bafce
...
1
2
 
 
 
 
3
...
 
 
1
2
3
4
5
0
@@ -1,3 +1,5 @@
0
-require 'will_paginate' unless Kernel.const_defined? 'WillPaginate'
0
-WillPaginate.enable
0
+if Kernel.const_defined? 'WillPaginate'
0
+ require 'will_paginate'
0
+ WillPaginate.enable
0
+end
0
 LoggedExceptionsController.view_paths = [File.join(directory, 'views')]
...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
 
 
 
 
 
 
23
 
 
 
 
 
 
 
 
 
 
 
 
24
...
4
5
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
0
@@ -4,21 +4,24 @@ module LoggedExceptionsHelper
0
   end
0
 
0
   def pagination_remote_links(collection)
0
- will_paginate collection,
0
- :renderer => 'LoggedExceptionsHelper::PaginationRenderer',
0
- :prev_label => '',
0
- :next_label => '',
0
- :container => false
0
- end
0
-
0
- class PaginationRenderer < WillPaginate::LinkRenderer
0
- def page_link_or_span(page, span_class = 'current', text = nil)
0
- text ||= page.to_s
0
- if page and page != current_page
0
- @template.link_to_function text, "ExceptionLogger.setPage(#{page})"
0
- else
0
- @template.content_tag :span, text, :class => span_class
0
- end
0
- end
0
+ if Kernel.const_defined? 'WillPaginate'
0
+ will_paginate collection,
0
+ :renderer => 'LoggedExceptionsHelper::PaginationRenderer',
0
+ :prev_label => '',
0
+ :next_label => '',
0
+ :container => false
0
+ end
0
   end
0
+ if Kernel.const_defined? 'WillPaginate'
0
+ class PaginationRenderer < WillPaginate::LinkRenderer
0
+ def page_link_or_span(page, span_class = 'current', text = nil)
0
+ text ||= page.to_s
0
+ if page and page != current_page
0
+ @template.link_to_function text, "ExceptionLogger.setPage(#{page})"
0
+ else
0
+ @template.content_tag :span, text, :class => span_class
0
+ end
0
+ end
0
+ end
0
+ end
0
 end

Comments

    No one has commented yet.