geoblacklight 1.0.0 → 1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e127521d287ca59baf0fc20ca40ca809a94b3b7
4
- data.tar.gz: 8a071536d30863fb3839b04813f6b33aaf43e4a3
3
+ metadata.gz: 5cbe25203c73d542b897ad3d556f55848632394c
4
+ data.tar.gz: 72c74184a3184e3307c32dd6abfe405f7790b3a4
5
5
  SHA512:
6
- metadata.gz: 3ac53e717f08c5534bdd2dcc53fe16c24586775128a673862918965bb3da0efd61e7c9c7d9626f025efe9140fdef930c6835f6132a4fe58b7a50e3f18b97b0ee
7
- data.tar.gz: c36c0aaad73b3baa21545033f462ba9ab3d16fc42b9f23c714b91960a1baff67428938cd8935c9dc452afb33fd2ee50b8cca2d342caa355c2d5e46b78434a00f
6
+ metadata.gz: a7edd50a9275357113347cf2965d590641254cbb36280dddc8bba6aee9ec41b609f0bc1bf68a26815dfafa9351eadf4cbe9a6f169c12d249757be25682a77053
7
+ data.tar.gz: 1b9b2064a3503c9a970fed6dd7f9c63ef1d82cc235da3e9a1bb115ab00202f7b8bd50fb2e0c195c491e1e3a7945591016d742feb9ca9731a53b62db422672e5f
@@ -1,7 +1,5 @@
1
1
  /*global GeoBlacklight */
2
2
 
3
- 'use strict';
4
-
5
3
  // Leaflet opacity control.
6
4
  GeoBlacklight.Controls.Opacity = function() {
7
5
  this.map.addControl(new L.Control.LayerOpacity(this.overlay));
@@ -20,7 +20,7 @@
20
20
 
21
21
  var GeoBlacklight = L.Class.extend({
22
22
  statics: {
23
- __version__: '1.0.0',
23
+ __version__: '1.0.1',
24
24
 
25
25
  debounce: function(fn, delay) {
26
26
  var timeout = null;
@@ -1,7 +1,5 @@
1
1
  /*global GeoBlacklight */
2
2
 
3
- 'use strict';
4
-
5
3
  GeoBlacklight.Util = {
6
4
  // Regex taken from http://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links
7
5
  linkify: function(str) {
@@ -1,7 +1,5 @@
1
1
  /*global GeoBlacklight */
2
2
 
3
- 'use strict';
4
-
5
3
  // base viewer
6
4
  GeoBlacklight.Viewer = L.Class.extend({
7
5
  options: {},
@@ -1,4 +1,7 @@
1
1
  .twitter-typeahead {
2
+ float: left;
3
+ width: 100%;
4
+ z-index: 1001;
2
5
 
3
6
  .tt-input.form-control {
4
7
  width: 100%;
@@ -24,7 +24,7 @@ module GeoblacklightHelper
24
24
  # @param [SolrDocument] args
25
25
  # @return [String]
26
26
  def snippit(args)
27
- truncate(Array(args[:value]).flatten.first, length: 150)
27
+ truncate(Array(args[:value]).flatten.join(' '), length: 150)
28
28
  end
29
29
 
30
30
  def render_facet_tags(facet)
@@ -90,7 +90,7 @@ module GeoblacklightHelper
90
90
  # @param [Hash] args from get_field_values
91
91
  def render_value_as_truncate_abstract(args)
92
92
  content_tag :div, class: 'truncate-abstract' do
93
- args[:value]
93
+ Array(args[:value]).flatten.join(' ')
94
94
  end
95
95
  end
96
96
 
@@ -1,3 +1,3 @@
1
1
  module Geoblacklight
2
- VERSION = '1.0.0'.freeze
2
+ VERSION = '1.0.1'.freeze
3
3
  end
@@ -21,7 +21,7 @@ namespace :geoblacklight do
21
21
 
22
22
  desc "Ingests a directory of geoblacklight.json files"
23
23
  task :ingest, [:directory] => :environment do |_t, args|
24
- args.with_default(directory: 'data')
24
+ args.with_defaults(directory: 'data')
25
25
  Dir.glob(File.join(args[:directory], '**', 'geoblacklight.json')).each do |fn|
26
26
  puts "Ingesting #{fn}"
27
27
  begin
@@ -0,0 +1,34 @@
1
+ # Standard english stop words taken from Lucene's StopAnalyzer
2
+ a
3
+ an
4
+ and
5
+ are
6
+ as
7
+ at
8
+ be
9
+ but
10
+ by
11
+ for
12
+ if
13
+ in
14
+ into
15
+ is
16
+ it
17
+ no
18
+ not
19
+ of
20
+ on
21
+ or
22
+ such
23
+ that
24
+ the
25
+ their
26
+ then
27
+ there
28
+ these
29
+ they
30
+ this
31
+ to
32
+ was
33
+ will
34
+ with
@@ -0,0 +1,21 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ # Use a protected word file to protect against the stemmer reducing two
15
+ # unrelated words to the same base word.
16
+
17
+ # Some non-words that normally won't be encountered,
18
+ # just to test that they won't be stemmed.
19
+ dontstems
20
+ zwhacky
21
+
@@ -0,0 +1,34 @@
1
+ # Standard english stop words taken from Lucene's StopAnalyzer
2
+ a
3
+ an
4
+ and
5
+ are
6
+ as
7
+ at
8
+ be
9
+ but
10
+ by
11
+ for
12
+ if
13
+ in
14
+ into
15
+ is
16
+ it
17
+ no
18
+ not
19
+ of
20
+ on
21
+ or
22
+ such
23
+ that
24
+ the
25
+ their
26
+ then
27
+ there
28
+ these
29
+ they
30
+ this
31
+ to
32
+ was
33
+ will
34
+ with
@@ -0,0 +1,29 @@
1
+ # The ASF licenses this file to You under the Apache License, Version 2.0
2
+ # (the "License"); you may not use this file except in compliance with
3
+ # the License. You may obtain a copy of the License at
4
+ #
5
+ # http://www.apache.org/licenses/LICENSE-2.0
6
+ #
7
+ # Unless required by applicable law or agreed to in writing, software
8
+ # distributed under the License is distributed on an "AS IS" BASIS,
9
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
+ # See the License for the specific language governing permissions and
11
+ # limitations under the License.
12
+
13
+ #-----------------------------------------------------------------------
14
+ #some test synonym mappings unlikely to appear in real input text
15
+ aaafoo => aaabar
16
+ bbbfoo => bbbfoo bbbbar
17
+ cccfoo => cccbar cccbaz
18
+ fooaaa,baraaa,bazaaa
19
+
20
+ # Some synonym groups specific to this example
21
+ GB,gib,gigabyte,gigabytes
22
+ MB,mib,megabyte,megabytes
23
+ Television, Televisions, TV, TVs
24
+ #notice we use "gib" instead of "GiB" so any WordDelimiterFilter coming
25
+ #after us won't split it into two words.
26
+
27
+ # Synonym mappings can be used for spelling correction too
28
+ pixima => pixma
29
+
@@ -96,6 +96,19 @@ describe GeoblacklightHelper, type: :helper do
96
96
  expect(helper.snippit(document)[-3..-1]).to eq '...'
97
97
  end
98
98
  end
99
+ context 'as a multivalued Array' do
100
+ let(:document_attributes) do
101
+ {
102
+ value: %w(short description)
103
+ }
104
+ end
105
+ it 'uses both values' do
106
+ expect(helper.snippit(document)).to eq 'short description'
107
+ end
108
+ it 'does not truncate' do
109
+ expect(helper.snippit(document)[-3..-1]).not_to eq '...'
110
+ end
111
+ end
99
112
  end
100
113
 
101
114
  describe '#cartodb_link' do
@@ -130,4 +143,13 @@ describe GeoblacklightHelper, type: :helper do
130
143
  expect(leaflet_options[:VIEWERS][:WMS][:CONTROLS]).to eq(['Opacity'])
131
144
  end
132
145
  end
146
+
147
+ describe '#render_value_as_truncate_abstract' do
148
+ context 'with multiple values' do
149
+ let(:document) { SolrDocument.new(value: %w(short description)) }
150
+ it 'wraps in correct DIV class' do
151
+ expect(helper.render_value_as_truncate_abstract(document)).to eq '<div class="truncate-abstract">short description</div>'
152
+ end
153
+ end
154
+ end
133
155
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-07-28 00:00:00.000000000 Z
14
+ date: 2016-07-30 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: blacklight
@@ -385,8 +385,12 @@ files:
385
385
  - lib/tasks/geoblacklight.rake
386
386
  - schema/geoblacklight-schema.json
387
387
  - schema/geoblacklight-schema.md
388
+ - schema/solr/conf/lang/stopwords_en.txt
389
+ - schema/solr/conf/protwords.txt
388
390
  - schema/solr/conf/schema.xml
389
391
  - schema/solr/conf/solrconfig.xml
392
+ - schema/solr/conf/stopwords_en.txt
393
+ - schema/solr/conf/synonyms.txt
390
394
  - spec/controllers/catalog_controller_spec.rb
391
395
  - spec/controllers/download_controller_spec.rb
392
396
  - spec/factories/user.rb