krikri 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/krikri/activity.rb +34 -8
- data/lib/generators/krikri/templates/schema.xml +1 -0
- data/lib/generators/krikri/templates/solrconfig.xml +1 -0
- data/lib/krikri/async_uri_getter.rb +27 -0
- data/lib/krikri/engine.rb +19 -4
- data/lib/krikri/enricher.rb +3 -6
- data/lib/krikri/entity_behavior.rb +57 -11
- data/lib/krikri/entity_behaviors/aggregation_entity_behavior.rb +1 -1
- data/lib/krikri/entity_behaviors/original_record_entity_behavior.rb +1 -1
- data/lib/krikri/entity_consumer.rb +40 -17
- data/lib/krikri/indexer.rb +7 -7
- data/lib/krikri/mapper.rb +23 -14
- data/lib/krikri/search_index.rb +4 -0
- data/lib/krikri/software_agent.rb +8 -4
- data/lib/krikri/version.rb +1 -1
- data/spec/internal/Gemfile +3 -3
- data/spec/internal/Gemfile.lock +28 -28
- data/spec/internal/app/assets/javascripts/application.js +1 -1
- data/spec/internal/config/initializers/blacklight_initializer.rb +1 -1
- data/spec/internal/config/initializers/devise.rb +2 -2
- data/spec/internal/config/secrets.yml +2 -2
- data/spec/internal/db/development.sqlite3 +0 -0
- data/spec/internal/db/migrate/{20160304151204_devise_create_users.rb → 20160226160200_devise_create_users.rb} +0 -0
- data/spec/internal/db/migrate/{20160304151247_create_searches.blacklight.rb → 20160226160226_create_searches.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20160304151248_create_bookmarks.blacklight.rb → 20160226160227_create_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/migrate/{20160304151249_add_polymorphic_type_to_bookmarks.blacklight.rb → 20160226160228_add_polymorphic_type_to_bookmarks.blacklight.rb} +0 -0
- data/spec/internal/db/schema.rb +1 -1
- data/spec/internal/db/test.sqlite3 +0 -0
- data/spec/internal/log/development.log +92 -92
- data/spec/lib/krikri/async_uri_getter_spec.rb +31 -7
- data/spec/lib/krikri/entity_consumer_spec.rb +37 -7
- data/spec/lib/krikri/harvester_spec.rb +7 -3
- data/spec/lib/krikri/indexer_spec.rb +7 -4
- data/spec/lib/krikri/mapper_agent_spec.rb +10 -9
- data/spec/lib/krikri/search_index_spec.rb +3 -6
- data/spec/models/activity_spec.rb +32 -0
- data/spec/models/dpla/map/aggregation_spec.rb +40 -21
- data/spec/models/provider_spec.rb +2 -9
- data/spec/spec_helper.rb +1 -2
- data/spec/support/shared_contexts/indexed_item.rb +1 -3
- data/spec/support/shared_examples/software_agent.rb +1 -1
- metadata +11 -14
- data/lib/generators/krikri/templates/schema.xml +0 -767
- data/lib/generators/krikri/templates/solrconfig.xml +0 -160
- data/spec/internal/log/test.log +0 -8537
data/spec/internal/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
|
-
remote: /
|
2
|
+
remote: /Users/mark/Documents/Code/dpla/KriKri
|
3
3
|
specs:
|
4
|
-
krikri (0.
|
4
|
+
krikri (0.11.2)
|
5
5
|
analysand (= 4.0.0)
|
6
6
|
audumbla (~> 0.1)
|
7
7
|
blacklight (~> 5.8.0)
|
@@ -26,17 +26,17 @@ PATH
|
|
26
26
|
GEM
|
27
27
|
remote: https://rubygems.org/
|
28
28
|
specs:
|
29
|
-
actionmailer (4.1.
|
30
|
-
actionpack (= 4.1.
|
31
|
-
actionview (= 4.1.
|
29
|
+
actionmailer (4.1.14.1)
|
30
|
+
actionpack (= 4.1.14.1)
|
31
|
+
actionview (= 4.1.14.1)
|
32
32
|
mail (~> 2.5, >= 2.5.4)
|
33
|
-
actionpack (4.1.
|
34
|
-
actionview (= 4.1.
|
35
|
-
activesupport (= 4.1.
|
33
|
+
actionpack (4.1.14.1)
|
34
|
+
actionview (= 4.1.14.1)
|
35
|
+
activesupport (= 4.1.14.1)
|
36
36
|
rack (~> 1.5.2)
|
37
37
|
rack-test (~> 0.6.2)
|
38
|
-
actionview (4.1.
|
39
|
-
activesupport (= 4.1.
|
38
|
+
actionview (4.1.14.1)
|
39
|
+
activesupport (= 4.1.14.1)
|
40
40
|
builder (~> 3.1)
|
41
41
|
erubis (~> 2.7.0)
|
42
42
|
active-triples (0.6.1)
|
@@ -45,14 +45,14 @@ GEM
|
|
45
45
|
deprecation (~> 0.1)
|
46
46
|
linkeddata (~> 1.1)
|
47
47
|
rdf (~> 1.1)
|
48
|
-
activemodel (4.1.
|
49
|
-
activesupport (= 4.1.
|
48
|
+
activemodel (4.1.14.1)
|
49
|
+
activesupport (= 4.1.14.1)
|
50
50
|
builder (~> 3.1)
|
51
|
-
activerecord (4.1.
|
52
|
-
activemodel (= 4.1.
|
53
|
-
activesupport (= 4.1.
|
51
|
+
activerecord (4.1.14.1)
|
52
|
+
activemodel (= 4.1.14.1)
|
53
|
+
activesupport (= 4.1.14.1)
|
54
54
|
arel (~> 5.0.0)
|
55
|
-
activesupport (4.1.
|
55
|
+
activesupport (4.1.14.1)
|
56
56
|
i18n (~> 0.6, >= 0.6.9)
|
57
57
|
json (~> 1.7, >= 1.7.7)
|
58
58
|
minitest (~> 5.1)
|
@@ -224,21 +224,21 @@ GEM
|
|
224
224
|
rack
|
225
225
|
rack-test (0.6.3)
|
226
226
|
rack (>= 1.0)
|
227
|
-
rails (4.1.
|
228
|
-
actionmailer (= 4.1.
|
229
|
-
actionpack (= 4.1.
|
230
|
-
actionview (= 4.1.
|
231
|
-
activemodel (= 4.1.
|
232
|
-
activerecord (= 4.1.
|
233
|
-
activesupport (= 4.1.
|
227
|
+
rails (4.1.14.1)
|
228
|
+
actionmailer (= 4.1.14.1)
|
229
|
+
actionpack (= 4.1.14.1)
|
230
|
+
actionview (= 4.1.14.1)
|
231
|
+
activemodel (= 4.1.14.1)
|
232
|
+
activerecord (= 4.1.14.1)
|
233
|
+
activesupport (= 4.1.14.1)
|
234
234
|
bundler (>= 1.3.0, < 2.0)
|
235
|
-
railties (= 4.1.
|
235
|
+
railties (= 4.1.14.1)
|
236
236
|
sprockets-rails (~> 2.0)
|
237
237
|
rails_config (0.4.2)
|
238
238
|
activesupport (>= 3.0)
|
239
|
-
railties (4.1.
|
240
|
-
actionpack (= 4.1.
|
241
|
-
activesupport (= 4.1.
|
239
|
+
railties (4.1.14.1)
|
240
|
+
actionpack (= 4.1.14.1)
|
241
|
+
activesupport (= 4.1.14.1)
|
242
242
|
rake (>= 0.8.7)
|
243
243
|
thor (>= 0.18.1, < 2.0)
|
244
244
|
rake (10.5.0)
|
@@ -392,7 +392,7 @@ DEPENDENCIES
|
|
392
392
|
jquery-rails
|
393
393
|
krikri!
|
394
394
|
pry-rails
|
395
|
-
rails (= 4.1.
|
395
|
+
rails (= 4.1.14.1)
|
396
396
|
sass-rails (~> 4.0.3)
|
397
397
|
sdoc (~> 0.4.0)
|
398
398
|
sqlite3
|
@@ -7,7 +7,7 @@
|
|
7
7
|
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
8
|
// compiled file.
|
9
9
|
//
|
10
|
-
// Read Sprockets README (https://github.com/
|
10
|
+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
11
|
// about supported directives.
|
12
12
|
//
|
13
13
|
//= require jquery
|
@@ -3,5 +3,5 @@
|
|
3
3
|
# will use the application's secret key base instead.
|
4
4
|
#
|
5
5
|
|
6
|
-
# Blacklight.secret_key = '
|
6
|
+
# Blacklight.secret_key = 'cc12cf6ecad283a96940ff1048f905f37fb193f90fb3f27864a00f9e11910c093279af59aa296c0ef2c18c0e325e59fd83ea20a66aa1db762c41211886820274'
|
7
7
|
|
@@ -4,7 +4,7 @@ Devise.setup do |config|
|
|
4
4
|
# The secret key used by Devise. Devise uses this key to generate
|
5
5
|
# random tokens. Changing this key will render invalid all existing
|
6
6
|
# confirmation, reset password and unlock tokens in the database.
|
7
|
-
# config.secret_key = '
|
7
|
+
# config.secret_key = '40ecf58b68fd1289ba1d8230901a4d066a5265f8f569e58a58adbdb05d26e95220beac0d20e9ff1c340093fc924b69dfb332a85427f37f748c0a520364be05b7'
|
8
8
|
|
9
9
|
# ==> Mailer Configuration
|
10
10
|
# Configure the e-mail address which will be shown in Devise::Mailer,
|
@@ -97,7 +97,7 @@ Devise.setup do |config|
|
|
97
97
|
config.stretches = Rails.env.test? ? 1 : 10
|
98
98
|
|
99
99
|
# Setup a pepper to generate the encrypted password.
|
100
|
-
# config.pepper = '
|
100
|
+
# config.pepper = '61f641377fee96c6de414fcb8ee81afbae5243d1c8fbc386b910eada4d445c79f429fee2415774134bed70cded219e56b96eb776ea8f16556ae589be15604e85'
|
101
101
|
|
102
102
|
# ==> Configuration for :confirmable
|
103
103
|
# A period that the user is allowed to access the website even without
|
@@ -11,10 +11,10 @@
|
|
11
11
|
# if you're sharing your code publicly.
|
12
12
|
|
13
13
|
development:
|
14
|
-
secret_key_base:
|
14
|
+
secret_key_base: 863fff84d2a9894a7ebbe17f0f0d7dc2a74dc3ebe204d6b6b9732538cc1148476637020525b1c80a520c18e4f679cb3169b634ba797bd7e12a8ff47d2a266ab0
|
15
15
|
|
16
16
|
test:
|
17
|
-
secret_key_base:
|
17
|
+
secret_key_base: 847e6a513b270df86d4aaed1a90d50cdd4309f019a7458e16f12cd03a15bca129056ee0da6616e8aed7dbb59fb99d228a5768d96abad6eb79146761815931e79
|
18
18
|
|
19
19
|
# Do not keep production secrets in the repository,
|
20
20
|
# instead read values from the environment.
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/internal/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
14
|
+
ActiveRecord::Schema.define(version: 20160226160228) do
|
15
15
|
|
16
16
|
create_table "bookmarks", force: true do |t|
|
17
17
|
t.integer "user_id", null: false
|
Binary file
|
@@ -1,57 +1,57 @@
|
|
1
|
-
[1m[36m (
|
1
|
+
[1m[36m (1.1ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
2
2
|
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
3
|
-
[1m[36m (
|
4
|
-
[1m[35mActiveRecord::SchemaMigration Load (
|
3
|
+
[1m[36m (1.0ms)[0m [1mCREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")[0m
|
4
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.1ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
5
5
|
Migrating to CreateKrikriInstitutions (20141113200614)
|
6
6
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
7
|
-
[1m[35m (
|
8
|
-
[1m[36mSQL (
|
9
|
-
[1m[35m (
|
7
|
+
[1m[35m (0.4ms)[0m CREATE TABLE "krikri_institutions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "created_at" datetime, "updated_at" datetime)
|
8
|
+
[1m[36mSQL (0.2ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141113200614"]]
|
9
|
+
[1m[35m (0.6ms)[0m commit transaction
|
10
10
|
Migrating to CreateKrikriHarvestSources (20141113200643)
|
11
|
-
[1m[36m (0.
|
12
|
-
[1m[35m (
|
13
|
-
[1m[36mSQL (0.
|
14
|
-
[1m[35m (
|
11
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
12
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "krikri_harvest_sources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "institution_id" integer, "name" varchar(255), "source_type" varchar(255), "metadata_schema" varchar(255), "uri" varchar(255), "notes" text, "created_at" datetime, "updated_at" datetime)
|
13
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141113200643"]]
|
14
|
+
[1m[35m (0.6ms)[0m commit transaction
|
15
15
|
Migrating to CreateKrikriActivities (20141212220924)
|
16
16
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
17
|
-
[1m[35m (
|
18
|
-
[1m[36mSQL (0.
|
19
|
-
[1m[35m (
|
17
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "krikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" varchar(255), "created_at" datetime, "updated_at" datetime)
|
18
|
+
[1m[36mSQL (0.4ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20141212220924"]]
|
19
|
+
[1m[35m (0.7ms)[0m commit transaction
|
20
20
|
Migrating to AddOptsToKrikriHarvestSources (20150106164218)
|
21
21
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
22
|
-
[1m[35m (
|
23
|
-
[1m[36mSQL (0.
|
24
|
-
[1m[35m (
|
22
|
+
[1m[35m (0.3ms)[0m ALTER TABLE "krikri_harvest_sources" ADD "opts" text
|
23
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150106164218"]]
|
24
|
+
[1m[35m (0.6ms)[0m commit transaction
|
25
25
|
Migrating to ChangeOptsInKrikriActivities (20150309160112)
|
26
26
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
27
|
-
[1m[35m (
|
28
|
-
[1m[36m (
|
29
|
-
[1m[35m (
|
30
|
-
[1m[36m (0.
|
31
|
-
[1m[35m (0.
|
27
|
+
[1m[35m (2.1ms)[0m CREATE TEMPORARY TABLE "akrikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" varchar(255), "created_at" datetime, "updated_at" datetime)
|
28
|
+
[1m[36m (0.0ms)[0m [1mSELECT * FROM "krikri_activities"[0m
|
29
|
+
[1m[35m (0.6ms)[0m DROP TABLE "krikri_activities"
|
30
|
+
[1m[36m (0.1ms)[0m [1mCREATE TABLE "krikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" text(255), "created_at" datetime, "updated_at" datetime) [0m
|
31
|
+
[1m[35m (0.0ms)[0m SELECT * FROM "akrikri_activities"
|
32
32
|
[1m[36m (0.2ms)[0m [1mDROP TABLE "akrikri_activities"[0m
|
33
|
-
[1m[35mSQL (0.
|
34
|
-
[1m[36m (
|
33
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20150309160112"]]
|
34
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
35
35
|
Migrating to RemoveOptsLimitInKrikriActivities (20150310190054)
|
36
|
-
[1m[35m (0.
|
37
|
-
[1m[36m (0.
|
38
|
-
[1m[35m (
|
39
|
-
[1m[36m (
|
36
|
+
[1m[35m (0.1ms)[0m begin transaction
|
37
|
+
[1m[36m (0.3ms)[0m [1mCREATE TEMPORARY TABLE "akrikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" text(255), "created_at" datetime, "updated_at" datetime) [0m
|
38
|
+
[1m[35m (0.1ms)[0m SELECT * FROM "krikri_activities"
|
39
|
+
[1m[36m (0.2ms)[0m [1mDROP TABLE "krikri_activities"[0m
|
40
40
|
[1m[35m (0.1ms)[0m CREATE TABLE "krikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" text, "created_at" datetime, "updated_at" datetime)
|
41
41
|
[1m[36m (0.1ms)[0m [1mSELECT * FROM "akrikri_activities"[0m
|
42
42
|
[1m[35m (0.1ms)[0m DROP TABLE "akrikri_activities"
|
43
|
-
[1m[36mSQL (0.
|
44
|
-
[1m[35m (
|
43
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150310190054"]]
|
44
|
+
[1m[35m (0.7ms)[0m commit transaction
|
45
45
|
Migrating to AddQaReport (20150328035550)
|
46
46
|
[1m[36m (0.1ms)[0m [1mbegin transaction[0m
|
47
|
-
[1m[35m (
|
48
|
-
[1m[36mSQL (0.
|
49
|
-
[1m[35m (
|
50
|
-
Migrating to DeviseCreateUsers (
|
51
|
-
[1m[36m (0.
|
52
|
-
[1m[35m (
|
53
|
-
[1m[36m (0.
|
54
|
-
[1m[35m (0.
|
47
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "krikri_qa_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "provider" varchar(255), "field_report" text, "count_report" text, "created_at" datetime, "updated_at" datetime)
|
48
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20150328035550"]]
|
49
|
+
[1m[35m (0.5ms)[0m commit transaction
|
50
|
+
Migrating to DeviseCreateUsers (20160226160200)
|
51
|
+
[1m[36m (0.0ms)[0m [1mbegin transaction[0m
|
52
|
+
[1m[35m (0.3ms)[0m CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime, "updated_at" datetime)
|
53
|
+
[1m[36m (0.3ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")[0m
|
54
|
+
[1m[35m (0.0ms)[0m SELECT sql
|
55
55
|
FROM sqlite_master
|
56
56
|
WHERE name='index_users_on_email' AND type='index'
|
57
57
|
UNION ALL
|
@@ -60,10 +60,10 @@ Migrating to DeviseCreateUsers (20160304151204)
|
|
60
60
|
WHERE name='index_users_on_email' AND type='index'
|
61
61
|
|
62
62
|
[1m[36m (0.1ms)[0m [1mCREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")[0m
|
63
|
-
[1m[35mSQL (
|
64
|
-
[1m[36m (
|
65
|
-
[1m[35mActiveRecord::SchemaMigration Load (
|
66
|
-
[1m[36m (
|
63
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160226160200"]]
|
64
|
+
[1m[36m (0.8ms)[0m [1mcommit transaction[0m
|
65
|
+
[1m[35mActiveRecord::SchemaMigration Load (0.2ms)[0m SELECT "schema_migrations".* FROM "schema_migrations"
|
66
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
67
67
|
FROM sqlite_master
|
68
68
|
WHERE name='index_users_on_reset_password_token' AND type='index'
|
69
69
|
UNION ALL
|
@@ -71,7 +71,7 @@ Migrating to DeviseCreateUsers (20160304151204)
|
|
71
71
|
FROM sqlite_temp_master
|
72
72
|
WHERE name='index_users_on_reset_password_token' AND type='index'
|
73
73
|
[0m
|
74
|
-
[1m[35m (
|
74
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
75
75
|
FROM sqlite_master
|
76
76
|
WHERE name='index_users_on_email' AND type='index'
|
77
77
|
UNION ALL
|
@@ -79,27 +79,27 @@ Migrating to DeviseCreateUsers (20160304151204)
|
|
79
79
|
FROM sqlite_temp_master
|
80
80
|
WHERE name='index_users_on_email' AND type='index'
|
81
81
|
|
82
|
-
[1m[36mActiveRecord::SchemaMigration Load (
|
83
|
-
Migrating to CreateSearches (
|
82
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.4ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
83
|
+
Migrating to CreateSearches (20160226160226)
|
84
84
|
[1m[35m (0.1ms)[0m begin transaction
|
85
|
-
[1m[36m (
|
86
|
-
[1m[35m (0.
|
87
|
-
[1m[36m (
|
88
|
-
[1m[35mSQL (0.
|
89
|
-
[1m[36m (
|
90
|
-
Migrating to CreateBookmarks (
|
91
|
-
[1m[35m (0.
|
92
|
-
[1m[36m (
|
93
|
-
[1m[35mSQL (
|
94
|
-
[1m[36m (
|
95
|
-
Migrating to AddPolymorphicTypeToBookmarks (
|
96
|
-
[1m[35m (0.
|
97
|
-
[1m[36m (
|
98
|
-
[1m[35m (0.
|
99
|
-
[1m[36mSQL (0.
|
100
|
-
[1m[35m (
|
101
|
-
[1m[36mActiveRecord::SchemaMigration Load (
|
102
|
-
[1m[35m (
|
85
|
+
[1m[36m (1.0ms)[0m [1mCREATE TABLE "searches" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "query_params" text, "user_id" integer, "user_type" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
86
|
+
[1m[35m (0.1ms)[0m select sqlite_version(*)
|
87
|
+
[1m[36m (0.1ms)[0m [1mCREATE INDEX "index_searches_on_user_id" ON "searches" ("user_id")[0m
|
88
|
+
[1m[35mSQL (0.2ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160226160226"]]
|
89
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
90
|
+
Migrating to CreateBookmarks (20160226160227)
|
91
|
+
[1m[35m (0.0ms)[0m begin transaction
|
92
|
+
[1m[36m (0.3ms)[0m [1mCREATE TABLE "bookmarks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255), "document_id" varchar(255), "title" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
93
|
+
[1m[35mSQL (0.1ms)[0m INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20160226160227"]]
|
94
|
+
[1m[36m (0.6ms)[0m [1mcommit transaction[0m
|
95
|
+
Migrating to AddPolymorphicTypeToBookmarks (20160226160228)
|
96
|
+
[1m[35m (0.0ms)[0m begin transaction
|
97
|
+
[1m[36m (0.3ms)[0m [1mALTER TABLE "bookmarks" ADD "document_type" varchar(255)[0m
|
98
|
+
[1m[35m (0.1ms)[0m CREATE INDEX "index_bookmarks_on_user_id" ON "bookmarks" ("user_id")
|
99
|
+
[1m[36mSQL (0.1ms)[0m [1mINSERT INTO "schema_migrations" ("version") VALUES (?)[0m [["version", "20160226160228"]]
|
100
|
+
[1m[35m (0.7ms)[0m commit transaction
|
101
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
102
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
103
103
|
FROM sqlite_master
|
104
104
|
WHERE name='index_bookmarks_on_user_id' AND type='index'
|
105
105
|
UNION ALL
|
@@ -107,7 +107,7 @@ Migrating to AddPolymorphicTypeToBookmarks (20160304151249)
|
|
107
107
|
FROM sqlite_temp_master
|
108
108
|
WHERE name='index_bookmarks_on_user_id' AND type='index'
|
109
109
|
|
110
|
-
[1m[36m (
|
110
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
111
111
|
FROM sqlite_master
|
112
112
|
WHERE name='index_searches_on_user_id' AND type='index'
|
113
113
|
UNION ALL
|
@@ -115,7 +115,7 @@ Migrating to AddPolymorphicTypeToBookmarks (20160304151249)
|
|
115
115
|
FROM sqlite_temp_master
|
116
116
|
WHERE name='index_searches_on_user_id' AND type='index'
|
117
117
|
[0m
|
118
|
-
[1m[35m (0.
|
118
|
+
[1m[35m (0.1ms)[0m SELECT sql
|
119
119
|
FROM sqlite_master
|
120
120
|
WHERE name='index_users_on_reset_password_token' AND type='index'
|
121
121
|
UNION ALL
|
@@ -123,7 +123,7 @@ Migrating to AddPolymorphicTypeToBookmarks (20160304151249)
|
|
123
123
|
FROM sqlite_temp_master
|
124
124
|
WHERE name='index_users_on_reset_password_token' AND type='index'
|
125
125
|
|
126
|
-
[1m[36m (
|
126
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
127
127
|
FROM sqlite_master
|
128
128
|
WHERE name='index_users_on_email' AND type='index'
|
129
129
|
UNION ALL
|
@@ -131,18 +131,18 @@ Migrating to AddPolymorphicTypeToBookmarks (20160304151249)
|
|
131
131
|
FROM sqlite_temp_master
|
132
132
|
WHERE name='index_users_on_email' AND type='index'
|
133
133
|
[0m
|
134
|
-
[1m[35m (
|
135
|
-
[1m[36m (0.
|
136
|
-
[1m[35m (
|
137
|
-
[1m[36m (
|
138
|
-
[1m[35m (
|
139
|
-
[1m[36m (
|
140
|
-
[1m[35m (
|
141
|
-
[1m[36m (
|
142
|
-
[1m[35m (
|
143
|
-
[1m[36m (
|
144
|
-
[1m[35m (
|
145
|
-
[1m[36m (0.
|
134
|
+
[1m[35m (0.8ms)[0m CREATE TABLE "bookmarks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255), "document_id" varchar(255), "title" varchar(255), "created_at" datetime, "updated_at" datetime, "document_type" varchar(255))
|
135
|
+
[1m[36m (0.0ms)[0m [1mselect sqlite_version(*)[0m
|
136
|
+
[1m[35m (0.7ms)[0m CREATE INDEX "index_bookmarks_on_user_id" ON "bookmarks" ("user_id")
|
137
|
+
[1m[36m (0.7ms)[0m [1mCREATE TABLE "krikri_activities" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "start_time" datetime, "end_time" datetime, "agent" varchar(255), "opts" text, "created_at" datetime, "updated_at" datetime) [0m
|
138
|
+
[1m[35m (0.7ms)[0m CREATE TABLE "krikri_harvest_sources" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "institution_id" integer, "name" varchar(255), "source_type" varchar(255), "metadata_schema" varchar(255), "uri" varchar(255), "notes" text, "created_at" datetime, "updated_at" datetime, "opts" text)
|
139
|
+
[1m[36m (0.8ms)[0m [1mCREATE TABLE "krikri_institutions" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "notes" text, "created_at" datetime, "updated_at" datetime) [0m
|
140
|
+
[1m[35m (2.0ms)[0m CREATE TABLE "krikri_qa_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "provider" varchar(255), "field_report" text, "count_report" text, "created_at" datetime, "updated_at" datetime)
|
141
|
+
[1m[36m (1.6ms)[0m [1mCREATE TABLE "searches" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "query_params" text, "user_id" integer, "user_type" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
142
|
+
[1m[35m (1.5ms)[0m CREATE INDEX "index_searches_on_user_id" ON "searches" ("user_id")
|
143
|
+
[1m[36m (0.9ms)[0m [1mCREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "email" varchar(255) DEFAULT '' NOT NULL, "encrypted_password" varchar(255) DEFAULT '' NOT NULL, "reset_password_token" varchar(255), "reset_password_sent_at" datetime, "remember_created_at" datetime, "sign_in_count" integer DEFAULT 0 NOT NULL, "current_sign_in_at" datetime, "last_sign_in_at" datetime, "current_sign_in_ip" varchar(255), "last_sign_in_ip" varchar(255), "created_at" datetime, "updated_at" datetime) [0m
|
144
|
+
[1m[35m (0.6ms)[0m CREATE UNIQUE INDEX "index_users_on_email" ON "users" ("email")
|
145
|
+
[1m[36m (0.1ms)[0m [1m SELECT sql
|
146
146
|
FROM sqlite_master
|
147
147
|
WHERE name='index_users_on_email' AND type='index'
|
148
148
|
UNION ALL
|
@@ -150,18 +150,18 @@ Migrating to AddPolymorphicTypeToBookmarks (20160304151249)
|
|
150
150
|
FROM sqlite_temp_master
|
151
151
|
WHERE name='index_users_on_email' AND type='index'
|
152
152
|
[0m
|
153
|
-
[1m[35m (
|
154
|
-
[1m[36m (
|
155
|
-
[1m[35m (
|
156
|
-
[1m[36m (
|
157
|
-
[1m[35m (
|
158
|
-
[1m[36m (
|
159
|
-
[1m[35m (
|
160
|
-
[1m[36m (
|
161
|
-
[1m[35m (
|
162
|
-
[1m[36m (
|
163
|
-
[1m[35m (
|
164
|
-
[1m[36m (
|
165
|
-
[1m[35m (
|
166
|
-
[1m[36m (
|
167
|
-
[1m[35m (
|
153
|
+
[1m[35m (0.7ms)[0m CREATE UNIQUE INDEX "index_users_on_reset_password_token" ON "users" ("reset_password_token")
|
154
|
+
[1m[36m (0.7ms)[0m [1mCREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) [0m
|
155
|
+
[1m[35m (0.8ms)[0m CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
|
156
|
+
[1m[36m (0.1ms)[0m [1mSELECT version FROM "schema_migrations"[0m
|
157
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160226160228')
|
158
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160226160200')[0m
|
159
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20160226160226')
|
160
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20160226160227')[0m
|
161
|
+
[1m[35m (0.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141113200614')
|
162
|
+
[1m[36m (0.6ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20141113200643')[0m
|
163
|
+
[1m[35m (0.6ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20141212220924')
|
164
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150106164218')[0m
|
165
|
+
[1m[35m (0.8ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150309160112')
|
166
|
+
[1m[36m (0.7ms)[0m [1mINSERT INTO "schema_migrations" (version) VALUES ('20150310190054')[0m
|
167
|
+
[1m[35m (0.7ms)[0m INSERT INTO "schema_migrations" (version) VALUES ('20150328035550')
|
@@ -92,15 +92,39 @@ describe Krikri::AsyncUriGetter do
|
|
92
92
|
.to_raise(Faraday::ConnectionFailed)
|
93
93
|
end
|
94
94
|
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
context 'without inline exceptions' do
|
96
|
+
it 'propagates exceptions to the calling thread when #join is called' do
|
97
|
+
r = subject.add_request(uri: test_uri)
|
98
|
+
expect { r.join }.to raise_error(Faraday::ConnectionFailed)
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'propagates exceptions when the response is requested' do
|
102
|
+
r = subject.add_request(uri: test_uri)
|
103
|
+
expect { r.with_response { |_| } }
|
104
|
+
.to raise_error(Faraday::ConnectionFailed)
|
105
|
+
end
|
98
106
|
end
|
99
107
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
108
|
+
context 'with inline exceptions' do
|
109
|
+
subject { described_class.new(opts: { inline_exceptions: true }) }
|
110
|
+
|
111
|
+
it 'does not throw an exception when #join is called' do
|
112
|
+
r = subject.add_request(uri: test_uri)
|
113
|
+
expect { r.join }.to_not raise_error
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'passes the exception as a 5xx HTTP response' do
|
117
|
+
r = subject.add_request(uri: test_uri)
|
118
|
+
r.with_response do |response|
|
119
|
+
expect(response.status).to eq(500)
|
120
|
+
expect(response.body).to include('Exception')
|
121
|
+
|
122
|
+
headers = response.headers
|
123
|
+
expect(headers.keys).to include('X-Internal-Response')
|
124
|
+
expect(headers.keys).to include('X-Exception-Message')
|
125
|
+
expect(headers['X-Exception']).to be_kind_of(Exception)
|
126
|
+
end
|
127
|
+
end
|
104
128
|
end
|
105
129
|
end
|
106
130
|
end
|
@@ -1,18 +1,50 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Krikri::EntityConsumer do
|
4
|
-
|
5
4
|
before(:all) do
|
6
5
|
DatabaseCleaner.clean_with(:truncation)
|
7
6
|
create(:krikri_harvest_activity)
|
8
7
|
create(:krikri_mapping_activity)
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
subject { DummyAgent.new }
|
11
|
+
let(:generator_uri) { Krikri::Activity.base_uri / 2 }
|
12
|
+
|
13
|
+
before { class DummyAgent; include Krikri::EntityConsumer; end }
|
14
|
+
after { Object.send(:remove_const, :DummyAgent) }
|
15
|
+
|
16
|
+
describe 'deprecated interface' do
|
17
|
+
it 'sets the activity' do
|
18
|
+
expect { subject.assign_generator_activity!(generator_uri: generator_uri) }
|
19
|
+
.to change { subject.generator_activity }
|
20
|
+
.to Krikri::Activity.from_uri(generator_uri)
|
21
|
+
end
|
22
|
+
|
23
|
+
it 'activity defaults to nil' do
|
24
|
+
expect(subject.generator_activity).to be_nil
|
25
|
+
end
|
26
|
+
|
27
|
+
it 'integrates with new interface' do
|
28
|
+
expect { subject.assign_generator_activity!(generator_uri: generator_uri) }
|
29
|
+
.to change { subject.entity_source }
|
30
|
+
.to Krikri::Activity.from_uri(generator_uri)
|
15
31
|
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#entities' do
|
35
|
+
it 'is empty when no source is available' do
|
36
|
+
expect(subject.entities).to be_empty
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#entity_source' do
|
41
|
+
it 'is nil by default' do
|
42
|
+
expect(subject.entities).to be_empty
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'as a mapper agent' do
|
47
|
+
let(:opts) { { name: :agent_map, generator_uri: generator_uri } }
|
16
48
|
let(:mapper_agent) { Krikri::Mapper::Agent.new(opts) }
|
17
49
|
|
18
50
|
describe '#assign_generator_activity!' do
|
@@ -21,7 +53,5 @@ describe Krikri::EntityConsumer do
|
|
21
53
|
.to respond_to(:entities)
|
22
54
|
end
|
23
55
|
end
|
24
|
-
|
25
56
|
end
|
26
|
-
|
27
57
|
end
|
@@ -4,8 +4,11 @@ describe Krikri::Harvester do
|
|
4
4
|
|
5
5
|
# Our subject is an instance of a dummy class that mixes in
|
6
6
|
# Krikri::Harvester.
|
7
|
-
|
8
|
-
|
7
|
+
before { class DummyHarvester; include(Krikri::Harvester); end }
|
8
|
+
after { Object.send(:remove_const, :DummyHarvester) }
|
9
|
+
|
10
|
+
let(:klass) { DummyHarvester }
|
11
|
+
subject { klass.new(:uri => 'urn:fake_uri') }
|
9
12
|
|
10
13
|
context 'with record_ids implemented' do
|
11
14
|
before do
|
@@ -33,7 +36,8 @@ describe Krikri::Harvester do
|
|
33
36
|
|
34
37
|
describe '.entity_behavior' do
|
35
38
|
it 'knows its entity behavior' do
|
36
|
-
expect(
|
39
|
+
expect(subject.class.entity_behavior)
|
40
|
+
.to eq(Krikri::OriginalRecordEntityBehavior)
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
@@ -8,15 +8,18 @@ describe Krikri::Indexer do
|
|
8
8
|
|
9
9
|
subject { described_class.new(opts) }
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
enrichment_gen_uri = Krikri::Activity.base_uri / 5
|
12
|
+
|
13
|
+
behaves_opts = { generator_uri: enrichment_gen_uri,
|
13
14
|
index_class: 'Krikri::QASearchIndex' }
|
14
15
|
|
15
|
-
it_behaves_like 'a software agent', behaves_opts
|
16
|
+
it_behaves_like 'a software agent', behaves_opts do
|
17
|
+
after { clear_search_index }
|
18
|
+
end
|
16
19
|
|
17
20
|
# See mapper_agent_spec.rb regarding :opts and behaves_opts...
|
18
21
|
let(:opts) do
|
19
|
-
{ generator_uri:
|
22
|
+
{ generator_uri: enrichment_gen_uri,
|
20
23
|
index_class: index_class.to_s }
|
21
24
|
end
|
22
25
|
|