mark_facets 0.1.5 → 0.1.6

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.
data/lib/mark_facets.rb CHANGED
@@ -6,7 +6,7 @@ path = File.join(File.dirname(__FILE__), 'mark_facets')
6
6
  ruby_path = File.join(path, 'ruby')
7
7
  rails_path = File.join(path, 'rails')
8
8
 
9
- %w{ruby string hash big_decimal math file magic_attributes}.each do |f|
9
+ %w{ruby string hash big_decimal math file magic_attributes will_paginate}.each do |f|
10
10
  p = File.expand_path(File.join(ruby_path, f))
11
11
  # puts p
12
12
  require p
@@ -0,0 +1,15 @@
1
+ if defined?(WillPaginate)
2
+
3
+ class Array
4
+
5
+ def to_will_paginate(options = {})
6
+ options.reverse_merge!({:page => 1, :per_page => self.size, :total => self.size})
7
+ results = WillPaginate::Collection.create(options[:page], options[:per_page], options[:total]) do |pager|
8
+ pager.replace(self)
9
+ end
10
+ return results
11
+ end
12
+
13
+ end
14
+
15
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 5
9
- version: 0.1.5
8
+ - 6
9
+ version: 0.1.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - markbates
@@ -48,7 +48,6 @@ files:
48
48
  - lib/mark_facets/rails/test/rspec/all.rb
49
49
  - lib/mark_facets/rails/test/rspec/should/have_same_elements.rb
50
50
  - lib/mark_facets/rails/test/rspec/should/render_404.rb
51
- - lib/mark_facets/rails/test/will_paginate.rb
52
51
  - lib/mark_facets/rails/test.rb
53
52
  - lib/mark_facets/rails/time_zones.rb
54
53
  - lib/mark_facets/ruby/big_decimal.rb
@@ -58,6 +57,7 @@ files:
58
57
  - lib/mark_facets/ruby/math.rb
59
58
  - lib/mark_facets/ruby/ruby.rb
60
59
  - lib/mark_facets/ruby/string.rb
60
+ - lib/mark_facets/ruby/will_paginate.rb
61
61
  - lib/mark_facets.rb
62
62
  - README
63
63
  - LICENSE
@@ -75,7 +75,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - ">="
77
77
  - !ruby/object:Gem::Version
78
- hash: 3406247377279307392
78
+ hash: -3940580121767564041
79
79
  segments:
80
80
  - 0
81
81
  version: "0"
@@ -1,11 +0,0 @@
1
- if defined?(WillPaginate)
2
-
3
- def stub_will_paginate(array, options = {})
4
- options.reverse_merge!({:page => 1, :per_page => array.size, :total => array.size})
5
- results = WillPaginate::Collection.create(options[:page], options[:per_page], options[:total]) do |pager|
6
- pager.replace(array)
7
- end
8
- return results
9
- end
10
-
11
- end