uri_service 0.2.11 → 0.2.12

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: 02fd7773d46ae95b6d76cc8dbbe0a677bb9c66a4
4
- data.tar.gz: b3590aec9568abde0a96b07f91661bf03dec539b
3
+ metadata.gz: c6dfdd9146dcc210aeddc11463baa748805e8f80
4
+ data.tar.gz: 495d0322eae8b105d97af658c41f6be059b895e3
5
5
  SHA512:
6
- metadata.gz: 9ca5464a6fda73f465444192ea4b81b69d4faa74db0db4ba1c449b758b740abbea39cd4d9ea81192e6dc1fe68615ebd1f6dea92224ae0bcf92469839cdb8c961
7
- data.tar.gz: 5ef70e08b7e5b4337463b2d4a3ae73be77fa269792d097ed099d02553f9bd100244af1bbabf065785e701fcb886ba03f3677251d97ff709c35aaf957e64ae414
6
+ metadata.gz: 16ce2155b663b3f042bf6530e573ece4b96e6552d1f11e6d4b74347e359ed850ce4aec9264245bdd14ee1cbc858d5552d762ab57ab62f04071e42281449834bc
7
+ data.tar.gz: 36acf7e9108320b1d44da61cd5758b842cd3627bfe78a02ce2e8015df99576ea878254f44428dd0d4344fb6599cf94dc77cae8a1b0802e691277eb7cfa1d0a7f
data/README.md CHANGED
@@ -193,6 +193,14 @@ UriService.client.reindex_all_terms(false, false) # Reindex
193
193
  UriService.client.reindex_all_terms(true, false) # Clear solr index and reindex
194
194
  ```
195
195
 
196
+ ### Problems when sharing an sqlite database with Rails:
197
+ If you're using an sqlite database for your Rails application's standard ActiveRecord connection (which is probably not the case in production environments), you should avoid using the same sqlite database file for UriService due to database locking issues -- otherwise you're likely to encounter this error:
198
+
199
+ ```
200
+ SQLite3::ReadOnlyException: attempt to write a readonly database
201
+ ```
202
+ In most cases, you'll probably find it easier to keep the UriService tables in a separate database anyway.
203
+
196
204
  ### Running Integration Tests (for developers):
197
205
 
198
206
  Integration tests are great and we should run them. Here's how:
@@ -14,6 +14,14 @@ namespace :uri_service do
14
14
  UriService.client.create_required_tables
15
15
  puts 'Done.'
16
16
  end
17
+
18
+ desc "Drop tables and clear solr (Dangerous! Use wisely!)"
19
+ task :drop_tables_and_clear_solr => :environment do
20
+ UriService.client.db.drop_table?(UriService::VOCABULARIES) # Drop table if it exists
21
+ UriService.client.db.drop_table?(UriService::TERMS) # Drop table if it exists
22
+ UriService.client.clear_solr_index
23
+ end
24
+
17
25
  end
18
26
 
19
27
  end
@@ -109,6 +109,7 @@ class UriService::Client
109
109
  String :string_key, size: 255, index: true, unique: true
110
110
  String :display_label, size: 255
111
111
  end
112
+ puts 'Created table: ' + UriService::VOCABULARIES.to_s
112
113
  else
113
114
  puts 'Skipped creation of table ' + UriService::VOCABULARIES.to_s + ' because it already exists.'
114
115
  end
@@ -124,6 +125,7 @@ class UriService::Client
124
125
  TrueClass :is_local, default: false
125
126
  String :additional_fields, text: true
126
127
  end
128
+ puts 'Created table: ' + UriService::TERMS.to_s
127
129
  else
128
130
  puts 'Skipped creation of table ' + UriService::TERMS.to_s + ' because it already exists.'
129
131
  end
@@ -504,6 +506,13 @@ class UriService::Client
504
506
  end
505
507
  end
506
508
 
509
+ def clear_solr_index
510
+ @rsolr_pool.with do |rsolr|
511
+ rsolr.delete_by_query('*:*');
512
+ rsolr.commit
513
+ end
514
+ end
515
+
507
516
  end
508
517
 
509
518
  class UriService::InvalidAdditionalFieldKeyError < StandardError;end
@@ -1,6 +1,6 @@
1
1
  module UriService
2
2
 
3
- VERSION = '0.2.11'
3
+ VERSION = '0.2.12'
4
4
 
5
5
  def self.version
6
6
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uri_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric O'Hanlon
@@ -206,3 +206,4 @@ specification_version: 4
206
206
  summary: A service for registering local URIs and performing both local and remote
207
207
  URI lookups.
208
208
  test_files: []
209
+ has_rdoc: