eitil 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eitil/version.rb +1 -1
- data/spec/dummy_app/app/models/user.rb +0 -25
- metadata +2 -6
- data/spec/eitil_wrapper/callbacks/helper_methods_spec.rb +0 -34
- data/spec/eitil_wrapper/jobs/single_method_job_spec.rb +0 -72
- data/spec/eitil_wrapper/routes/extended_resources_spec.rb +0 -16
- data/spec/eitil_wrapper/scopes/default_scopes_spec.rb +0 -154
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05a2d070e732081418638b63efa8cb3024799de3bd8c174bea4e37ff4cd75110
|
4
|
+
data.tar.gz: 03d461c7a66be59841238bcd851fc2e3b8e0ca08df0462685a3c739afb5684cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ed7414c2eaccd3a0bb07db747fb43c5c5c6bab1c3eaeb0bc19f73cf7e0bf41bc4024a34f044e3db8ce513f7072bfaaf51ec042bd01fb631ce52ffece8a32f02
|
7
|
+
data.tar.gz: 6d614f632c07eb0261723d0e41c52a66a830606417acd8f6a2c5c94f912705acf6d894a1b00f25d47a92b46fa743de329e8371da3673d2a9d8a405e8e1c0916a
|
data/lib/eitil/version.rb
CHANGED
@@ -2,29 +2,4 @@ class User < ApplicationRecord
|
|
2
2
|
|
3
3
|
has_one :address
|
4
4
|
|
5
|
-
# ---
|
6
|
-
# below are methods, used for testing EitilWrapper::Jobs
|
7
|
-
|
8
|
-
def self.this_is_a_singleton_method(positional_value = nil, keyword_value: nil)
|
9
|
-
"this is a singleton method"
|
10
|
-
return positional_value if positional_value
|
11
|
-
return keyword_value if keyword_value
|
12
|
-
return nil
|
13
|
-
end
|
14
|
-
|
15
|
-
new_job :this_is_a_singleton_method
|
16
|
-
new_job_now :this_is_a_singleton_method
|
17
|
-
|
18
|
-
def this_is_an_instance_method(positional_value = nil, keyword_value: nil)
|
19
|
-
"this is an instance method"
|
20
|
-
return positional_value if positional_value
|
21
|
-
return keyword_value if keyword_value
|
22
|
-
return nil
|
23
|
-
end
|
24
|
-
|
25
|
-
new_job :this_is_an_instance_method
|
26
|
-
new_job_now :this_is_an_instance_method
|
27
|
-
|
28
|
-
# ---
|
29
|
-
|
30
5
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eitil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Schrofer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -419,10 +419,6 @@ files:
|
|
419
419
|
- spec/eitil_core/type_checkers/is_num_or_nan_spec.rb
|
420
420
|
- spec/eitil_integrate/application_exporter/auto_sum_spec.rb
|
421
421
|
- spec/eitil_integrate/application_exporter/initialize_spec.rb
|
422
|
-
- spec/eitil_wrapper/callbacks/helper_methods_spec.rb
|
423
|
-
- spec/eitil_wrapper/jobs/single_method_job_spec.rb
|
424
|
-
- spec/eitil_wrapper/routes/extended_resources_spec.rb
|
425
|
-
- spec/eitil_wrapper/scopes/default_scopes_spec.rb
|
426
422
|
- spec/spec_helper.rb
|
427
423
|
homepage: https://github.com/eitje-app/eitil_engine
|
428
424
|
licenses:
|
@@ -1,34 +0,0 @@
|
|
1
|
-
|
2
|
-
RSpec.describe "EitilWrapper::Callbacks" do
|
3
|
-
|
4
|
-
let(:callbacks) { User.instance_methods(false) }
|
5
|
-
|
6
|
-
context "for columns of datatype: boolean" do
|
7
|
-
|
8
|
-
it "should create the callback .{column_name}_became_true" do
|
9
|
-
expect(callbacks).to include(:confirmed_became_true)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should create the callback .{column_name}_becomes_true" do
|
13
|
-
expect(callbacks).to include(:confirmed_becomes_true)
|
14
|
-
end
|
15
|
-
|
16
|
-
it "should create the callback .{column_name}_to_true (works for both become and became)" do
|
17
|
-
expect(callbacks).to include(:confirmed_to_true)
|
18
|
-
end
|
19
|
-
|
20
|
-
it "should create the callback .{column_name}_became_false" do
|
21
|
-
expect(callbacks).to include(:confirmed_became_false)
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should create the callback .{column_name}_becomes_false" do
|
25
|
-
expect(callbacks).to include(:confirmed_becomes_false)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should create the callback .{column_name}_to_false (works for both become and became)" do
|
29
|
-
expect(callbacks).to include(:confirmed_to_false)
|
30
|
-
end
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
|
2
|
-
RSpec.describe "EitilWrapper::Jobs" do
|
3
|
-
|
4
|
-
let(:user) { User.create(first_name: "Donald", last_name: "Duck") }
|
5
|
-
|
6
|
-
it "should create a new method, if the new_job (perform_later) is used for a singleton method" do
|
7
|
-
expect(User.methods).to include(:this_is_a_singleton_method_job)
|
8
|
-
end
|
9
|
-
|
10
|
-
it "should create a new method, if the new_job (perform_later) is used for an instance method" do
|
11
|
-
expect(User.instance_methods).to include(:this_is_an_instance_method_job)
|
12
|
-
end
|
13
|
-
|
14
|
-
it "should create a new method, if the new_job_now (perform_now) is used for a singleton method" do
|
15
|
-
expect(User.methods).to include(:this_is_a_singleton_method_job_now)
|
16
|
-
end
|
17
|
-
|
18
|
-
it "should create a new method, if the new_job_now (perform_now) is used for an instance method" do
|
19
|
-
expect(User.instance_methods).to include(:this_is_an_instance_method_job_now)
|
20
|
-
end
|
21
|
-
|
22
|
-
it "should allow us to perform the created singleton perform_later method" do
|
23
|
-
begin
|
24
|
-
User.this_is_a_singleton_method_job
|
25
|
-
status = 'passed'
|
26
|
-
rescue
|
27
|
-
status = 'failed'
|
28
|
-
end
|
29
|
-
expect(status).to eq 'passed'
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should allow us to perform the created instance perform_later method" do
|
33
|
-
begin
|
34
|
-
user.this_is_an_instance_method_job
|
35
|
-
status = 'passed'
|
36
|
-
rescue
|
37
|
-
status = 'failed'
|
38
|
-
end
|
39
|
-
expect(status).to eq 'passed'
|
40
|
-
end
|
41
|
-
|
42
|
-
it "should allow us to perform the created singleton perform_now method" do
|
43
|
-
begin
|
44
|
-
User.this_is_a_singleton_method_job_now
|
45
|
-
status = 'passed'
|
46
|
-
rescue
|
47
|
-
status = 'failed'
|
48
|
-
end
|
49
|
-
expect(status).to eq 'passed'
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should allow us to perform the created instance perform_now method" do
|
53
|
-
begin
|
54
|
-
user.this_is_an_instance_method_job_now
|
55
|
-
status = 'passed'
|
56
|
-
rescue
|
57
|
-
status = 'failed'
|
58
|
-
end
|
59
|
-
expect(status).to eq 'passed'
|
60
|
-
end
|
61
|
-
|
62
|
-
it "should accept positional arguments" do
|
63
|
-
return_value = User.this_is_a_singleton_method_job_now("positional_argument")
|
64
|
-
expect(return_value).to eq "positional_argument"
|
65
|
-
end
|
66
|
-
|
67
|
-
it "should accept keyword arguments " do
|
68
|
-
return_value = User.this_is_a_singleton_method_job_now(keyword_value: "keyword_argument")
|
69
|
-
expect(return_value).to eq "keyword_argument"
|
70
|
-
end
|
71
|
-
|
72
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
|
2
|
-
# NOT YET IMPLEMENTED, SINCE THIS PART OF EITIL IS NOT YET IN USE.
|
3
|
-
# FIRST HOOK UP INTO EITJE_API, SINCE THAT MAY CHANGE THE FUNCTIONALITY.
|
4
|
-
|
5
|
-
# RSpec.describe "EitilWrapper::Routes" do
|
6
|
-
|
7
|
-
# before do
|
8
|
-
# @pretty_routes = `cd spec/dummy_app && rails routes`
|
9
|
-
# @routes = @pretty_routes.gsub(/[ \t]+/, ' ')
|
10
|
-
# end
|
11
|
-
|
12
|
-
# it "should " do
|
13
|
-
# expect(@routes).to include('POST /users(.:format) users#create')
|
14
|
-
# end
|
15
|
-
|
16
|
-
# end
|
@@ -1,154 +0,0 @@
|
|
1
|
-
|
2
|
-
RSpec.describe "EitilWrapper::Scopes" do
|
3
|
-
|
4
|
-
let(:scopes) { User.singleton_methods(false) }
|
5
|
-
|
6
|
-
context "for columns of datatype: boolean" do
|
7
|
-
|
8
|
-
it "should create the scope .{column_name}_true" do
|
9
|
-
expect(scopes).to include(:confirmed_true)
|
10
|
-
end
|
11
|
-
|
12
|
-
it "should create the scope .{column_name}_false" do
|
13
|
-
expect(scopes).to include(:confirmed_false)
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|
17
|
-
|
18
|
-
context "for columns of datatype: date" do
|
19
|
-
|
20
|
-
it "should create the scope .{column_name}_today" do
|
21
|
-
expect(scopes).to include(:birthday_today)
|
22
|
-
end
|
23
|
-
|
24
|
-
it "should create the scope .{column_name}_past" do
|
25
|
-
expect(scopes).to include(:birthday_past)
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should create the scope .{column_name}_future" do
|
29
|
-
expect(scopes).to include(:birthday_future)
|
30
|
-
end
|
31
|
-
|
32
|
-
it "should create the scope .{column_name}_on_date(date)" do
|
33
|
-
expect(scopes).to include(:birthday_on_date)
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should create the scope .{column_name}_before_date(date)" do
|
37
|
-
expect(scopes).to include(:birthday_before_date)
|
38
|
-
end
|
39
|
-
|
40
|
-
it "should create the scope .{column_name}_after_date(date)" do
|
41
|
-
expect(scopes).to include(:birthday_after_date)
|
42
|
-
end
|
43
|
-
|
44
|
-
it "should create the scope .{column_name}_between_dates(start_date, end_date)" do
|
45
|
-
expect(scopes).to include(:birthday_between_dates)
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should create the scope .{column_name}_oldest_first" do
|
49
|
-
expect(scopes).to include(:birthday_oldest_first)
|
50
|
-
end
|
51
|
-
|
52
|
-
it "should create the scope .{column_name}_newest_first" do
|
53
|
-
expect(scopes).to include(:birthday_newest_first)
|
54
|
-
end
|
55
|
-
|
56
|
-
end
|
57
|
-
|
58
|
-
context "for columns of datatype: datetime" do
|
59
|
-
|
60
|
-
it "should create the scope .{column_name}_today" do
|
61
|
-
expect(scopes).to include(:last_sign_in_today)
|
62
|
-
end
|
63
|
-
|
64
|
-
it "should create the scope .{column_name}_past" do
|
65
|
-
expect(scopes).to include(:last_sign_in_past)
|
66
|
-
end
|
67
|
-
|
68
|
-
it "should create the scope .{column_name}_future" do
|
69
|
-
expect(scopes).to include(:last_sign_in_future)
|
70
|
-
end
|
71
|
-
|
72
|
-
it "should create the scope .{column_name}_on_date(date)" do
|
73
|
-
expect(scopes).to include(:last_sign_in_on_date)
|
74
|
-
end
|
75
|
-
|
76
|
-
it "should create the scope .{column_name}_before_date(date)" do
|
77
|
-
expect(scopes).to include(:last_sign_in_before_date)
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should create the scope .{column_name}_after_date(date)" do
|
81
|
-
expect(scopes).to include(:last_sign_in_after_date)
|
82
|
-
end
|
83
|
-
|
84
|
-
it "should create the scope .{column_name}_between_dates(start_date, end_date)" do
|
85
|
-
expect(scopes).to include(:last_sign_in_between_dates)
|
86
|
-
end
|
87
|
-
|
88
|
-
it "should create the scope .{column_name}_oldest_first" do
|
89
|
-
expect(scopes).to include(:last_sign_in_oldest_first)
|
90
|
-
end
|
91
|
-
|
92
|
-
it "should create the scope .{column_name}_newest_first" do
|
93
|
-
expect(scopes).to include(:last_sign_in_newest_first)
|
94
|
-
end
|
95
|
-
|
96
|
-
end
|
97
|
-
|
98
|
-
context "for columns of datatype: integer" do
|
99
|
-
|
100
|
-
it "should create the scope .{column_name}_equal_to(number)" do
|
101
|
-
expect(scopes).to include(:age_equal_to)
|
102
|
-
end
|
103
|
-
|
104
|
-
it "should create the scope .{column_name}_lower_than(number)" do
|
105
|
-
expect(scopes).to include(:age_lower_than)
|
106
|
-
end
|
107
|
-
|
108
|
-
it "should create the scope .{column_name}_higher_than(number)" do
|
109
|
-
expect(scopes).to include(:age_higher_than)
|
110
|
-
end
|
111
|
-
|
112
|
-
it "should create the scope .{column_name}_between(min, max)" do
|
113
|
-
expect(scopes).to include(:age_between)
|
114
|
-
end
|
115
|
-
|
116
|
-
it "should create the scope .{column_name}_ascending" do
|
117
|
-
expect(scopes).to include(:age_ascending)
|
118
|
-
end
|
119
|
-
|
120
|
-
it "should create the scope .{column_name}_descending" do
|
121
|
-
expect(scopes).to include(:age_descending)
|
122
|
-
end
|
123
|
-
|
124
|
-
end
|
125
|
-
|
126
|
-
context "for columns of datatype: float" do
|
127
|
-
|
128
|
-
it "should create the scope .{column_name}_equal_to(number)" do
|
129
|
-
expect(scopes).to include(:wage_equal_to)
|
130
|
-
end
|
131
|
-
|
132
|
-
it "should create the scope .{column_name}_lower_than(number)" do
|
133
|
-
expect(scopes).to include(:wage_lower_than)
|
134
|
-
end
|
135
|
-
|
136
|
-
it "should create the scope .{column_name}_higher_than(number)" do
|
137
|
-
expect(scopes).to include(:wage_higher_than)
|
138
|
-
end
|
139
|
-
|
140
|
-
it "should create the scope .{column_name}_between(min, max)" do
|
141
|
-
expect(scopes).to include(:wage_between)
|
142
|
-
end
|
143
|
-
|
144
|
-
it "should create the scope .{column_name}_ascending" do
|
145
|
-
expect(scopes).to include(:wage_ascending)
|
146
|
-
end
|
147
|
-
|
148
|
-
it "should create the scope .{column_name}_descending" do
|
149
|
-
expect(scopes).to include(:wage_descending)
|
150
|
-
end
|
151
|
-
|
152
|
-
end
|
153
|
-
|
154
|
-
end
|