alphabetical_paginate 2.3.2 → 2.3.3

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d2347ca0e1d35699ddf3d45a5d75171551e98382
4
+ data.tar.gz: dad83f259bd0b94bbf34584d7f274cd8e6defe3a
5
+ SHA512:
6
+ metadata.gz: 3385ab205d343031f942e1e60afb40c2364cccdd8eb19d4708a002d76c23e9f6d99fb960ae0991741f8bb1cbc7263fcb028bc7d2e2933efcd36dfd83067d15b5
7
+ data.tar.gz: 83187b20de7b5a36afb18f21f042a604b9242823d1b79fb984b1fdc234763294ecfd46345fbb90e680068a595e404e36280d61b895181316c75731e4b1f24fab
@@ -12,6 +12,7 @@ module AlphabeticalPaginate
12
12
  js: true, support_language: :en,
13
13
  bootstrap3: false, slugged_link: false,
14
14
  slug_field: "slug", all_as_link: true}
15
+ params[:default_field] ||= "a"
15
16
  params[:paginate_all] ||= false
16
17
  params[:support_language] ||= :en
17
18
  params[:language] = AlphabeticalPaginate::Language.new(params[:support_language])
@@ -1,3 +1,3 @@
1
1
  module AlphabeticalPaginate
2
- VERSION = "2.3.2"
2
+ VERSION = "2.3.3"
3
3
  end
@@ -6,7 +6,7 @@ module AlphabeticalPaginate
6
6
  links = ""
7
7
  output += javascript_include_tag 'alphabetical_paginate' if options[:js] == true
8
8
  options[:scope] ||= main_app
9
-
9
+
10
10
  if options[:paginate_all]
11
11
  range = options[:language].letters_range
12
12
  if options[:others]
@@ -48,7 +48,7 @@ module AlphabeticalPaginate
48
48
  end
49
49
  options[:availableLetters] -= (1..9).to_a.map{|x| x.to_s} if !options[:numbers]
50
50
  options[:availableLetters] -= ["*"] if !options[:others]
51
-
51
+
52
52
  options[:availableLetters].each do |l|
53
53
  link_letter = l
54
54
  if options[:slugged_link] && (l =~ options[:language].letters_regexp || l == "All")
@@ -75,7 +75,7 @@ module AlphabeticalPaginate
75
75
  (options[:bootstrap3] ? "" : "<ul>") +
76
76
  links +
77
77
  (options[:bootstrap3] ? "" : "</ul>") +
78
- (options[:bootstrap3] ? "" : "</div>")
78
+ "</#{element}>"
79
79
 
80
80
  output += pagination
81
81
  output.html_safe
@@ -55,7 +55,7 @@ module AlphabeticalPaginate
55
55
  enumerate: false,
56
56
  }
57
57
  collection, params = @list.alpha_paginate("b")
58
- collection.to_s.should ==
58
+ collection.to_s.should ==
59
59
  expectedCollection.to_s
60
60
  params.to_s.should include
61
61
  expectedParams.to_s
@@ -73,7 +73,7 @@ module AlphabeticalPaginate
73
73
  collection, params = @list.alpha_paginate("b") do |x|
74
74
  x.word
75
75
  end
76
- collection.to_s.should ==
76
+ collection.to_s.should ==
77
77
  expectedCollection.to_s
78
78
  params.to_s.should include
79
79
  expectedParams.to_s
@@ -100,7 +100,7 @@ module AlphabeticalPaginate
100
100
  enumerate: false,
101
101
  }
102
102
  collection, params = @list.alpha_paginate("с", { support_language: :ru })
103
- collection.to_s.should ==
103
+ collection.to_s.should ==
104
104
  expectedCollection.to_s
105
105
  params.to_s.should include
106
106
  expectedParams.to_s
@@ -116,7 +116,7 @@ module AlphabeticalPaginate
116
116
  enumerate: false,
117
117
  }
118
118
  collection, params = @list.alpha_paginate(nil, { include_all: false, support_language: :ru })
119
- collection.to_s.should ==
119
+ collection.to_s.should ==
120
120
  expectedCollection.to_s
121
121
  params.to_s.should include
122
122
  expectedParams.to_s
@@ -144,6 +144,20 @@ module AlphabeticalPaginate
144
144
  pagination.should include "div", "pagination"
145
145
  end
146
146
 
147
+ it "should open and close the div tag" do
148
+ index, params = @list.alpha_paginate(nil)
149
+ pagination = alphabetical_paginate(params)
150
+ pagination.start_with?('<div').should be_truthy
151
+ pagination.end_with?('</div>').should be_truthy
152
+ end
153
+
154
+ it "should open and close the ul tag when run in bootstrap3 mode" do
155
+ index, params = @list.alpha_paginate(nil)
156
+ pagination = alphabetical_paginate(params.merge(bootstrap3: true))
157
+ pagination.start_with?('<ul').should be_truthy
158
+ pagination.end_with?('</ul>').should be_truthy
159
+ end
160
+
147
161
  it "should include a numbers and others field" do
148
162
  index, params = @list.alpha_paginate(nil)
149
163
  pagination = alphabetical_paginate(params)
metadata CHANGED
@@ -1,78 +1,69 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alphabetical_paginate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
5
- prerelease:
4
+ version: 2.3.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - lingz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2016-09-20 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
19
  version: '1.3'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - "~>"
28
25
  - !ruby/object:Gem::Version
29
26
  version: '1.3'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - ">="
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - ">="
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ~>
45
+ - - "~>"
52
46
  - !ruby/object:Gem::Version
53
47
  version: '2.6'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ~>
52
+ - - "~>"
60
53
  - !ruby/object:Gem::Version
61
54
  version: '2.6'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rails
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - ">="
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - ">="
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  description: Alphabetical Pagination
@@ -82,8 +73,8 @@ executables: []
82
73
  extensions: []
83
74
  extra_rdoc_files: []
84
75
  files:
85
- - .gitignore
86
- - .rspec
76
+ - ".gitignore"
77
+ - ".rspec"
87
78
  - Gemfile
88
79
  - LICENSE.txt
89
80
  - README.md
@@ -108,27 +99,26 @@ files:
108
99
  homepage: https://github.com/lingz/alphabetical_paginate
109
100
  licenses:
110
101
  - MIT
102
+ metadata: {}
111
103
  post_install_message:
112
104
  rdoc_options: []
113
105
  require_paths:
114
106
  - lib
115
107
  required_ruby_version: !ruby/object:Gem::Requirement
116
- none: false
117
108
  requirements:
118
- - - ! '>='
109
+ - - ">="
119
110
  - !ruby/object:Gem::Version
120
111
  version: '0'
121
112
  required_rubygems_version: !ruby/object:Gem::Requirement
122
- none: false
123
113
  requirements:
124
- - - ! '>='
114
+ - - ">="
125
115
  - !ruby/object:Gem::Version
126
116
  version: '0'
127
117
  requirements: []
128
118
  rubyforge_project:
129
- rubygems_version: 1.8.23
119
+ rubygems_version: 2.6.14
130
120
  signing_key:
131
- specification_version: 3
121
+ specification_version: 4
132
122
  summary: Pagination
133
123
  test_files:
134
124
  - spec/alpha_example.rb