geoblacklight 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.rubocop.yml +45 -0
  4. data/CONTRIBUTING.md +38 -0
  5. data/Gemfile +27 -6
  6. data/README.md +2 -9
  7. data/Rakefile +20 -11
  8. data/app/assets/javascripts/geoblacklight/basemaps.js +6 -3
  9. data/app/assets/javascripts/geoblacklight/modules/layer_opacity.js +13 -5
  10. data/app/assets/javascripts/geoblacklight/viewers/map.js +7 -0
  11. data/app/assets/javascripts/geoblacklight/viewers/wms.js +2 -5
  12. data/app/assets/stylesheets/geoblacklight/modules/item.scss +1 -1
  13. data/app/controllers/download_controller.rb +18 -14
  14. data/app/controllers/wms_controller.rb +1 -1
  15. data/app/helpers/geoblacklight_helper.rb +17 -11
  16. data/{lib → app/models/concerns}/geoblacklight/solr_document.rb +13 -8
  17. data/{lib → app/models/concerns}/geoblacklight/solr_document/carto_db.rb +0 -0
  18. data/{lib → app/models/concerns}/geoblacklight/solr_document/finder.rb +1 -2
  19. data/app/models/concerns/geoblacklight/solr_document/inspection.rb +15 -0
  20. data/{lib → app/presenters}/geoblacklight/document_presenter.rb +0 -0
  21. data/app/views/catalog/_show_default_viewer_container.html.erb +1 -1
  22. data/config/initializers/rails_config.rb +2 -2
  23. data/geoblacklight.gemspec +3 -4
  24. data/lib/generators/geoblacklight/install_generator.rb +17 -16
  25. data/lib/generators/geoblacklight/templates/catalog_controller.rb +1 -5
  26. data/lib/generators/geoblacklight/templates/geoblacklight.css.scss +0 -1
  27. data/lib/generators/geoblacklight/templates/geoblacklight.js +0 -1
  28. data/lib/geoblacklight.rb +1 -6
  29. data/lib/geoblacklight/bounding_box.rb +2 -1
  30. data/lib/geoblacklight/catalog_helper_override.rb +0 -1
  31. data/lib/geoblacklight/download.rb +12 -7
  32. data/lib/geoblacklight/download/hgl_download.rb +2 -3
  33. data/lib/geoblacklight/download/kmz_download.rb +9 -3
  34. data/lib/geoblacklight/download/shapefile_download.rb +5 -1
  35. data/lib/geoblacklight/engine.rb +1 -3
  36. data/lib/geoblacklight/exceptions.rb +1 -1
  37. data/lib/geoblacklight/metadata.rb +0 -1
  38. data/lib/geoblacklight/references.rb +3 -4
  39. data/lib/geoblacklight/routes.rb +5 -3
  40. data/lib/geoblacklight/search_builder.rb +3 -2
  41. data/lib/geoblacklight/version.rb +1 -1
  42. data/lib/geoblacklight/view_helper_override.rb +9 -10
  43. data/lib/geoblacklight/wms_layer.rb +12 -15
  44. data/lib/geoblacklight/wms_layer/feature_info_response.rb +1 -1
  45. data/spec/controllers/catalog_controller_spec.rb +1 -1
  46. data/spec/controllers/download_controller_spec.rb +7 -7
  47. data/spec/features/home_page_spec.rb +1 -1
  48. data/spec/features/layer_opacity_spec.rb +9 -0
  49. data/spec/features/metadata_panel_spec.rb +6 -4
  50. data/spec/features/saved_searches_spec.rb +1 -1
  51. data/spec/features/split_view.html.erb_spec.rb +3 -3
  52. data/spec/helpers/geoblacklight_helpers_spec.rb +3 -4
  53. data/spec/lib/geoblacklight/bounding_box_spec.rb +7 -7
  54. data/spec/lib/geoblacklight/controller_override_spec.rb +1 -1
  55. data/spec/lib/geoblacklight/document_presenter_spec.rb +1 -1
  56. data/spec/lib/geoblacklight/download/geojson_download_spec.rb +5 -5
  57. data/spec/lib/geoblacklight/download/geotiff_download_spec.rb +5 -5
  58. data/spec/lib/geoblacklight/download/hgl_download_spec.rb +6 -6
  59. data/spec/lib/geoblacklight/download/kmz_download_spec.rb +5 -5
  60. data/spec/lib/geoblacklight/download/shapefile_download_spec.rb +5 -5
  61. data/spec/lib/geoblacklight/download_spec.rb +14 -14
  62. data/spec/lib/geoblacklight/geoblacklight_helper_behavior_spec.rb +2 -1
  63. data/spec/lib/geoblacklight/item_viewer_spec.rb +5 -5
  64. data/spec/lib/geoblacklight/metadata_spec.rb +3 -3
  65. data/spec/lib/geoblacklight/reference_spec.rb +3 -3
  66. data/spec/lib/geoblacklight/references_spec.rb +34 -34
  67. data/spec/lib/geoblacklight/search_builder_spec.rb +7 -15
  68. data/spec/lib/geoblacklight/view_helper_override_spec.rb +15 -15
  69. data/spec/lib/geoblacklight/wms_layer/feature_info_response_spec.rb +10 -10
  70. data/spec/lib/geoblacklight/wms_layer_spec.rb +7 -7
  71. data/spec/{lib → models/concerns}/geoblacklight/solr_document/carto_db_spec.rb +0 -0
  72. data/spec/{lib → models/concerns}/geoblacklight/solr_document/finder_spec.rb +2 -2
  73. data/spec/models/concerns/geoblacklight/solr_document/inspection_spec.rb +16 -0
  74. data/spec/{lib → models/concerns}/geoblacklight/solr_document_spec.rb +24 -24
  75. data/spec/spec_helper.rb +6 -7
  76. data/spec/support/features.rb +1 -1
  77. data/spec/support/features/session_helpers.rb +1 -1
  78. data/spec/teaspoon_env.rb +38 -33
  79. data/spec/test_app_templates/lib/generators/test_app_generator.rb +4 -4
  80. data/spec/views/catalog/_document_split.html.erb_spec.rb +1 -1
  81. data/spec/views/catalog/_index_split.html.erb_spec.rb +1 -1
  82. metadata +31 -33
  83. data/lib/geoblacklight/config.rb +0 -0
@@ -5,6 +5,7 @@ module Geoblacklight
5
5
 
6
6
  include Geoblacklight::SolrDocument::Finder
7
7
  include Geoblacklight::SolrDocument::CartoDb
8
+ include Geoblacklight::SolrDocument::Inspection
8
9
 
9
10
  delegate :download_types, to: :references
10
11
  delegate :viewer_protocol, to: :item_viewer
@@ -26,10 +27,6 @@ module Geoblacklight
26
27
  (direct_download || download_types.present?) && available?
27
28
  end
28
29
 
29
- def download_types
30
- references.download_types
31
- end
32
-
33
30
  def references
34
31
  References.new(self)
35
32
  end
@@ -51,18 +48,26 @@ module Geoblacklight
51
48
  end
52
49
 
53
50
  def itemtype
54
- "http://schema.org/Dataset"
51
+ 'http://schema.org/Dataset'
55
52
  end
56
53
 
57
54
  def bounding_box_as_wsen
58
- s = fetch(Settings.GEOMETRY_FIELD.to_sym)
59
- if s =~ /^\s*ENVELOPE\(\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*,\s*([-\.\d]+)\s*\)\s*$/
60
- w, s, e, n = $1, $4, $2, $3
55
+ geom_field = fetch(Settings.GEOMETRY_FIELD.to_sym)
56
+ exp = /^\s*ENVELOPE\(
57
+ \s*([-\.\d]+)\s*,
58
+ \s*([-\.\d]+)\s*,
59
+ \s*([-\.\d]+)\s*,
60
+ \s*([-\.\d]+)\s*
61
+ \)\s*$/x # uses 'x' option for free-spacing mode
62
+ bbox_match = exp.match(geom_field)
63
+ if bbox_match
64
+ w, e, n, s = bbox_match.captures
61
65
  return "#{w} #{s} #{e} #{n}"
62
66
  else
63
67
  return s # as-is, not a WKT
64
68
  end
65
69
  end
70
+
66
71
  ##
67
72
  # Provides a convenience method to access a SolrDocument's References
68
73
  # endpoint url without having to check and see if it is available
@@ -11,7 +11,6 @@ module Geoblacklight
11
11
  ##
12
12
  # Class level finder methods for documents
13
13
  module ClassMethods
14
-
15
14
  ##
16
15
  # Find a Solr Document from an index
17
16
  # @param [String]
@@ -36,4 +35,4 @@ module Geoblacklight
36
35
  end
37
36
  end
38
37
  end
39
- end
38
+ end
@@ -0,0 +1,15 @@
1
+ module Geoblacklight
2
+ module SolrDocument
3
+ ##
4
+ # Module to provide inspection logic for solr document
5
+ module Inspection
6
+ ##
7
+ # Returns boolean about whether document viewer protocol is inspectable
8
+ # @return [Boolean]
9
+ def inspectable?
10
+ %w(wms)
11
+ .include? viewer_protocol
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  <% document ||= @document %>
2
2
  <div id='viewer-container' class="col-md-8">
3
- <%= content_tag :div, id: 'map', data: { map: 'item', protocol: document.viewer_protocol, url: document.viewer_endpoint, 'layer-id' => wxs_identifier(document), 'map-bbox' => document.bounding_box_as_wsen, 'catalog-path'=> catalog_index_path, available: document_available?, basemap: geoblacklight_basemap } do %>
3
+ <%= content_tag :div, id: 'map', data: { map: 'item', protocol: document.viewer_protocol.camelize, url: document.viewer_endpoint, 'layer-id' => wxs_identifier(document), 'map-bbox' => document.bounding_box_as_wsen, 'catalog-path'=> catalog_index_path, available: document_available?, inspect: show_attribute_table?, basemap: geoblacklight_basemap } do %>
4
4
  <% end %>
5
5
  </div>
@@ -1,3 +1,3 @@
1
1
  RailsConfig.setup do |config|
2
- config.const_name = "Settings"
3
- end
2
+ config.const_name = 'Settings'
3
+ end
@@ -18,9 +18,8 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ['lib']
20
20
 
21
- spec.add_dependency 'blacklight', '~> 5.12.0'
21
+ spec.add_dependency 'blacklight', '~> 5.12', '< 6'
22
22
  spec.add_dependency 'leaflet-rails', '~> 0.7.3'
23
- spec.add_dependency 'blacklight_range_limit', '~> 5.0.3'
24
23
  spec.add_dependency 'font-awesome-rails', '~> 4.1.0.0'
25
24
  spec.add_dependency 'rails_config', '~> 0.4.2'
26
25
  spec.add_dependency 'faraday'
@@ -31,9 +30,9 @@ Gem::Specification.new do |spec|
31
30
  spec.add_development_dependency 'rake', '~> 10.3.2'
32
31
  spec.add_development_dependency 'rspec-rails', '~> 3.0.1'
33
32
  spec.add_development_dependency 'jettywrapper', '>= 2.0'
34
- spec.add_development_dependency 'engine_cart', '~> 0.4.0'
33
+ spec.add_development_dependency 'engine_cart', '~> 0.8'
35
34
  spec.add_development_dependency 'capybara', '~> 2.3.0'
36
- spec.add_development_dependency 'poltergeist', '~> 1.5.0'
35
+ spec.add_development_dependency 'poltergeist', '~> 1.5'
37
36
  spec.add_development_dependency 'factory_girl_rails'
38
37
  spec.add_development_dependency 'database_cleaner'
39
38
  end
@@ -2,33 +2,35 @@ require 'rails/generators'
2
2
 
3
3
  module Geoblacklight
4
4
  class Install < Rails::Generators::Base
5
-
6
5
  source_root File.expand_path('../templates', __FILE__)
7
6
 
8
- class_option :jettywrapper, type: :boolean, default: false, desc: 'Use jettywrapper to download and control Jetty'
7
+ class_option :jettywrapper,
8
+ type: :boolean,
9
+ default: false,
10
+ desc: 'Use jettywrapper to download and control Jetty'
9
11
 
10
- desc "Install Geoblacklight"
12
+ desc 'Install Geoblacklight'
11
13
 
12
14
  def install_jettywrapper
13
15
  return unless options[:jettywrapper]
14
16
  copy_file 'config/jetty.yml'
15
17
 
16
18
  append_to_file 'Rakefile',
17
- "\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.3.zip\"\n" +
18
- "require 'jettywrapper'\n"
19
+ "\nZIP_URL = \"https://github.com/projectblacklight/blacklight-jetty/archive/v4.10.3.zip\"\n" \
20
+ "require 'jettywrapper'\n"
19
21
  end
20
22
 
21
23
  def assets
22
- copy_file "geoblacklight.css.scss", "app/assets/stylesheets/geoblacklight.css.scss"
23
- copy_file "geoblacklight.js", "app/assets/javascripts/geoblacklight.js"
24
+ copy_file 'geoblacklight.css.scss', 'app/assets/stylesheets/geoblacklight.css.scss'
25
+ copy_file 'geoblacklight.js', 'app/assets/javascripts/geoblacklight.js'
24
26
 
25
27
  append_to_file 'config/initializers/assets.rb',
26
- "\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
28
+ "\nRails.application.config.assets.precompile += %w( favicon.ico )\n"
27
29
  end
28
30
 
29
31
  def create_blacklight_catalog
30
- remove_file "app/controllers/catalog_controller.rb"
31
- copy_file "catalog_controller.rb", "app/controllers/catalog_controller.rb"
32
+ remove_file 'app/controllers/catalog_controller.rb'
33
+ copy_file 'catalog_controller.rb', 'app/controllers/catalog_controller.rb'
32
34
  end
33
35
 
34
36
  def rails_config
@@ -48,30 +50,29 @@ module Geoblacklight
48
50
  end
49
51
 
50
52
  def create_downloads_directory
51
- FileUtils.mkdir_p("tmp/cache/downloads") unless File.directory?("tmp/cache/downloads")
53
+ FileUtils.mkdir_p('tmp/cache/downloads') unless File.directory?('tmp/cache/downloads')
52
54
  end
53
55
 
54
56
  # Necessary for bootstrap-sass 3.2
55
57
  def inject_sprockets
56
- blacklight_css = Dir["app/assets/stylesheets/blacklight.css.scss"].first
58
+ blacklight_css = Dir['app/assets/stylesheets/blacklight.css.scss'].first
57
59
  if blacklight_css
58
60
  insert_into_file blacklight_css, before: "@import 'bootstrap';" do
59
61
  "@import 'bootstrap-sprockets';\n"
60
62
  end
61
63
  else
62
- say_status "warning", "Can not find blacklight.css.scss, did not insert our require", :red
64
+ say_status 'warning', 'Can not find blacklight.css.scss, did not insert our require', :red
63
65
  end
64
66
  end
65
67
 
66
68
  def disable_turbolinks
67
- gsub_file('app/assets/javascripts/application.js', /\/\/= require turbolinks/, '')
69
+ gsub_file('app/assets/javascripts/application.js', %r{\/\/= require turbolinks}, '')
68
70
  end
69
71
 
70
72
  def bundle_install
71
73
  Bundler.with_clean_env do
72
- run "bundle install"
74
+ run 'bundle install'
73
75
  end
74
76
  end
75
-
76
77
  end
77
78
  end
@@ -79,11 +79,7 @@ class CatalogController < ApplicationController
79
79
  config.add_facet_field 'dct_spatial_sm', :label => 'Place', :limit => 8
80
80
  config.add_facet_field 'dct_isPartOf_sm', :label => 'Collection', :limit => 8
81
81
 
82
- config.add_facet_field 'solr_year_i', :label => 'Year', :limit => 10, :range => {
83
- # :num_segments => 6,
84
- :assumed_boundaries => [1100, 2015]
85
- # :segments => true
86
- }
82
+ config.add_facet_field 'solr_year_i', :label => 'Year', :limit => 10
87
83
 
88
84
  config.add_facet_field 'dc_rights_s', label: 'Access', limit: 8, partial: "icon_facet"
89
85
  config.add_facet_field 'layer_geom_type_s', label: 'Data type', limit: 8, partial: "icon_facet"
@@ -1,4 +1,3 @@
1
1
  /*
2
2
  *= require geoblacklight/application
3
- *= require blacklight_range_limit
4
3
  */
@@ -3,6 +3,5 @@
3
3
  //= require geoblacklight/viewers
4
4
  //= require geoblacklight/modules
5
5
  //= require geoblacklight/downloaders
6
- //= require blacklight_range_limit
7
6
  //= require leaflet-iiif
8
7
  //= require readmore.min
data/lib/geoblacklight.rb CHANGED
@@ -1,19 +1,14 @@
1
- require "geoblacklight/engine"
1
+ require 'geoblacklight/engine'
2
2
 
3
3
  module Geoblacklight
4
4
  require 'geoblacklight/bounding_box'
5
5
  require 'geoblacklight/catalog_helper_override'
6
- require 'geoblacklight/config'
7
6
  require 'geoblacklight/constants'
8
7
  require 'geoblacklight/controller_override'
9
8
  require 'geoblacklight/exceptions'
10
9
  require 'geoblacklight/geoblacklight_helper_behavior'
11
- require 'geoblacklight/document_presenter'
12
10
  require 'geoblacklight/view_helper_override'
13
11
  require 'geoblacklight/item_viewer'
14
- require 'geoblacklight/solr_document/finder'
15
- require 'geoblacklight/solr_document/carto_db'
16
- require 'geoblacklight/solr_document'
17
12
  require 'geoblacklight/wms_layer'
18
13
  require 'geoblacklight/wms_layer/feature_info_response'
19
14
  require 'geoblacklight/download'
@@ -28,7 +28,8 @@ module Geoblacklight
28
28
  # @return [Geoblacklight::BoundingBox]
29
29
  def self.from_rectangle(rectangle)
30
30
  rectangle_array = rectangle.split(' ')
31
- fail Geoblacklight::Exceptions::WrongBoundingBoxFormat, 'Bounding box should be a string in Solr rectangle syntax e.g."W S E N"' if rectangle_array.count != 4
31
+ message = 'Bounding box should be a string in Solr rectangle syntax e.g."W S E N"'
32
+ fail Geoblacklight::Exceptions::WrongBoundingBoxFormat, message if rectangle_array.count != 4
32
33
  new(
33
34
  rectangle_array[0],
34
35
  rectangle_array[1],
@@ -1,6 +1,5 @@
1
1
  module Geoblacklight
2
2
  module CatalogHelperOverride
3
-
4
3
  ##
5
4
  # Removes spatial query from params
6
5
  # @param [Symbol] symbol of field to be removed
@@ -39,7 +39,7 @@ module Geoblacklight
39
39
  # @return [String] filename of the completed download
40
40
  def create_download_file
41
41
  download = initiate_download
42
- File.open("#{file_path_and_name}.tmp", 'wb') do |file|
42
+ File.open("#{file_path_and_name}.tmp", 'wb') do |file|
43
43
  if download.headers['content-type'] == @options[:content_type]
44
44
  file.write download.body
45
45
  else
@@ -49,7 +49,8 @@ module Geoblacklight
49
49
  File.rename("#{file_path_and_name}.tmp", "#{file_path_and_name}")
50
50
  file_name
51
51
  rescue Geoblacklight::Exceptions::WrongDownloadFormat => error
52
- Geoblacklight.logger.error "#{error} expected #{@options[:content_type]} received #{download.headers['content-type']}"
52
+ Geoblacklight.logger.error "#{error} expected #{@options[:content_type]} "\
53
+ "received #{download.headers['content-type']}"
53
54
  File.delete("#{file_path_and_name}.tmp")
54
55
  raise Geoblacklight::Exceptions::ExternalDownloadFailed, message: 'Wrong download type'
55
56
  end
@@ -57,7 +58,7 @@ module Geoblacklight
57
58
  ##
58
59
  # Initiates download from a remote source url using the `request_params`.
59
60
  # Will catch Faraday::Error::ConnectionFailed and
60
- # Faraday::Error::TimeoutError
61
+ # Faraday::Error::TimeoutError
61
62
  # @return [Faraday::Request] returns a Faraday::Request object
62
63
  def initiate_download
63
64
  conn = Faraday.new(url: url)
@@ -66,10 +67,14 @@ module Geoblacklight
66
67
  request.options.timeout = timeout
67
68
  request.options.open_timeout = timeout
68
69
  end
69
- rescue Faraday::Error::ConnectionFailed => error
70
- raise Geoblacklight::Exceptions::ExternalDownloadFailed, message: 'Download connection failed', url: conn.url_prefix.to_s
71
- rescue Faraday::Error::TimeoutError => error
72
- raise Geoblacklight::Exceptions::ExternalDownloadFailed, message: 'Download timed out', url: conn.url_prefix.to_s
70
+ rescue Faraday::Error::ConnectionFailed
71
+ raise Geoblacklight::Exceptions::ExternalDownloadFailed,
72
+ message: 'Download connection failed',
73
+ url: conn.url_prefix.to_s
74
+ rescue Faraday::Error::TimeoutError
75
+ raise Geoblacklight::Exceptions::ExternalDownloadFailed,
76
+ message: 'Download timed out',
77
+ url: conn.url_prefix.to_s
73
78
  end
74
79
 
75
80
  ##
@@ -1,10 +1,9 @@
1
1
  module Geoblacklight
2
2
  class HglDownload < Geoblacklight::Download
3
3
  def initialize(document, email, options = {})
4
-
5
4
  request_params = {
6
- "LayerName" => document[:layer_id_s].sub(/^cite:/, ''),
7
- "UserEmail" => email
5
+ 'LayerName' => document[:layer_id_s].sub(/^cite:/, ''),
6
+ 'UserEmail' => email
8
7
  }
9
8
  super(document, {
10
9
  request_params: request_params,
@@ -1,9 +1,15 @@
1
1
  module Geoblacklight
2
2
  class KmzDownload < Geoblacklight::Download
3
- KMZ_DOWNLOAD_PARAMS = { service: 'wms', version: '1.1.0', request: 'GetMap', srsName: 'EPSG:900913', format: 'application/vnd.google-earth.kmz', width: 2000, height: 2000 }
4
-
3
+ KMZ_DOWNLOAD_PARAMS = { service: 'wms',
4
+ version: '1.1.0',
5
+ request: 'GetMap',
6
+ srsName: 'EPSG:900913',
7
+ format: 'application/vnd.google-earth.kmz',
8
+ width: 2000, height: 2000 }
9
+
5
10
  def initialize(document, options = {})
6
- request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[:layer_id_s], bbox: document.bounding_box_as_wsen.split(' ').join(', '))
11
+ bbox_wsen = document.bounding_box_as_wsen.split(' ').join(', ')
12
+ request_params = KMZ_DOWNLOAD_PARAMS.merge(layers: document[:layer_id_s], bbox: bbox_wsen)
7
13
  super(document, {
8
14
  type: 'kmz',
9
15
  extension: 'kmz',
@@ -1,6 +1,10 @@
1
1
  module Geoblacklight
2
2
  class ShapefileDownload < Geoblacklight::Download
3
- SHAPEFILE_DOWNLOAD_PARAMS = { service: 'wfs', version: '2.0.0', request: 'GetFeature', srsName: 'EPSG:4326', outputformat: 'SHAPE-ZIP' }
3
+ SHAPEFILE_DOWNLOAD_PARAMS = { service: 'wfs',
4
+ version: '2.0.0',
5
+ request: 'GetFeature',
6
+ srsName: 'EPSG:4326',
7
+ outputformat: 'SHAPE-ZIP' }
4
8
 
5
9
  def initialize(document, options = {})
6
10
  request_params = SHAPEFILE_DOWNLOAD_PARAMS.merge(typeName: document[:layer_id_s])
@@ -3,19 +3,17 @@ require 'leaflet-rails'
3
3
  require 'font-awesome-rails'
4
4
  require 'rails_config'
5
5
  require 'faraday'
6
- require 'blacklight_range_limit'
7
6
  require 'nokogiri'
8
7
  require 'coderay'
9
8
  require 'geoblacklight-icons'
10
9
 
11
10
  module Geoblacklight
12
11
  class Engine < ::Rails::Engine
13
-
14
12
  Blacklight::Configuration.default_values[:view].split.partials = ['index']
15
13
  Blacklight::Configuration.default_values[:view].delete_field('list')
16
14
  # GeoblacklightHelper is needed by all helpers, so we inject it
17
15
  # into action view base here.
18
- initializer 'geoblacklight.helpers' do |app|
16
+ initializer 'geoblacklight.helpers' do
19
17
  ActionView::Base.send :include, GeoblacklightHelper
20
18
  end
21
19
 
@@ -7,7 +7,7 @@ module Geoblacklight
7
7
 
8
8
  ##
9
9
  # URL tried from failed download
10
- # @return [String]
10
+ # @return [String]
11
11
  def url
12
12
  @options[:url].to_s
13
13
  end
@@ -1,6 +1,5 @@
1
1
  module Geoblacklight
2
2
  class Metadata
3
-
4
3
  ##
5
4
  # Instantiates a Geoblacklight::Metadata object used for retrieving and
6
5
  # formatting metadata
@@ -75,9 +75,9 @@ module Geoblacklight
75
75
  # present
76
76
  # @return (see #downloads_by_format)
77
77
  def vector_download_formats
78
- if wfs && wms
79
- { shapefile: wfs.to_hash, kmz: wms.to_hash, geojson: wfs.to_hash } if wms.present? && wfs.present?
80
- end
78
+ { shapefile: wfs.to_hash,
79
+ kmz: wms.to_hash,
80
+ geojson: wfs.to_hash } if wms.present? && wfs.present?
81
81
  end
82
82
 
83
83
  ##
@@ -103,6 +103,5 @@ module Geoblacklight
103
103
  super
104
104
  end
105
105
  end
106
-
107
106
  end
108
107
  end
@@ -6,13 +6,15 @@ module Geoblacklight
6
6
  end
7
7
 
8
8
  def web_services_routes(primary_resource)
9
- add_routes do |options|
9
+ add_routes do
10
10
  post 'wms/handle'
11
11
  resources :download, only: [:show, :file]
12
12
  get 'download/file/:id' => 'download#file', as: :download_file
13
13
  get 'download/hgl/:id' => 'download#hgl', as: :download_hgl
14
- get "#{primary_resource}/:id/web_services" => "#{primary_resource}#web_services", as: "web_services_#{primary_resource}"
15
- get "#{primary_resource}/:id/metadata" => "#{primary_resource}#metadata", as: "metadata_#{primary_resource}"
14
+ get "#{primary_resource}/:id/web_services" => "#{primary_resource}#web_services",
15
+ as: "web_services_#{primary_resource}"
16
+ get "#{primary_resource}/:id/metadata" => "#{primary_resource}#metadata",
17
+ as: "metadata_#{primary_resource}"
16
18
  end
17
19
  end
18
20
  end