geo_concerns 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 855515a951ec28e268a9cd763fb7672293f3124c
4
- data.tar.gz: 56188c811164b602d7192147c7080416b28ba211
3
+ metadata.gz: a0c4d8596311ffeda0e5bf74bea8326745f83e51
4
+ data.tar.gz: 165200c939e0446ae0e0d78ac8a12d7222689985
5
5
  SHA512:
6
- metadata.gz: e847ae51eb4d7b2f460f944f88d265df4bb1d2f1cc7c2d5191a8a8cbf6cad9164ddce90ebd1c0dc94feca07978144e21abc15d1c0861939af7fcaea2b2028c5b
7
- data.tar.gz: d7750c9f69ce7bbff2d3303611ac3ebd73ea164a57f5b17034700e29b1a57c0c81105154d892e3355f78371bc885ebb6419c58af3a5d9e5a47fcca15ac33e22d
6
+ metadata.gz: 2ab54206205eacda39834e6a28c9b362d6fa8c41dcb95ce116f238c5df17888dae05f1668447017a3f6319baeaa92fb0cb0f9f06f21ea1278739c57a582c9f70
7
+ data.tar.gz: 8a2e87ad653f38218d7df60178bbcd8d8a9cd20df3e4bf04cff8390777097121d2a92ca39bce06df1d1327818ac0755d791611f70a97897aaab48f42b556990f
@@ -77,6 +77,10 @@ module GeoConcerns
77
77
  path.gsub(CurationConcerns.config.derivatives_path, '')
78
78
  end
79
79
 
80
+ def shapefile_dir
81
+ "#{File.dirname(file_path)}/#{File.basename(file_path, '.zip')}"
82
+ end
83
+
80
84
  def persist_coveragestore
81
85
  url = "file:///#{@config[:derivatives_path]}#{base_path(file_path)}"
82
86
  coveragestore.url = url
@@ -95,8 +99,6 @@ module GeoConcerns
95
99
  end
96
100
 
97
101
  def publish_vector
98
- shapefile_dir = "#{File.dirname(file_path)}/shapefile"
99
-
100
102
  # Delete existing shapefile
101
103
  FileUtils.rm_rf(shapefile_dir)
102
104
 
@@ -25,7 +25,8 @@ module GeoConcerns
25
25
  spatial_builder,
26
26
  date_builder,
27
27
  references_builder,
28
- layer_info_builder
28
+ layer_info_builder,
29
+ slug_builder
29
30
  )
30
31
  end
31
32
 
@@ -63,6 +64,13 @@ module GeoConcerns
63
64
  def layer_info_builder
64
65
  LayerInfoBuilder.new(geo_concern)
65
66
  end
67
+
68
+ # Instantiates a SlugBuilder object.
69
+ # Builds the Geoblacklight slug field
70
+ # @return [SlugBuilder] layer info builder for document
71
+ def slug_builder
72
+ SlugBuilder.new(geo_concern)
73
+ end
66
74
  end
67
75
  end
68
76
  end
@@ -41,7 +41,6 @@ module GeoConcerns
41
41
  document.identifier = identifier
42
42
  document.description = description
43
43
  document.access_rights = geo_concern.solr_document.visibility
44
- document.slug = slug
45
44
  end
46
45
 
47
46
  # Returns the work indentifier. This is (usually) different from the hydra/fedora work id.
@@ -60,13 +59,6 @@ module GeoConcerns
60
59
  return geo_concern.description.first if geo_concern.description.first
61
60
  "A #{geo_concern.human_readable_type.downcase} object."
62
61
  end
63
-
64
- # Returns the document slug for use in discovery systems.
65
- # @return [String] document slug
66
- def slug
67
- return geo_concern.id unless geo_concern.provenance
68
- "#{geo_concern.provenance.parameterize}-#{geo_concern.id}"
69
- end
70
62
  end
71
63
  end
72
64
  end
@@ -0,0 +1,24 @@
1
+ module GeoConcerns
2
+ module Discovery
3
+ class DocumentBuilder
4
+ class SlugBuilder
5
+ attr_reader :geo_concern
6
+
7
+ def initialize(geo_concern)
8
+ @geo_concern = geo_concern
9
+ end
10
+
11
+ def build(document)
12
+ document.slug = slug
13
+ end
14
+
15
+ # Returns the document slug for use in discovery systems.
16
+ # @return [String] document slug
17
+ def slug
18
+ return geo_concern.id unless geo_concern.provenance
19
+ "#{geo_concern.provenance.parameterize}-#{geo_concern.id}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module GeoConcerns
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
@@ -1,5 +1,5 @@
1
1
  gem 'curation_concerns', '1.6.3'
2
- gem 'geo_concerns', '0.2.0'
2
+ gem 'geo_concerns', '0.3.0'
3
3
 
4
4
  run 'bundle install'
5
5
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geo_concerns
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Griffin
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-12-02 00:00:00.000000000 Z
15
+ date: 2016-12-07 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: curation_concerns
@@ -457,6 +457,7 @@ files:
457
457
  - app/services/geo_concerns/discovery/document_builder/document_path.rb
458
458
  - app/services/geo_concerns/discovery/document_builder/layer_info_builder.rb
459
459
  - app/services/geo_concerns/discovery/document_builder/references_builder.rb
460
+ - app/services/geo_concerns/discovery/document_builder/slug_builder.rb
460
461
  - app/services/geo_concerns/discovery/document_builder/spatial_builder.rb
461
462
  - app/services/geo_concerns/discovery/document_builder/wxs.rb
462
463
  - app/services/geo_concerns/discovery/geoblacklight_document.rb
@@ -681,7 +682,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
681
682
  version: '0'
682
683
  requirements: []
683
684
  rubyforge_project:
684
- rubygems_version: 2.4.5
685
+ rubygems_version: 2.6.6
685
686
  signing_key:
686
687
  specification_version: 4
687
688
  summary: Rails engine for Hydra Geo models. Built around Curation Concerns engine.