dry-elastic_model 0.1.0.pre → 0.1.0

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
  SHA256:
3
- metadata.gz: bbf4b536a1498cf5adabf60c456a7e09a55e3f82a80277edede9addd8f544fe6
4
- data.tar.gz: 8359870d7e139074c09e317922cb60ec63712fb69e1efa639c05afde0fa6a2df
3
+ metadata.gz: 72ff75a8c73318a6ebe0089383466c49db95c57a677b23aa080a1458f059bcc4
4
+ data.tar.gz: c77ec6f292318434991effe639e5d5565bfd75448fc67a4b2f062d290c0b74bc
5
5
  SHA512:
6
- metadata.gz: f28efa4742d61e263befbbfd0a49e0cc0931c44113c00c26d9f5ab9a82be22018f9f2edc4097593c33d5713a696739d58f7591a59f210ff3bd22218f9b100efd
7
- data.tar.gz: 74e49fad9e28ed237efd3dd338fb94022b8016cf55f465433b14b31c834985c026238f0838475b9a6f5e282893e735d0c75220dde3d51a7b34b6dc597b431985
6
+ metadata.gz: 3f6cdd6d2672451f9becb3773d505f23449b1fd46e57fbb20df608d1eebea2c9dfd92998c898dc085e015f32d7d2e0422d5d8bf9453ddac0a9e2159e19e0d0ff
7
+ data.tar.gz: 6fc0e72e61004fd4e1273f990c6c54dee68b74c61d656b0a3cbdc785893d35c7b05a5b5004fb6a1c5db1def59be7b631802ad95dda8fa6272cd6e7bd9b45d281
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+
13
+ *.gem
@@ -4,7 +4,6 @@ language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
6
  - 2.6.2
7
- - 2.3.8
8
7
  - 2.4.4
9
8
  - 2.5.5
10
9
 
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dry-elastic_model (0.1.0)
5
- dry-struct (~> 0.6.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.4)
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.1)
22
+ dry-equalizer (0.2.2)
23
23
  dry-inflector (0.1.2)
24
- dry-logic (0.5.0)
25
- dry-container (~> 0.2, >= 0.2.6)
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.6.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.13)
31
+ dry-types (~> 1.0)
32
32
  ice_nine (~> 0.11)
33
- dry-types (0.14.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 (~> 0.5, >= 0.5)
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 [![Build Status](https://travis-ci.org/koleksiuk/dry-elastic_model.svg?branch=master)](https://travis-ci.org/koleksiuk/dry-elastic_model) [![Test Coverage](https://api.codeclimate.com/v1/badges/feba233f76f9fd76a6ad/test_coverage)](https://codeclimate.com/github/koleksiuk/dry-elastic_model/test_coverage) [![Maintainability](https://api.codeclimate.com/v1/badges/feba233f76f9fd76a6ad/maintainability)](https://codeclimate.com/github/koleksiuk/dry-elastic_model/maintainability)
1
+ # Dry::ElasticModel [![Gem Version](https://badge.fury.io/rb/dry-elastic_model.svg)](https://rubygems.org/gems/dry-elastic_model) [![Build Status](https://travis-ci.org/koleksiuk/dry-elastic_model.svg?branch=master)](https://travis-ci.org/koleksiuk/dry-elastic_model) [![Test Coverage](https://api.codeclimate.com/v1/badges/feba233f76f9fd76a6ad/test_coverage)](https://codeclimate.com/github/koleksiuk/dry-elastic_model/test_coverage) [![Maintainability](https://api.codeclimate.com/v1/badges/feba233f76f9fd76a6ad/maintainability)](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 Foo < Dry::ElasticModel::Base
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
- "foo":{
50
- "properties":{
51
- "text_field":{
52
- "type":"text",
53
- "index":false
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/[USERNAME]/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.
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/[USERNAME]/dry-elastic_model/blob/master/CODE_OF_CONDUCT.md).
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).
@@ -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.6.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, (attr, definition)|
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)
@@ -3,8 +3,8 @@
3
3
  module Dry
4
4
  module ElasticModel
5
5
  module TypeOptions
6
- class Base < Dry::Struct
7
- input input.strict
6
+ class Base < ::Dry::Struct
7
+ schema schema.strict
8
8
 
9
9
  def to_h
10
10
  attributes
@@ -8,7 +8,6 @@ module Dry
8
8
  attribute :enabled, Types::Bool.meta(omittable: true)
9
9
  attribute :include_in_all, Types::Bool.meta(omittable: true)
10
10
  attribute :properties, Types::Hash.meta(omittable: true)
11
- # rubocop:enable Metrics/LineLength
12
11
  end
13
12
  end
14
13
  end
@@ -4,8 +4,6 @@ module Dry
4
4
  module ElasticModel
5
5
  module TypeOptions
6
6
  class ScaledFloat < Numeric
7
- input input.strict
8
-
9
7
  attribute :scaling_factor, Types::Integer
10
8
 
11
9
  def to_h
@@ -6,7 +6,7 @@ require "resolv"
6
6
  module Dry
7
7
  module ElasticModel
8
8
  module Types
9
- include Dry::Types.module
9
+ include Dry::Types()
10
10
 
11
11
  # rubocop:disable Metrics/LineLength
12
12
  # String datatypes
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module ElasticModel
5
- VERSION = "0.1.0.pre"
5
+ VERSION = "0.1.0"
6
6
  end
7
7
  end
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.pre
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-05-02 00:00:00.000000000 Z
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.6.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.6.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: 1.3.1
168
+ version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
171
  rubygems_version: 2.7.3