handshake_service 0.1.11 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/handshake_service/railtie.rb +0 -1
- data/lib/handshake_service/version.rb +1 -1
- metadata +2 -3
- data/lib/tasks/elasticsearch.rake +0 -86
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 918ab85d77aad62143c188351e121cbbbbacebb3
|
4
|
+
data.tar.gz: 6c82ff0296a9c555620a73bad3c0a350875a9701
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f631c1e08997830414f422689052c38137c79b38be494ff17882ce709fab3e418f61f5230f3b66755c95217d197b6b57b16e14b19919adcff4f719890b1ef45f
|
7
|
+
data.tar.gz: e7111f1f12879369c4afe4f90467a8d1371ab7d3d452f81c67ceb9da0de2a64627d96aaae79318b0cba152b33a5fa954b07f2f51fa23ec016470d10266ad5c47
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: handshake_service
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Ringwelski
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,7 +74,6 @@ files:
|
|
74
74
|
- lib/handshake_service/version.rb
|
75
75
|
- lib/tasks/auto_annotate_models.rake
|
76
76
|
- lib/tasks/deploy.rake
|
77
|
-
- lib/tasks/elasticsearch.rake
|
78
77
|
- lib/tasks/heroku.rake
|
79
78
|
- lib/tasks/invalids.rake
|
80
79
|
- lib/tasks/rspec_generator.rake
|
@@ -1,86 +0,0 @@
|
|
1
|
-
# Run with: rake environment elasticsearch:reindex
|
2
|
-
# Begins by creating the index using tire:import:model command. This will create the "official" index name, e.g. "things" each time.
|
3
|
-
# Then we rename it to, e.g. "things_20121001052916" and alias "things" to it.
|
4
|
-
# Assumes usage of the elasticsearch-ruby libraries
|
5
|
-
# TODO: Assumes you have a library called ElasticsearchAdminHelper defined with the right methods. Move that helper into this gem
|
6
|
-
|
7
|
-
if defined?(Rails)
|
8
|
-
namespace :elasticsearch do
|
9
|
-
desc 'Reindexes all ActiveRecord model indices'
|
10
|
-
task "reindex:all" => :environment do
|
11
|
-
Rails.application.eager_load!
|
12
|
-
include ElasticsearchAdminHelper
|
13
|
-
|
14
|
-
ActiveRecord::Base.descendants.each do |model_class|
|
15
|
-
next unless model_class.respond_to? :__elasticsearch__
|
16
|
-
reindex_model(model_class)
|
17
|
-
end
|
18
|
-
|
19
|
-
puts 'All indices reindexed'
|
20
|
-
end
|
21
|
-
|
22
|
-
desc 'Deletes indices and then reindexes all ActiveRecord model indices assuming none exist yet'
|
23
|
-
task "reindex:all:fresh" => :environment do
|
24
|
-
return unless Rails.env.development? or Rails.env.test?
|
25
|
-
|
26
|
-
Rails.application.eager_load!
|
27
|
-
include ElasticsearchAdminHelper
|
28
|
-
|
29
|
-
# If we don't create the temporary indices, then mass emails (for example) will try
|
30
|
-
# to query users for recipient count and fail
|
31
|
-
ActiveRecord::Base.descendants.each do |model_class|
|
32
|
-
next unless model_class.respond_to? :__elasticsearch__
|
33
|
-
delete_index(model_class.index_name)
|
34
|
-
create_temporary_index(model_class)
|
35
|
-
end
|
36
|
-
|
37
|
-
ActiveRecord::Base.descendants.each do |model_class|
|
38
|
-
next unless model_class.respond_to? :__elasticsearch__
|
39
|
-
reindex_model(model_class, true)
|
40
|
-
end
|
41
|
-
|
42
|
-
puts 'All indices created, aliased and ready'
|
43
|
-
end
|
44
|
-
|
45
|
-
desc 'Deletes indices and then reindexes all ActiveRecord model indices assuming none exist yet. Is used for testing where aliases are not used'
|
46
|
-
task "tests:prepare" => :environment do
|
47
|
-
return unless Rails.env.development? or Rails.env.test?
|
48
|
-
|
49
|
-
Rails.application.eager_load!
|
50
|
-
include ElasticsearchAdminHelper
|
51
|
-
|
52
|
-
# If we don't create the temporary indices, then mass emails (for example) will try
|
53
|
-
# to query users for recipient count and fail
|
54
|
-
ActiveRecord::Base.descendants.each do |model_class|
|
55
|
-
next unless model_class.respond_to? :__elasticsearch__
|
56
|
-
delete_index(model_class.index_name)
|
57
|
-
create_temporary_index(model_class)
|
58
|
-
end
|
59
|
-
|
60
|
-
puts 'All indices created, aliased and ready'
|
61
|
-
end
|
62
|
-
|
63
|
-
Dir.foreach("#{Rails.root}/app/models") do |item|
|
64
|
-
next if item == '.' or item == '..' or not item
|
65
|
-
name = item.split(".")[0].pluralize
|
66
|
-
|
67
|
-
desc "Reindexes #{name} using aliases"
|
68
|
-
task "reindex:#{name}" => :environment do
|
69
|
-
Rails.application.eager_load!
|
70
|
-
include ElasticsearchAdminHelper
|
71
|
-
|
72
|
-
klass = Kernel.const_get(name.classify)
|
73
|
-
reindex_model(klass)
|
74
|
-
end
|
75
|
-
|
76
|
-
desc "Reindexes #{name} using aliases, and deletes the old one first" # because Tire tries to create an index for us sometimes
|
77
|
-
task "reindex:#{name}:delete_old_first" => :environment do
|
78
|
-
Rails.application.eager_load!
|
79
|
-
include ElasticsearchAdminHelper
|
80
|
-
|
81
|
-
klass = Kernel.const_get(name.classify)
|
82
|
-
reindex_model(klass, true)
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|