discovery-indexer 0.9.8 → 0.9.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjlmOTZlZjM3MWNhYjA1MTU2OTMyZjEyZGVmMDZjNjkzYTc2NjJlYg==
5
- data.tar.gz: !binary |-
6
- YzhlYzJmNzJjMDZkNjA3ZjIzMzFkMDUzZTk4MDZhOTBjMzNiNTMzOQ==
2
+ SHA1:
3
+ metadata.gz: 93f05df8dfe2ec4cc27b0aeac78404c0e6057649
4
+ data.tar.gz: 7b885d7eba120bf651346629a5cc36ff49d8f97f
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MmZjNTI3ZDVkOGU2NGQzYWZjM2Y4YjA4ZjMxYTc1YjVlMTA2MmJkZjA4ODgz
10
- NGQ2NTFkODg2NGRkNjA4NDdlMjBjMDc1NGU4NzhhOTYzMGM2MmRjMGVlNTUx
11
- OWU3NWY3ODg3MmQzMGEyMDkzOTAzODc2MjQyODE1ODhlMjIzNGE=
12
- data.tar.gz: !binary |-
13
- NmQ0Yzc5MGI4MzE3NzZiNzMzODBhYmI0ZTYxODQxMjNkMTIyMDQyNGE4ZjMx
14
- ZjJhM2VjOWI5NjkyNzJlOGQ1ZmIwMjJiNmVkNmVkNDRiMmMxYTYyNDY2Y2U3
15
- NGFlYzRkZDA5ZmJjZDc1MjRkZDVlOTExOGQ1ZGYzZmQxNWQ2N2I=
6
+ metadata.gz: 10d1f654b04103b0bd3db50f036d88976845cea7c96cb361469e250d32715aec08aab33e5fef4cf43df8e044c0f90b3b121eccd92f09bf2f5b8822821e5526db
7
+ data.tar.gz: 9e6d5d0ce1811532e4754cdbc2aa7191e76e68a1a1a0e066e0d322dd95a7fefd82eadc454ac7db1f11c896bfa754630101a227c7eb5ed19eacda8856718d27c7
@@ -154,9 +154,11 @@ module DiscoveryIndexer
154
154
  return nil if content_md.nil?
155
155
  types_to_search=%w{image page}
156
156
  types_to_search.each do |resource_type|
157
- content_md.xpath("//resource[@type=\"#{resource_type}\"]/file/@id").each do |node|
158
- ids << node.text unless node.text.empty?
159
- end
157
+ content_md.xpath("//resource[@type=\"#{resource_type}\"]/file").each do |node|
158
+ if node['mimetype'] == 'image/jp2'
159
+ ids << node['id'] unless node['id'].empty?
160
+ end
161
+ end
160
162
  end
161
163
  return nil if ids.empty?
162
164
  ids
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module DiscoveryIndexer
2
- VERSION = '0.9.8'
2
+ VERSION = '0.9.9'
3
3
  end
@@ -5,30 +5,25 @@ module DiscoveryIndexer
5
5
  module Writer
6
6
  # Performs writes to solr client based upon true and false release flags
7
7
  class SolrWriter
8
+ attr_reader :solr_targets_configs
9
+
8
10
  include DiscoveryIndexer::Logging
9
11
 
10
- def process(id, index_doc, targets, solr_targets_configs)
11
- @solr_targets_configs = solr_targets_configs
12
- index_targets = []
13
- delete_targets = []
14
- targets.keys.each do |target|
15
- if targets[target]
16
- index_targets.append(target)
17
- else
18
- delete_targets.append(target)
19
- end
20
- end
12
+ def process(id, index_doc, targets, targets_configs)
13
+ @solr_targets_configs = targets_configs
14
+ index_targets = targets.select { |_, b| b }.keys
15
+ delete_targets = targets.reject { |_, b| b }.keys
21
16
 
22
17
  # get targets with true
23
- solr_index_client(id, index_doc, index_targets)
18
+ solr_index_client(id, index_doc, index_targets) if index_targets.present?
24
19
  # get targets with false
25
- solr_delete_client(id, delete_targets)
20
+ solr_delete_client(id, delete_targets) if delete_targets.present?
26
21
  end
27
22
 
28
- def solr_delete_from_all(id, solr_targets_configs)
23
+ def solr_delete_from_all(id, targets_configs)
29
24
  # Get a list of all registered targets
30
- @solr_targets_configs = solr_targets_configs
31
- targets = @solr_targets_configs.keys
25
+ @solr_targets_configs = targets_configs
26
+ targets = solr_targets_configs.keys
32
27
  solr_delete_client(id, targets)
33
28
  end
34
29
 
@@ -48,8 +43,8 @@ module DiscoveryIndexer
48
43
 
49
44
  def get_connector_for_target(solr_target)
50
45
  solr_connector = nil
51
- if @solr_targets_configs.keys.include?(solr_target)
52
- config = @solr_targets_configs[solr_target]
46
+ if solr_targets_configs.keys.include?(solr_target)
47
+ config = solr_targets_configs[solr_target]
53
48
  solr_connector = RSolr.connect(config.deep_symbolize_keys)
54
49
  end
55
50
  solr_connector
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: discovery-indexer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ahmed AlSum
@@ -9,132 +9,132 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-23 00:00:00.000000000 Z
12
+ date: 2015-10-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ! '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ! '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: stanford-mods
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ! '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ! '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: retries
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: '0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rsolr
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - ! '>='
60
+ - - ">="
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - ! '>='
67
+ - - ">="
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rest-client
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - ! '>='
74
+ - - ">="
75
75
  - !ruby/object:Gem::Version
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - ! '>='
81
+ - - ">="
82
82
  - !ruby/object:Gem::Version
83
83
  version: '0'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: rspec
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - ! '>='
88
+ - - ">="
89
89
  - !ruby/object:Gem::Version
90
90
  version: '0'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - ! '>='
95
+ - - ">="
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: webmock
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
- - - ! '>='
102
+ - - ">="
103
103
  - !ruby/object:Gem::Version
104
104
  version: '0'
105
105
  type: :development
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
- - - ! '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: '0'
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: equivalent-xml
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ! '>='
116
+ - - ">="
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0'
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - ! '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: vcr
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - ! '>='
130
+ - - ">="
131
131
  - !ruby/object:Gem::Version
132
132
  version: '0'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ! '>='
137
+ - - ">="
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  description: This library manages the core operations for the discovery indexing such
@@ -168,17 +168,17 @@ require_paths:
168
168
  - lib
169
169
  required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ! '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
- - - ! '>='
176
+ - - ">="
177
177
  - !ruby/object:Gem::Version
178
178
  version: '0'
179
179
  requirements: []
180
180
  rubyforge_project:
181
- rubygems_version: 2.4.2
181
+ rubygems_version: 2.4.5
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: Shared library for the basic discovery indexing operation for Stanford DLSS.