ree_lib 1.1.0 → 1.2.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/.ruby-version +1 -1
- data/Gemfile.lock +30 -30
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/build_methods.rb +14 -0
- data/lib/ree_lib/packages/ree_dao/package/ree_dao/functions/build_connection.rb +2 -0
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/build_dto_spec.rb +69 -0
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/load_agg/agg_spec.rb +128 -128
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/one_to_one_spec.rb +1 -1
- data/lib/ree_lib/packages/ree_dao/spec/ree_dao/functions/persist_assoc_spec.rb +4 -4
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/dto/dto_builder.rb +11 -4
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/dto/dto_class_methods.rb +21 -0
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/dto/dto_instance_methods.rb +8 -10
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/dto/field_meta.rb +4 -3
- data/lib/ree_lib/packages/ree_dto/package/ree_dto/functions/build_dto.rb +1 -0
- data/lib/ree_lib/packages/ree_dto/spec/ree_dto/dsl_spec.rb +46 -5
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/error.rb +3 -5
- data/lib/ree_lib/packages/ree_errors/package/ree_errors/invalid_param_error.rb +1 -1
- data/lib/ree_lib/packages/ree_errors/spec/ree_errors/invalid_param_error_spec.rb +13 -1
- data/lib/ree_lib/packages/ree_logger/spec/ree_logger/formatters/colorized_formatter_spec.rb +10 -3
- data/lib/ree_lib/packages/ree_logger/spec/ree_logger/formatters/default_formatter_spec.rb +6 -2
- data/lib/ree_lib/packages/ree_logger/spec/ree_logger/multi_logger_spec.rb +13 -3
- data/lib/ree_lib/packages/ree_mapper/package/ree_mapper/strategy_outputs/ree_dto_output.rb +1 -1
- data/lib/ree_lib/version.rb +1 -1
- metadata +31 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6bc4d8631de1c0c3a6c684730f28796df131d7a9dae3c5ca74864b5494b3b976
|
4
|
+
data.tar.gz: ca1154e4e622addc89f4da3cd0ab3e53ea909fa8129686e911796ba0a7f93273
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778dbf087c22dc7ccbe0305db22270463c83b5cc2f4a2c24840581edf0f670cf0b5d4b2acc1c7a0bbb60767cc0702a5e5f5d17270e2836c60387e4230d3b477d
|
7
|
+
data.tar.gz: 3c272e17d4b76ac7cee20be42084c9355c04e072326be94ef6943e5c728378b51169aab972b311b93cb4710636e2891a57309123922bb36b6082d016826214c4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.4.1
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ree_lib (1.
|
5
|
-
bigdecimal (~> 3.1.
|
6
|
-
binding_of_caller (~> 1.0.
|
7
|
-
i18n (~> 1.14.
|
8
|
-
loofah (~> 2.
|
9
|
-
oj (~> 3.16.
|
4
|
+
ree_lib (1.2.0)
|
5
|
+
bigdecimal (~> 3.1.9)
|
6
|
+
binding_of_caller (~> 1.0.1)
|
7
|
+
i18n (~> 1.14.7)
|
8
|
+
loofah (~> 2.24.0)
|
9
|
+
oj (~> 3.16.9)
|
10
10
|
rainbow (~> 3.1.1)
|
11
11
|
ree (~> 1.1.0)
|
12
|
-
sequel (~> 5.
|
13
|
-
tzinfo (~> 2.0.
|
12
|
+
sequel (~> 5.88.0)
|
13
|
+
tzinfo (~> 2.0.6)
|
14
14
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
18
|
addressable (2.8.7)
|
19
19
|
public_suffix (>= 2.0.2, < 7.0)
|
20
|
-
bigdecimal (3.1.
|
20
|
+
bigdecimal (3.1.9)
|
21
21
|
binding_of_caller (1.0.1)
|
22
22
|
debug_inspector (>= 1.2.0)
|
23
23
|
bootsnap (1.18.4)
|
@@ -31,25 +31,25 @@ GEM
|
|
31
31
|
crass (1.0.6)
|
32
32
|
debug_inspector (1.2.0)
|
33
33
|
diff-lcs (1.5.1)
|
34
|
-
faker (3.
|
34
|
+
faker (3.5.1)
|
35
35
|
i18n (>= 1.8.11, < 2)
|
36
36
|
hashdiff (1.1.1)
|
37
37
|
highline (3.0.1)
|
38
|
-
i18n (1.14.
|
38
|
+
i18n (1.14.7)
|
39
39
|
concurrent-ruby (~> 1.0)
|
40
|
-
loofah (2.
|
40
|
+
loofah (2.24.0)
|
41
41
|
crass (~> 1.0.2)
|
42
42
|
nokogiri (>= 1.12.0)
|
43
43
|
msgpack (1.7.2)
|
44
|
-
nokogiri (1.
|
44
|
+
nokogiri (1.18.2-x86_64-darwin)
|
45
45
|
racc (~> 1.4)
|
46
|
-
nokogiri (1.
|
46
|
+
nokogiri (1.18.2-x86_64-linux-gnu)
|
47
47
|
racc (~> 1.4)
|
48
|
-
oj (3.16.
|
48
|
+
oj (3.16.9)
|
49
49
|
bigdecimal (>= 3.0)
|
50
50
|
ostruct (>= 0.2)
|
51
|
-
ostruct (0.6.
|
52
|
-
pg (1.5.
|
51
|
+
ostruct (0.6.1)
|
52
|
+
pg (1.5.9)
|
53
53
|
public_suffix (6.0.1)
|
54
54
|
racc (1.8.1)
|
55
55
|
rack (3.1.7)
|
@@ -57,13 +57,13 @@ GEM
|
|
57
57
|
rack (>= 1.3)
|
58
58
|
rainbow (3.1.1)
|
59
59
|
rake (13.2.1)
|
60
|
-
ree (1.1.
|
60
|
+
ree (1.1.1)
|
61
61
|
commander (~> 5.0.0)
|
62
62
|
rexml (3.3.6)
|
63
63
|
strscan
|
64
|
-
roda (3.
|
64
|
+
roda (3.88.0)
|
65
65
|
rack
|
66
|
-
rollbar (3.
|
66
|
+
rollbar (3.6.0)
|
67
67
|
rspec (3.13.0)
|
68
68
|
rspec-core (~> 3.13.0)
|
69
69
|
rspec-expectations (~> 3.13.0)
|
@@ -78,10 +78,10 @@ GEM
|
|
78
78
|
rspec-support (~> 3.13.0)
|
79
79
|
rspec-support (3.13.1)
|
80
80
|
ruby-prof (1.7.0)
|
81
|
-
sequel (5.
|
81
|
+
sequel (5.88.0)
|
82
82
|
bigdecimal
|
83
|
-
sqlite3 (
|
84
|
-
sqlite3 (
|
83
|
+
sqlite3 (2.5.0-x86_64-darwin)
|
84
|
+
sqlite3 (2.5.0-x86_64-linux-gnu)
|
85
85
|
strscan (3.1.0)
|
86
86
|
timecop (0.9.10)
|
87
87
|
tzinfo (2.0.6)
|
@@ -102,19 +102,19 @@ PLATFORMS
|
|
102
102
|
|
103
103
|
DEPENDENCIES
|
104
104
|
bootsnap
|
105
|
-
faker (~> 3.
|
106
|
-
pg (~> 1.5.
|
105
|
+
faker (~> 3.5.1)
|
106
|
+
pg (~> 1.5.9)
|
107
107
|
rack-test
|
108
108
|
rake (~> 13.0)
|
109
109
|
ree_lib!
|
110
|
-
roda (~> 3.
|
111
|
-
rollbar (~> 3.
|
110
|
+
roda (~> 3.88.0)
|
111
|
+
rollbar (~> 3.6.0)
|
112
112
|
rspec
|
113
113
|
ruby-prof
|
114
|
-
sqlite3 (~>
|
115
|
-
timecop (~> 0.9.
|
114
|
+
sqlite3 (~> 2.5.0)
|
115
|
+
timecop (~> 0.9.10)
|
116
116
|
warden (~> 1.2.9)
|
117
117
|
webmock
|
118
118
|
|
119
119
|
BUNDLED WITH
|
120
|
-
2.
|
120
|
+
2.6.3
|
@@ -10,6 +10,7 @@ class ReeDao::BuildConnection
|
|
10
10
|
fn :build_connection do
|
11
11
|
link :connections
|
12
12
|
link 'ree_dao/dataset_extensions', -> { DatasetExtensions }
|
13
|
+
link 'ree_dao/build_methods', -> { BuildMethods }
|
13
14
|
end
|
14
15
|
|
15
16
|
TIMEZONES = [:utc, :local].freeze
|
@@ -92,6 +93,7 @@ class ReeDao::BuildConnection
|
|
92
93
|
dataset_class = connection.dataset_class
|
93
94
|
klass = Class.new(dataset_class)
|
94
95
|
klass.extend(ReeDao::DatasetExtensions)
|
96
|
+
klass.extend(ReeDao::BuildMethods)
|
95
97
|
|
96
98
|
connection.dataset_class = klass
|
97
99
|
|
@@ -0,0 +1,69 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
RSpec.describe :build_dto do
|
4
|
+
link :build_sqlite_connection, from: :ree_dao
|
5
|
+
|
6
|
+
let(:connection) { build_sqlite_connection({database: 'sqlite_db'}) }
|
7
|
+
|
8
|
+
before :all do
|
9
|
+
Ree.enable_irb_mode
|
10
|
+
end
|
11
|
+
|
12
|
+
after do
|
13
|
+
Ree.disable_irb_mode
|
14
|
+
end
|
15
|
+
|
16
|
+
it {
|
17
|
+
module TestBuildDto
|
18
|
+
include Ree::PackageDSL
|
19
|
+
|
20
|
+
package do
|
21
|
+
depends_on :ree_dao
|
22
|
+
depends_on :ree_dto
|
23
|
+
end
|
24
|
+
|
25
|
+
class Db
|
26
|
+
include Ree::BeanDSL
|
27
|
+
|
28
|
+
bean :db do
|
29
|
+
singleton
|
30
|
+
factory :build
|
31
|
+
|
32
|
+
link :build_sqlite_connection, from: :ree_dao
|
33
|
+
end
|
34
|
+
|
35
|
+
def build
|
36
|
+
build_sqlite_connection({database: 'sqlite_db'})
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class Project
|
41
|
+
include ReeDto::DSL
|
42
|
+
|
43
|
+
build_dto do
|
44
|
+
field :id, Nilor[Integer], default: nil
|
45
|
+
field :is_published, Bool, default: true
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class ProjectsDao
|
50
|
+
include ReeDao::DSL
|
51
|
+
|
52
|
+
dao :projects_dao do
|
53
|
+
link :db
|
54
|
+
end
|
55
|
+
|
56
|
+
schema Project do
|
57
|
+
integer :id, null: true
|
58
|
+
bool :is_published
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
project = TestBuildDto::Project.build(id: 1)
|
64
|
+
expect(project.is_published).to eq(true)
|
65
|
+
|
66
|
+
project = TestBuildDto::ProjectsDao.new.build(id: 2)
|
67
|
+
expect(project.is_published).to eq(true)
|
68
|
+
}
|
69
|
+
end
|