foliate 1.2.0 → 2.0.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 623f2bcd5507e824c335e58a1f784fbbfcf92bc8
4
- data.tar.gz: fb3261438e55746a95fca86a8304de049b14d7d8
2
+ SHA256:
3
+ metadata.gz: bf9d741403e9509ce9f4f51ea941bdbf142992d38b46698572eb26cffd299e63
4
+ data.tar.gz: cd0e74a544f428e761bd6500de60d6b08d48b1da79c3fa8c0c8416f2577b2890
5
5
  SHA512:
6
- metadata.gz: 9adbdc17b6c8b3960e56664232a78737ad7e21cd6ab3e1d4e6133c6ed594804541f104a93c972cea4d584c77545cc5bf2ac6b4d74a89cda90baea559ae7a9636
7
- data.tar.gz: 3dc543c00f892cef7abfa351907a5a492db3539bcd03a61ad8f55f9febee7a504a563b0852539859aa4d40662cb9043f4180981bc8e7d340dd64a5610bd4b408
6
+ metadata.gz: 05c988806df2c9f3b434a2e7524fc2592c6cede5fb191de053c656636720a292d784f1d617202fe3e5c2cd5ec96a7b8e803d099adb05e46f4366901b34d61ba0
7
+ data.tar.gz: cd0f11d534ea497d34ec9da78edef335a3c7a9640f369cecdfb3b22b940b6d3d8ab7ed811532b9b78fa34bdea9482526205eb57a61dc04f4cba8be07f54da188
data/README.md CHANGED
@@ -26,7 +26,7 @@ current page of records, as dictated by `params[:page]`.
26
26
 
27
27
  Calling `paginate` also sets a `@pagination` instance variable for use
28
28
  in the view. This object can be passed directly to `render`, which will
29
- then render the "app/views/pagination/_pagination.html.erb" view
29
+ then render the "app/views/application/_pagination.html.erb" view
30
30
  partial:
31
31
 
32
32
  ```html
@@ -45,7 +45,7 @@ Do something with @posts here...
45
45
  ## Appearance
46
46
 
47
47
  The *foliate* installation generator creates
48
- "app/views/pagination/_pagination.html.erb" and
48
+ "app/views/application/_pagination.html.erb" and
49
49
  "app/assets/stylesheets/pagination.scss" in your project directory.
50
50
  These files can be freely edited to suit your needs.
51
51
 
@@ -1,3 +1,5 @@
1
1
  require "foliate/version"
2
2
  require "foliate/config"
3
+ require "foliate/pagination"
4
+ require "foliate/controller"
3
5
  require "foliate/railtie"
@@ -1,13 +1,15 @@
1
1
  module Foliate
2
2
 
3
3
  class Config
4
+ # Default number of records to allot per page. Defaults to +10+.
5
+ #
4
6
  # @return [Integer]
5
- # default number of records to allot per page (defaults to +10+)
6
7
  attr_accessor :default_per_page
7
8
 
9
+ # Name of query param used to indicate page number. Defaults to
10
+ # +:page+.
11
+ #
8
12
  # @return [Symbol]
9
- # request query param name for specifying page numbers (defaults
10
- # to +:page+)
11
13
  attr_accessor :page_param
12
14
 
13
15
  def initialize
@@ -1,6 +1,3 @@
1
- require "foliate/config"
2
- require "foliate/pagination"
3
-
4
1
  module Foliate
5
2
  module Controller
6
3
 
@@ -1,30 +1,34 @@
1
- require "foliate/config"
2
-
3
1
  module Foliate
4
2
  class Pagination
5
3
 
4
+ # Current page number.
5
+ #
6
6
  # @return [Integer]
7
- # current page number
8
7
  attr_accessor :current_page
9
8
 
9
+ # Number of records per page.
10
+ #
10
11
  # @return [Integer]
11
- # number of records per page
12
12
  attr_accessor :per_page
13
13
 
14
+ # Total number of records.
15
+ #
14
16
  # @return [Integer]
15
- # total number of records
16
17
  attr_accessor :total_records
17
18
 
19
+ # Originating controller.
20
+ #
18
21
  # @return [Symbol]
19
- # originating controller
20
22
  attr_accessor :controller
21
23
 
24
+ # Originating controller action.
25
+ #
22
26
  # @return [Symbol]
23
- # originating controller action
24
27
  attr_accessor :action
25
28
 
29
+ # Originating request query params.
30
+ #
26
31
  # @return [Hash]
27
- # originating request query params
28
32
  attr_accessor :query_params
29
33
 
30
34
  # Computes the total number of pages based on {#total_records} and
@@ -129,7 +133,7 @@ module Foliate
129
133
  #
130
134
  # @return [String]
131
135
  def to_partial_path
132
- "pagination/pagination"
136
+ "pagination"
133
137
  end
134
138
 
135
139
  module ParamsHelper
@@ -1,12 +1,9 @@
1
- require "rails/railtie"
2
- require "foliate/controller"
3
-
4
1
  module Foliate
5
2
  # @!visibility private
6
3
  class Railtie < Rails::Railtie
7
- initializer :foliate do |app|
4
+ initializer "foliate" do |app|
8
5
  ActiveSupport.on_load :action_controller do
9
- ActionController::Base.send :include, Foliate::Controller
6
+ include Foliate::Controller
10
7
  end
11
8
  end
12
9
  end
@@ -1,3 +1,3 @@
1
1
  module Foliate
2
- VERSION = "1.2.0"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -12,11 +12,11 @@ module Foliate
12
12
 
13
13
  def copy_config
14
14
  template "config/initializer.rb.erb", "config/initializers/foliate.rb"
15
- copy_file "config/locales.yml", "config/locales/foliate.yml"
15
+ copy_file "config/locales.yml", "config/locales/foliate.en.yml"
16
16
  end
17
17
 
18
18
  def copy_view
19
- copy_file "views/page_input.html.erb", "app/views/pagination/_pagination.html.erb"
19
+ copy_file "views/page_input.html.erb", "app/views/application/_pagination.html.erb"
20
20
  template "stylesheets/page_input.scss.erb", "app/assets/stylesheets/pagination.scss"
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foliate
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Hefner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-08 00:00:00.000000000 Z
11
+ date: 2018-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -93,7 +93,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  version: '0'
94
94
  requirements: []
95
95
  rubyforge_project:
96
- rubygems_version: 2.5.2.1
96
+ rubygems_version: 2.7.6
97
97
  signing_key:
98
98
  specification_version: 4
99
99
  summary: Rails pagination