blacklight 3.2.0pre1 → 3.2.0pre2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.0pre1
1
+ 3.2.0pre2
@@ -1,12 +1,17 @@
1
1
  module Blacklight
2
- class Configuration::SearchField < Configuration::SolrField
2
+ class Configuration::SearchField < OpenStructWithHashAccess
3
3
  def normalize! blacklight_config
4
4
  # Some normalization, calculate display_label from key,
5
5
  # and make sure we have a qt from defaults.
6
- self.key = self.field
6
+ self.key ||= self.field
7
+ self.field ||= self.key
7
8
  self.label ||= self.key.try(:titlecase)
8
9
  self.qt ||= blacklight_config.default_solr_params[:qt] if blacklight_config.default_solr_params
9
10
  end
11
+
12
+ def validate!
13
+ raise ArgumentError.new("Must supply a search field key") if self.key.nil?
14
+ end
10
15
  end
11
16
  end
12
17
 
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
- class Configuration::SortField < Configuration::SolrField
2
+ class Configuration::SortField < OpenStructWithHashAccess
3
3
  def normalize! blacklight_config
4
4
  self.sort ||= self.field
5
5
 
@@ -1,5 +1,4 @@
1
1
  Rails.configuration.sass.tap do |config|
2
+ require 'compass'
2
3
  config.load_paths << "#{Gem.loaded_specs['compass'].full_gem_path}/frameworks/compass/stylesheets"
3
4
  end
4
-
5
-
@@ -203,6 +203,12 @@ describe "Blacklight::Configuration" do
203
203
  describe "add_search_field" do
204
204
  it "should accept hash form" do
205
205
  c = Blacklight::Configuration.new
206
+ c.add_search_field(:key => "my_search_key")
207
+ c.search_fields["my_search_key"].should_not be_nil
208
+ end
209
+
210
+ it "should accept two-arg hash form" do
211
+ c = Blacklight::Configuration.new
206
212
 
207
213
  c.add_search_field("my_search_type",
208
214
  :key => "my_search_type",
@@ -260,6 +266,12 @@ describe "Blacklight::Configuration" do
260
266
 
261
267
  describe "add_sort_field" do
262
268
  it "should take a hash" do
269
+ c = Blacklight::Configuration.new
270
+ c.add_sort_field(:key => "my_sort_key", :sort => "score desc")
271
+ c.sort_fields["my_sort_key"].should_not be_nil
272
+ end
273
+
274
+ it "should take a two-arg form with a hash" do
263
275
  @config.add_sort_field("score desc, pub_date_sort desc, title_sort asc", :label => "relevance")
264
276
 
265
277
 
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: 3.2.0pre1
4
+ version: 3.2.0pre2
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
@@ -20,7 +20,7 @@ date: 2011-12-13 00:00:00.000000000 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
23
- requirement: &2152421360 !ruby/object:Gem::Requirement
23
+ requirement: &2165181060 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
26
  - - ~>
@@ -28,10 +28,10 @@ dependencies:
28
28
  version: 3.1.1
29
29
  type: :runtime
30
30
  prerelease: false
31
- version_requirements: *2152421360
31
+ version_requirements: *2165181060
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: nokogiri
34
- requirement: &2152436680 !ruby/object:Gem::Requirement
34
+ requirement: &2165225320 !ruby/object:Gem::Requirement
35
35
  none: false
36
36
  requirements:
37
37
  - - ~>
@@ -39,10 +39,10 @@ dependencies:
39
39
  version: '1.5'
40
40
  type: :runtime
41
41
  prerelease: false
42
- version_requirements: *2152436680
42
+ version_requirements: *2165225320
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: unicode
45
- requirement: &2152435560 !ruby/object:Gem::Requirement
45
+ requirement: &2165224280 !ruby/object:Gem::Requirement
46
46
  none: false
47
47
  requirements:
48
48
  - - ! '>='
@@ -50,10 +50,10 @@ dependencies:
50
50
  version: '0'
51
51
  type: :runtime
52
52
  prerelease: false
53
- version_requirements: *2152435560
53
+ version_requirements: *2165224280
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: marc
56
- requirement: &2152434620 !ruby/object:Gem::Requirement
56
+ requirement: &2165222960 !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
59
  - - ~>
@@ -61,10 +61,10 @@ dependencies:
61
61
  version: 0.4.3
62
62
  type: :runtime
63
63
  prerelease: false
64
- version_requirements: *2152434620
64
+ version_requirements: *2165222960
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: rsolr
67
- requirement: &2152434020 !ruby/object:Gem::Requirement
67
+ requirement: &2165221960 !ruby/object:Gem::Requirement
68
68
  none: false
69
69
  requirements:
70
70
  - - ~>
@@ -72,10 +72,10 @@ dependencies:
72
72
  version: 1.0.6
73
73
  type: :runtime
74
74
  prerelease: false
75
- version_requirements: *2152434020
75
+ version_requirements: *2165221960
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rsolr-ext
78
- requirement: &2152433500 !ruby/object:Gem::Requirement
78
+ requirement: &2165221360 !ruby/object:Gem::Requirement
79
79
  none: false
80
80
  requirements:
81
81
  - - ~>
@@ -83,10 +83,10 @@ dependencies:
83
83
  version: 1.0.3
84
84
  type: :runtime
85
85
  prerelease: false
86
- version_requirements: *2152433500
86
+ version_requirements: *2165221360
87
87
  - !ruby/object:Gem::Dependency
88
88
  name: kaminari
89
- requirement: &2152432940 !ruby/object:Gem::Requirement
89
+ requirement: &2165220820 !ruby/object:Gem::Requirement
90
90
  none: false
91
91
  requirements:
92
92
  - - ! '>='
@@ -94,10 +94,10 @@ dependencies:
94
94
  version: '0'
95
95
  type: :runtime
96
96
  prerelease: false
97
- version_requirements: *2152432940
97
+ version_requirements: *2165220820
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: sass-rails
100
- requirement: &2152432240 !ruby/object:Gem::Requirement
100
+ requirement: &2165219480 !ruby/object:Gem::Requirement
101
101
  none: false
102
102
  requirements:
103
103
  - - ~>
@@ -105,10 +105,10 @@ dependencies:
105
105
  version: 3.1.1
106
106
  type: :runtime
107
107
  prerelease: false
108
- version_requirements: *2152432240
108
+ version_requirements: *2165219480
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: jettywrapper
111
- requirement: &2152431480 !ruby/object:Gem::Requirement
111
+ requirement: &2165218460 !ruby/object:Gem::Requirement
112
112
  none: false
113
113
  requirements:
114
114
  - - ! '>='
@@ -116,10 +116,10 @@ dependencies:
116
116
  version: 1.2.0
117
117
  type: :development
118
118
  prerelease: false
119
- version_requirements: *2152431480
119
+ version_requirements: *2165218460
120
120
  - !ruby/object:Gem::Dependency
121
121
  name: compass
122
- requirement: &2152430640 !ruby/object:Gem::Requirement
122
+ requirement: &2165227180 !ruby/object:Gem::Requirement
123
123
  none: false
124
124
  requirements:
125
125
  - - ! '>='
@@ -127,7 +127,7 @@ dependencies:
127
127
  version: 0.12.alpha.2
128
128
  type: :runtime
129
129
  prerelease: false
130
- version_requirements: *2152430640
130
+ version_requirements: *2165227180
131
131
  description: Blacklight is a free and open source ruby-on-rails based discovery interface
132
132
  (a.k.a. “next-generation catalog”) especially optimized for heterogeneous collections.
133
133
  You can use it as a library catalog, as a front end for a digital repository, or
@@ -432,7 +432,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
432
432
  version: '0'
433
433
  segments:
434
434
  - 0
435
- hash: 1358212209663666339
435
+ hash: -2728276321394562257
436
436
  required_rubygems_version: !ruby/object:Gem::Requirement
437
437
  none: false
438
438
  requirements: