geo_concerns 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +9 -2
  3. data/README.md +13 -0
  4. data/app/controllers/concerns/geo_concerns/file_sets_controller_behavior.rb +15 -0
  5. data/app/controllers/concerns/geo_concerns/geoblacklight_controller_behavior.rb +29 -0
  6. data/app/models/concerns/geo_concerns/ability.rb +12 -0
  7. data/app/models/concerns/geo_concerns/file_set/derivatives.rb +6 -6
  8. data/app/models/concerns/geo_concerns/geo_file_format_behavior.rb +4 -4
  9. data/app/presenters/geo_concerns/raster_work_show_presenter.rb +1 -1
  10. data/app/processors/geo_concerns/processors/mapnik.rb +30 -0
  11. data/app/processors/geo_concerns/processors/vector/base.rb +2 -1
  12. data/app/processors/geo_concerns/processors/vector/info.rb +66 -0
  13. data/app/services/geo_concerns/authority_service.rb +29 -0
  14. data/app/services/geo_concerns/discovery.rb +4 -0
  15. data/app/services/geo_concerns/discovery/abstract_document.rb +36 -0
  16. data/app/services/geo_concerns/discovery/document_builder.rb +69 -0
  17. data/app/services/geo_concerns/discovery/document_builder/basic_metadata_builder.rb +69 -0
  18. data/app/services/geo_concerns/discovery/document_builder/composite_builder.rb +21 -0
  19. data/app/services/geo_concerns/discovery/document_builder/date_builder.rb +38 -0
  20. data/app/services/geo_concerns/discovery/document_builder/document_helper.rb +10 -0
  21. data/app/services/geo_concerns/discovery/document_builder/document_path.rb +82 -0
  22. data/app/services/geo_concerns/discovery/document_builder/layer_info_builder.rb +65 -0
  23. data/app/services/geo_concerns/discovery/document_builder/references_builder.rb +82 -0
  24. data/app/services/geo_concerns/discovery/document_builder/spatial_builder.rb +40 -0
  25. data/app/services/geo_concerns/discovery/geoblacklight_document.rb +122 -0
  26. data/app/services/geo_concerns/image_format_service.rb +6 -0
  27. data/app/services/geo_concerns/metadata_format_service.rb +6 -0
  28. data/app/services/geo_concerns/raster_format_service.rb +6 -0
  29. data/app/services/geo_concerns/vector_format_service.rb +6 -0
  30. data/app/views/curation_concerns/image_works/show.html.erb +1 -1
  31. data/app/views/curation_concerns/raster_works/show.html.erb +1 -1
  32. data/app/views/curation_concerns/vector_works/show.html.erb +1 -1
  33. data/app/views/geo_concerns/_representative_media.html.erb +5 -0
  34. data/app/views/{curation_concerns → geo_concerns}/file_sets/_form.html.erb +4 -4
  35. data/app/views/geo_concerns/file_sets/media_display/_geo.html.erb +16 -0
  36. data/app/views/geo_concerns/file_sets/new.html.erb +12 -0
  37. data/config/routes.rb +18 -0
  38. data/geo_concerns.gemspec +2 -0
  39. data/lib/generators/geo_concerns/install_generator.rb +34 -0
  40. data/lib/generators/geo_concerns/templates/config/authorities/image_formats.yml +2 -0
  41. data/lib/generators/geo_concerns/templates/config/authorities/raster_formats.yml +4 -0
  42. data/lib/generators/geo_concerns/templates/config/authorities/vector_formats.yml +2 -0
  43. data/lib/generators/geo_concerns/templates/config/discovery/geoblacklight_schema.json +168 -0
  44. data/lib/generators/geo_concerns/templates/config/mapnik.yml +24 -0
  45. data/lib/generators/geo_concerns/templates/controllers/curation_concerns/image_works_controller.rb +1 -0
  46. data/lib/generators/geo_concerns/templates/controllers/curation_concerns/raster_works_controller.rb +1 -0
  47. data/lib/generators/geo_concerns/templates/controllers/curation_concerns/vector_works_controller.rb +1 -0
  48. data/lib/geo_concerns/version.rb +1 -1
  49. data/spec/controllers/file_sets_controller_spec.rb +20 -0
  50. data/spec/controllers/vector_works_controller_spec.rb +33 -0
  51. data/spec/processors/geo_concerns/processors/mapnik_spec.rb +48 -0
  52. data/spec/processors/geo_concerns/processors/vector/base_spec.rb +1 -1
  53. data/spec/processors/geo_concerns/processors/vector/info_spec.rb +41 -0
  54. data/spec/services/geo_concerns/discovery/abstract_document_spec.rb +23 -0
  55. data/spec/services/geo_concerns/discovery/document_builder_spec.rb +186 -0
  56. data/spec/services/geo_concerns/discovery/geoblacklight_document_spec.rb +17 -0
  57. data/spec/services/raster_format_service_spec.rb +1 -1
  58. data/template.rb +2 -2
  59. metadata +70 -9
  60. data/app/services/authority_service.rb +0 -23
  61. data/app/services/image_format_service.rb +0 -4
  62. data/app/services/metadata_format_service.rb +0 -4
  63. data/app/services/raster_format_service.rb +0 -4
  64. data/app/services/vector_format_service.rb +0 -4
@@ -1,23 +0,0 @@
1
- module AuthorityService
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- mattr_accessor :authority
6
- end
7
-
8
- class_methods do
9
- def select_options
10
- authority.all.map do |element|
11
- [element[:label], element[:id]]
12
- end
13
- end
14
-
15
- def label(id)
16
- (authority.find(id) || {}).fetch('term', nil)
17
- end
18
-
19
- def include?(id)
20
- !authority.find(id).nil? && !authority.find(id).empty?
21
- end
22
- end
23
- end
@@ -1,4 +0,0 @@
1
- class ImageFormatService
2
- include AuthorityService
3
- self.authority = Qa::Authorities::Local.subauthority_for('image_formats')
4
- end
@@ -1,4 +0,0 @@
1
- class MetadataFormatService
2
- include AuthorityService
3
- self.authority = Qa::Authorities::Local.subauthority_for('metadata_formats')
4
- end
@@ -1,4 +0,0 @@
1
- class RasterFormatService
2
- include AuthorityService
3
- self.authority = Qa::Authorities::Local.subauthority_for('raster_formats')
4
- end
@@ -1,4 +0,0 @@
1
- class VectorFormatService
2
- include AuthorityService
3
- self.authority = Qa::Authorities::Local.subauthority_for('vector_formats')
4
- end