ree_lib 1.0.16 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/ree_lib/packages/ree_enum/package/ree_enum/dsl.rb +12 -8
  4. data/lib/ree_lib/packages/ree_enum/spec/ree_enum/dsl_spec.rb +1 -1
  5. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/mapper.rb +7 -6
  6. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/abstract_type.rb +4 -4
  7. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/array.rb +20 -20
  8. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/bool.rb +12 -12
  9. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/date.rb +13 -13
  10. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/date_time.rb +13 -13
  11. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/float.rb +13 -13
  12. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/integer.rb +13 -13
  13. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/string.rb +12 -12
  14. data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/types/time.rb +13 -13
  15. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/array_spec.rb +15 -6
  16. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/bool_spec.rb +9 -9
  17. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/date_spec.rb +11 -11
  18. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/date_time_spec.rb +17 -17
  19. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/float_spec.rb +14 -14
  20. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/hash_spec.rb +5 -1
  21. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/integer_spec.rb +15 -15
  22. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/string_spec.rb +13 -13
  23. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/time_spec.rb +17 -17
  24. data/lib/ree_lib/packages/ree_mapper/spec/ree_mapper/types/type_options_spec.rb +2 -2
  25. data/lib/ree_lib/version.rb +1 -1
  26. metadata +2 -4
  27. data/lib/ree_lib/packages/ree_dao/package/ree_dao/types/pg_array.rb +0 -43
  28. data/lib/ree_lib/packages/ree_dao/spec/ree_dao/types/pg_array_spec.rb +0 -19
@@ -170,7 +170,7 @@ RSpec.describe 'ReeMapper::MapperFactory type options' do
170
170
  }
171
171
 
172
172
  it {
173
- expect { mapper.cast({ number: nil }) }.to raise_error(ReeMapper::TypeError, 'should be an integer')
173
+ expect { mapper.cast({ number: nil }) }.to raise_error(ReeMapper::TypeError, '`number` should be an integer')
174
174
  }
175
175
 
176
176
  it {
@@ -183,7 +183,7 @@ RSpec.describe 'ReeMapper::MapperFactory type options' do
183
183
  let(:mapper) { mapper_factory.call.use(:cast) { integer? :number, default: :not_number } }
184
184
 
185
185
  it {
186
- expect { mapper.cast({}) }.to raise_error(ReeMapper::TypeError, 'should be an integer')
186
+ expect { mapper.cast({}) }.to raise_error(ReeMapper::TypeError, '`number` should be an integer')
187
187
  }
188
188
  end
189
189
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReeLib
4
- VERSION = "1.0.16"
4
+ VERSION = "1.0.18"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ree_lib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ruslan Gatiyatov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-09-15 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ree
@@ -249,7 +249,6 @@ files:
249
249
  - lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_pg_connection.rb
250
250
  - lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_sqlite_connection.rb
251
251
  - lib/ree_lib/packages/ree_dao/package/ree_dao/functions/persist_assoc.rb
252
- - lib/ree_lib/packages/ree_dao/package/ree_dao/types/pg_array.rb
253
252
  - lib/ree_lib/packages/ree_dao/schemas/ree_dao/beans/connections.schema.json
254
253
  - lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/build_connection.schema.json
255
254
  - lib/ree_lib/packages/ree_dao/schemas/ree_dao/functions/build_dao.schema.json
@@ -259,7 +258,6 @@ files:
259
258
  - lib/ree_lib/packages/ree_dao/spec/package_schema_spec.rb
260
259
  - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_sqlite_connection_spec.rb
261
260
  - lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/persist_assoc_spec.rb
262
- - lib/ree_lib/packages/ree_dao/spec/ree_dao/types/pg_array_spec.rb
263
261
  - lib/ree_lib/packages/ree_dao/spec/spec_helper.rb
264
262
  - lib/ree_lib/packages/ree_date/.gitignore
265
263
  - lib/ree_lib/packages/ree_date/.rspec
@@ -1,43 +0,0 @@
1
- require "sequel/extensions/pg_array"
2
-
3
- class ReeDao::PgArray < ReeMapper::AbstractType
4
- contract(
5
- ReeEnum::Value,
6
- Kwargs[
7
- role: Nilor[Symbol, ArrayOf[Symbol]]
8
- ] => String
9
- )
10
- def serialize(value, role: nil)
11
- raise ArgumentError.new("not supported")
12
- end
13
-
14
- contract(
15
- Any,
16
- Kwargs[
17
- role: Nilor[Symbol, ArrayOf[Symbol]]
18
- ] => ReeEnum::Value
19
- ).throws(ReeMapper::CoercionError)
20
- def cast(value, role: nil)
21
- raise ArgumentError.new("not supported")
22
- end
23
-
24
- contract(
25
- ArrayOf[Any],
26
- Kwargs[
27
- role: Nilor[Symbol, ArrayOf[Symbol]]
28
- ] => Sequel::Postgres::PGArray
29
- )
30
- def db_dump(value, role: nil)
31
- Sequel.pg_array(value)
32
- end
33
-
34
- contract(
35
- Sequel::Postgres::PGArray,
36
- Kwargs[
37
- role: Nilor[Symbol, ArrayOf[Symbol]]
38
- ] => ArrayOf[Any]
39
- ).throws(ReeMapper::TypeError)
40
- def db_load(value, role: nil)
41
- value.to_a
42
- end
43
- end
@@ -1,19 +0,0 @@
1
- # frozen_string_literal = true
2
- package_require("ree_dao/types/pg_array")
3
-
4
- RSpec.describe ReeDao::PgArray do
5
- it {
6
- type = ReeDao::PgArray.new
7
-
8
- result = type.db_dump([1], role: nil)
9
- expect(result).to be_a(Sequel::Postgres::PGArray)
10
- }
11
-
12
- it {
13
- type = ReeDao::PgArray.new
14
-
15
- result = type.db_dump([1], role: nil)
16
- result = type.db_load(result, role: nil)
17
- expect(result).to eq([1])
18
- }
19
- end