dry-elastic_model 0.1.0.pre → 0.1.0
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/.gitignore +2 -0
- data/.travis.yml +0 -1
- data/Gemfile.lock +14 -14
- data/README.md +29 -22
- data/dry-elastic_model.gemspec +1 -1
- data/lib/dry/elastic_model/schema.rb +4 -1
- data/lib/dry/elastic_model/type_options/base.rb +2 -2
- data/lib/dry/elastic_model/type_options/object.rb +0 -1
- data/lib/dry/elastic_model/type_options/scaled_float.rb +0 -2
- data/lib/dry/elastic_model/types.rb +1 -1
- data/lib/dry/elastic_model/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72ff75a8c73318a6ebe0089383466c49db95c57a677b23aa080a1458f059bcc4
|
|
4
|
+
data.tar.gz: c77ec6f292318434991effe639e5d5565bfd75448fc67a4b2f062d290c0b74bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3f6cdd6d2672451f9becb3773d505f23449b1fd46e57fbb20df608d1eebea2c9dfd92998c898dc085e015f32d7d2e0422d5d8bf9453ddac0a9e2159e19e0d0ff
|
|
7
|
+
data.tar.gz: 6fc0e72e61004fd4e1273f990c6c54dee68b74c61d656b0a3cbdc785893d35c7b05a5b5004fb6a1c5db1def59be7b631802ad95dda8fa6272cd6e7bd9b45d281
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
dry-elastic_model (0.1.0)
|
|
5
|
-
dry-struct (~> 0.
|
|
4
|
+
dry-elastic_model (0.1.0.pre)
|
|
5
|
+
dry-struct (~> 1.0.0)
|
|
6
6
|
|
|
7
7
|
GEM
|
|
8
8
|
remote: https://rubygems.org/
|
|
9
9
|
specs:
|
|
10
10
|
coderay (1.1.2)
|
|
11
|
-
concurrent-ruby (1.1.
|
|
11
|
+
concurrent-ruby (1.1.5)
|
|
12
12
|
diff-lcs (1.3)
|
|
13
13
|
docile (1.3.1)
|
|
14
14
|
dry-configurable (0.8.2)
|
|
@@ -19,24 +19,24 @@ GEM
|
|
|
19
19
|
dry-configurable (~> 0.1, >= 0.1.3)
|
|
20
20
|
dry-core (0.4.7)
|
|
21
21
|
concurrent-ruby (~> 1.0)
|
|
22
|
-
dry-equalizer (0.2.
|
|
22
|
+
dry-equalizer (0.2.2)
|
|
23
23
|
dry-inflector (0.1.2)
|
|
24
|
-
dry-logic (0.
|
|
25
|
-
|
|
24
|
+
dry-logic (1.0.0)
|
|
25
|
+
concurrent-ruby (~> 1.0)
|
|
26
26
|
dry-core (~> 0.2)
|
|
27
27
|
dry-equalizer (~> 0.2)
|
|
28
|
-
dry-struct (0.
|
|
28
|
+
dry-struct (1.0.0)
|
|
29
29
|
dry-core (~> 0.4, >= 0.4.3)
|
|
30
30
|
dry-equalizer (~> 0.2)
|
|
31
|
-
dry-types (~> 0
|
|
31
|
+
dry-types (~> 1.0)
|
|
32
32
|
ice_nine (~> 0.11)
|
|
33
|
-
dry-types (0.
|
|
33
|
+
dry-types (1.0.0)
|
|
34
34
|
concurrent-ruby (~> 1.0)
|
|
35
35
|
dry-container (~> 0.3)
|
|
36
36
|
dry-core (~> 0.4, >= 0.4.4)
|
|
37
|
-
dry-equalizer (~> 0.2)
|
|
37
|
+
dry-equalizer (~> 0.2, >= 0.2.2)
|
|
38
38
|
dry-inflector (~> 0.1, >= 0.1.2)
|
|
39
|
-
dry-logic (~>
|
|
39
|
+
dry-logic (~> 1.0)
|
|
40
40
|
ice_nine (0.11.2)
|
|
41
41
|
json (2.2.0)
|
|
42
42
|
method_source (0.9.2)
|
|
@@ -70,11 +70,11 @@ PLATFORMS
|
|
|
70
70
|
DEPENDENCIES
|
|
71
71
|
bundler (~> 2.0)
|
|
72
72
|
dry-elastic_model!
|
|
73
|
-
pry
|
|
73
|
+
pry (~> 0)
|
|
74
74
|
rake (~> 10.0)
|
|
75
75
|
rspec (~> 3.0)
|
|
76
|
-
simplecov
|
|
77
|
-
simplecov-lcov
|
|
76
|
+
simplecov (~> 0)
|
|
77
|
+
simplecov-lcov (~> 0)
|
|
78
78
|
|
|
79
79
|
BUNDLED WITH
|
|
80
80
|
2.0.1
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Dry::ElasticModel [](https://travis-ci.org/koleksiuk/dry-elastic_model) [](https://codeclimate.com/github/koleksiuk/dry-elastic_model/test_coverage) [](https://codeclimate.com/github/koleksiuk/dry-elastic_model/maintainability)
|
|
1
|
+
# Dry::ElasticModel [](https://rubygems.org/gems/dry-elastic_model) [](https://travis-ci.org/koleksiuk/dry-elastic_model) [](https://codeclimate.com/github/koleksiuk/dry-elastic_model/test_coverage) [](https://codeclimate.com/github/koleksiuk/dry-elastic_model/maintainability)
|
|
2
2
|
|
|
3
3
|
## Installation
|
|
4
4
|
|
|
@@ -29,7 +29,7 @@ Responsibilities of this library:
|
|
|
29
29
|
Sample model:
|
|
30
30
|
|
|
31
31
|
```ruby
|
|
32
|
-
class
|
|
32
|
+
class FooBar < Dry::ElasticModel::Base
|
|
33
33
|
field :text_field, :text
|
|
34
34
|
field :keyword_field, :keyword, index: false
|
|
35
35
|
field :date_field, :date
|
|
@@ -46,30 +46,37 @@ This corresponds to following Elasticsearch mapping (calling `Foo.mapping.to_jso
|
|
|
46
46
|
|
|
47
47
|
```json
|
|
48
48
|
{
|
|
49
|
-
"
|
|
50
|
-
"properties":{
|
|
51
|
-
"text_field":{
|
|
52
|
-
"type":"text",
|
|
53
|
-
"index":
|
|
49
|
+
"foobar": {
|
|
50
|
+
"properties": {
|
|
51
|
+
"text_field": {
|
|
52
|
+
"type": "text",
|
|
53
|
+
"index": "not_analyzed"
|
|
54
54
|
},
|
|
55
|
-
"keyword_field":{
|
|
56
|
-
"type":"keyword"
|
|
55
|
+
"keyword_field": {
|
|
56
|
+
"type": "keyword",
|
|
57
|
+
"index": false
|
|
57
58
|
},
|
|
58
|
-
"date_field":{
|
|
59
|
-
"type":"date",
|
|
60
|
-
"format":"strict_date_optional_time||epoch_millis"
|
|
59
|
+
"date_field": {
|
|
60
|
+
"type": "date",
|
|
61
|
+
"format": "strict_date_optional_time||epoch_millis"
|
|
61
62
|
},
|
|
62
|
-
"long_field":{
|
|
63
|
-
"type":"long"
|
|
63
|
+
"long_field": {
|
|
64
|
+
"type": "long"
|
|
64
65
|
},
|
|
65
|
-
"double_field":{
|
|
66
|
-
"type":"double"
|
|
66
|
+
"double_field": {
|
|
67
|
+
"type": "double"
|
|
67
68
|
},
|
|
68
|
-
"boolean_field":{
|
|
69
|
-
"type":"boolean"
|
|
69
|
+
"boolean_field": {
|
|
70
|
+
"type": "boolean"
|
|
70
71
|
},
|
|
71
|
-
"ip_field":{
|
|
72
|
-
"type":"ip"
|
|
72
|
+
"ip_field": {
|
|
73
|
+
"type": "ip"
|
|
74
|
+
},
|
|
75
|
+
"list_text_field": {
|
|
76
|
+
"type": "text"
|
|
77
|
+
},
|
|
78
|
+
"range_long_field": {
|
|
79
|
+
"type": "long_range"
|
|
73
80
|
}
|
|
74
81
|
}
|
|
75
82
|
}
|
|
@@ -85,7 +92,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
85
92
|
|
|
86
93
|
## Contributing
|
|
87
94
|
|
|
88
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
95
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/koleksiuk/dry-elastic_model. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
|
89
96
|
|
|
90
97
|
## License
|
|
91
98
|
|
|
@@ -93,4 +100,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
|
93
100
|
|
|
94
101
|
## Code of Conduct
|
|
95
102
|
|
|
96
|
-
Everyone interacting in the Dry::ElasticModel project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
103
|
+
Everyone interacting in the Dry::ElasticModel project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/koleksiuk/dry-elastic_model/blob/master/CODE_OF_CONDUCT.md).
|
data/dry-elastic_model.gemspec
CHANGED
|
@@ -34,7 +34,7 @@ Gem::Specification.new do |spec|
|
|
|
34
34
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
35
35
|
spec.require_paths = ["lib"]
|
|
36
36
|
|
|
37
|
-
spec.add_dependency "dry-struct", "~> 0.
|
|
37
|
+
spec.add_dependency "dry-struct", "~> 1.0.0"
|
|
38
38
|
spec.add_development_dependency "bundler", "~> 2.0"
|
|
39
39
|
spec.add_development_dependency "rake", "~> 10.0"
|
|
40
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
@@ -8,7 +8,10 @@ module Dry
|
|
|
8
8
|
def mapping
|
|
9
9
|
{
|
|
10
10
|
name.downcase.to_sym => {
|
|
11
|
-
properties: schema.inject({}) do |h,
|
|
11
|
+
properties: schema.inject({}) do |h, type|
|
|
12
|
+
attr = type.name
|
|
13
|
+
definition = type.lax
|
|
14
|
+
|
|
12
15
|
opts = definition.meta.fetch(:opts, {})
|
|
13
16
|
h.merge(
|
|
14
17
|
attr => { type: definition.meta.fetch(:es_name) }.merge(opts)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dry-elastic_model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Konrad Oleksiuk
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-11-18 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: dry-struct
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 0.
|
|
19
|
+
version: 1.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 0.
|
|
26
|
+
version: 1.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: bundler
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -163,9 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
163
163
|
version: '0'
|
|
164
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
165
|
requirements:
|
|
166
|
-
- - "
|
|
166
|
+
- - ">="
|
|
167
167
|
- !ruby/object:Gem::Version
|
|
168
|
-
version:
|
|
168
|
+
version: '0'
|
|
169
169
|
requirements: []
|
|
170
170
|
rubyforge_project:
|
|
171
171
|
rubygems_version: 2.7.3
|