blacklight 4.6.1 → 4.6.2

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
2
  SHA1:
3
- metadata.gz: 7778b16dcb6a423cfc3ae78a5c8c94ee31622039
4
- data.tar.gz: 05a40b65ff9610a0f76b259c0d765897dfb44d08
3
+ metadata.gz: 2973df853ccd78aa817fb76e2b5f2aaec1273b55
4
+ data.tar.gz: 4e6e6d1ad0d678deb64588ce0a3b81628c8a10dc
5
5
  SHA512:
6
- metadata.gz: 2d6a0c5e522c97076ce95ccdc52b9ec11d841e23bc7143e2678c2d9cee5bd5836d405f4a71c9ebc6317e07a2446200a5fbf5a29fa427e923130920bceb6dda05
7
- data.tar.gz: e119661aa4a379fa17d92f5c57c0dce7d9f2014a9cafbd1a03ca1b1c9960a6fc515c0fcb571bd5d571c504fcaffc90209ddc6a35c66053cfdb32e26ba1300cd8
6
+ metadata.gz: 0978b221b5f4308e8ee8011826ab39cad5fd69fc122399ae0b0d45ab1373e9db21ed099e6c4c69b159caa988633c02babb6988cd3eb2b6a52e684bf5df5eafe5
7
+ data.tar.gz: d0f6f2e7324af35f7c9d967de599ab24f0a9153942e2d15209d9b1aee19bd7c02b7b4cfe82690bbda17ec0e708aa6c9ca8deb5f41df9591bbb6d907fb70aee5e
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.6.1
1
+ 4.6.2
@@ -126,7 +126,7 @@ module Blacklight::BlacklightHelperBehavior
126
126
  # Field keys for the index fields
127
127
  # @deprecated
128
128
  def index_field_names document=nil
129
- Deprecation.warn(self, "#index_field_names helper is deprecated, and should be replaced by overriding the appropriate partial")
129
+ Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#index_field_names helper is deprecated, and should be replaced by overriding the appropriate partial")
130
130
  index_fields(document).keys
131
131
  end
132
132
 
@@ -135,7 +135,7 @@ module Blacklight::BlacklightHelperBehavior
135
135
  # @deprecated
136
136
  def index_field_labels document=nil
137
137
  # XXX DEPRECATED
138
- Deprecation.warn(self, "#index_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
138
+ Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#index_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
139
139
 
140
140
  Hash[*index_fields(document).map { |key, field| [key, field.label] }.flatten]
141
141
  end
@@ -263,7 +263,7 @@ module Blacklight::BlacklightHelperBehavior
263
263
  # @deprecated
264
264
  def document_show_field_labels document=nil
265
265
  # XXX DEPRECATED
266
- Deprecation.warn(self, "#document_show_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
266
+ Deprecation.warn(Blacklight::BlacklightHelperBehavior, "#document_show_field_labels helper is deprecated, and should be replaced by overriding the appropriate partial")
267
267
 
268
268
  Hash[*document_show_fields(document).map { |key, field| [key, field.label] }.flatten]
269
269
  end
@@ -8,7 +8,7 @@ module Blacklight::CatalogHelperBehavior
8
8
  # it translates to a Kaminari-paginatable
9
9
  # object, with the keys Kaminari views expect.
10
10
  def paginate_params(response)
11
- Deprecation.warn self, "#paginate_params is deprecated; the original response object is Kaminari-compatible"
11
+ Deprecation.warn Blacklight::CatalogHelperBehavior, "#paginate_params is deprecated; the original response object is Kaminari-compatible"
12
12
 
13
13
  response
14
14
  end
@@ -26,7 +26,7 @@ module Blacklight::CatalogHelperBehavior
26
26
  # shortcut for built-in Rails helper, "number_with_delimiter"
27
27
  #
28
28
  def format_num(num)
29
- Deprecation.warn self, "#format_num is deprecated; use e.g. #number_with_delimiter directly"
29
+ Deprecation.warn Blacklight::CatalogHelperBehavior, "#format_num is deprecated; use e.g. #number_with_delimiter directly"
30
30
  number_with_delimiter(num)
31
31
  end
32
32
 
@@ -178,7 +178,7 @@ module Blacklight::CatalogHelperBehavior
178
178
  end
179
179
 
180
180
  def response_has_no_search_results?
181
- Deprecation.warn(self, "#response_has_no_search_results? is deprecated; use Response#empty? to check instead")
181
+ Deprecation.warn(Blacklight::CatalogHelperBehavior, "#response_has_no_search_results? is deprecated; use Response#empty? to check instead")
182
182
  @response.empty?
183
183
  end
184
184
  end
@@ -35,7 +35,7 @@ module Blacklight::FacetsHelperBehavior
35
35
  #
36
36
  def render_facet_limit(display_facet, options = {})
37
37
  if display_facet.is_a? String or display_facet.is_a? Symbol
38
- Deprecation.warn(self, "Blacklight::FacetsHelper#render_facet_limit: use #render_facet_partials to render facets by field name")
38
+ Deprecation.warn(Blacklight::FacetsHelperBehavior, "Blacklight::FacetsHelper#render_facet_limit: use #render_facet_partials to render facets by field name")
39
39
  return render_facet_partials([display_facet])
40
40
  end
41
41
  return if not should_render_facet?(display_facet)
@@ -90,6 +90,30 @@ describe BlacklightHelper do
90
90
  def current_search_session
91
91
 
92
92
  end
93
+
94
+ describe "deprecated methods" do
95
+ describe "#index_field_names" do
96
+ it "should warn" do
97
+ expect(Blacklight::BlacklightHelperBehavior.deprecation_behavior.first).to receive(:call)
98
+ helper.stub(:index_fields => {})
99
+ helper.index_field_names
100
+ end
101
+ end
102
+ describe "#index_field_labels" do
103
+ it "should warn" do
104
+ expect(Blacklight::BlacklightHelperBehavior.deprecation_behavior.first).to receive(:call)
105
+ helper.stub(:index_fields => {})
106
+ helper.index_field_labels
107
+ end
108
+ end
109
+ describe "#document_show_field_labels" do
110
+ it "should warn" do
111
+ expect(Blacklight::BlacklightHelperBehavior.deprecation_behavior.first).to receive(:call)
112
+ helper.stub(:document_show_fields => {})
113
+ helper.document_show_field_labels
114
+ end
115
+ end
116
+ end
93
117
 
94
118
  describe "#application_name", :test => true do
95
119
  it "should use the Rails application config application_name if available" do
@@ -21,7 +21,33 @@ describe CatalogHelper do
21
21
  def render_grouped_response?
22
22
  false
23
23
  end
24
-
24
+
25
+ describe "deprecated methods" do
26
+ describe "response_has_no_search_results?" do
27
+ it "should be deprecated" do
28
+ expect(Blacklight::CatalogHelperBehavior.deprecation_behavior.first).to receive(:call)
29
+ assign(:response, double(:empty? => false))
30
+ expect(helper.response_has_no_search_results?).to be_false
31
+ end
32
+ end
33
+
34
+ describe "paginate_params" do
35
+ let(:response) { double }
36
+ it "should be deprecated" do
37
+ expect(Blacklight::CatalogHelperBehavior.deprecation_behavior.first).to receive(:call)
38
+ assign(:response, response)
39
+ expect(helper.paginate_params(response)).to eq response
40
+ end
41
+ end
42
+
43
+ describe "format_num" do
44
+ it "should be deprecated" do
45
+ expect(Blacklight::CatalogHelperBehavior.deprecation_behavior.first).to receive(:call)
46
+ expect(format_num(10000)).to eq '10,000'
47
+ end
48
+ end
49
+
50
+ end
25
51
 
26
52
  describe "page_entries_info" do
27
53
  before(:all) do
@@ -229,6 +229,13 @@ describe FacetsHelper do
229
229
  helper.should_receive(:render).with(hash_including(:partial => 'custom_facet_partial'))
230
230
  helper.render_facet_limit(@mock_facet)
231
231
  end
232
+
233
+ it "should be deprecated when a string is passed" do
234
+ expect(@response).to receive(:facet_by_field_name)
235
+ expect(Blacklight::FacetsHelperBehavior.deprecation_behavior.first).to receive(:call)
236
+ helper.render_facet_limit('basic_field')
237
+ end
238
+
232
239
  end
233
240
 
234
241
  describe "add_facet_params" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.6.1
4
+ version: 4.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
@@ -17,7 +17,7 @@ authors:
17
17
  autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
- date: 2014-01-15 00:00:00.000000000 Z
20
+ date: 2014-01-17 00:00:00.000000000 Z
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
23
23
  name: rails