blacklight_highlight 0.0.1pre1 → 0.0.1

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1pre1
1
+ 0.0.1
@@ -7,16 +7,29 @@ module BlacklightHighlight
7
7
  end
8
8
 
9
9
  def [] key
10
- return highlight(key) unless highlight(key).blank?
10
+ return super(key) if key == self.class.unique_key
11
+ return highlight(key) if highlight_fields.key?(key) and not highlight(key).blank?
11
12
 
12
13
  super(key)
13
14
  end
14
15
 
15
- def highlight key=nil
16
- return unless solr_response and solr_response.respond_to? :highlight
16
+ def key? key
17
+ return super(key) if key == self.class.unique_key
18
+ return true if highlight_fields.key?(key)
19
+
20
+ super(key)
21
+ end
22
+
23
+ def highlight key = nil
17
24
  return if key == self.class.unique_key
25
+ highlight_fields[key]
26
+ end
18
27
 
19
- solr_response.highlight(self, key)
28
+ def highlight_fields
29
+ @highlight_fields ||= begin
30
+ return {} unless solr_response and solr_response.respond_to? :highlight
31
+ solr_response.highlight(self)
32
+ end
20
33
  end
21
34
  end
22
35
  end
metadata CHANGED
@@ -1,15 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight_highlight
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1923831971
5
- prerelease: 5
4
+ hash: 29
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 1
10
- - pre
11
- - 1
12
- version: 0.0.1pre1
10
+ version: 0.0.1
13
11
  platform: ruby
14
12
  authors:
15
13
  - Chris Beer
@@ -17,7 +15,7 @@ autorequire:
17
15
  bindir: bin
18
16
  cert_chain: []
19
17
 
20
- date: 2011-07-25 00:00:00 -04:00
18
+ date: 2011-07-26 00:00:00 -04:00
21
19
  default_executable:
22
20
  dependencies:
23
21
  - !ruby/object:Gem::Dependency
@@ -124,14 +122,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
122
  required_rubygems_version: !ruby/object:Gem::Requirement
125
123
  none: false
126
124
  requirements:
127
- - - ">"
125
+ - - ">="
128
126
  - !ruby/object:Gem::Version
129
- hash: 25
127
+ hash: 3
130
128
  segments:
131
- - 1
132
- - 3
133
- - 1
134
- version: 1.3.1
129
+ - 0
130
+ version: "0"
135
131
  requirements: []
136
132
 
137
133
  rubyforge_project: blacklight