searchcraft 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/searchcraft/annotate.rb +3 -1
- data/lib/searchcraft/configuration.rb +6 -1
- data/lib/searchcraft/version.rb +1 -1
- data/lib/searchcraft.rb +2 -2
- data/sig/searchcraft/configuration.rbs +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 913320513d07b3447532e62d060b3ebc118dce10531d2f1d62587bdccc5c8c33
|
|
4
|
+
data.tar.gz: f8b7d111101ece94baeffd41d5d4f42350f47a9b7db0d96e589ee2297e4ae196
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: baab9337ba89647bd3cf7819570d0de0ae32a066c07d33587ac33c157f8bd3014c20516c6a3d5a2bc77ed37fb9e53fa73eabacef8fbf784b240cc5046da036a0
|
|
7
|
+
data.tar.gz: 4daaa7dcd5d3312740a83eb8f08efb6f86bc20179a0081e092207f7788673e9bb6ecc0b88ca47beeb33278406f96d4775653b24ccd4255282e9fd8eba16ba3b1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## Not Yet Released
|
|
2
|
+
|
|
3
|
+
## [0.4.2] - 2023-11-06
|
|
4
|
+
|
|
5
|
+
- `SEARCHCRAFT_DEBUG=true` is the same as `SearchCraft.debug = true` and shows internal debugging of errors and activities
|
|
6
|
+
- `SearchCraft.config.disable_annotate = true` to disable automatic annotation of models (which is enabled by default if `annotate_model` gem discovered)
|
|
7
|
+
|
|
8
|
+
Fixes:
|
|
9
|
+
|
|
10
|
+
- `SearchCraft.dependencies_ready?` (used on launch) is fixed for normal/default case where `explicit_builder_class_names` not provided
|
|
11
|
+
|
|
1
12
|
## [0.4.1] - 2023-11-01
|
|
2
13
|
|
|
3
14
|
- [`SearchCraft::TextSearch`](lib/searchcraft/text_search.rb) module added to `Builder` which provides `tsvector` helpers. See [`test_text_search.rb`](test/searchcraft/builder/test_text_search.rb) for examples.
|
data/lib/searchcraft/annotate.rb
CHANGED
|
@@ -2,6 +2,7 @@ module SearchCraft::Annotate
|
|
|
2
2
|
# If using annotate gem, then automatically annotate models after rebuilding views
|
|
3
3
|
# TODO: I'm suspicious this is not working for dependent Builders, e.g. demo_app's OnsaleSearchBuilder
|
|
4
4
|
def annotate_models!
|
|
5
|
+
return if SearchCraft.config.disable_annotate
|
|
5
6
|
return unless Rails.env.development?
|
|
6
7
|
return unless Object.const_defined?(:Annotate)
|
|
7
8
|
|
|
@@ -16,7 +17,8 @@ module SearchCraft::Annotate
|
|
|
16
17
|
exclude_helpers: true,
|
|
17
18
|
hide_limit_column_types: "",
|
|
18
19
|
hide_default_column_types: "",
|
|
19
|
-
ignore_unknown_models: true
|
|
20
|
+
ignore_unknown_models: true,
|
|
21
|
+
show_indexes: true
|
|
20
22
|
}
|
|
21
23
|
capture_stdout do
|
|
22
24
|
AnnotateModels.do_annotations(options)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module SearchCraft
|
|
2
2
|
class Configuration
|
|
3
3
|
attr_accessor :disable_autorebuild
|
|
4
|
-
attr_accessor :
|
|
4
|
+
attr_accessor :disable_annotate
|
|
5
|
+
attr_writer :debug
|
|
5
6
|
attr_reader :explicit_builder_classes
|
|
6
7
|
attr_accessor :explicit_builder_class_names
|
|
7
8
|
attr_accessor :explicit_model_class_names
|
|
@@ -11,6 +12,10 @@ module SearchCraft
|
|
|
11
12
|
!disable_autorebuild
|
|
12
13
|
end
|
|
13
14
|
|
|
15
|
+
def debug
|
|
16
|
+
@debug || ENV["SEARCHCRAFT_DEBUG"] == "true"
|
|
17
|
+
end
|
|
18
|
+
|
|
14
19
|
# If you need to explicitly list the builder + model classes you want to use,
|
|
15
20
|
# then set this to a hash of builder class names => model class names.
|
|
16
21
|
# {
|
data/lib/searchcraft/version.rb
CHANGED
data/lib/searchcraft.rb
CHANGED
|
@@ -20,8 +20,8 @@ module SearchCraft
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def dependencies_ready?
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
Builder.builders_to_rebuild.all? do |builder_class|
|
|
24
|
+
builder_class.new.dependencies_ready?
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
|
|
@@ -12,6 +12,10 @@ module SearchCraft
|
|
|
12
12
|
|
|
13
13
|
def disable_autorebuild=: (bool) -> void
|
|
14
14
|
|
|
15
|
+
def disable_annotate: () -> bool
|
|
16
|
+
|
|
17
|
+
def disable_annotate=: (bool) -> void
|
|
18
|
+
|
|
15
19
|
def explicit_builder_classes: () -> Hash[String, String]
|
|
16
20
|
|
|
17
21
|
def explicit_builder_classes=: (Hash[String, String]) -> void
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: searchcraft
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dr Nic Williams
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|