will_paginate-materialize 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 260c0bf901cd6ab32f476b35c9338e2b52d5252c
4
- data.tar.gz: 756b30922c1853fb5137d974a440378156ccb28d
3
+ metadata.gz: 00d8ef8d2958ddb55154f297076c1433bd68f273
4
+ data.tar.gz: 7b5f3d86353f18fff34949884733c1735ae020c8
5
5
  SHA512:
6
- metadata.gz: 21dcda2db6ceec6c25a7256edc88f88b89f48ca1ece7bbf970d8972ed0026c0eb848e2f809a24eafe27e34cdf49061fb2c87551e8f41b81f4ce25d720cbb487e
7
- data.tar.gz: 1f88ba92983c59a919a4391c9f8ac48f6ff69cb8f19efd3bb77295ce360e6891076ddb1e28e0af3ad3ffc2c7f6cf625f9600a04aaabfa97e6722072eee3464e2
6
+ metadata.gz: 0a53f1765e34d781bbd5409227a8adc96abdbcc21c7fc838df2784d7c47e5f007f9632a568f67ebc5b23170c67bf86de3aa2932629de0d64e760f735343c259e
7
+ data.tar.gz: ff93ec3dbcf481fd1719a6bf2ea1d642120ada29134d665f783df294100355893757835a4c142fd408df6fddd3c4820db99ac1793f5f4108fc565cb3c4d942bd
data/CHANGELOG.mod ADDED
@@ -0,0 +1,10 @@
1
+ # CHANGELOG
2
+
3
+ ## Version 0.1.2
4
+ * Set Materialize to the default LinkRenderer
5
+
6
+ ## Version 0.1.1
7
+ * Add will_paginate dependency. This means users do not need to require will_paginate in their Gemfile.
8
+
9
+ ## Version 0.1.0
10
+ * Initial release.
data/README.md CHANGED
@@ -20,23 +20,23 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage
22
22
 
23
- 1. Install [Materialize-sass](https://github.com/mkhairi/materialize-sass)
24
- 2. In your view, use the renderer: MaterializePagination::Rails option with the will_paginate helper.
25
- ```ruby
26
- <%= will_paginate @collection, renderer: MaterializePagination::Rails %>
23
+ 1. Install [Materialize-sass](https://github.com/mkhairi/materialize-sass) (if you haven't already)
24
+ 2. Add the following to your application.scss file
27
25
  ```
28
- 3. Add the following to your application.scss file
29
- ```
30
- .pagination a li.active {
31
- color: #fff;
32
- }
26
+ .pagination a li.active {
27
+ color: #fff;
28
+ }
33
29
  ```
30
+ 3. You're done! Use the will_paginate helper as you would otherwise.
31
+ ```ruby
32
+ <%= will_paginate @collection %>
33
+ ```
34
+
34
35
  ## Contributing
35
36
 
36
37
  Bug reports and pull requests are welcome on GitHub at https://github.com/patricklindsay/will_paginate-materialize. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
37
38
 
38
39
  ### Further works
39
- * Extend gem so the MaterializePagination renderer is the default renderer
40
40
  * Add specs
41
41
 
42
42
  ## License
@@ -0,0 +1,9 @@
1
+ require 'materialize_pagination/view_helpers'
2
+
3
+ module MaterializePagination
4
+ class Railtie < ::Rails::Railtie
5
+ initializer "materialize_pagination.view_helpers" do
6
+ ActionView::Base.send :include, ViewHelpers
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module MaterializePagination
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -0,0 +1,15 @@
1
+ module MaterializePagination
2
+ module ViewHelpers
3
+ # Change the default link renderer for will_paginate
4
+ def will_paginate(collection_or_options = nil, options = {})
5
+ if collection_or_options.is_a? Hash
6
+ options, collection_or_options = collection_or_options, nil
7
+ end
8
+ unless options[:renderer]
9
+ options = options.merge :renderer => MaterializePagination::Rails
10
+ end
11
+ super *[collection_or_options, options].compact
12
+ end
13
+ end
14
+ end
15
+
@@ -1,5 +1,4 @@
1
1
  require 'will_paginate'
2
2
 
3
- if defined?(ActionView)
4
- require "materialize_pagination/action_view"
5
- end
3
+ require "materialize_pagination/action_view" if defined?(ActionView)
4
+ require 'materialize_pagination/railtie' if defined?(Rails)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_paginate-materialize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Lindsay
@@ -77,6 +77,7 @@ files:
77
77
  - ".gitignore"
78
78
  - ".rspec"
79
79
  - ".travis.yml"
80
+ - CHANGELOG.mod
80
81
  - CODE_OF_CONDUCT.md
81
82
  - Gemfile
82
83
  - LICENSE.txt
@@ -86,7 +87,9 @@ files:
86
87
  - bin/setup
87
88
  - lib/materialize_pagination/action_view.rb
88
89
  - lib/materialize_pagination/materialize_renderer.rb
90
+ - lib/materialize_pagination/railtie.rb
89
91
  - lib/materialize_pagination/version.rb
92
+ - lib/materialize_pagination/view_helpers.rb
90
93
  - lib/will_paginate/materialize.rb
91
94
  - will_paginate-materialize.gemspec
92
95
  homepage: https://github.com/patricklindsay/will_paginate-materialize